Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if not args[1] then
- print"Usage: pause application"
- print"Then press f1 to pause while in that application, and then any key to unpause."
- return false
- end
- local co = coroutine.create(function()
- shell.run(args[1])
- end)
- local nextEvent={""}
- while true do --59 is f1
- local a=nextEvent or {os.pullEvent()}
- nextEvent = nil
- if a[1]=="key" and a[2]==59 then
- while true do
- local b={os.pullEvent()}
- if b[1]~="timer" and b[1]~="rednet_message" then
- break
- else
- nextEvent = b
- end
- end
- else
- coroutine.resume(co,unpack(a))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment