Advertisement
jimthenerd1999

Untitled

Jul 1st, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("left");
  2. print("Elevator Control Client v0.1 ")
  3. print("------------------------------------")
  4. print("Use your rednet device to control")
  5. print(" -- 'UP' to move up")
  6. print(" -- 'DOWN' to move down")
  7. print(" -- 'UPDATE' to perform firmware update")
  8. print("")
  9.  
  10. for i=1, 100 do
  11. turtle.down()
  12. end
  13.  
  14. while true do
  15. id, command = rednet.receive()
  16.  
  17. if (command == "UP") then
  18. turtle.up()
  19. else
  20. if (command == "DOWN") then
  21. turtle.down()
  22. else
  23. if (command == "UPDATE") then
  24. id, link = rednet.receive()
  25. print ("Updating firmware....")
  26. sleep(5)
  27.  
  28. shell.run("delete startup");
  29. shell.run("pastebin get " .. link .. " startup")
  30.  
  31. print("Update DONE.")
  32. sleep(2)
  33. os.reboot()
  34. end
  35. end
  36. end
  37.  
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement