Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local Args = {...}
- local func
- function cleanup()
- turtle.select(16)
- turtle.placeDown()
- for i = 1, 12 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.digDown()
- end
- function fuel()
- turtle.select(15)
- turtle.placeDown()
- turtle.select(14)
- turtle.suckDown()
- turtle.dropDown(turtle.getItemCount(1) - 4)
- turtle.refuel()
- turtle.select(15)
- turtle.digDown()
- end
- function checkFuel()
- if turtle.getFuelLevel() < 400 then
- fuel()
- end
- end
- function cycle()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- while turtle.getItemCount(1) > 20 do
- cleanup()
- sleep(2)
- end
- checkFuel()
- end
- function checkIn(fromID)
- rednet.send(fromID, Args[1])
- end
- while true do
- sleep(0)
- local id,msg,dist = rednet.receive()
- if msg == "cycle" then
- cycle()
- elseif msg == "checkIn" then
- checkIn()
- end
- func = loadstring(msg.."(...)")
- setfenv(func,getfenv())
- func (id)
- rednet.send(id,"Done")
- end
- if msg == "cycle" then
- cycle()
- elseif msg == "checkIn" then
- checkIn()
- end
Advertisement
Add Comment
Please, Sign In to add comment