What is "Couldn't find a comparison operator in '100=10

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

Moderator: MacroQuest Developers

BadBoy
a hill giant
a hill giant
Posts: 158
Joined: Thu Sep 05, 2002 11:53 am

What is "Couldn't find a comparison operator in '100=10

Post by BadBoy » Tue Oct 01, 2002 10:51 pm

What is "Couldn't find a comparison operator in '100=100'??

User avatar
DeathSpiral
a ghoul
a ghoul
Posts: 95
Joined: Thu Aug 22, 2002 6:31 pm

Re: What is "Couldn't find a comparison operator in '10

Post by DeathSpiral » Tue Oct 01, 2002 11:54 pm

BadBoy wrote:What is "Couldn't find a comparison operator in '100=100'??
Comparison operators are... == (equal) != (not equal) > (greater than) < (less than) etc etc. a single = isn't a comparison, its an assignment. Hope that helps.
I am orc pawn, hear me yell for centurians...

BadBoy
a hill giant
a hill giant
Posts: 158
Joined: Thu Sep 05, 2002 11:53 am

Post by BadBoy » Wed Oct 02, 2002 6:23 am

but why 100=100?? =\

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Wed Oct 02, 2002 7:12 am

100=100 in most languages would mean set 100 to be the value 100. MQScript doesnt use assignment statements like this. It uses the /varset command. 100==100 would be a comparison that would allways be true.

Not sure what your problem is really as you havent given enough detail.

sorry

Maybe post the code thats the problem ??

Fippy

BadBoy
a hill giant
a hill giant
Posts: 158
Joined: Thu Sep 05, 2002 11:53 am

Heres my code

Post by BadBoy » Wed Oct 02, 2002 10:44 am

Code: Select all

#turbo 
Sub Main 
:ScanSelf 
:LoopStart 
/press F1 
/varset v11 $target(hp,pct) 
:Group2 
/press F2 
/Call CC2 
:Group3 
/press F3 
/Call CC3 
:Group4 
/press F4 
/Call CC4 
:Group5 
/press F5 
/Call CC5 
:Group6 
/press F6 
/Call CC6 


Sub CC2 
/If $target(Class)==Enchanter { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else /If $target(Class)== Magician { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else /If $target(Class)== Wizard { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else /If $target(Class)== Cleric { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else /If $target(Class)== Beastlord { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else /If $target(Class)== Druid { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else /If $target(Class)== Necromancer { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else /If $target(Class)== Shaman { 
/varset v2 1 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
} Else 
/varset v2 0 
/varset v22 $target(hp,pct) 
/GoTo :Group3 
/return 


Sub CC3 
/If $target(Class)==Enchanter { 
/varset v3 1 
/GoTo :Group4 
} Else /If $target(Class)== Magician { 
/varset v3 1 
/varset v33 $target(hp,pct) 
/GoTo :Group4 
} Else /If $target(Class)== Wizard { 
/varset v3 1 
/varset v33 $target(hp,pct) 
/GoTo :Group4 
} Else /If $target(Class)== Cleric { 
/varset v3 1 
/varset v33 $target(hp,pct) 
/GoTo :Group4 
} Else /If $target(Class)== Beastlord { 
/varset v3 1 
/varset v33 $target(hp,pct) 
/GoTo :Group4 
} Else /If $target(Class)== Druid { 
/varset v3 1 
/varset v33 $target(hp,pct) 
/GoTo :Group4 
} Else /If $target(Class)== Necromancer { 
/varset v3 1 
/varset v33 $target(hp,pct) 
/GoTo :Group4 
} Else /If $target(Class)== Shaman { 
/varset v3 1 
/varset v33 $target(hp,pct) 
/GoTo :Group4 
} Else 
/varset v3 0 
/varset v33 $target(hp,pct) 
/GoTo :Group4 

Sub CC4 
/If $target(Class)==Enchanter { 
/varset v4 1 
/varset v44 $target(hp,pct) 
/GoTo :Group5 
} Else /If $target(Class)== Magician { 
/varset v4 1 
/varset v44 $target(hp,pct) 
/GoTo :Group5 
} Else /If $target(Class)== Wizard { 
/varset v4 1 
/GoTo :Group5 
} Else /If $target(Class)== Cleric { 
/varset v4 1 
/varset v44 $target(hp,pct) 
/GoTo :Group5 
} Else /If $target(Class)== Beastlord { 
/varset v4 1 
/varset v44 $target(hp,pct) 
/GoTo :Group5 
} Else /If $target(Class)== Druid { 
/varset v4 1 
/varset v44 $target(hp,pct) 
/GoTo :Group5 
} Else /If $target(Class)== Necromancer { 
/varset v4 1 
/varset v44 $target(hp,pct) 
/GoTo :Group5 
} Else /If $target(Class)== Shaman { 
/varset v4 1 
/varset v44 $target(hp,pct) 
/GoTo :Group5 
} Else 
/varset v4 0 
/varset v44 $target(hp,pct) 
/GoTo :Group5 

Sub CC5 
/If $target(Class)==Enchanter { 
/varset v5 1 
/varset v55 $target(hp,pct) 
/GoTo :Group6 
} Else /If $target(Class)== Magician { 
/varset v5 1 
/varset v55 $target(hp,pct) 
/GoTo :Group6 
} Else /If $target(Class)== Wizard { 
/varset v5 1 
/varset v55 $target(hp,pct) 
/GoTo :Group6 
} Else /If $target(Class)== Cleric { 
/varset v5 1 
/varset v55 $target(hp,pct) 
/GoTo :Group6 
} Else /If $target(Class)== Beastlord { 
/varset v5 1 
/varset v55 $target(hp,pct) 
/GoTo :Group6 
} Else /If $target(Class)== Druid { 
/varset v5 1 
/varset v55 $target(hp,pct) 
/GoTo :Group6 
} Else /If $target(Class)== Necromancer { 
/varset v5 1 
/varset v55 $target(hp,pct) 
/GoTo :Group6 
} Else /If $target(Class)== Shaman { 
/varset v5 1 
/GoTo :Group6 
} Else 
/varset v5 0 
/varset v55 $target(hp,pct) 
/GoTo :Group6 


Sub CC6 
/If $target(Class)==Enchanter { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else /If $target(Class)== Magician { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else /If $target(Class)== Wizard { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else /If $target(Class)== Cleric { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else /If $target(Class)== Beastlord { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else /If $target(Class)== Druid { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else /If $target(Class)== Necromancer { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else /If $target(Class)== Shaman { 
/varset v6 1 
/varset v66 $target(hp,pct) 
/Call Heal 
} Else 
/varset v6 0 
/varset v66 $target(hp,pct) 
/Call Heal 

Sub Heal 

/If n $v11<=80 And 
/If n $v22<=80 And 
/If n $v33<=80 And 
/If n $v44<=80 And 
/If n $v55<=80 And 
/If n $v66<=80 { 
/Call :GroupHeal 
} 
/If n $v11<=60 { 
/Call FastHeal 
} Else /If n $v11 =<80 { 
/Call CompleteHeal 
} /If n $v22<=60 And 
/If $v2=1 { 
/Call FastHeal 
} Else /If $v2=0 { 
/Call CompleteHeal 
} /If n $v33<=60 And 
/If $v3=1 { 
/Call FastHeal 
} Else /If $v3=0 { 
/Call CompleteHeal 
} /If n $v44<=60 And 
/If $v4=1 { 
/Call FastHeal 
} Else /If $v4=0 { 
/Call CompleteHeal 
} /If n $v55<=60 And 
/If $v5=1 { 
/Call FastHeal 
} Else /If $v5=0 { 
/Call CompleteHeal 
} /If n $v66<=60 And 
/If $v6=1 { 
/Call FastHeal 
} Else /If $v6=0 { 
/Call CompleteHeal 
} 

Sub FastHeal 
/sit off 
/cast 2 
/delay 50 
/sit On 
/GoTo :LoopStart 


Sub CompleteHeal 
/sit off 
/cast 4 
/delay 120 
/sit On 
/GoTo :LoopStart 


Sub GroupHeal 
/sit off 
/cast 3 
/delay 60 
/sit On 
/GoTo :LoopStart 

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Wed Oct 02, 2002 10:52 am

This chunk

Code: Select all

/If n $v11<=60 { 
/Call FastHeal 
} Else /If n $v11 =<80 { 
/Call CompleteHeal 
} /If n $v22<=60 And 
/If $v2=1 { 
/Call FastHeal 
} Else /If $v2=0 { 
/Call CompleteHeal 
} /If n $v33<=60 And 
/If $v3=1 { 
/Call FastHeal 
} Else /If $v3=0 { 
/Call CompleteHeal 
} /If n $v44<=60 And 
/If $v4=1 { 
/Call FastHeal 
} Else /If $v4=0 { 
/Call CompleteHeal 
} /If n $v55<=60 And 
/If $v5=1 { 
/Call FastHeal 
} Else /If $v5=0 { 
/Call CompleteHeal 
} /If n $v66<=60 And 
/If $v6=1 { 
/Call FastHeal 
} Else /If $v6=0 { 
/Call CompleteHeal 
} 
has some single = signs in it. Fix them and the error will probably disappear.

Fippy

BadBoy
a hill giant
a hill giant
Posts: 158
Joined: Thu Sep 05, 2002 11:53 am

Thank you :)

Post by BadBoy » Wed Oct 02, 2002 2:13 pm

Ahh! thank you very much!

BadBoy
a hill giant
a hill giant
Posts: 158
Joined: Thu Sep 05, 2002 11:53 am

Post by BadBoy » Wed Oct 02, 2002 2:20 pm

Still get that dumb error, Couldnt find a comparison operator in 100. At least it isn&#8217;t 100=10 :\

BadBoy
a hill giant
a hill giant
Posts: 158
Joined: Thu Sep 05, 2002 11:53 am

found out what it was

Post by BadBoy » Wed Oct 02, 2002 2:42 pm

I found out what it was, instead of

Code: Select all

/if n $v11=>81
should be

Code: Select all

/if $v11=>81

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Wed Oct 02, 2002 3:53 pm

Thats kinda weird then. the n makes the comparison a numeric one which is what you want to do! Still if it works then i guess ya dont need to worry about it.

Fippy

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

Post by Valerian » Wed Oct 02, 2002 10:48 pm

BadBoy wrote:

Code: Select all

/if n $v11=>81
shouldn't that be...

Code: Select all

/if n $v11>=81

*shrug*

schue
decaying skeleton
decaying skeleton
Posts: 7
Joined: Fri Jul 05, 2002 3:16 pm

Post by schue » Sun Oct 06, 2002 5:42 am

As neither one still got a real clue, here a little hint:

Correct: /if n $v1==0

Incorrect: /if n $v1 ==0
Incorrect: /if n $v1== 0
Incorrect: /if n $v1 == 0


If you see the pattern, you got your bug. Its all over your code...