Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local t=turtle
- if tArgs == 0 then
- tArgs[1] = 12 -- inactive now, doesn`t working, may work
- tArgs[2] = 120 -- inactive now, doesn`t working, may work
- end
- function refuel()
- t.select(16)
- while t.getFuelLevel()<100 do
- if not turtle.refuel(1) then
- print("Put fuel in slot 16")
- os.sleep(10)
- end
- end
- end
- function cleaninv()
- for i=1,15 do
- t.select(i)
- t.drop()
- end
- t.select(1)
- end
- function suck()
- t.turnRight()
- t.suck()
- t.suckUp()
- t.turnLeft()
- t.suck()
- t.suckUp()
- t.turnLeft()
- t.suck()
- t.suckUp()
- t.turnRight()
- end
- function move(tArgs[1])
- for i=1,tArgs[1] do
- suck()
- refuel()
- t.forward()
- end
- end
- function turnBack()
- t.turnRight()
- t.turnRight()
- end
- function main(tArgs[1], tArgs[2])
- while true do
- move(tArgs[1])
- turnBack()
- move()
- cleaninv()
- turnBack()
- sleep(tArgs[2])
- end
- end
- main(tArgs[1], tArgs[2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement