Advertisement
HandieAndy

RailSignal Installer Download

May 29th, 2022 (edited)
3,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. local function downloadScriptCCT(url, dest)
  2.     local resp = http.get(url)
  3.     if not resp then
  4.         print("Could not download file from " .. url)
  5.         return false
  6.     end
  7.     local f = io.open(dest, "w")
  8.     if not f then
  9.         print("Could not open file " .. dest .. " for writing.")
  10.         return false
  11.     end
  12.     local txt = resp.readAll()
  13.     f:write(txt)
  14.     resp.close()
  15.     f:close()
  16.     return true
  17. end
  18.  
  19.  
  20. print("Rail Signal Driver Installation Script")
  21. print("--------------------------------------")
  22. print("Enter the URL of your Rail System site.")
  23. print("  Example: http://localhost:8080")
  24. print("  Example: https://www.my-rail-system.com")
  25. local url = io.read()
  26.  
  27. print("Which system are you using?")
  28. print("[1] CC:Tweaked + Immersive Railroading")
  29. local choice = nil
  30. while choice == nil do
  31.     choice = tonumber(io.read())
  32.     if choice == nil then
  33.         print("Invalid choice.")
  34.     end
  35. end
  36.  
  37. if choice == 1 then
  38.     downloadScriptCCT(url .. "/driver/cc/installer.lua", "rs-installer.lua")
  39.     shell.execute("rs-installer.lua", url)
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement