Working on some new features
This commit is contained in:
parent
927e45db77
commit
ec8c8c7074
@ -1220,6 +1220,9 @@ function multi:newTLoop(func,set)
|
||||
self:create(c)
|
||||
return c
|
||||
end
|
||||
function multi:setTimeout(func,t)
|
||||
multi:newThread(function() thread.sleep(t) func() end)
|
||||
end
|
||||
function multi:newTrigger(func)
|
||||
local c={}
|
||||
c.Type='trigger'
|
||||
|
||||
9
test.lua
9
test.lua
@ -3,6 +3,9 @@ multi,thread = require("multi"):init()
|
||||
multi.OnLoad(function()
|
||||
print("Code Loaded!")
|
||||
end)
|
||||
multi:setTimeout(function()
|
||||
print("here we are!")
|
||||
end,2)
|
||||
local t
|
||||
co = 0
|
||||
multi.OnExit(function(n)
|
||||
@ -12,6 +15,12 @@ test = thread:newFunction(function()
|
||||
thread.sleep(1)
|
||||
return 1,math.random(2,100)
|
||||
end)
|
||||
multi:newThread(function()
|
||||
while true do
|
||||
thread.sleep(.1)
|
||||
print("!")
|
||||
end
|
||||
end)
|
||||
multi:newThread(function()
|
||||
t = os.clock()
|
||||
while true do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user