MatthewGB

EMC Farmer

Feb 27th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. length = 10
  2. function place2(side)
  3.     if turtle.getItemCount(turtle.getSelectedSlot()) == 0 then
  4.         turtle.select(turtle.getSelectedSlot()+1)
  5.     end
  6.     if side == "f" then
  7.         turtle.place()
  8.     elseif side == "u" then
  9.         turtle.placeUp()
  10.     else
  11.         turtle.placeDown()
  12.     end
  13. end
  14. function forward()
  15.     if turtle.getFuelLevel() == 0 then
  16.         curslot = turtle.getSelectedSlot()
  17.         turtle.select(15)
  18.         turtle.refuel()
  19.         turtle.select(curslot)
  20.     end
  21.     while not turtle.forward() do
  22.         turtle.dig()
  23.     end
  24. end
  25. i = 0
  26. ii = 0
  27. while ii < length do
  28.     turtle.turnLeft()
  29.     place2("f")
  30.     turtle.turnRight()
  31.     turtle.turnRight()
  32.     i = 0
  33.     while i < 11 do
  34.         print("At gen no "..ii.." building part "..i.." with "..turtle.getFuelLevel().."/"..turtle.getFuelLimit().." fuel left")
  35.         place2()
  36.         if i == 8 then
  37.             curslot = turtle.getSelectedSlot()
  38.             turtle.select(16)
  39.             place2("u")
  40.             comp = peripheral.wrap("top")
  41.             comp.turnOn()
  42.             --peripheral.call("top", "shell.run('pastebin get 7jn3bJzA startup')")
  43.             --comp.reboot()
  44.             turtle.select(curslot)
  45.         end
  46.         forward()
  47.         i = i + 1
  48.     end
  49.     place2("f")
  50.     place2()
  51.     i = 0
  52.     turtle.turnRight()
  53.     turtle.turnRight()
  54.     while i < 11 do
  55.         turtle.forward()
  56.         i = i + 1
  57.     end
  58.     turtle.turnRight()
  59.     forward()
  60.     ii = ii + 1
  61. end
Advertisement
Add Comment
Please, Sign In to add comment