Advertisement
fyrkantis

GetSchedule

Feb 18th, 2025 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  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. local color = tonumber(args[2])
  8.  
  9. local station = peripheral.find("Create_Station")
  10. local schedule = station.getSchedule()
  11. schedule["progress"] = nil
  12. if color ~= nil then
  13.     schedule["color"] = color
  14. end
  15. local file = fs.open(filePath, "w")
  16. file.write(textutils.serialize(schedule))
  17. file.close()
  18. print("Successfully copied schedule to \""..filePath.."\".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement