Q: How to unregister all timers?
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Q: How to unregister all timers?
Is there a way to unregister all timers, even if i don't know their names and how many was registered?
Re: Q: How to unregister all timers?
The timers are stored in a table but the table is local to lib/lib.lua, I wouldn't suguest making it global.
Easiest way I see of doing it would be to add your own function to lib.lua doing what ever it is you want to do.
it could be as simple as
then call it somewhere in a userfunction I guess
table would look like this
The other way would be to find what timers are called and as they are being called to add the names to a global table which you can then later do a unregistertimer on them all if needed.
Default bot uses just 2 timers
which is for updating the things ont he window, up top.
which is also unregistered, so this wouldn't be a latent timer.
So any other timers would have been added by non default code.
flying//wallclimbing//gmdetect//mountspeed
Easiest way I see of doing it would be to add your own function to lib.lua doing what ever it is you want to do.
it could be as simple as
Code: Select all
function timerlist()
return timerList
end
Code: Select all
local tlist = {}
tlist = timerlist()
Code: Select all
Command> local tlist = {} tlist = timerlist() table.print(tlist)
table: 01384540
GMdetection: table: 04FA6748
time: 5000
func: function: 0144B820
args: table: 04FA6770
timedSetWindowName: table: 0404B870
time: 1000
func: function: 013EFD20
args: table: 0404B9D8
1: Charname
Default bot uses just 2 timers
Code: Select all
registerTimer("timedSetWindowName", secondsToTimer(1), timedSetWindowName, load_profile_name);
Code: Select all
registerTimer("timedAttack", secondsToTimer(2), timedAttack);
So any other timers would have been added by non default code.
flying//wallclimbing//gmdetect//mountspeed
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Q: How to unregister all timers?
Thx for answer.
I've forgot about other timers that i didn't register in my scripts.
It would be better to leave them alone.
I think i'll make make own function that will register timers and add their names to global list.
I've forgot about other timers that i didn't register in my scripts.
It would be better to leave them alone.
I think i'll make make own function that will register timers and add their names to global list.
Who is online
Users browsing this forum: No registered users and 1 guest