Problematic IF Statement

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

PcNy
Noob
Noob
Posts: 12
Joined: 02 Dec 2011, 00:44
Noob?: No

Problematic IF Statement

#1 Post by PcNy »

I always got error whenever I try to use IF statement.
No matter how simple or complex the condition is, I will get an error.

This is an example I took from Macro section in Wiki

Code: Select all

macro checkZeny {
	if ($.zeny > 1000) do c I've over 1.000z! 
	else do c I've 1.000z or less...
}
or

Code: Select all

macro checkZeny {
   if ($.zeny > 1000) {
      do c I've over 1.000z! 
   } else {
      do c I've 1.000z or less...
   }
}
After running this macro, I got this error message.
Image
Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: Problematic IF Statement

#2 Post by Raider »

You have updated your OpenKore to the latest revision?
PcNy
Noob
Noob
Posts: 12
Joined: 02 Dec 2011, 00:44
Noob?: No

Re: Problematic IF Statement

#3 Post by PcNy »

My openkore is not of latest version but I have updated Plugins/macro recently. Now the IF statement problem is solved but the $.variable in WHEN statement just does not work again.

Do I need to update my whole openkore folder?

Thanks
rocknroll
Been there done that!
Been there done that!
Posts: 118
Joined: 19 Sep 2011, 07:30
Noob?: Yes

Re: Problematic IF Statement

#4 Post by rocknroll »

this work with lates macro plugin,

Code: Select all

macro checkZeny {
   if ($.zeny > 1000) {
      do c I've over 1.000z! 
   } else {
      do c I've 1.000z or less...
   }
}
but if you want to use old syntax, it looks like

Code: Select all

macro checkZeny {
 if ($.zeny > 1000) goto ok
 do c I've 1.000z or less...
 stop

 :ok
 do c I've over 1.000z!
}
Sorry, my english is very bad !
Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: Problematic IF Statement

#5 Post by Kaspy »

Here works perfectly

Image
Image