arbarr3

plantWorker

Feb 1st, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. sleep(2)
  2.  
  3. fuelLvl = turtle.getFuelLevel()
  4. name = os.getComputerLabel()
  5.  
  6. print("Name: "..name)
  7. print("Fuel: "..fuelLvl)
  8.  
  9. rednet.open("right")
  10. rednet.broadcast(name..": "..fuelLvl)
  11.  
  12. function backLeft()
  13.     turtle.back()
  14.     turtle.turnLeft()
  15.     turtle.forward()
  16. end
  17.  
  18. function backRight()
  19.     turtle.back()
  20.     turtle.turnRight()
  21.     turtle.forward()
  22. end
  23.  
  24. function cycleWire()
  25.     if turtle.detectUp() then
  26.         turtle.digUp()
  27.         sleep(2)
  28.         turtle.placeUp()
  29.     elseif turtle.detectDown() then
  30.         turtle.digDown()
  31.         sleep(2)
  32.         turtle.placeDown()
  33.     else
  34.     end
  35. end
  36.  
  37. function upLevel()
  38.     turtle.up()
  39.     turtle.up()
  40. end
  41.  
  42. function downLevel()
  43.     turtle.down()
  44.     turtle.down()
  45. end
  46.  
  47. --MAIN--
  48.  
  49. cycleWire()
  50. upLevel()
  51. cycleWire()
  52. backRight()
  53. cycleWire()
  54. downLevel()
  55. cycleWire()
  56. backLeft()
Advertisement
Add Comment
Please, Sign In to add comment