Advertisement
fyrkantis

SetSchedule

Feb 18th, 2025 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2. local filePath = args[1]
  3. if filePath == nil then
  4.     print("ERROR: Please specify a file location.")
  5.     return
  6. end
  7.  
  8. local station = peripheral.find("Create_Station")
  9. local file = fs.open(filePath, "r")
  10. local body = file.readAll()
  11. file.close()
  12. local schedule = textutils.unserialize(body)
  13. schedule["color"] = nil
  14. station.setSchedule(schedule)
  15. print("Successfully set train schedule to \""..filePath.."\".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement