Code: Select all
function theDelay(entity,name,time)
delayedCall(self.go.id, time, name)
end
Code: Select all
function theDelay(entity,name,time)
delayedCall(self.go.id, time, name)
end
Code: Select all
timers = {}
function call(delay,method,args)
local timer = spawn('timer',party.level,1,1,1,1)
timers[timer.id] = {method,args}
timer.timer:addConnector('onActivate',self.go.id,'execute')
timer.timer:setTimerInterval(delay)
timer.timer:setDisableSelf(true)
end
function execute(timer)
local data = timers[timer.go.id]
data[1](unpack(data[2]))
cleanup(timer)
end
function cleanup(timer)
timers[timer.go.id] = nil
timer.go:destroy()
end
Code: Select all
local callback = function(arg1,arg2,arg3)
print(arg1,arg2,arg3)
end
delay.script.call(3,callback,{1,2,3})
petri wrote:I've added support for arbitrary number of optional args to delayedCall in 2.1.16.
Can anyone explain me what does this mean, please? Iam using dalayedCall in my mod now...petri wrote:I've added support for arbitrary number of optional args to delayedCall in 2.1.16.