Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cnt=0
- local hasChargeStation=false;
- --cnt=0
- args={...}
- turtle.select(2)
- if(args[1]==nil) then
- else
- if not turtle.compare() then
- turtle.back()
- --turtle.select(2)
- turtle.place()
- end
- end
- --if turtle.getItemCount(4)>0 then hasChargeStation = true end
- while true do
- turtle.select(2)
- while turtle.compareDown() do
- --check fuel first
- while turtle.getFuelLevel()<40 do
- if(hasChargeStation) then
- turtle.up()
- turtle.select(4)
- turtle.placeDown()
- sleep(10)
- turtle.digDown()
- turtle.down()
- turtle.select(2)
- else
- print(" I need more fuel")
- for k=1,4 do turtle.turnLeft() end
- shell.run("refuel all")
- sleep(5);
- end
- end
- cnt=cnt+1
- turtle.back()
- if not turtle.detectDown() and turtle.getItemCount(2)>48 then
- redstone.setOutput("bottom",true)
- turtle.down()
- --turtle.turnRight()
- turtle.select(1)
- turtle.transferTo(16,1)
- turtle.select(2)
- turtle.transferTo(1,32)
- turtle.select(1)
- while not turtle.detectDown() do
- sleep(1)
- end
- --redstone.setOutput("bottom",false)
- while( turtle.getItemCount(1)>0) do sleep(0.5) end
- turtle.select(16)
- turtle.transferTo(1,1)
- --redstone.setOutput("bottom",true)
- --turtle.drop()
- turtle.up()
- --turtle.turnLeft()
- turtle.select(2)
- redstone.setOutput("bottom",false)
- end
- sleep(0.5)
- end
- if cnt>7 then
- cnt=0
- turtle.select(2)
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.select(1)
- turtle.placeDown()
- turtle.back()
- turtle.attackDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- --turtle.forward()
- turtle.select(2)
- repeat
- if turtle.compareDown() then turtle.digDown() end
- until not turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- --turtle.back()
- turtle.turnRight()
- turtle.forward()
- turtle.select(1)
- turtle.digDown()
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- turtle.select(2)
- while turtle.compareDown() do
- turtle.digDown()
- end
- turtle.select(2)
- while not turtle.compareDown() do
- turtle.back()
- end
- turtle.back()
- turtle.back()
- turtle.place()
- else
- sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement