SHOW:
|
|
- or go back to the newest paste.
1 | --[[ Big Reactor Monitor 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 | ||
8 | program = "Big Reactor Monitor Setup V:1.3" | |
9 | ||
10 | --functions | |
11 | function intro() | |
12 | term.setBackgroundColour(colors.white) | |
13 | term.clear() | |
14 | term.setCursorPos(1,1) | |
15 | term.setTextColour(colors.green) | |
16 | print(program.." -Written By: 0_Mr_Redstone_0 AKA MoJoCreatior") | |
17 | print(" ") | |
18 | end | |
19 | ||
20 | function setup(question,file,binary,subText) | |
21 | term.setBackgroundColour(colors.white) | |
22 | term.clear() | |
23 | intro() | |
24 | term.setTextColour(colors.gray) | |
25 | print(question) | |
26 | if binary == 1 then | |
27 | term.setTextColour(colors.lightGray) | |
28 | print(subText) | |
29 | end | |
30 | term.setTextColour(colors.cyan) | |
31 | fs.delete("config/"..file) | |
32 | cfg = fs.open("config/"..file,"w") | |
33 | answer = io.read() | |
34 | cfg.write(answer) | |
35 | cfg.close() | |
36 | end | |
37 | ||
38 | function update() | |
39 | fs.delete("program") | |
40 | shell.run("pastebin get rFmYL6uc program") | |
41 | fs.delete("startup") | |
42 | boot = 'shell.run("program")' | |
43 | startup = fs.open("startup","w") | |
44 | startup.write(boot) | |
45 | startup.close() | |
46 | end | |
47 | ||
48 | ||
49 | --Setup | |
50 | intro() | |
51 | print(program.." Configuration and Installation Walkthrough") | |
52 | term.setTextColour(colors.red) | |
53 | print("Please Label this computer to prevent data loss.") | |
54 | sleep(2) | |
55 | setup("What do you want the Title to be?","title",1,"Titles will appear off screen if made too long") | |
56 | setup("Should the Monitor Refresh be fast or slow?","rate",1," [f/s]\n fast is every 1 second\n slow is every 5 seconds") | |
57 | setup("Would you like Dynamic Text Scaling to be turned on?","dynamic",1,"[y/n]\n Makes monitors update as you build them.\n restart computer to update Text scaling.") | |
58 | if not fs.exists("program") then update() else | |
59 | setup("Do you want to Update?","update",1," [y/n]") | |
60 | end | |
61 | if answer == "y" then update() end | |
62 | ||
63 | intro() | |
64 | print("Auto Restart in 3 seconds!") sleep(1) | |
65 | print("Auto Restart in 2 seconds!") sleep(1) | |
66 | print("Auto Restart in 1 seconds!") sleep(1) | |
67 | print("Restarting...") | |
68 | os.reboot()--[[ Big Reactor Monitor Program Written By: 0_Mr_Redstone_0 AKA MoJoCreatior | |
69 | This code is considered free for use both commercial and private and can be redistributed so long as it meats following criteria: | |
70 | 1: 0_Mr_Redstone_0 and MoJoCreatior are credited as the original authors | |
71 | 2: You do not try to take full ownership of the code/written program | |
72 | 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]] | |
73 | ||
74 | ||
75 | program = "Big Reactor Monitor Setup V:1.3" | |
76 | ||
77 | --functions | |
78 | function intro() | |
79 | term.setBackgroundColour(colors.white) | |
80 | term.clear() | |
81 | term.setCursorPos(1,1) | |
82 | term.setTextColour(colors.green) | |
83 | print(program.." -Written By: 0_Mr_Redstone_0 AKA MoJoCreatior") | |
84 | print(" ") | |
85 | end | |
86 | ||
87 | function setup(question,file,binary,subText) | |
88 | term.setBackgroundColour(colors.white) | |
89 | term.clear() | |
90 | intro() | |
91 | term.setTextColour(colors.gray) | |
92 | print(question) | |
93 | if binary == 1 then | |
94 | term.setTextColour(colors.lightGray) | |
95 | print(subText) | |
96 | end | |
97 | term.setTextColour(colors.cyan) | |
98 | fs.delete("config/"..file) | |
99 | cfg = fs.open("config/"..file,"w") | |
100 | cfg.write(io.read()) | |
101 | cfg.close() | |
102 | end | |
103 | ||
104 | function update() | |
105 | fs.delete("program") | |
106 | shell.run("pastebin get rFmYL6uc program") | |
107 | fs.delete("startup") | |
108 | boot = 'shell.run("program")' | |
109 | startup = fs.open("startup","w") | |
110 | startup.write(boot) | |
111 | startup.close() | |
112 | end | |
113 | ||
114 | ||
115 | --Setup | |
116 | intro() | |
117 | print(program.." Configuration and Installation Walkthrough") | |
118 | term.setTextColour(colors.red) | |
119 | print("Please Label this computer to prevent data loss.") | |
120 | sleep(2) | |
121 | setup("What do you want the Title to be?","title",1,"Titles will appear off screen if made too long") | |
122 | setup("Should the Monitor Refresh be fast or slow?","rate",1," [f/s]\n fast is every 1 second\n slow is every 5 seconds") | |
123 | if not fs.exists("program") then update() else | |
124 | setup("Do you want to Update?","update",1," [y/n]\n note: if this is first install then you need to update") | |
125 | end | |
126 | if answer == y then update() end | |
127 | setup("Would you like Dynamic Text Scaling to be turned on?","dynamic",1,"[y/n]\n Makes monitors update as you build them.\n restart computer to update Text scaling.") | |
128 | ||
129 | ||
130 | intro() | |
131 | print("Auto Restart in 3 seconds!") sleep(1) | |
132 | print("Auto Restart in 2 seconds!") sleep(1) | |
133 | print("Auto Restart in 1 seconds!") sleep(1) | |
134 | print("Restarting...") | |
135 | os.reboot() |