Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left");
- print("Elevator Control Client v0.1 ")
- print("------------------------------------")
- print("Use your rednet device to control")
- print(" -- 'UP' to move up")
- print(" -- 'DOWN' to move down")
- print(" -- 'UPDATE' to perform firmware update")
- print("")
- for i=1, 100 do
- turtle.down()
- end
- while true do
- id, command = rednet.receive()
- if (command == "UP") then
- turtle.up()
- else
- if (command == "DOWN") then
- turtle.down()
- else
- if (command == "UPDATE") then
- id, link = rednet.receive()
- print ("Updating firmware....")
- sleep(5)
- shell.run("delete startup");
- shell.run("pastebin get " .. link .. " startup")
- print("Update DONE.")
- sleep(2)
- os.reboot()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement