I've written a small script that plays sound when someone sends me a tell with a specific text (use it so that friends can wake me up for flag mobs) and I've been wondering about the correct way to do infinite loops that wait for events. What I do now is I just loop around a /doevents with a /delay 1s, like the code below. Is this a good way to do it or do I risk any stack overflows or the like? The reason I'm asking is that I'm noticing a bit of client side lag when I break out of the macro with /end so I'm thinking this may build up something behind the scenes that I don't see.
Basically the question is, is this right or wrong:
Code: Select all
#event blah "blah blah'"
Sub Main
:neverending
/delay 1s
/doevents
/goto :neverending
/return
TIA