Advertisement
Guest User

kopacz

a guest
Jan 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. if not os.loadAPI("rtl") then shell.run("pastebin get XM1Zpwpq rtl") os.loadAPI("rtl") end
  2. if turtle.isWorking() then
  3. print("Uwaga! Turtle nieoczekiwanie sie wylaczyl. Cofanie...")
  4. turtle.rtl()
  5. turtle.setWorking(false)
  6. end
  7. function turn(p)
  8. turtle.forward()
  9. if p == "b" then turtle.digDown() elseif p == "p" then turtle.placeDown() end
  10. turtle.forward()
  11. if p == "b" then turtle.digDown() elseif p == "p" then turtle.placeDown() end
  12. turtle.turnRight()
  13. end
  14.  
  15. function selectItem(name,alt)
  16. local oldpos = turtle.getSelectedSlot()
  17. for i=1,16 do
  18. turtle.select(i)
  19. local slot = turtle.getItemDetail()
  20. if slot ~= nil and (slot["name"] == name or slot["name"] == alt) then
  21. break
  22. end
  23. end
  24. end
  25.  
  26. while true do
  27. if turtle.getFuelLevel() < 500 then selectItem("minecraft:coal_block") turtle.refuel(64) end
  28. if not turtle.isIdle() then
  29. turtle.setWorking(true)
  30. turtle.suckDown(64)
  31. selectItem("minecraft:log","minecraft:stone")
  32. turtle.forward()
  33. for i=1,7 do
  34.  for i=1,4 do turn("p") end
  35.  turtle.up()
  36. end
  37. turn("p")
  38. turtle.setIdle(true)
  39. end
  40. while true do
  41.  os.sleep(1)
  42.  local _,name = turtle.inspectDown()
  43.  if name ~= nil and (name["name"] == "Botania:livingrock" or name["name"] == "Botania:livingwood") then
  44.  break
  45. end
  46. turtle.setIdle(false)
  47. end
  48. for i=1,7 do
  49.  for i=1,4 do turn("b") end
  50.  turtle.down()
  51. end
  52. turn("b")
  53.  turtle.back()
  54.  selectItem("Botania:livingwood","Botania:livingrock")
  55.  turtle.dropUp(64)
  56.  turtle.setWorking(false)
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement