UNOBTANIUM

MegaPipeAlveary

Jun 18th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.47 KB | None | 0 0
  1. -- MEGA WOODEN PIPE SEGMENT 0.1.0
  2.  
  3. local speed = 0.5
  4.  
  5. os.setComputerLabel("MegaPipeAlveary")
  6. if not fs.exists("bee") then
  7.  shell.run("pastebin","get","7geFYhut","bee")
  8. end
  9. if not fs.exists("princess") then
  10.  shell.run("pastebin","get","5GLf6ZCB","princess")
  11. end
  12. if not fs.exists("comb") then
  13.  shell.run("pastebin","get","YUrtgM6X","comb")
  14. end
  15. term.clear()
  16. term.setCursorPos(1,1)
  17.  
  18. local bee = paintutils.loadImage("bee")
  19. local comb = paintutils.loadImage("comb")
  20. local princess = paintutils.loadImage("princess")
  21.  
  22. rednet.open("top")
  23.  
  24. local monitor = peripheral.wrap("back")
  25. term.redirect(monitor)
  26.  
  27.  
  28. function clear()
  29.  term.clear()
  30.  term.setCursorPos(1,1)
  31. end
  32.  
  33. function run()
  34.  clear()
  35.  local id, message = rednet.receive()
  36.  local m = textutils.unserialize(message)
  37.  if type(m[1]) == "string" and m[1] == "MegaPipeAlveary" then
  38.   if m[2] == "bee" or m[2] == "princess" then
  39.    local beeImage = princess
  40.    if m[2] == "bee" then
  41.     beeImage = bee
  42.    end
  43.    for y=19,4, -1 do
  44.     term.clear()
  45.     paintutils.drawImage(beeImage, 1, y)
  46.     sleep(speed)
  47.    end
  48.    for x=1,-28, -2 do
  49.     term.clear()
  50.     paintutils.drawImage(beeImage, x, 4)
  51.     sleep(speed)
  52.    end
  53.   end
  54.  
  55.   if m[2] == "comb" then
  56.    for y=19,-17, -1 do
  57.     term.clear()
  58.     paintutils.drawImage(comb, 1, y)
  59.     sleep(speed)
  60.     if y == -17 then
  61.      rednet.broadcast(textutils.serialize({"MegaPipeStoneSegment","comb"}))
  62.     end
  63.    end
  64.   end
  65.  end
  66. end
  67.  
  68.  
  69.  
  70. while true do
  71.  run()
  72. end
Advertisement
Add Comment
Please, Sign In to add comment