screen = peripheral.find("monitor")
station = peripheral.find("Create_Station")
term.redirect(screen)
while true do
screen.clear()
screen.setCursorPos(1,1)
stationName = station.getStationName()
isTrainPresent = station.isTrainPresent()
isTrainImminent = station.isTrainImminent()
isTrainEnroute = station.isTrainEnroute()
trainName = isTrainPresent and station.getTrainName() or "???"
hasSchedule = isTrainPresent and station.hasSchedule() or "???"
if screen.isColor() then
screen.setBackgroundColor(colors.black)
if isTrainPresent then screen.setBackgroundColor(colors.lime)
elseif isTrainImminent then screen.setBackgroundColor(colors.orange)
elseif isTrainEnroute then screen.setBackgroundColor(colors.lightBlue)
end
end
print("stationName", stationName)
print("isTrainPresent", isTrainPresent)
print("isTrainImminent", isTrainImminent)
print("isTrainEnroute", isTrainEnroute)
print("trainName", trainName)
print("hasSchedule", hasSchedule)
sleep()
end
Comments