Help: Waiting for events?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Spectra
decaying skeleton
decaying skeleton
Posts: 6
Joined: Wed Nov 26, 2003 12:39 am
Location: US

Help: Waiting for events?

Post by Spectra » Sun Dec 28, 2003 8:28 pm

I'm writing a bot macro based largely upon events occuring. Was wondering what is the best way to have the macro pause for an event to trigger. May sound sorta newbieish, but I'm unfamiliar with this language and learning as I go... yes you can shudder, I'm a VB guy and am feeling my way through this from my experiences there.

User avatar
wilso132
Contributing Member
Contributing Member
Posts: 106
Joined: Thu Oct 17, 2002 11:53 am

Post by wilso132 » Sun Dec 28, 2003 9:22 pm

Code: Select all

:LOOP
/doevents
/goto :LOOP
Will just keep checking to see if any events have happened over and over and over.... if that's what you need.

Edit: Reading over your post a second time I think you're wanting the macro to pause until an event occurs. An easy fix for this is to do something like this.

Code: Select all

Sub Main
    /declare var global
    /varset var 0
    :LOOP
    /doevents
    /if n var==0 /goto :LOOP
    /return

Sub Event_whatever
    /varset var 1
    /return