Advertisement
Heracles421

Turtle Remote Control Installer

Oct 22nd, 2012
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.77 KB | None | 0 0
  1. function menu(id, text)
  2.     if sid == id then
  3.         print("["..text.."]")
  4.     else
  5.         print(" "..text)
  6.     end
  7. end
  8.  
  9. function installer()
  10. sid = 0
  11. while true do
  12.     term.clear()
  13.     term.setCursorPos(1,1)
  14.     print("TurtleControl V "..version.." Installer")
  15.     menu(0, "Install")
  16.     menu(1, "Install with tutorial")
  17.     menu(2, "Abort")
  18.     local sEvent, param = os.pullEvent("key")
  19.     if(sEvent == "key") then
  20.         if(param == 200) then
  21.             if sid > 0 then
  22.                 sid = sid - 1
  23.             elseif sid == 0 then
  24.                 sid = 2
  25.             end
  26.         elseif (param == 208) then
  27.             if sid < 2 then
  28.                 sid = sid + 1
  29.             elseif sid == 2 then
  30.                 sid = 0
  31.             end
  32.         elseif (param == 28) then
  33.             if sid == 0 then
  34.                 print("Installing...")
  35.                 shell.run("pastebin get m6jMQJEx RC_Console")
  36.                 sleep(.5)
  37.                 shell.run("pastebin get g8Y65Z7N RC_Turtle")
  38.                 shell.run("move", "RC_Turtle", "disk")
  39.                 sleep(.5)
  40.                 print("Done! Enjoy the remote controller. Rebooting.")
  41.                 sleep(4)
  42.                 shell.run("delete", "startup")
  43.                 os.reboot()
  44.             elseif sid == 1 then
  45.                 print("Installing with tutorial...")
  46.                 shell.run("pastebin get m6jMQJEx RC_Console")
  47.                 sleep(.5)
  48.                 shell.run("pastebin get g8Y65Z7N RC_Turtle")
  49.                 shell.run("move", "RC_Turtle", "disk")
  50.                 sleep(.5)
  51.                 shell.run("pastebin get tNu1XQRV Tutorial")
  52.                 sleep(.5)
  53.                 print("Done! Enjoy the remote controller. Rebooting.")
  54.                 sleep(4)
  55.                 shell.run("delete", "startup")
  56.                 shell.run("rename", "Tutorial", "startup")
  57.                 os.reboot()
  58.             elseif sid == 2 then
  59.                 print("Aborting...")
  60.                 sleep(4)
  61.                 shell.run("delete", "startup")
  62.                 os.reboot()
  63.             end
  64.         end
  65.     end
  66. end
  67. end
  68.  
  69. version=1.0
  70. term.clear()
  71. term.setCursorPos(1,1)
  72. print("Proceeding to install Turtle Remote Control, make sure you have a floppy disk attached to the terminal.")
  73. sleep(5)
  74. installer()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement