Advertisement
jonnathonchristopher

end

Mar 10th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.87 KB | None | 0 0
  1. os.loadAPI("/req/menuApi")
  2. os.loadAPI("/req/config")
  3.  
  4.  
  5. config.load("configs","server")
  6. term.clear()
  7. term.setCursorPos(1, 1)
  8. nof = tonumber(config.readVal("floors"))
  9. if nof >= 2 then
  10. if nof <= 16 then
  11.     term.clear()
  12.     term.setCursorPos(1, 1)
  13.     print("What is the name of your first floor?")
  14.     f1 = read()
  15.     config.writeVal("f1",f1)
  16.     print("What is the number of your first floor monitor?")
  17.     m1 = read()
  18.     config.writeVal("m1",m1)
  19.     config.save()
  20.    
  21.     term.clear()
  22.     term.setCursorPos(1, 1)
  23.     config.load("configs","server")
  24.     print("What is the name of your second floor?")
  25.     f2 = read()
  26.     config.writeVal("f2",f2)
  27.     print("What is the number of your second floor monitor?")
  28.     m2 = read()
  29.     config.writeVal("m2",m2)
  30.     config.save()
  31.  
  32.     if nof >= 3 then
  33.         term.clear()
  34.         term.setCursorPos(1, 1)
  35.         config.load("configs","server")
  36.         print("What is the name of your third floor?")
  37.         f3 = read()
  38.         config.writeVal("f3",f3)
  39.         print("What is the number of your third floor monitor?")
  40.         m3 = read()
  41.         config.writeVal("m3",m3)
  42.         config.save()
  43.     end
  44.    
  45.     if nof >= 4 then
  46.         term.clear()
  47.         term.setCursorPos(1, 1)
  48.         config.load("configs","server")
  49.         print("What is the name of your forth floor?")
  50.         f4 = read()
  51.         config.writeVal("f4",f4)
  52.         print("What is the number of your forth floor monitor?")
  53.         m4 = read()
  54.         config.writeVal("m4",m4)
  55.         config.save()
  56.     end
  57.    
  58.     if nof >= 5 then
  59.         term.clear()
  60.         term.setCursorPos(1, 1)
  61.         config.load("configs","server")
  62.         print("What is the name of your fifth floor?")
  63.         f5 = read()
  64.         config.writeVal("f5",f5)
  65.         print("What is the number of your fifth floor monitor?")
  66.         m5 = read()
  67.         config.writeVal("m5",m5)
  68.         config.save()
  69.     end
  70.    
  71.     if nof >= 6 then
  72.         term.clear()
  73.         term.setCursorPos(1, 1)
  74.         config.load("configs","server")
  75.         print("What is the name of your sixth floor?")
  76.         f6 = read()
  77.         config.writeVal("f6",f6)
  78.         print("What is the number of your sixth floor monitor?")
  79.         m6 = read()
  80.         config.writeVal("m6",m6)
  81.         config.save()
  82.     end
  83.    
  84.     if nof >= 7 then
  85.         term.clear()
  86.         term.setCursorPos(1, 1)
  87.         config.load("configs","server")
  88.         print("What is the name of your seventh floor?")
  89.         f7 = read()
  90.         config.writeVal("f7",f7)
  91.         print("What is the number of your seventh floor monitor?")
  92.         m7 = read()
  93.         config.writeVal("m7",m7)
  94.         config.save()
  95.     end
  96.    
  97.     if nof >= 8 then
  98.         term.clear()
  99.         term.setCursorPos(1, 1)
  100.         config.load("configs","server")
  101.         print("What is the name of your eighth floor?")
  102.         f8 = read()
  103.         config.writeVal("f8",f8)
  104.         print("What is the number of your eighth floor monitor?")
  105.         m8 = read()
  106.         config.writeVal("m8",m8)
  107.         config.save()
  108.     end
  109.    
  110.     if nof >= 9 then
  111.         term.clear()
  112.         term.setCursorPos(1, 1)
  113.         config.load("configs","server")
  114.         print("What is the name of your ninth floor?")
  115.         f9 = read()
  116.         config.writeVal("f9",f9)
  117.         print("What is the number of your ninth floor monitor?")
  118.         m9 = read()
  119.         config.writeVal("m9",m9)
  120.         config.save()
  121.     end
  122.    
  123.     if nof >= 10 then
  124.         term.clear()
  125.         term.setCursorPos(1, 1)
  126.         config.load("configs","server")
  127.         print("What is the name of your tenth floor?")
  128.         f10 = read()
  129.         config.writeVal("f10",f10)
  130.         print("What is the number of your tenth floor monitor?")
  131.         m10 = read()
  132.         config.writeVal("m10",m10)
  133.         config.save()
  134.     end
  135.    
  136.     if nof >= 11 then
  137.         term.clear()
  138.         term.setCursorPos(1, 1)
  139.         config.load("configs","server")
  140.         print("What is the name of your eleventh floor?")
  141.         f11 = read()
  142.         config.writeVal("f11",f11)
  143.         print("What is the number of your eleventh floor monitor?")
  144.         m11 = read()
  145.         config.writeVal("m11",m11)
  146.         config.save()
  147.     end
  148.    
  149.     if nof >= 12 then
  150.         term.clear()
  151.         term.setCursorPos(1, 1)
  152.         config.load("configs","server")
  153.         print("What is the name of your twelfth floor?")
  154.         f12 = read()
  155.         config.writeVal("f12",f12)
  156.         print("What is the number of your twelfth floor monitor?")
  157.         m12 = read()
  158.         config.writeVal("m12",m12)
  159.         config.save()
  160.     end
  161.    
  162.     if nof >= 13 then
  163.         term.clear()
  164.         term.setCursorPos(1, 1)
  165.         config.load("configs","server")
  166.         print("What is the name of your thirteenth floor?")
  167.         f13 = read()
  168.         config.writeVal("f13",f13)
  169.         print("What is the number of your thirteenth floor monitor?")
  170.         m13 = read()
  171.         config.writeVal("m13",m13)
  172.         config.save()
  173.     end
  174.    
  175.     if nof >= 14 then
  176.         term.clear()
  177.         term.setCursorPos(1, 1)
  178.         config.load("configs","server")
  179.         print("What is the name of your fourteenth floor?")
  180.         f14 = read()
  181.         config.writeVal("f14",f14)
  182.         print("What is the number of your fourteenth floor monitor?")
  183.         m14 = read()
  184.         config.writeVal("m14",m14)
  185.         config.save()
  186.     end
  187.    
  188.     if nof >= 15 then
  189.         term.clear()
  190.         term.setCursorPos(1, 1)
  191.         config.load("configs","server")
  192.         print("What is the name of your fifteenth floor?")
  193.         f15 = read()
  194.         config.writeVal("f15",f15)
  195.         print("What is the number of your fifteenth floor monitor?")
  196.         m15 = read()
  197.         config.writeVal("m15",m15)
  198.         config.save()
  199.     end
  200.    
  201.     if nof >= 16 then
  202.         term.clear()
  203.         term.setCursorPos(1, 1)
  204.         config.load("configs","server")
  205.         print("What is the name of your sixteenth floor?")
  206.         f16 = read()
  207.         config.writeVal("f16",f16)
  208.         print("What is the number of your sixteenth floor monitor?")
  209.         m16 = read()
  210.         config.writeVal("m16",m16)
  211.         config.save()
  212.     end
  213.  
  214.     fs.delete("server.lua")
  215. if not shell.run("pastebin", "get", "kULurzKm", "server.lua") then
  216.     print("Failed to download main program. Try manually from pastebin: kULurzKm\n(this is just the setup component)")
  217.     return
  218. end
  219.  
  220. file = io.open("/startup", "w")
  221. file:write("shell.run(\"/"..shell.resolve(".").."/server.lua\")")
  222. file:close()
  223. term.write("Done")
  224. term.clear()
  225. term.setCursorPos(1, 1)
  226. print("Setup is complete press any key to reboot")
  227. os.pullEvent("key")
  228. os.reboot()
  229.  
  230. else
  231.     print("This program only supports 16 floors")
  232.     print("please re-run this script and try again")
  233. end
  234. else
  235.     print("You need at least 2 floors")
  236.     print("please re-run this script and try again")
  237. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement