View difference between Paste ID: 83WixnmB and EhTQMcyC
SHOW: | | - or go back to the newest paste.
1
--[[   ### Hier bitte nix mehr machen außer du weißt was du machst! ###
2
function clear()
3
        term.clear()
4
        term.setCursorPos(1,1)
5
end
6
print( "Copyright by Birog" )
7
write( "Es wird nach Updates gesucht... " )
8
local response = http.get("http://pastebin.com/raw.php?i=EhTQMcyC")    
9
if response then
10
   print("Update-suche erfolgreich!")
11
   local sSource = response.readAll()
12
   response.close()
13
   local file = fs.open( "startup", "r" )
14
   local sTarget = ""    
15
   if file then
16
          sTarget = file.readAll()
17
          file.close()
18
   end  
19
   if sSource ~= sTarget then
20
          term.write("Updates gefunden!")
21
          file = fs.open( "startup", "w" )
22
          file.write( sSource )
23
          file.close()
24
          print( "Wurde herruntergeladen als - startup - -Datei")
25
          print("Programm wird Neugestartet!")
26
          shell.run("startup")
27
          return  
28
   else
29
          print("Es sind keine Updates vorhanden!")
30
          print("Programm wird gestartet!")
31
          sleep(3)
32
          clear()
33
   end
34
else
35
   clear()
36
   print("ERROR! Informiere bitte Birog!!")
37
   clear()
38
end]]
39
-------------------------------------------------------------------------------------------------------------------
40-
moniside = "right"
40+
moniside = "left"
41
-- 
42-
redout = "left"
42+
redout1 = "top"
43
redout2 = "button"
44
--
45
Info = "Schild"
46-
adminpass = "5555"
46+
47
adminpass = "2610"
48
49
term = peripheral.wrap(moniside)
50
local pullEvent = os.pullEvent
51
os.pullEvent = os.pullEventRaw
52-
function AnzeigeAus()
52+
53
function AnzeigeDown()
54
	term.setCursorPos(2,1)
55
	term.setBackgroundColor(colors.red)
56
	term.write(" ")
57
	term.setBackgroundColor(colors.black)
58
	term.setCursorPos(3,1)
59
	term.setBackgroundColor(colors.red)
60
	term.write("D")
61
	term.setBackgroundColor(colors.black)
62
	term.setCursorPos(4,1)
63-
	term.write("F")
63+
64
	term.write("O")
65
	term.setBackgroundColor(colors.black)
66
	term.setCursorPos(5,1)
67-
	term.write("F")
67+
68
	term.write("W")
69
	term.setBackgroundColor(colors.black)
70
	term.setCursorPos(6,1)
71
	term.setBackgroundColor(colors.red)
72
	term.write("N")
73
	term.setBackgroundColor(colors.black)
74
end
75-
function AnzeigeEin()
75+
76
function AnzeigeUp()
77
	term.setCursorPos(2,1)
78
	term.setBackgroundColor(colors.green)
79
	term.write(" ")
80
	term.setBackgroundColor(colors.black)
81
	term.setCursorPos(3,1)
82
	term.setBackgroundColor(colors.green)
83
	term.write("U")
84
	term.setBackgroundColor(colors.black)
85
	term.setCursorPos(4,1)
86
	term.setBackgroundColor(colors.green)
87
	term.write(" ")
88
	term.setBackgroundColor(colors.black)
89
	term.setCursorPos(5,1)
90
	term.setBackgroundColor(colors.green)
91
	term.write("P")
92
	term.setBackgroundColor(colors.black)
93
	term.setCursorPos(6,1)
94
	term.setBackgroundColor(colors.green)
95
	term.write(" ")
96
	term.setBackgroundColor(colors.black)
97
end
98
99
function Rahmen()
100
term.clear()
101
term.setTextColor(colors.white)
102
-- Information
103
term.setCursorPos(2,2)
104
term.setBackgroundColor(colors.blue)
105
term.write("Hello")
106
term.setBackgroundColor(colors.black)
107
-- Anzeige
108
term.setCursorPos(2,1)
109
term.setBackgroundColor(colors.orange)
110
term.write(" ")
111
term.setBackgroundColor(colors.black)
112
term.setCursorPos(3,1)
113
term.setBackgroundColor(colors.orange)
114
term.write(" ")
115
term.setBackgroundColor(colors.black)
116
term.setCursorPos(4,1)
117
term.setBackgroundColor(colors.orange)
118
term.write(" ")
119
term.setBackgroundColor(colors.black)
120
term.setCursorPos(5,1)
121
term.setBackgroundColor(colors.orange)
122
term.write(" ")
123
term.setBackgroundColor(colors.black)
124
term.setCursorPos(6,1)
125
term.setBackgroundColor(colors.orange)
126
term.write(" ")
127
term.setBackgroundColor(colors.black)
128
129
-- Einschalten
130
term.setCursorPos(2,3)
131
term.setBackgroundColor(colors.green)
132
term.write(" ")
133
term.setBackgroundColor(colors.black)
134
term.setCursorPos(2,4)
135
term.setBackgroundColor(colors.green)
136
term.write(" ")
137
term.setBackgroundColor(colors.black)
138
term.setCursorPos(2,5)
139
term.setBackgroundColor(colors.green)
140
term.write(" ")
141
term.setBackgroundColor(colors.black)
142
term.setCursorPos(3,3)
143
term.setBackgroundColor(colors.green)
144
term.write(" ")
145
term.setBackgroundColor(colors.black)
146
term.setCursorPos(3,4)
147
term.setBackgroundColor(colors.green)
148
term.write(" ")
149
term.setBackgroundColor(colors.black)
150
term.setCursorPos(3,5)
151
term.setBackgroundColor(colors.green)
152
term.write(" ")
153
term.setBackgroundColor(colors.black)
154
-- Ausschalten
155
term.setCursorPos(5,3)
156
term.setBackgroundColor(colors.red)
157
term.write(" ")
158
term.setBackgroundColor(colors.black)
159
term.setCursorPos(5,4)
160
term.setBackgroundColor(colors.red)
161
term.write(" ")
162
term.setBackgroundColor(colors.black)
163
term.setCursorPos(5,5)
164
term.setBackgroundColor(colors.red)
165
term.write(" ")
166
term.setBackgroundColor(colors.black)
167
term.setCursorPos(6,3)
168
term.setBackgroundColor(colors.red)
169
term.write(" ")
170
term.setBackgroundColor(colors.black)
171
term.setCursorPos(6,4)
172
term.setBackgroundColor(colors.red)
173
term.write(" ")
174
term.setBackgroundColor(colors.black)
175
term.setCursorPos(6,5)
176
term.setBackgroundColor(colors.red)
177
term.write(" ")
178
term.setBackgroundColor(colors.black)
179
end
180
181
182
function Eingabe()
183
	event,side,x,y = os.pullEvent()
184
	if event == "terminate" then
185
		write("Admin Passwort:")
186
		admin = read("*")
187
		if admin == adminpass then
188
			os.pullEvent = pullEvent
189
			write("Richtig! Mache jetzt nochmal STRG + T für 4 sec")
190
			sleep(5)
191
		end
192
	end
193
	if event == "monitor_touch" then
194
195
		if x == 2 and y == 2 or 
196
		   x == 2 and y == 3 or
197
		   x == 2 and y == 4 or
198
		   x == 3 and y == 2 or
199
		   x == 3 and y == 3 or
200-
		   redstone.setOutput(redout, true)
200+
201-
--		   redstone.setOutput(redout2, false)
201+
		   AnzeigeUp()
202-
		   AnzeigeEin()
202+
		   for u =1,5 do
203
		   	redstone.setOutput(redout1, true)
204
		   	sleep(1)
205
		   	redstone.setOutput(redout1, false)
206
		   	sleep(1)
207
		   end
208
		end
209
210
		if x == 5 and y == 2 or 
211-
		   redstone.setOutput(redout, false)
211+
212-
--		   redstone.setOutput(redout2, true)
212+
213-
		   AnzeigeAus()
213+
214
		   x == 6 and y == 3 or
215
		   x == 6 and y == 4 then
216
		   AnzeigeDown()
217
		   for n =1,5 do
218-
redstone.setOutput(redout, false)
218+
			redstone.setOutput(redout2, true)
219
		  	sleep(1)
220
		   	redstone.setOutput(redout2, false)
221
		   	sleep(1)
222
		   end
223
		   
224
		end
225
	end
226
end
227
228
Rahmen()
229
while true do
230
Eingabe()
231
Rahmen()
232
end