Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DROP(dropslot, top_bottom)
- turtle.select(dropslot)
- if top_bottom == 1 then
- turtle.dropUp(1)
- else
- turtle.dropDown(1)
- end
- end
- function SUCK(top_bottom)
- for slot=1,4 do
- turtle.select(slot)
- if top_bottom == 1 then
- turtle.suckUp()
- else
- turtle.suckDown()
- end
- end
- end
- function GET_RID_OF()
- turtle.select(4)
- turtle.drop()
- end
- function GET_NEW()
- turtle.select(4)
- turtle.suck(6)
- end
- function INSERT(top_bottom)
- for line=1,2 do
- for pattern=1,3 do
- for slot=1,3 do
- DROP(slot, top_bottom)
- end
- end
- for pattern=1,3 do
- DROP(2, top_bottom)
- DROP(4, top_bottom)
- DROP(2, top_bottom)
- end
- for pattern=1,3 do
- for slot=1,3 do
- DROP(4-slot, top_bottom)
- end
- end
- end
- end
- function GET_TO(reactornum)
- turtle.up()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- if ( reactornum == 1 ) or ( reactornum == 4 ) then
- turtle.turnRight()
- for xtoreac=1,4 do
- turtle.forward()
- end
- turtle.turnLeft()
- else
- if ( reactornum == 3 ) or ( reactornum == 6 ) then
- turtle.turnLeft()
- for xtoreactor=1,4 do
- turtle.forward()
- end
- turtle.turnRight()
- end
- end
- end
- function GET_REACTOR(reactornum)
- if reactornum <= 3 then
- turtle.down()
- SUCK(0)
- turtle.up()
- else
- turtle.up()
- SUCK(1)
- turtle.down()
- end
- end
- function PUT_REACTOR(reactornum)
- if reactornum <=3 then
- turtle.down()
- INSERT(0)
- turtle.up()
- else
- turtle.up()
- INSERT(1)
- turtle.down()
- end
- end
- function GET_BACK(reactornum)
- if ( reactornum == 1 ) or ( reactornum == 4 ) then
- turtle.turnLeft()
- for i=1,4 do
- turtle.forward()
- end
- turtle.turnLeft()
- else
- if ( reactornum == 3 ) or ( reactornum == 6 ) then
- turtle.turnRight()
- for i=1,4 do
- turtle.forward()
- end
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.down()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function REACTOR_RENEW(reactornum)
- local Fuel = true
- GET_TO(reactornum)
- GET_REACTOR(reactornum)
- GET_BACK(reactornum)
- turtle.turnLeft()
- GET_RID_OF()
- turtle.turnLeft()
- GET_NEW()
- turtle.turnLeft()
- while Fuel do
- if turtle.getFuelLevel() < 1000 then
- turtle.select(16)
- turtle.suck(1)
- turtle.drop()
- else
- Fuel = false
- end
- end
- turtle.turnLeft()
- GET_TO(reactornum)
- PUT_REACTOR(reactornum)
- GET_BACK(reactornum)
- end
- REACTOR_RENEW(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement