Need some code to kill and restart a macro!

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

skysurf
a lesser mummy
a lesser mummy
Posts: 52
Joined: Fri Aug 15, 2003 1:54 am

Need some code to kill and restart a macro!

Post by skysurf » Mon Sep 01, 2003 1:44 pm

I have a macro that just dies every now and then.

I have a feeling it totally lag related.

But anyway, I am looking for a way to kill it, and restart it every X amount of minutes.

I have spent hours and hours pouring over the code, and I can't find anything that could be hanging it up, it just dies.

Any help would be appreciated.

Sky

Zeus
a hill giant
a hill giant
Posts: 180
Joined: Wed Feb 19, 2003 10:03 am
Contact:

Post by Zeus » Tue Sep 02, 2003 8:13 am

If i remember right you can't call a macro from within a macro so seems you can't do that, you can tho have a counter to stop after x amoutn of times then have it beep when it stops and manually restart. Best I can think of =\

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Tue Sep 02, 2003 5:00 pm

/macro works inside a macro. it will end the currently running macro and start the new macro, without zapping vars.

Zeus
a hill giant
a hill giant
Posts: 180
Joined: Wed Feb 19, 2003 10:03 am
Contact:

Post by Zeus » Tue Sep 02, 2003 7:13 pm

So set a counter for x amoutn of times you have it running do a /zapvars and call itself?

User avatar
auth
a ghoul
a ghoul
Posts: 84
Joined: Sun Apr 13, 2003 12:47 am

/agree Valerian

Post by auth » Tue Sep 02, 2003 7:44 pm

I agree with Val's method, which is what I always use. At the end of a macro that needs to loop over and over, I don't worry so much about the loop, I more or less just call the macro at the end for the continuous loop. This makes sure that there are no hung events, or any little things that can happen over long macro periods. It seems just makes macros much more stable to be called fresh at the end. So my answer would be

/macro cheese.mac - at the end...
Auth - "If it isn't broke, let VI patch it"