-----------------------easyLanes------------------------- --[[ This functions are based in my myTimer functions that I made a few weeks ago to control different timers ]]-- require"lanes";--We load the lua lanes module easyLanes = {}; easyLanes.Version = "0.1.0.0"; -------- easyLanes.Lanes = {}; ------- easyLanes.Timers = {};--Based in myTimers control table :P ------- easyLanes.NewLane = function (sName, sFunc, ...) local n,g,s; s = sName or "noname"; n = #easyLanes.Lanes+1; g = ... or nil;--These are global vars that can be passed to the lane but they will work as read-only vars local a = lanes.gen("*", {globals=g}, sFunc); table.insert(easyLanes.Lanes, n, {a, name=sName}); return easyLanes.Lanes[n][1]; end easyLanes.AddToMonitor = function(sVar, sFunc) local id = #easyLanes.Timers+1; easyLanes.Timers[id] = {var=sVar,func=sFunc}; Page.StartTimer(500, (id+20000)); return id; end easyLanes.OnRunning = function(eID) local n = eID-20000 if easyLanes.Timers[n].var.status == "done" then Page.StopTimer(eID); easyLanes.Timers[n].func(easyLanes.Timers[n].var) elseif easyLanes.Timers[n].var.status == "error" then Page.StopTimer(eID); local a, e = easyLanes.Timers[n].var:join() Debug.ShowWindow(true); Debug.Print(tostring(e)); end end easyLanes.GetStatus = function(id) return (easyLanes.Timers[id]~=nil) and easyLanes.Timers[id].var.status or "ID not found"; end -----------------------by WeBuLtRa-------------------------