View difference between Paste ID: 87NhmuCN and ftNsC9ww
SHOW: | | - or go back to the newest paste.
1
mon = peripheral.wrap("right")
2
p = peripheral.wrap("left")
3
4
function pulse()
5
redstone.setOutput("left", true)
6
sleep(2)
7
redstone.setOutput("left", false)
8
end
9
10
function trains()
11
mon.setTextColor(colors.white)
12
mon.setCursorPos(2,5)
13
mon.write("TRAIN 1 - Water")
14
mon.setCursorPos(2,6)
15
mon.write("TRAIN 2 - Oil")
16
mon.setCursorPos(2,7)
17
mon.write("TRAIN 3 -")
18
mon.setCursorPos(2,8)
19
mon.write("TRAIN 4 -")
20
mon.setCursorPos(2,9)
21
mon.write("TRAIN 5 -")
22
mon.setCursorPos(2,10)
23
mon.write("TRAIN 6 -")
24
mon.setCursorPos(2,11)
25
mon.write("TRAIN 7 -")
26
mon.setCursorPos(2,12)
27
mon.write("TRAIN 8 -")
28
end
29
30
function stop1()
31
32
33
34
p.setFreq(100)
35
mon.setTextColor(colors.red)
36
mon.setCursorPos(22,5)
37
mon.write("CANCELLED")
38
mon.setCursorPos(22,6)
39
mon.write("CANCELLED")
40
mon.setCursorPos(22,7)
41
mon.write("CANCELLED")
42
mon.setCursorPos(22,8)
43
mon.write("CANCELLED")
44
mon.setCursorPos(22,9)
45
mon.write("CANCELLED")
46
mon.setCursorPos(22,10)
47
mon.write("CANCELLED")
48
mon.setCursorPos(22,11)
49
mon.write("CANCELLED")
50
mon.setCursorPos(22,12)
51
mon.write("CANCELLED")
52
end
53
54
function start1()
55
56
57
58
mon.setTextColor(colors.green)
59
mon.setCursorPos(22,12)
60
mon.write("DEPARTING")
61
p.setFreq(108) 
62
pulse() 
63
sleep(2)
64
mon.setCursorPos(22,11)
65
mon.write("DEPARTING")
66
p.setFreq(107) 
67
pulse() 
68
sleep(2)
69
mon.setCursorPos(22,10)
70
mon.write("DEPARTING")
71
p.setFreq(106)
72
pulse()
73
sleep(2)
74
mon.setCursorPos(22,9)
75
mon.write("DEPARTING")
76
p.setFreq(105)
77
pulse()
78
sleep(2)
79
mon.setCursorPos(22,8)
80
mon.write("DEPARTING")
81
p.setFreq(104)
82
pulse()
83
sleep(2)
84
mon.setCursorPos(22,7)
85
mon.write("DEPARTING")
86
p.setFreq(103)
87
pulse()
88
sleep(2)
89
mon.setCursorPos(22,6)
90
mon.write("DEPARTING")
91
p.setFreq(102)
92
pulse()
93
sleep(2)
94
mon.setCursorPos(22,5)
95
mon.write("DEPARTING")
96
p.setFreq(101)
97
pulse()
98
end
99
100
101
102
while true do
103
   local event = os.pullEvent("redstone")
104
   local Red=rs.getInput("back")
105-
local SIGNAL_SIDE = "back"
105+
   if Red then
106-
local timerActive = rs.getInput (SIGNAL_SIDE)
106+
mon.clear()
107
   mon.setCursorPos(2,2)
108
   mon.setTextColor(colors.white)
109-
 mon.clear()
109+
110
   mon.setCursorPos(2,3)
111
   mon.setTextColor(colors.green)
112
   mon.write("ZONE CLEAR. RESUMING DEPARTURES.          ")
113
trains()
114
115
start1()
116
sleep(0.4)
117
118
   end
119
end