Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function downloadScriptCCT(url, dest)
- local resp = http.get(url)
- if not resp then
- print("Could not download file from " .. url)
- return false
- end
- local f = io.open(dest, "w")
- if not f then
- print("Could not open file " .. dest .. " for writing.")
- return false
- end
- local txt = resp.readAll()
- f:write(txt)
- resp.close()
- f:close()
- return true
- end
- print("Rail Signal Driver Installation Script")
- print("--------------------------------------")
- print("Enter the URL of your Rail System site.")
- print(" Example: http://localhost:8080")
- print(" Example: https://www.my-rail-system.com")
- local url = io.read()
- print("Which system are you using?")
- print("[1] CC:Tweaked + Immersive Railroading")
- local choice = nil
- while choice == nil do
- choice = tonumber(io.read())
- if choice == nil then
- print("Invalid choice.")
- end
- end
- if choice == 1 then
- downloadScriptCCT(url .. "/driver/cc/installer.lua", "rs-installer.lua")
- shell.execute("rs-installer.lua", url)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement