Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- function search()
- print("Initalizing search for blocks")
- slot1 = 1
- done1 = false
- repeat
- print("Searching slot "..slot1)
- if turtle.getItemDetail(slot1) ~= nil then
- turtle.select(slot1)
- turtle.transferTo(1)
- turtle.select(1)
- break
- else
- slot1 = slot1+1
- end
- if slot1 == 16 and turtle.getItemDetail(16) == nil then
- os.sleep(2)
- textutils.slowPrint("Not found.. rebooting")
- os.reboot()
- end
- until done1 == true
- end
- i = 0
- repeat
- if turtle.getItemDetail == nil then
- search()
- end
- turtle.placeDown()
- turtle.forward()
- i = i+1
- until i == tonumber(args[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement