SHOW:
|
|
- or go back to the newest paste.
1 | - | screen = peripheral.wrap("top") |
1 | + | screen = peripheral.find("monitor") |
2 | - | station = peripheral.wrap("left") |
2 | + | station = peripheral.find("Create_Station") |
3 | ||
4 | term.redirect(screen) | |
5 | ||
6 | while true do | |
7 | screen.clear() | |
8 | screen.setCursorPos(1,1) | |
9 | - | screen.setBackgroundColor(colors.black) |
9 | + | |
10 | stationName = station.getStationName() | |
11 | isTrainPresent = station.isTrainPresent() | |
12 | isTrainImminent = station.isTrainImminent() | |
13 | isTrainEnroute = station.isTrainEnroute() | |
14 | trainName = isTrainPresent and station.getTrainName() or "???" | |
15 | hasSchedule = isTrainPresent and station.hasSchedule() or "???" | |
16 | ||
17 | if screen.isColor() then | |
18 | - | if isTrainPresent then screen.setBackgroundColor(colors.lime) |
18 | + | |
19 | - | elseif isTrainImminent then screen.setBackgroundColor(colors.orange) |
19 | + | screen.setBackgroundColor(colors.black) |
20 | - | elseif isTrainEnroute then screen.setBackgroundColor(colors.lightBlue) |
20 | + | |
21 | - | end |
21 | + | if isTrainPresent then screen.setBackgroundColor(colors.lime) |
22 | elseif isTrainImminent then screen.setBackgroundColor(colors.orange) | |
23 | elseif isTrainEnroute then screen.setBackgroundColor(colors.lightBlue) | |
24 | end | |
25 | ||
26 | end | |
27 | ||
28 | print("stationName", stationName) | |
29 | print("isTrainPresent", isTrainPresent) | |
30 | print("isTrainImminent", isTrainImminent) | |
31 | print("isTrainEnroute", isTrainEnroute) | |
32 | print("trainName", trainName) | |
33 | print("hasSchedule", hasSchedule) | |
34 | ||
35 | sleep() | |
36 | end | |
37 |