if statements

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

Moderator: Moderators

Message
Author
TheyHaveMoney
Noob
Noob
Posts: 3
Joined: 02 Mar 2014, 03:48
Noob?: No

if statements

#1 Post by TheyHaveMoney »

typing macros, got error
macro checknum {
$num = @rand(1, 3)
if ($num == 1) call one
if ($num == 2) call two
if ($num == 3) call three
}
macro one {
log $num is 1
}
macro two {
log $num is 2
}
macro three {
log $num is 3
}
http://wiki.openkore.com/index.php/Macro_plugin#If

is this really will work?

do the same :

macro resp {
$t = @random (1, 2)
if ($t == 1) call onea
if ($t == 2) call twoa
}
my massege is
[macro] resp error: error in 1: syntax error in if statement

========================= solution - update plugins by TortoiseSVN ^^ thanks

k1nt4r0
Human
Human
Posts: 30
Joined: 11 Jun 2014, 12:13
Noob?: Yes

Re: if statements

#2 Post by k1nt4r0 »

macro resp {
$t = @random (1, 2)
if ($t == 1) call onea
if ($t == 2) call twoa
}
may this one can help.

Code: Select all

macro resp {
$t = @random(1,2,3)
if ($t == 1) call onea
if ($t == 2) call twoa
if ($t == 3) call threea
or if the call command cannot detected try this 1

Code: Select all

macro resp {
$t = @random(1,2,3)
if ($t == 1) goto onea
if ($t == 2) goto twoa
if ($t == 3) goto threea
then make the resume

Code: Select all

:onea
do "command"

:twoa
do "command"

:threea
do "command
}

Post Reply