Does "call" in automacros not support parameters?

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

Moderator: Moderators

forbbs
Human
Human
Posts: 30
Joined: 26 Jul 2011, 21:03
Noob?: Yes

Does "call" in automacros not support parameters?

#1 Post by forbbs »

I tried:

Code: Select all

macro myMacro {
 log Parameter 1 is $.param1
}
automacro bala {
	<some conditions>
	call myMacro -- this1st
}
When automacro bala is triggered,it print "Parameter 1 is".Why?
Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: Does "call" in automacros not support parameters?

#2 Post by Raider »

Because the automacro calls the macro myMacro which logs that message?
forbbs
Human
Human
Posts: 30
Joined: 26 Jul 2011, 21:03
Noob?: Yes

Re: Does "call" in automacros not support parameters?

#3 Post by forbbs »

I considered it will print "Parameter 1 is this1st".
Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: Does "call" in automacros not support parameters?

#4 Post by Raider »

forbbs wrote:I considered it will print "Parameter 1 is this1st".
Hm, you're right, what the version of OpenKore you are using? If it's not the latest please update.
forbbs
Human
Human
Posts: 30
Joined: 26 Jul 2011, 21:03
Noob?: Yes

Re: Does "call" in automacros not support parameters?

#5 Post by forbbs »

I see.Thank you.
crasherkie
Noob
Noob
Posts: 7
Joined: 25 Apr 2013, 01:52
Noob?: Yes

Re: Does "call" in automacros not support parameters?

#6 Post by crasherkie »

Code: Select all

automacro changeLocation{
	pm Sample Check (.*)
	call checkmaster -- $.lastpm $.lastMatch1
}

macro checkmaster {
	log Person who pm is: $.param1
	log That Person said: $.param2
}
i tried this and when checkmaster is called... $.param1 and $.param2 has no value... anyone know why?
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: Does "call" in automacros not support parameters?

#7 Post by iMikeLance »

IIRC macro plugins only supports parameters while using "macro <macroname>" in console. It should be implemented in macro calls too, I'll do it if I have some spare time.
Dark Airnel
Been there done that!
Been there done that!
Posts: 133
Joined: 09 Oct 2009, 01:43
Noob?: No

Re: Does "call" in automacros not support parameters?

#8 Post by Dark Airnel »

@iMikeLance

If possible, please allow usage of separators which would allow it to accept multi-worded parameters. AFAICR, the plugin treats each word as a parameter which somehow limits it usage.

Code: Select all

macro invokepm {
do pm $.param1 Warp and meet me at $.map $.pos
}
If I type in console:

Code: Select all

macro invokepm -- Jelly Bean
This will not work if I intend to pm the player "Jelly Bean" to trigger its automacro:

Code: Select all

automacro warpandmeet {
console /Warp and meet me at (.*) (\d+) (\d+)/
timeout 1
overrideAI 1
call {
do c @warp $.lastMatch1 $.lastMatch2 $.lastMatch3
}
}
I hope something like this would work:

Code: Select all

macro invokepm -- Jelly Bean, some-other-parameters, and still some others
crasherkie
Noob
Noob
Posts: 7
Joined: 25 Apr 2013, 01:52
Noob?: Yes

Re: Does "call" in automacros not support parameters?

#9 Post by crasherkie »

Dark Airnel wrote:@iMikeLance

If possible, please allow usage of separators which would allow it to accept multi-worded parameters. AFAICR, the plugin treats each word as a parameter which somehow limits it usage.

Code: Select all

macro invokepm {
do pm $.param1 Warp and meet me at $.map $.pos
}
If I type in console:

Code: Select all

macro invokepm -- Jelly Bean
This will not work if I intend to pm the player "Jelly Bean" to trigger its automacro:

Code: Select all

automacro warpandmeet {
console /Warp and meet me at (.*) (\d+) (\d+)/
timeout 1
overrideAI 1
call {
do c @warp $.lastMatch1 $.lastMatch2 $.lastMatch3
}
}
I hope something like this would work:

Code: Select all

macro invokepm -- Jelly Bean, some-other-parameters, and still some others
I like this idea.. this will make macro more dynamic.. and also a bit user friendly....

@iMikeLance
Therefore at the mean time all we can do for now is to use something like this.
Instead of calling the call function. we can use the do command.
for example

Code: Select all

do macro nameOfMacro -- param1 param2 etc
.
am i right? or there is another way?
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: Does "call" in automacros not support parameters?

#10 Post by iMikeLance »

crasherkie wrote: I like this idea.. this will make macro more dynamic.. and also a bit user friendly....

@iMikeLance
Therefore at the mean time all we can do for now is to use something like this.
Instead of calling the call function. we can use the do command.
for example

Code: Select all

do macro nameOfMacro -- param1 param2 etc
.
am i right? or there is another way?
In order to prevent some bugs, macro plugin won't allow you to use "do macro" inside macros.