experimenting w/ xconf.pl

For everything NOT server specific support. Do NOT ask for connectivity help here!.

Moderator: Moderators

Message
Author
nyak00
Noob
Noob
Posts: 13
Joined: 15 Apr 2012, 02:35
Noob?: No

experimenting w/ xconf.pl

#1 Post by nyak00 »

hello there, im making a macro that uses mconf commands but the kore doesn't detect the macro.. I cant find whats wrong.. Can you help me with this?

Code: Select all

macro mymacro {
	$hp = $.hp
	$mp = $.mp
	$lowhp = @eval($hp*0.25)
	$highhp = @eval($hp*0.55)
	$lowmp = @eval($mp*0.25)
	$highmp = @eval($mp*0.45)
	if ($hp >= $highhp && $mp >= $highmp) goto one
	if ($hp <= $lowhp && $mp <= $lowmp) goto two
	if ($hp >= $highhp && $mp <= $lowmp) goto two
	if ($hp <= $lowhp && $mp >= $highmp) goto two

:one
do mconf Magmaring 2
do reload mon_control
do stand

:two
do mconf Magmaring 0
do reload mon_control
do sit
}

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: experimenting w/ xconf.pl

#2 Post by Kaspy »

[EN] This is all your macro? It would not be because they lack a automacro to call it?

[PT-BR] Essa é toda a sua macro? Não seria porque falta uma automacro para chama-la?
Image

nyak00
Noob
Noob
Posts: 13
Joined: 15 Apr 2012, 02:35
Noob?: No

Re: experimenting w/ xconf.pl

#3 Post by nyak00 »

KeplerBR wrote:[EN] This is all your macro? It would not be because they lack a automacro to call it?
Hey there KeplerBR, yeah silly me.. but on my macros.txt its an automacro.. still, kore doesn't detect this macro and I keep getting this "munch munch" message..

User avatar
SkylorD
Moderators
Moderators
Posts: 1166
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: experimenting w/ xconf.pl

#4 Post by SkylorD »

Post your other macro here.
"Munch munch strange?" You don't said this.
Learn rules

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: experimenting w/ xconf.pl

#5 Post by Kaspy »

nyak00 wrote:
KeplerBR wrote:[EN] This is all your macro? It would not be because they lack a automacro to call it?
Hey there KeplerBR, yeah silly me.. but on my macros.txt its an automacro.. still, kore doesn't detect this macro and I keep getting this "munch munch" message..
[EN] Do not quite understand what you mean...
Try calling your macro this with a simple automacro

[PT-BR]
Não entendi muito bem o que quis dizer...
Tente chamar essa sua macro com um automacro simples
Image

nyak00
Noob
Noob
Posts: 13
Joined: 15 Apr 2012, 02:35
Noob?: No

Re: experimenting w/ xconf.pl

#6 Post by nyak00 »

Hey there, I've edited a few on my macro, now the message is

mymacro.call error: error in 6: syntax error in if statement.

I wonder what's wrong here, can u help me?

Code: Select all

automacro mymacro {
	location ve_fild03
	timeout 30
	call {
	$hp = $.hp
	$mp = $.mp
	$lowhp = @eval ($hp*0.25)
	$highhp = @eval ($hp*0.55)
	$lowmp = @eval ($mp*0.25)
	$highmp = @eval ($mp*0.45)
	if ($hp >= $highhp && $mp >= $highmp) goto one
	if (($hp <= $lowhp && $mp <= $lowmp) || ($hp >= $highhp && $mp <= $lowmp) || ($hp <= $lowhp && $mp >= $highmp)) goto two

:one
do mconf Magmaring 2 0 1 1
do reload mon_control
do stand
release mymacro

:two
do mconf Magmaring 1 0 1 1
do reload mon_control
do sit
release mymacro
}
}


User avatar
SkylorD
Moderators
Moderators
Posts: 1166
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: experimenting w/ xconf.pl

#7 Post by SkylorD »

http://openkore.com/index.php/Macro#IF_statement
Note² : If statements are unlimited, you can use as many statements as you want.

if (arg1 <Conditions> arg2 || arg3 <Conditions> arg4 || ... || argN <Conditions> argN+1) (goto <label> | call <macro> <n> | stop)
Learn rules

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: experimenting w/ xconf.pl

#8 Post by EternalHarvest »

Print your whole condition with "log" and check if it looks right.

nyak00
Noob
Noob
Posts: 13
Joined: 15 Apr 2012, 02:35
Noob?: No

Re: experimenting w/ xconf.pl

#9 Post by nyak00 »

EternalHarvest wrote:Print your whole condition with "log" and check if it looks right.
How do i print my condition? Sorry if i ask too much, I'm new w/ macros.. I'm having a hard time with if statements..

Post Reply