Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local program = [[
- textutils.slowPrint("Repair Drone Software")
- textutils.slowPrint("(C) 1989 KillaVanilla Industries")
- textutils.slowPrint("Running on drone ID: "..os.computerID())
- textutils.slowPrint("Starting...")
- rednet.open("right")
- textutils.slowPrint("Press SPACEBAR to initate refueling.")
- while true do
- local event, id, msg = os.pullEvent()
- if event == "key" then
- if id == keys.space then
- for i=1, 16 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- turtle.refuel()
- end
- end
- end
- elseif event == "rednet_message" then
- if msg == "FORWARD" then
- turtle.forward()
- elseif msg == "BACK" then
- turtle.back()
- elseif msg == "TURNLEFT" then
- turtle.turnLeft()
- elseif msg == "TURNRIGHT" then
- turtle.turnRight()
- elseif msg == "UP" then
- turtle.up()
- elseif msg == "DOWN" then
- turtle.down()
- elseif string.sub(msg,1,5) == "PLACE" then
- for i=1, 16 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- break
- end
- end
- turtle.placeDown(string.sub(msg,6))
- end
- local material = 0
- for i=1, 16 do
- material = material + turtle.getItemCount(i)
- end
- rednet.send(id, textutils.serialize({turtle.getFuelLevel(), material}))
- end
- end
- ]]
- if turtle then
- if not fs.exists("startup") then
- textutils.slowPrint("Installing: Repair Drone Software")
- local handle = fs.open("startup", "w")
- handle.write(program)
- handle.close()
- os.sleep(0.5)
- textutils.slowPrint("Installation complete, rebooting...")
- os.reboot()
- elseif fs.exists("startup") then
- shell.run("startup")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement