Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ this is an edit of something that WAS NOT MY IDEA. it's awesome though :) ]]
- local level,maxlevel=1,0
- local resume,pR=coroutine.resume,os.pullEventRaw
- getUp=function()
- local at,lastFunc,fileName=1
- while true do
- local ok,func=pcall(function() return setfenv(at,getfenv(at)) end)
- local _,err=pcall(error,"err",at)
- if ok then
- lastFunc=func
- fileName=err:match("(.-):")
- else
- return lastFunc,fileName
- end
- at=at+1
- end
- end
- os.pullEventRaw=function(...)
- if level>=maxlevel then
- maxlevel=level
- os.originator={getUp()}
- end
- level=level+1
- return coroutine.yield(...)
- end
- coroutine.resume=function(...)
- level=level-1
- return resume(...)
- end
- os.queueEvent("ohi")
- os.pullEventRaw()
- coroutine.resume=resume
- os.pullEventRaw=pR
Advertisement
Add Comment
Please, Sign In to add comment