View difference between Paste ID: 7GT19HrD and N3Y5VYSL
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,2)
12+
mon.setCursorPos(2,5)
13
mon.write("TRAIN 1 - Water")
14-
mon.setCursorPos(2,3)
14+
mon.setCursorPos(2,6)
15
mon.write("TRAIN 2 - Oil")
16
mon.setCursorPos(2,7)
17
mon.write("TRAIN 3 -")
18-
function cancelled()
18+
mon.setCursorPos(2,8)
19-
mon.setCursorPos(18,2)
19+
mon.write("TRAIN 4 -")
20
mon.setCursorPos(2,9)
21-
sleep(0.2)
21+
mon.write("TRAIN 5 -")
22-
mon.setCursorPos(18,3)
22+
mon.setCursorPos(2,10)
23
mon.write("TRAIN 6 -")
24-
sleep(0.2)
24+
mon.setCursorPos(2,11)
25-
mon.setCursorPos(18,4)
25+
mon.write("TRAIN 7 -")
26
mon.setCursorPos(2,12)
27-
sleep(0.2)
27+
mon.write("TRAIN 8 -")
28
end
29
30-
function timer()
30+
function stop()
31
mon.setTextColor(colors.red)
32
33
mon.setCursorPos(22,5)
34
mon.write("CANCELLED")
35
36
mon.setCursorPos(22,6)
37
mon.write("CANCELLED")
38
39
mon.setCursorPos(22,7)
40
mon.write("CANCELLED")
41
42
mon.setCursorPos(22,8)
43-
mon.setCursorPos(18,4)
43+
44
45
mon.setCursorPos(22,9)
46
mon.write("CANCELLED")
47-
mon.setCursorPos(18,3)
47+
48
mon.setCursorPos(22,10)
49
mon.write("CANCELLED")
50
51-
mon.setCursorPos(18,2)
51+
mon.setCursorPos(22,11)
52
mon.write("CANCELLED")
53
54
mon.setCursorPos(22,12)
55
mon.write("CANCELLED")
56-
  os.pullEvent("redstone")
56+
57-
  function trains()
57+
58-
  term.clear()
58+
59-
  mon.clear()
59+
60-
  if rs.getInput("back") then
60+
61-
    mon.setCursorPos(2,8)
61+
   mon.clear()
62-
    mon.write("TRAIN IN EXIT ZONE. CANCELLING DEPARTURES.")
62+
   mon.setCursorPos(2,2)
63-
    cancelled()
63+
   mon.setTextColor(colors.white)
64-
  else
64+
   mon.write("TRAIN STATION")
65-
    mon.setCursorPos(2,8)
65+
66-
    mon.write("ZONE CLEAR. RESUMING DEPARTURES.                ")
66+
   if rs.getInput("back") then
67-
    timer()
67+
   mon.setCursorPos(2,3)
68-
  end
68+
   mon.setTextColor(colors.red)
69
   mon.write("TRAIN IN EXIT ZONE. CANCELLING DEPARTURES.")
70
trains()
71
stop()
72
73
   else
74
   mon.setCursorPos(2,3)
75
   mon.setTextColor(colors.green)
76
   mon.write("ZONE CLEAR. RESUMING DEPARTURES.          ")
77
trains()
78
79
mon.setTextColor(colors.green)
80
81
mon.setCursorPos(22,12)
82
mon.write("DEPARTING")
83
p.setFreq(108)
84
    pulse()
85
sleep(2)
86
mon.setCursorPos(22,11)
87
mon.write("DEPARTING")
88
p.setFreq(107)
89
    pulse()
90
sleep(2)
91
mon.setCursorPos(22,10)
92
mon.write("DEPARTING")
93
p.setFreq(106)
94
    pulse()
95
sleep(2)
96
mon.setCursorPos(22,9)
97
mon.write("DEPARTING")
98
p.setFreq(105)
99
    pulse()
100
sleep(2)
101
mon.setCursorPos(22,8)
102
mon.write("DEPARTING")
103
p.setFreq(104)
104
    pulse()
105
sleep(2)
106
mon.setCursorPos(22,7)
107
mon.write("DEPARTING")
108
p.setFreq(103)
109
    pulse()
110
sleep(2)
111
mon.setCursorPos(22,6)
112
mon.write("DEPARTING")
113
p.setFreq(102)
114
    pulse()
115
sleep(2)
116
mon.setCursorPos(22,5)
117
mon.write("DEPARTING")
118
p.setFreq(101)
119
    pulse()
120
121
122
end
123
sleep(2)
124
end