Advertisement
Whiskee

mon.lua

Apr 24th, 2024
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. screen = peripheral.find("monitor")
  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.    
  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.  
  19.     screen.setBackgroundColor(colors.black)
  20.  
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement