Advertisement
ecco7777

CC Particle Generator Pixelart

Jul 6th, 2020
1,545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. br=0.1
  2. delay=0
  3. file="bild"
  4. t=peripheral.wrap("top")
  5. color={}
  6. color[" "]={0x00,0x00,0xFF}
  7. color["0"]={0xF0,0xF0,0xF0}
  8. color["1"]={0xF2,0xB2,0x33}
  9. color["2"]={0xE5,0x7F,0xD8}
  10. color["3"]={0x99,0xB2,0xF2}
  11. color["4"]={0xDE,0xDE,0x6C}
  12. color["5"]={0x7F,0xCC,0x19}
  13. color["6"]={0xF2,0xB2,0xCC}
  14. color["7"]={0x4C,0x4C,0x4C}
  15. color["8"]={0x99,0x99,0x99}
  16. color["9"]={0x4C,0x99,0xB2}
  17. color["a"]={0xB2,0x66,0xE5}
  18. color["b"]={0x33,0x66,0xCC}
  19. color["c"]={0x7F,0x66,0x4C}
  20. color["d"]={0x57,0xA6,0x4E}
  21. color["e"]={0xCC,0x4C,0x4C}
  22. color["f"]={0x19,0x19,0x19}
  23.  
  24. fp=fs.open(file,"r")
  25. y=1
  26. line=1
  27. while line~=nil do
  28. line=fp.readLine()
  29. if line~=nil then
  30. for i=1,#line do
  31. t.setGeneratorProperty("spawn_x",i*br)
  32. t.setGeneratorProperty("spawn_z",y*br)
  33. t.setGeneratorProperty("red",color[string.sub(line,i,i)][1])
  34. t.setGeneratorProperty("green",color[string.sub(line,i,i)][2])
  35. t.setGeneratorProperty("blue",color[string.sub(line,i,i)][3])
  36. sleep(delay)
  37. end
  38. end
  39. y=y+1
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement