UNOBTANIUM

MegaPipeWoodenSegment

Jun 18th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.62 KB | None | 0 0
  1. -- MEGA WOODEN PIPE SEGMENT 0.1.0
  2.  
  3. local speed = 0.5
  4.  
  5. os.setComputerLabel("MegaPipeWoodenSegment")
  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.  
  29. function clear()
  30.  term.clear()
  31.  term.setCursorPos(1,1)
  32. end
  33.  
  34. function run()
  35.  local id, message = rednet.receive()
  36.  local m = textutils.unserialize(message)
  37.  sleep(speed-0.1)
  38.  if type(m[1]) == "string" and m[1] == "MegaPipeWoodenSegment" then
  39.   if m[2] == "bee" or m[2] == "princess" then
  40.    local beeImage = princess
  41.    if m[2] == "bee" then
  42.     beeImage = bee
  43.    end
  44.    for y=12,-17, -1 do
  45.     term.clear()
  46.     paintutils.drawImage(beeImage, 1, y)
  47.     sleep(speed)
  48.     if y == -17 then
  49.      if m[2] == "princess" then
  50.       rednet.broadcast(textutils.serialize({"MegaPipeAlveary","princess"}))
  51.      else
  52.       rednet.broadcast(textutils.serialize({"MegaPipeAlveary","bee"}))
  53.      end
  54.     end
  55.    end
  56.   end
  57.  
  58.   if m[2] == "comb" then
  59.    for y=12,-17, -1 do
  60.     term.clear()
  61.     paintutils.drawImage(comb, 1, y)
  62.     sleep(speed)
  63.     if y == -17 then
  64.      rednet.broadcast(textutils.serialize({"MegaPipeAlveary","comb"}))
  65.     end
  66.    end
  67.   end
  68.  end
  69. end
  70.  
  71.  
  72.  
  73. while true do
  74.  run()
  75. end
Advertisement
Add Comment
Please, Sign In to add comment