Advertisement
Guest User

setup

a guest
Feb 11th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.49 KB | None | 0 0
  1. --[[  Power Monitoring Program Written By: 0_Mr_Redstone_0  AKA  MoJoCreatior
  2. This code is considered free for use both commercial and private and can be redistributed so long as it meats following criteria:
  3. 1: 0_Mr_Redstone_0 and MoJoCreatior are credited as the original authors
  4. 2: You do not try to take full ownership of the code/written program
  5. 3: If you modify the code for re-upload you must provide it under the same conditions. as in- Open Source, and credit me as original author]]
  6.  
  7. --Power Monitoring Program
  8. --Version 13
  9.  
  10. --Setup
  11.   fs.delete("config/")
  12.  
  13.   term.setTextColour(colors.lime)
  14.   print("Power Monitor Setup")
  15.   term.setTextColour(colors.yellow)
  16.   print("Please label the computer to avoid data loss! use:'label set ******' in the terminal")
  17.   term.setTextColour(colors.lightBlue)
  18.   print("Launching Configuration...")
  19.   term.setTextColour(colors.red)
  20.   print("What is the name of your Monitor?")
  21.   term.setTextColour(colors.yellow)
  22.   mon = io.read()
  23.   config = fs.open("config/monitor","w")
  24.   config.write(mon)
  25.   config.close()
  26.   term.setTextColour(colors.blue)
  27.   print("Saved...")
  28.  
  29.   term.setTextColour(colors.red)
  30.   print("What is the name of your Energy Storage Device?")
  31.   term.setTextColour(colors.yellow)
  32.   cube = io.read()
  33.   config = fs.open("config/cube","w")
  34.   config.write(cube)
  35.   config.close()
  36.   term.setTextColour(colors.blue)
  37.   print("Saved...")
  38.  
  39.   term.setTextColour(colors.red)
  40.   print("What is the Power Monitor going to be Titled? NOT TOO LONG!!")
  41.   term.setTextColour(colors.yellow)
  42.   title = io.read()
  43.   config = fs.open("config/title","w")
  44.   config.write(title)
  45.   config.close()
  46.   term.setTextColour(colors.blue)
  47.   print("Saved...")
  48.  
  49.   term.setTextColour(colors.red)
  50.   print("Are you using Mekanism? [y/n]")
  51.   term.setTextColour(colors.yellow)
  52.   powerSystem = io.read()
  53.   config = fs.open("config/mekanism","w")
  54.   config.write(powerSystem)
  55.   config.close()
  56.   term.setTextColour(colors.blue)
  57.   print("Saved...")
  58.  
  59.   term.setTextColour(colors.red)
  60.   print("Are you using IC2? [y/n]")
  61.   term.setTextColour(colors.yellow)
  62.   IC2 = io.read()
  63.   config = fs.open("config/IC2","w")
  64.   config.write(IC2)
  65.   config.close()
  66.   term.setTextColour(colors.blue)
  67.   print("Saved...")
  68.  
  69.   term.setTextColour(colors.red)
  70.   print("Should the monitor update fast or slow? [f/s/0]")
  71.   term.setTextColour(colors.lightBlue)
  72.   print("fast is every 1 second, slow is every 5 seconds, zero is for instant")
  73.   term.setTextColour(colors.yellow)
  74.   rate = io.read()
  75.   config = fs.open("config/rate","w")
  76.   config.write(rate)
  77.   config.close()
  78.   term.setTextColour(colors.blue)
  79.   print("Saved...")
  80.  
  81.   term.setTextColour(colors.red)
  82.   print("Do you want to update? [y/n]")
  83.   term.setTextColour(colors.lightBlue)
  84.   print("Warning: if you edited the power program this will revert it to default!")
  85.   term.setTextColour(colors.yellow)
  86.   update = io.read()
  87.   term.setTextColour(colors.blue)
  88.  
  89.   if update == "y" then
  90.     print("Updating/Creating Power Monitor Program and Setting Auto Startup")
  91.     fs.delete("power")
  92.     shell.run("pastebin get 869zZQ35 power")
  93.     fs.delete("startup")
  94.     boot = 'shell.run("power")'
  95.     startup = fs.open("startup","w")
  96.     startup.write(boot)
  97.     startup.close()
  98.     print("Installation Complete")
  99.   else
  100.     print("Reconfigured!")
  101.   end
  102.   print("Auto Restart in 3 seconds!") sleep(1)
  103.   print("Auto Restart in 2 seconds!") sleep(1)
  104.   print("Auto Restart in 1 seconds!") sleep(1)
  105.   print("Restarting...")
  106.   os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement