UNOBTANIUM

MegaPipeStoneSegment

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