View difference between Paste ID: nUtQ8ybB and CGv4njnX
SHOW: | | - or go back to the newest paste.
1
a = 0
2
mon = peripheral.wrap("back")
3
4
anzahl = turtle.getItemCount(1)
5
rs.setOutput("right",false)
6
rs.setOutput("left",false)
7
redstone.setBundledOutput("top", 0)
8
mon.clear()
9
turtle.select(1)
10
turtle.drop()
11
mon.setBackgroundColor(colors.black)
12
13
14
15
function stop()	
16
	if colors.test (redstone.getBundledInput("top"), colors.red) then ----- red = cancel 
17
		mon.clear() 
18
		mon.setTextColor(colors.red)
19
		mon.setCursorPos(1, 1)
20
		mon.write("Progamm wurde gestoppt")
21
		sleep(3)
22
		os.reboot()
23
		
24
	end
25
end
26
27
function drawGer()
28
	mon.clear()
29
	mon.setTextColor(colors.white)
30
	mon.setCursorPos(1, 3)
31
	mon.write("Bitte zuerst nur die Shard of Minium")
32
	mon.setCursorPos(1, 4)
33
	mon.write("in das")
34
	mon.setTextColor(colors.lime)
35
	mon.write(" gråBCne")
36
	mon.setTextColor(colors.white)
37
	mon.write(" Input-ME legen")
38
	mon.setCursorPos(1, 5)
39
	mon.write("")
40
	mon.setCursorPos(1, 9)
41
	mon.write("Zum Berechnen dann hier klicken.")
42
	mon.setCursorPos(1, 10)
43
	mon.setTextColor(colors.lime)
44
	mon.write("<----")
45
	mon.setTextColor(colors.white)
46
	mon.setCursorPos(1, 15)
47
	mon.write("")
48
	mon.setCursorPos(1, 16)
49
	mon.write("")
50
	mon.setCursorPos(1, 17)
51
	mon.write("")
52
	deutsch()
53
54
end
55
56
function drawEng()
57
mon.clear()
58
mon.setCursorPos(1, 1)
59
mon.write("Work in progress")
60
sleep(5)
61
os.reboot()
62
end
63
64
function count()
65
        mon.clear()
66
        mon.setCursorPos(1, 2)
67
        mon.write("Es wurden")
68
        mon.setCursorPos(11, 2)
69
		mon.setTextColor(colors.red)
70
        mon.write(anzahl)
71
		mon.setTextColor(colors.white)
72
        mon.setCursorPos(17, 2)
73
        mon.write("Shards erkannt.")
74
        mon.setCursorPos(1, 3)
75
        mon.write("=") 
76
        mon.setCursorPos(3, 3)
77
        mon.write(craft) 
78
        mon.setCursorPos(10, 3)
79
        mon.write("errechneten CraftingvorgåA4nge")
80
        mon.setCursorPos(1, 5)
81
        mon.write("Bitte jetzt mindestens")
82
        mon.setCursorPos(24, 5)
83
		mon.setTextColor(colors.orange)
84
        mon.write(craft)
85
		mon.setTextColor(colors.white)
86
        mon.setCursorPos(1, 6)
87
        mon.write("GoldblåB6cke in das Input ME legen.")
88
        mon.setCursorPos(1, 10)
89
        mon.write("Zum abbrechen hier klicken:")
90
        mon.setCursorPos(32, 10)
91
		mon.setTextColor(colors.red)
92
        mon.write("---->")
93
		mon.setTextColor(colors.white)
94
        mon.setCursorPos(1, 11)
95
        mon.write("dann landen eure Shards im Output ME.")
96
        mon.setCursorPos(1, 16)
97
        mon.write("Zum Starten dann hier klicken:")
98
        mon.setCursorPos(1, 17)
99
		mon.setTextColor(colors.cyan)
100
        mon.write("<----")
101
		mon.setTextColor(colors.white)
102
        mon.setCursorPos(1, 18)
103
		mon.setTextColor(colors.red)
104
        mon.write("Achtung danach kein ZuråBCck mehr måB6glich")
105
		mon.setTextColor(colors.white)
106
end
107
108
function buttonDraw()
109
	mon.clear()
110
	turtle.select(1)
111
	turtle.drop()
112
	mon.setBackgroundColor(colors.black)
113
	mon.clear()
114
		for yPos = 7, 11 do 
115
			for xPos = 3, 15 do 
116
			mon.setBackgroundColor(colors.lime)
117
			mon.setCursorPos(xPos, yPos)
118
			mon.write(" ")
119
			end
120
		end
121
		
122
	mon.setTextColor(colors.white)
123
	mon.setCursorPos(6, 9)
124
	mon.write("Deutsch")
125
126
		for yPos = 7, 11 do 
127
			for xPos = 24, 36 do
128
				mon.setBackgroundColor(colors.lime)
129
				mon.setCursorPos(xPos, yPos)
130
				mon.write(" ")
131
			end
132
		end
133
		
134
	mon.setTextColor(colors.white)
135
	mon.setCursorPos(27, 9)
136
	mon.write("English")
137
	mon.setBackgroundColor(colors.black)
138
	button() 
139
	
140
end
141
142
function button()
143
event, side, x, y = os.pullEvent("monitor_touch")
144
	if (x >= 3 and x <= 15 and y >= 7 and y <= 11) then 
145
		drawGer()
146
	elseif (x >= 24 and x <= 36 and y >= 7 and y <= 11) then 
147
		drawEng()
148
	else
149
	button()
150
end
151
end
152
153
function deutsch()
154
	while true do 
155
	
156
		if (colors.test (redstone.getBundledInput("top"), colors.green)  and a == 0) then --- green = count 
157
			sleep(0.5)
158
			rs.setOutput("right",true)
159
			sleep(1)
160
			anzahl = turtle.getItemCount(1)
161
			craft = anzahl * 40
162
			count()
163
			a = 1
164
		else
165
			sleep(0.5)
166
		end
167
		stop()
168
169
		if (colors.test (redstone.getBundledInput("top"), colors.blue) and a == 1)then ----- blue = craft 
170
			rs.setBundledOutput("top", colors.pink)
171
			rs.setOutput("right",false)
172
			turtle.drop()
173
			sleep(0.5)
174
			craft = craft + 8 
175
			rs.setOutput("left",true)
176
177
			
178
			if craft == 0 then 
179
				mon.clear()
180
				mon.setTextColor(colors.red)
181
				mon.setCursorPos(1, 1)
182
				mon.write("reboot....")
183
				sleep(5)
184
				buttonDraw()
185
			end
186
			
187
			while craft >= 1 do 
188
				turtle.dropDown(8)
189
				mon.setCursorPos(26, 2)
190
				mon.clear()
191
				mon.setTextColor(colors.white)
192
				mon.setCursorPos(1, 2)
193
				mon.write("å9Cbrige CraftingvorgåA4nge:")
194
				mon.setCursorPos(1, 10)
195
				mon.write("Zum abbrechen hier klicken:")
196
				mon.setCursorPos(32, 10)
197
				mon.setTextColor(colors.red)
198
				mon.write("---->")
199
				mon.setTextColor(colors.white)
200
				mon.setCursorPos(1, 11)
201
				mon.setTextColor(colors.red)
202
				mon.write("Bei abbruch gehen alle Miniumshards")
203
				mon.setCursorPos(1, 12)
204
				mon.write("verloren!")
205
				mon.setCursorPos(1, 13)
206
				mon.setTextColor(colors.orange)
207
				mon.write("Nur GoldblåB6cke werden erstattet")
208
				mon.setTextColor(colors.lime)
209
				mon.setCursorPos(25, 2)
210
				mon.write(craft)
211
				craft = craft - 8 
212
				sleep(0.5)
213
				stop()
214
				
215
				if craft == 0 then 
216
					mon.clear()
217
					mon.setTextColor(colors.red)
218
					mon.setCursorPos(1, 1)
219
					mon.write("reboot....")
220
					mon.setTextColor(colors.white)
221
					sleep(5)
222
					os.reboot()
223
				end
224
				
225
		end
226
			a = 0 
227
		else
228
			sleep(0.5)
229
		end
230
		
231
	end	
232
end
233
234
function englisch()
235
while true do 
236
237
	if (colors.test (redstone.getBundledInput("top"), colors.green)  and a == 0) then --- green = count 
238
		sleep(0.5)
239
		rs.setOutput("right",true)
240
		sleep(1)
241
		anzahl = turtle.getItemCount(1)
242
		craft = anzahl * 40
243
		mon.clear()
244
		mon.setCursorPos(1, 1)
245
		mon.setTextColor(colors.white)
246
		mon.write("Anzahl der Miniumshards:")
247
		mon.setCursorPos(25, 1)
248
		mon.setTextColor(colors.red)
249
		mon.write(anzahl)
250
		mon.setCursorPos(1, 2)
251
		mon.setTextColor(colors.white)
252
		mon.write("Anzahl der maximalen Crafting VorgåA4nge:")
253
		mon.setCursorPos(40, 2)
254
		mon.setTextColor(colors.lime)
255
		mon.write(craft)
256
		a = 1
257
	else
258
		sleep(0.5)
259
	end
260
	stop()
261
262
	if (colors.test (redstone.getBundledInput("top"), colors.blue) and a == 1)then ----- blue = craft 
263
		rs.setBundledOutput("top", colors.pink)
264
		rs.setOutput("right",false)
265
		turtle.drop()
266
		sleep(0.5)
267
		craft = craft + 8 
268
		rs.setOutput("left",true)
269
			if craft == 0 then 
270
				mon.clear()
271
				mon.setTextColor(colors.red)
272
				mon.setCursorPos(1, 1)
273
				mon.write("reboot....")
274
				sleep(5)
275
				os.reboot()
276
			end
277
				while craft >= 1 do 
278
					turtle.dropDown(8)
279
					mon.setCursorPos(1, 1)
280
					mon.clear()
281
					mon.setTextColor(colors.lime)
282
					mon.write(craft)
283
					craft = craft - 8 
284
					sleep(0.5)
285
					stop()
286
						if craft == 0 then 
287
							mon.clear()
288
							mon.setTextColor(colors.red)
289
							mon.write("reboot....")
290
							sleep(5)
291
							os.reboot()
292
						end
293
				end
294
		a = 0 
295
	else
296
		sleep(0.5)
297
	end
298
	
299
end	
300
301
302
end
303
304
buttonDraw()
305
306
307