Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = (...)
- if not tArgs then
- print("Usage: AutoUpdate <ProgramName> <AdditionalArgs>")
- error()
- end
- local handle = fs.open("startup","w")
- local code = [[
- local w = term.getSize()
- term.clear()
- while true do
- local events = {os.pullEvent()}
- if events[1] == "key" and events[2] == 56 then
- shell.run("pastebin run ".."]]..tArgs..[[")
- end
- term.clear()
- term.setCursorPos(1,1)
- for _,v in ipairs(events) do
- print( v..(" "):rep(w-#tostring(v)) )
- end
- end
- ]]
- handle.write(code)
- handle.close()
- shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement