Advertisement
UNOBTANIUM

MegaPipeStone

Jun 18th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. -- MEGA STONE PIPE 0.1.0
  2.  
  3. local speed = 0.5
  4. os.setComputerLabel("MegaPipeStone")
  5. if not fs.exists("comb") then
  6.  shell.run("pastebin","get","YUrtgM6X","comb")
  7. end
  8. term.clear()
  9. term.setCursorPos(1,1)
  10.  
  11. local comb = paintutils.loadImage("comb")
  12.  
  13. rednet.open("top")
  14.  
  15. local monitor = peripheral.wrap("back")
  16. term.redirect(monitor)
  17.  
  18.  
  19. function clear()
  20.  term.clear()
  21.  term.setCursorPos(1,1)
  22. end
  23.  
  24. function run()
  25.  clear()
  26.  local id, message = rednet.receive()
  27.  local m = textutils.unserialize(message)
  28.  sleep(speed-0.1)
  29.  if type(m[1]) == "string" and m[1] == "MegaPipeStone" then
  30.   if m[2] == "comb" then
  31.    for y=19,-17, -1 do
  32.     term.clear()
  33.     paintutils.drawImage(comb, 1, y)
  34.     sleep(speed)
  35.    end
  36.   end
  37.  end
  38. end
  39.  
  40.  
  41. while true do
  42.  run()
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement