varset question.Help Please

Status
Not open for further replies.

kool26

New member
Joined
Aug 7, 2006
Messages
134
Reaction score
0
Points
0
Hello, how do you call a varset?

example
/varset sow FALSE

/if (!${sow} /call main iam not sure on how to do this never messed with it yet. not sure on what ! means what = false? or true?

ive been messing with for a few hours now + doing other things with mac iam creating. and cant figure it out i tried like above and it wouldnt continue took out the ! and it continues but it dont go to the /call :(

any help would be great

Thanks
 
kool26 said:
Hello, how do you call a varset?

example
/varset sow FALSE

/if (!${sow} /call main iam not sure on how to do this never messed with it yet. not sure on what ! means what = false? or true?

ive been messing with for a few hours now + doing other things with mac iam creating. and cant figure it out i tried like above and it wouldnt continue took out the ! and it continues but it dont go to the /call :(

any help would be great

Thanks


First things first, you must declare your var that you want to play with along with what type of variable it will be used as. In your sample "sow".

/declare sow <type> <space>

Types commonly used: string, int, or timer.
String: When you use a string type your variable can include letter, numbers, and other characters.
Int: When you use an int type your variable can only include numbers. This type of variable is commonly used in if statements. It will return true for any non-zero number. It will return False for 0.
Timer: When you use a timer type your variable is set to a specific value and then proceeds to count down to 0. You can use short version for minutes (m), and seconds (s) to set your variable and it will be converted to a number at that time. 1m = 60s, 1s = 10. When a timer elapses it stays at 0. When used in an if statement it will return true for any timer that is not elapsed.

Space commonly used: inner, outer, or global.
Inner: The variable is contained in the subroutine the variable was defined in. If referenced outside of this subroutine or while a macro is not running it will return NULL. This variable type expires when a subroutine is ended.
Outer: The variable is available anytime a macro is running. If a macro is not running it will return NULL. This variable type expires when a macro is ended.
Global: The variable is available anytime until macroquest is unloaded or everquest is restarted. This variable will not expire until the client is closed.

If statements:
Runs command(s) if formula evaluates to something other than 0. Formulas are ONLY numeric operations. You must use MQ2Data string comparison to turn string comparisons into numeric operations.

/if (formula) {
command(s)
}
or....
/if (forumla) command(single)

Code:
/declare testvar int outer 1
/if (${testvar}) /echo True.
/if (${testvar}==1) /echo True.
/if (!${testvar}) /echo False.

/declare testvar string outer Test String!
/if (${testvar}) --- Errors due to being a string type. /if (Test String!) cannot be evaluated.
/if (${testvar.Length}) /echo True (${testvar.Length}==12)
/if (${testvar.Equal[Test String!]}) /echo True
/if (${testvar.NotEqual[Test String!]}) /echo False

/declare testvar timer outer 1m
/if (${testvar}) /echo True (${testvar}==600)
/delay 30s
/if (${testvar}) /echo True (${testvar}==300)
/delay 31s
/if (${testvar}) /echo False. (${testvar}==0)
 
kool26 said:
Hello, how do you call a varset?

example
/varset sow FALSE

/if (!${sow} /call main iam not sure on how to do this never messed with it yet. not sure on what ! means what = false? or true?

ive been messing with for a few hours now + doing other things with mac iam creating. and cant figure it out i tried like above and it wouldnt continue took out the ! and it continues but it dont go to the /call :(

any help would be great

Thanks

Code:
/if (!${sow}[COLOR="Red"])[/COLOR] /call main

! means FALSE, as you probably assumed. And easier way to remember it is to think of it as the word 'not'.
Normally in an 'if' statement you compare things to see if something is TRUE. But if you want to check for FALSE instead, you use the ! command.

It breaks down to /if (!FALSE) /call main
Not False = True.. so /if (TRUE) /call main
Is how the macro interprets it.

But just place that ')' in there and it should work for you.

And like Z said, don't forget to /declare it
 
ok WTH

Great Info Thanks alot...wasnt exspecting all that ;)

but ethier iam not understanding some right.. or iam doing something totally rong :(

Code:
  /if (${DoSnare} && !${MobSnared} && ${Me.PctMana}>=${SnareMana} && ${Target.PctHPs}<${CastSnareat}) { 
      /call cast ${SpellATK} gem4
       /1 **** %T Is Snared ...
        /gsay **** %T Is Snared ...
      /varset MobSnared TRUE
       /echo MobSnared TRUE
         }

just fyi iam revamping a sham mac to a wiz one hehe... as this is here it will not go on after this line and dont cast snare...this is also in nuke2 sub..

i have it declared

/declare DoSnare outer TRUE
/declare Snareat int outer 50
/declare SnareMana int outer 23
/declare MobSnared outer FALSE

but then again after playing with it it sometimes casts after mob is dead? or at leasts does the /1 and /gsay ....this one gots me baffled usally if i play around with it i can get stuff to work
 
kool26 said:
Code:
  /if (${DoSnare} && !${MobSnared} && ${Me.PctMana}>=${SnareMana} && ${Target.PctHPs}<[COLOR="Red"]${CastSnareat}[/COLOR]) { 
      /call cast [COLOR="royalblue"]"[/COLOR]${SpellATK}[COLOR="RoyalBlue"]"[/COLOR] gem4
       /1 **** %T Is Snared ...
        /gsay **** %T Is Snared ...
      /varset MobSnared TRUE
       /echo MobSnared TRUE
         }

/declare DoSnare outer TRUE
/declare Snareat int outer 50
/declare SnareMana int outer 23
/declare MobSnared outer FALSE

I think your issues are here. Your checking for ${CastSnareat} and your variable is ${Snareat}. Also i would put the spell to cast in quotes as most spells are multiple words and if you sent /call cast Uber Spell gem6 its not the same as /call cast "Uber Spell" gem6. Just a few things i see in your sample. If you'd like to post the exact code I can assist further and see if we can narrow down the issue.
 
You're not checking to see if the mob is dead. At least in the code you're showing, you only check a few snare variables, including if the mob is less than a certain % HP.

You need to also check if it's dead or not, ex:

Code:
/if (${Target.Type.Equal[NPC]})
And that should fix you up on that one issue.
 
Last edited:
Status
Not open for further replies.