View difference between Paste ID: KAq9pNiD and WVXJfHaY
SHOW: | | - or go back to the newest paste.
1-
rednet.open("back")
1+
rednet.open("top")
2
3
Pc1 = 4733
4
Pc2 = 4734
5
Pc3 = 4735
6-
Pc4 = 4731
6+
7
cursorPos = 0
8
cursorPosFre = 0
9
cursorPosEnd = 0
10
11
sleepTime = 0.3
12
13
selection = ""
14
15
mode = "Slide"
16
17
term.setTextColor(colors.black)
18
term.setBackgroundColor(colors.white)
19
term.clear()
20
21
function drawScreen()
22
23
  bground = paintutils.loadImage(".bground")
24
  paintutils.drawImage(bground,1,1)
25
26
end
27
28
29
function main()
30
31
drawScreen()
32
33
while true do
34
35
  term.setBackgroundColor(colors.white)
36
         
37
  term.setCursorPos(1,3)
38
  term.write("                                                            ")
39
40
  term.setCursorPos(1,4)
41
  term.write("                                                            ")
42
43
  term.setCursorPos(1,5)
44
  term.write("                                                            ")
45
46
  term.setCursorPos(1,6)
47
  term.write("                                                            ")
48
  
49
  term.setCursorPos(1,7)
50
  term.write("                                                            ")
51
  
52
  term.setCursorPos(1,8)
53
  term.write("                                                            ")
54
  
55
  term.setCursorPos(1,9)
56
  term.write("                                                            ")
57
  
58
  term.setCursorPos(1,10)
59
  term.write("                                                            ")
60
  
61
  term.setCursorPos(1,3)
62
  term.write("Z1 > ")
63
  
64
  term.setCursorPos(1,4)
65
  term.write("Z2 > ")
66
  
67
  term.setCursorPos(1,5)
68
  term.write("Z3 > ")
69
70
  term.setCursorPos(1,6)
71
  term.write("Z4 > ")
72
  
73
  term.setCursorPos(1,7)
74
  term.write("Z5 > ")
75
  
76
  term.setCursorPos(1,8)
77
  term.write("Z6 > ")
78
  
79
  term.setCursorPos(1,9)
80
  term.write("Z7 > ")
81
  
82
  term.setCursorPos(6,3)
83
  textLineOne = read()
84
  
85
  term.setCursorPos(6,4)
86
  textLineTwo = read()
87
  
88
  term.setCursorPos(6,5)
89
  textLineThree = read()
90
91
  term.setCursorPos(6,6)
92
  textLineFour = read()
93
  
94
  term.setCursorPos(6,7)
95
  textLineFive = read()
96
  
97
  term.setCursorPos(6,8)
98
  textLineSix = read()
99
  
100
  term.setCursorPos(6,9)
101
  textLineSeven = read()
102
  
103
  if mode == "Slide" then
104
  
105
    if string.len(textLineOne) < string.len(textLineTwo) then
106
        selection = string.len(textLineTwo)
107
      else
108
        selection = string.len(textLineOne)
109
      end
110
    
111
    if string.len(textLineThree) < selection then
112
        selection = selection
113
      else
114
        selection = string.len(textLineThree)
115
      end
116
      
117
    if string.len(textLineFour) < selection then
118
        selection = selection
119
      else
120
        selection = string.len(textLineFour)
121
      end
122
      
123
    if string.len(textLineFive) < selection then
124
        selection = selection
125
      else
126
        selection = string.len(textLineFive)
127
      end
128
      
129
    if string.len(textLineSix) < selection then
130
        selection = selection
131
      else
132
        selection = string.len(textLineSix)
133
      end  
134
    
135
    cursorPos = 50
136-
    cursorPos = 66
136+
137
  
138
    while cursorPos >= cursorPosEnd do
139
  
140
      rednet.send(Pc1, "1".."$"..cursorPos.."&1%"..textLineOne)
141
      rednet.send(Pc2, "2".."$"..cursorPos.."&1%"..textLineOne)
142
      rednet.send(Pc3, "3".."$"..cursorPos.."&1%"..textLineOne)
143
  
144-
      rednet.send(Pc4, "4".."$"..cursorPos.."&1%"..textLineOne)
144+
145
      rednet.send(Pc2, "2".."$"..cursorPos.."&2%"..textLineTwo)
146
      rednet.send(Pc3, "3".."$"..cursorPos.."&2%"..textLineTwo)
147
      
148
      rednet.send(Pc1, "1".."$"..cursorPos.."&3%"..textLineThree)
149-
      rednet.send(Pc4, "4".."$"..cursorPos.."&2%"..textLineTwo)
149+
150
      rednet.send(Pc3, "3".."$"..cursorPos.."&3%"..textLineThree)
151
152
      rednet.send(Pc1, "1".."$"..cursorPos.."&4%"..textLineFour)
153
      rednet.send(Pc2, "2".."$"..cursorPos.."&4%"..textLineFour)
154-
      rednet.send(Pc4, "4".."$"..cursorPos.."&3%"..textLineThree)
154+
155
	  
156
      rednet.send(Pc1, "1".."$"..cursorPos.."&5%"..textLineFive)
157
      rednet.send(Pc2, "2".."$"..cursorPos.."&5%"..textLineFive)
158
      rednet.send(Pc3, "3".."$"..cursorPos.."&5%"..textLineFive)
159-
      rednet.send(Pc4, "4".."$"..cursorPos.."&4%"..textLineFour)
159+
160
      rednet.send(Pc1, "1".."$"..cursorPos.."&6%"..textLineSix)
161
      rednet.send(Pc2, "2".."$"..cursorPos.."&6%"..textLineSix)
162
      rednet.send(Pc3, "3".."$"..cursorPos.."&6%"..textLineSix)
163
	  
164-
      rednet.send(Pc4, "4".."$"..cursorPos.."&5%"..textLineFive)
164+
165
      rednet.send(Pc2, "2".."$"..cursorPos.."&7%"..textLineSeven)
166
      rednet.send(Pc3, "3".."$"..cursorPos.."&7%"..textLineSeven)
167
  
168
      cursorPos = cursorPos - 1
169-
      rednet.send(Pc4, "4".."$"..cursorPos.."&6%"..textLineSix)
169+
170
      if cursorPos <= cursorPosEnd then
171
  
172
        os.run({},shell.getRunningProgram())
173
  
174-
      rednet.send(Pc4, "4".."$"..cursorPos.."&7%"..textLineSeven)
174+
175
    
176
      sleep(sleepTime)
177
    
178
    end
179
    
180
  elseif mode == "Freeze" then
181
  
182
      rednet.send(Pc1, "1".."$"..cursorPosFre.."&1%"..textLineOne)
183
      rednet.send(Pc2, "2".."$"..cursorPosFre.."&1%"..textLineOne)
184
      rednet.send(Pc3, "3".."$"..cursorPosFre.."&1%"..textLineOne)
185
  
186
      rednet.send(Pc1, "1".."$"..cursorPosFre.."&2%"..textLineTwo)
187
      rednet.send(Pc2, "2".."$"..cursorPosFre.."&2%"..textLineTwo)
188
      rednet.send(Pc3, "3".."$"..cursorPosFre.."&2%"..textLineTwo)
189
      
190
      rednet.send(Pc1, "1".."$"..cursorPosFre.."&3%"..textLineThree)
191
      rednet.send(Pc2, "2".."$"..cursorPosFre.."&3%"..textLineThree)
192
      rednet.send(Pc3, "3".."$"..cursorPosFre.."&3%"..textLineThree)
193-
      rednet.send(Pc4, "4".."$"..cursorPosFre.."&1%"..textLineOne)
193+
194
      rednet.send(Pc1, "1".."$"..cursorPosFre.."&4%"..textLineFour)
195
      rednet.send(Pc2, "2".."$"..cursorPosFre.."&4%"..textLineFour)
196
      rednet.send(Pc3, "3".."$"..cursorPosFre.."&4%"..textLineFour)
197
	  
198-
      rednet.send(Pc4, "4".."$"..cursorPosFre.."&2%"..textLineTwo)
198+
199
      rednet.send(Pc2, "2".."$"..cursorPosFre.."&5%"..textLineFive)
200
      rednet.send(Pc3, "3".."$"..cursorPosFre.."&5%"..textLineFive)
201
	  
202
      rednet.send(Pc1, "1".."$"..cursorPosFre.."&6%"..textLineSix)
203-
      rednet.send(Pc4, "4".."$"..cursorPosFre.."&3%"..textLineThree)
203+
204
      rednet.send(Pc3, "3".."$"..cursorPosFre.."&6%"..textLineSix)
205
	  
206
	  rednet.send(Pc1, "1".."$"..cursorPosFre.."&7%"..textLineSeven)
207
      rednet.send(Pc2, "2".."$"..cursorPosFre.."&7%"..textLineSeven)
208-
      rednet.send(Pc4, "4".."$"..cursorPosFre.."&4%"..textLineFour)
208+
209
  
210
  end
211
212
end
213-
      rednet.send(Pc4, "4".."$"..cursorPosFre.."&5%"..textLineFive)
213+
214
end
215
216
217
218-
      rednet.send(Pc4, "4".."$"..cursorPosFre.."&6%"..textLineSix)
218+
219
220
  while true do
221
222
  term.setBackgroundColor(colors.white)
223-
      rednet.send(Pc4, "4".."$"..cursorPosFre.."&7%"..textLineSeven)
223+
224
  term.write("Speed")
225
  term.setCursorPos(1,19)
226
  term.write("< "..sleepTime.." >")
227
  
228
  term.setCursorPos(6,3)
229
  
230
  event, side, x, y = os.pullEvent("mouse_click")
231
  
232
  if x == 1 and y == 19 then
233
  
234
    if sleepTime >= 0.2 then
235
    
236
      sleepTime = sleepTime - 0.1
237
    
238
    end
239
  
240
  elseif x == (4 + string.len(tostring(sleepTime))) and y == 19 then
241
  
242
    if sleepTime <= 0.9 then
243
    
244
      sleepTime = sleepTime + 0.1
245
    
246
    end
247
  
248
  end
249
  
250
  end
251
252
end
253
254
255
function changeMode()
256
257
  while true do
258
259
    term.setBackgroundColor(colors.white)
260
    term.setCursorPos(1,15)
261
    term.write("Mode")
262
    term.setBackgroundColor(colors.red)
263
    term.setCursorPos(1,16)
264
    term.write(mode)
265
    term.setBackgroundColor(colors.white)
266
    term.setCursorPos(1,12)
267
    term.write("Cursor Position")
268
    term.setCursorPos(1,13)
269
    term.write("< "..cursorPosFre.." > ")
270
    
271
    term.setCursorPos(6,3)
272
  
273
    event, side, x, y = os.pullEvent("mouse_click")
274
  
275
    if x >= 1 and x <= 5 and y == 16 then
276
    
277
      if mode == "Slide" then
278
      
279
        term.setCursorPos(1,16)
280
        term.write("     ")
281
        mode = "Freeze"
282
      
283
      else
284
      
285
        term.setCursorPos(1,16)
286
        term.write("      ")
287
        mode = "Slide"
288
      
289
      end
290
      
291
    elseif x == 1 and y == 13 then
292
      if cursorPosFre >= 1 then
293
        cursorPosFre = cursorPosFre - 1
294
      end
295
    elseif x == (4 + string.len(tostring(cursorPosFre))) and y == 13 then
296
      if cursorPosFre <= 64 then
297
        cursorPosFre = cursorPosFre + 1
298
      end
299
    end
300
    
301
  end
302
  
303
end
304
305
function clearMonitor()
306
307
  while true do
308
  
309
    term.setBackgroundColor(colors.red)
310
    term.setCursorPos(1,1)
311
    term.write("Clear")
312
    term.setBackgroundColor(colors.white)
313
    
314
    term.setCursorPos(6,3)
315
    
316
    event, side, x, y = os.pullEvent("mouse_click")
317
    
318
    if x >= 1 and x <= 5 and y == 1 then
319
    
320
      rednet.send(Pc1, "$clear")
321
      rednet.send(Pc2, "$clear")
322
      rednet.send(Pc3, "$clear")
323
    
324
    end
325
    
326
  end
327
328
end
329
330
parallel.waitForAny(main,changeSleep,changeMode,clearMonitor)