Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Power Monitoring Program Written By: 0_Mr_Redstone_0 AKA MoJoCreatior
- This code is considered free for use both commercial and private and can be redistributed so long as it meats following criteria:
- 1: 0_Mr_Redstone_0 and MoJoCreatior are credited as the original authors
- 2: You do not try to take full ownership of the code/written program
- 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]]
- --Power Monitoring Program
- --Version 13
- --Setup
- fs.delete("config/")
- term.setTextColour(colors.lime)
- print("Power Monitor Setup")
- term.setTextColour(colors.yellow)
- print("Please label the computer to avoid data loss! use:'label set ******' in the terminal")
- term.setTextColour(colors.lightBlue)
- print("Launching Configuration...")
- term.setTextColour(colors.red)
- print("What is the name of your Monitor?")
- term.setTextColour(colors.yellow)
- mon = io.read()
- config = fs.open("config/monitor","w")
- config.write(mon)
- config.close()
- term.setTextColour(colors.blue)
- print("Saved...")
- term.setTextColour(colors.red)
- print("What is the name of your Energy Storage Device?")
- term.setTextColour(colors.yellow)
- cube = io.read()
- config = fs.open("config/cube","w")
- config.write(cube)
- config.close()
- term.setTextColour(colors.blue)
- print("Saved...")
- term.setTextColour(colors.red)
- print("What is the Power Monitor going to be Titled? NOT TOO LONG!!")
- term.setTextColour(colors.yellow)
- title = io.read()
- config = fs.open("config/title","w")
- config.write(title)
- config.close()
- term.setTextColour(colors.blue)
- print("Saved...")
- term.setTextColour(colors.red)
- print("Are you using Mekanism? [y/n]")
- term.setTextColour(colors.yellow)
- powerSystem = io.read()
- config = fs.open("config/mekanism","w")
- config.write(powerSystem)
- config.close()
- term.setTextColour(colors.blue)
- print("Saved...")
- term.setTextColour(colors.red)
- print("Are you using IC2? [y/n]")
- term.setTextColour(colors.yellow)
- IC2 = io.read()
- config = fs.open("config/IC2","w")
- config.write(IC2)
- config.close()
- term.setTextColour(colors.blue)
- print("Saved...")
- term.setTextColour(colors.red)
- print("Should the monitor update fast or slow? [f/s/0]")
- term.setTextColour(colors.lightBlue)
- print("fast is every 1 second, slow is every 5 seconds, zero is for instant")
- term.setTextColour(colors.yellow)
- rate = io.read()
- config = fs.open("config/rate","w")
- config.write(rate)
- config.close()
- term.setTextColour(colors.blue)
- print("Saved...")
- term.setTextColour(colors.red)
- print("Do you want to update? [y/n]")
- term.setTextColour(colors.lightBlue)
- print("Warning: if you edited the power program this will revert it to default!")
- term.setTextColour(colors.yellow)
- update = io.read()
- term.setTextColour(colors.blue)
- if update == "y" then
- print("Updating/Creating Power Monitor Program and Setting Auto Startup")
- fs.delete("power")
- shell.run("pastebin get 869zZQ35 power")
- fs.delete("startup")
- boot = 'shell.run("power")'
- startup = fs.open("startup","w")
- startup.write(boot)
- startup.close()
- print("Installation Complete")
- else
- print("Reconfigured!")
- end
- print("Auto Restart in 3 seconds!") sleep(1)
- print("Auto Restart in 2 seconds!") sleep(1)
- print("Auto Restart in 1 seconds!") sleep(1)
- print("Restarting...")
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement