Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --startup script keeps sHost up to date and running. Can update pastebin on user command, or restart current script
- local function prompt(msg)
- term.clear()
- term.setCursorPos(1,1)
- term.write(msg)
- term.setCursorPos(1,2)
- local input = read()
- return input
- end
- local function getPaste(saveName,paste)
- print("Creating file")
- if fs.exists(name) then --if file exists
- os.run("delete "..saveName)
- end
- shell.run("pastebin","get",paste,saveName)
- end
- while true do
- a,b,c = nil,nil,nil
- local a,b,c = prompt("Commands: new progname paste, refresh progname")
- if a == "new" then
- refreshProg = b
- getPaste(b,c)
- shell.run(refreshProg)
- elseif a == "refresh" then
- getPaste(refreshProg,c)
- shell.run(refreshProg)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement