Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- done = 0
- for l=1,10 do
- if fs.exists("goto") == false
- then do
- print("downloading goto")
- shell.run("pastebin","get","9wbmJhWS","goto")
- end
- else do
- while true do
- if done ~= 4 then do
- --CHANGE HERE START
- lenth = 5
- st_width = 5
- --CHANGE HERE END
- function chest()
- shell.run("goto", "359", "88", "629")
- chest = 2
- while chest ~= 17 do
- if turtle.detectDown() == true then
- print("chest: " .. chest)
- turtle.select(chest)
- turtle.dropDown()
- chest = chest + 1
- elseif turtle.detectDown() == false then
- turtle.down()
- end
- sleep(45)
- os.reboot()
- end
- function turn()
- if right == 1 then
- print("right")
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- dist = lenth
- width = width - 1
- right = 0
- else
- print("left")
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- dist = lenth
- width = width - 1
- right = 1
- end
- end
- shell.run("goto", "355", "89", "631")
- shell.run("goto", "359", "89", "629")
- turtle.turnRight()
- right = 1
- turtle.select(1)
- dist = lenth
- turtle.forward()
- turtle.forward()
- if width == 0 or width == nil then
- done = done + 1
- print ("add")
- print ("Steps: " .. done)
- if done == 4 then
- chest()
- done = 0
- end
- width = st_width
- print("width: " .. width)
- elseif width ~= 0 then
- if dist ~= 0 then
- if done == 1 then
- while width ~= 0 do
- while dist ~= 0 do
- success, data = turtle.inspectDown()
- if success then
- print("Age: " .. data.state.age)
- if data.state.age == 7 then
- print("Age Check 2: " .. data.state.age)
- turtle.digDown()
- end
- end
- turtle.forward()
- print ("Steps: " .. done)
- print("dig")
- dist = dist - 1
- end
- turn()
- end
- elseif done == 2 then
- while width ~= 0 do
- while dist ~= 0 do
- turtle.suckDown()
- turtle.forward()
- print("grab")
- print ("Steps: " .. done)
- dist = dist - 1
- end
- turn()
- end
- elseif done == 3 then
- while width ~= 0 do
- while dist ~= 0 do
- turtle.placeDown()
- turtle.forward()
- print("plant")
- print ("Steps: " .. done)
- dist = dist - 1
- end
- turn()
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment