Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- br=0.5
- delay=0.15
- file="bild"
- function wrapPs(peripheralName)
- periTab = {}
- sideTab = {}
- if peripheralName == nil then
- print("Fehler")
- end
- local peripherals = peripheral.getNames()
- local i2 = 1
- for i = 1, #peripherals do
- if peripheral.getType(peripherals[i]) == peripheralName then
- periTab[i2] = peripheral.wrap(peripherals[i])
- sideTab[i2] = peripherals[i]
- i2 = i2 + 1
- end
- end
- if periTab ~= {} then
- return periTab, sideTab
- else
- return nil
- end
- function getPSide(peripheralName)
- if peripheralName == nil then
- print("Fehler")
- end
- local peripherals = peripheral.getNames()
- local i = 1
- while i < #peripherals and peripheral.getType(peripherals[i]) ~= peripheralName do
- i = i + 1
- end
- if peripheral.getType(peripherals[i]) == peripheralName then
- return peripherals[i]
- else
- return nil
- end
- end
- end
- pgs=wrapPs("particle_generator")
- for i=1,#pgs do
- pgs[i].setGeneratorProperty("spawn_y",30)
- pgs[i].setGeneratorProperty("scale",2.6)
- pgs[i].setGeneratorProperty("motion_y",-1)
- pgs[i].setGeneratorProperty("life",1000)
- pgs[i].setGeneratorProperty("collide",true)
- pgs[i].setGeneratorProperty("selected_particle",2)
- end
- color={}
- color[" "]={0x00,0x00,0xFF}
- color["0"]={0xF0,0xF0,0xF0}
- color["1"]={0xF2,0xB2,0x33}
- color["2"]={0xE5,0x7F,0xD8}
- color["3"]={0x99,0xB2,0xF2}
- color["4"]={0xDE,0xDE,0x6C}
- color["5"]={0x7F,0xCC,0x19}
- color["6"]={0xF2,0xB2,0xCC}
- color["7"]={0x4C,0x4C,0x4C}
- color["8"]={0x99,0x99,0x99}
- color["9"]={0x4C,0x99,0xB2}
- color["a"]={0xB2,0x66,0xE5}
- color["b"]={0x33,0x66,0xCC}
- color["c"]={0x7F,0x66,0x4C}
- color["d"]={0x57,0xA6,0x4E}
- color["e"]={0xCC,0x4C,0x4C}
- color["f"]={0x19,0x19,0x19}
- fp=fs.open(file,"r")
- y=1
- line=1
- pgn=1
- while line~=nil do
- line=fp.readLine()
- if line~=nil then
- for i=1,#line do
- if pgn>#pgs then
- pgn=1
- end
- pgs[pgn].setGeneratorProperty("spawn_x",i*br)
- pgs[pgn].setGeneratorProperty("spawn_z",y*br)
- pgs[pgn].setGeneratorProperty("red",color[string.sub(line,i,i)][1])
- pgs[pgn].setGeneratorProperty("green",color[string.sub(line,i,i)][2])
- pgs[pgn].setGeneratorProperty("blue",color[string.sub(line,i,i)][3])
- pgn=pgn+1
- end
- sleep(delay)
- end
- y=y+1
- end
- for i=1,#pgs do
- pgs[i].setGeneratorProperty("motion_y",0)
- pgs[i].setGeneratorProperty("life",0)
- end
Add Comment
Please, Sign In to add comment