check current zone code.

unknownerrors

New member
Joined
May 16, 2007
Messages
202
Reaction score
5
Points
0
Location
Las Veags NV, USA
Website
unknownerrors.net
i'm working on a little macro, that will start and finish the Slipgear's Errands quest..

i'm having some problems with a few lines of code that the macro will depend on from time to time.

Code:
/if (${Zone.ShortName}=Corathus Creep) {
/goto :hail
}

for some reason this doesn't look correct to me. can anyone tell if this right?
 
Treehuggingdruid just put up a post with alot of useful subs in another section. One of the subs he posted was a zone check, check it out near the bottom of his post.

LINK
 
/if requires numbers, this is a misuse of string

do a

/if (${Zone.ID}=number) {
/goto :hail
}
 
You cannot use the ${} == format for strings. A string is a series of letters and numbers, or just letters. For example, a word is a string of letters. For the purposes that you need to think about, if the word isn't TRUE or FALSE (which translate to 1 and 0 in computer language, the most basic concepts in binary and thus able to be translated without more work), then it's a string, and MQ2 needs to use other tools to think about it. While the ${}== script can interpret numbers to the right of the "==", that's it.

To interpret a string, the correct format has already been posted...(${Zone.ShortName.Equal[]}). If you want something more flexible, though, you could try THIS for a more generic format:

Code:
/if (${Zone.ID}==${Zone[Corathus].ID})

This is also a whole lot more flexible in that you can put any ShortName of a zone in there and get the ID. I don't remember if that's the correct ShortName for Corathus, but w/e.

PS -- to translate what was said above...

"==" is used in MQ2 script when you want to check if two things are equal, the same, etc. The use of a single "=" is used to indicate when you want to change the current value of something to a new value. For a rough example (not intended to be 100% valid macro script, just to illustrate the point):

Code:
To figure out what value we want to use:

/if (${Me.Male}) /varset AmIMale=1
/if (${Me.Female}) /varset AmIMale=0

then to use what we figured out earlier:

/if (${AmIMale}==1) /dothis
/if (${AmIMale}==0) /dothat

That's not actually exactly the correct use of /varset, but hopefully will give you an idea of the correct usage of "==" and "=". Honestly, you'll really never need "=" when writing in MQ2Script.
 
i have never had a need to use the /notify command.. but i'm going to need it to accept Slipgear's tasks. i have read Notify - MacroQuest Wiki
and i'm still kinda foggy.. ok really foggy.

Here's an example you can use..

Code:
/notify TaskSelectWnd TSel_TaskList listselect #
/notify TaskSelectWnd TSel_AcceptButton leftmouseup
Where # is the number of the option inside the list you want to select (1,2,3,4). That help any?