Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local id,msg,dist
- function checknfuel()
- if (turtle.getFuelLevel()<1000) and (turtle.getItemCount(5)==0) then
- turtle.select(4)
- turtle.place()
- turtle.select(5)
- turtle.suck()
- turtle.refuel(1)
- turtle.select(4)
- turtle.dig()
- elseif (turtle.getFuelLevel()<1000) and (turtle.getItemCount(5)>0) then
- turtle.select(5)
- turtle.refuel(1)
- end
- end
- while true do
- id,msg,dist=rednet.receive()
- checknfuel()
- if (msg=="deployportal") and (turtle.detectDown()==false) then
- print("deploying portal")
- turtle.down()
- turtle.select(2)
- turtle.placeDown()
- turtle.up()
- turtle.placeDown()
- turtle.back()
- turtle.back()
- turtle.down()
- turtle.select(1)
- turtle.place()
- turtle.up()
- turtle.forward()
- pt=peripheral.wrap("bottom")
- pt.setGun("normal")
- pt.setColor(true)
- pt.setPowered(false)
- rs.setOutput("bottom",true)
- turtle.forward()
- elseif msg=="retrieve" then
- print("removing portal")
- turtle.back()
- turtle.back()
- turtle.down()
- turtle.select(1)
- turtle.dig()
- turtle.suck()
- turtle.forward()
- turtle.select(2)
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.up()
- turtle.up()
- turtle.forward()
- turtle.forward()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment