TehNoiseBomb_

ComputerCraft 1.75 - 9x9 Farming - refuel

Apr 13th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. --@Author: Zach Combs aka TehNoiseBomb
  2. --@Version: 1.2
  3.  
  4. local inputs = {...}
  5. local fuel  = ... --variable passed in (inputs)
  6.  
  7. --If the turtle has less than 150 fuel:
  8. -- Turn left, move forward
  9. -- Select the second slot
  10. -- Suck up one item from the block below the turtle
  11. -- If the turtle has less than 80 fuel:
  12. --  Suck up one item from the block below the turtle
  13. -- Refuel the turtle
  14. -- Select the first slot in the turtle's inventory
  15. -- Turn right (twice)
  16. -- Move forward one block
  17. -- Turn right
  18. -- Move forward three blocks
  19. -- Turn left
  20. --Otherwise turn right
  21. --Turtle will now be facing east in the starting position
  22. if fuel < 150 then
  23.  turtle.turnLeft()
  24.  turtle.forward()
  25.  turtle.select(2)
  26.  turtle.suckDown(1)
  27.  if fuel < 80 then
  28.   turtle.suckDown(1)
  29.  end
  30.  turtle.refuel()
  31.  turtle.select(1)
  32.  turtle.turnRight()
  33.  turtle.turnRight()
  34.  turtle.forward()
  35.  turtle.turnRight()
  36.  for i = 0, 2 do
  37.   turtle.forward()
  38.  end
  39.  turtle.turnLeft()
  40.  else turtle.turnRight()
  41. end
  42.  
  43. --Return the new fuel level of the turtle
  44. return turtle.getFuelLevel()
Add Comment
Please, Sign In to add comment