Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[FATFILE
- 2
- unknown
- does magical bs
- Made by Fatboychummy, do not redistribute/edit without permission.
- ]]
- local funcs = {}
- local count = 0
- local countMax = 10000
- local function doYield()
- os.queueEvent("Yielder")
- os.pullEvent("Yielder")
- count = 0
- end
- function funcs.yieldizeFunction(f)
- return function(...)
- count = count + 1
- if count > countMax then
- doYield()
- end
- return f(...)
- end
- end
- function funcs.yieldize(tbl)
- for k, v in pairs(tbl) do
- if type(v) == "function" then
- tbl[k] = funcs.yieldizeFunction(v)
- end
- end
- end
- function funcs.setMax(x)
- countMax = x
- end
- function funcs.reset()
- count = 0
- end
- return funcs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement