BOT to BOT Trade using automacro. Is it possible?

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

tooter666
Noob
Noob
Posts: 3
Joined: 23 May 2011, 23:18
Noob?: Yes

BOT to BOT Trade using automacro. Is it possible?

#1 Post by tooter666 »

I still havent found a way using automacro, for my bot to initiate the deal with another bot.

When using the deal command using macro, it needs the pl# of the player you want to deal with.

Is there a way to extract a specific player's pl# using macro?

is it possible using automacro?

if it is. can somebody show some sample syntax.
setsunaseiei
Human
Human
Posts: 38
Joined: 17 May 2011, 07:09
Noob?: No

Re: BOT to BOT Trade using automacro. Is it possible?

#2 Post by setsunaseiei »

There is a macro keyword or function called @player:

Code: Select all

@player (<name>)
Returns player index of player <name>. If player <name> is not found, it returns -1
from
http://wiki.openkore.com/index.php/Macro
First, move the char near the player then put this in your block:

Code: Select all

$playerID = @player("player name")
*player name is the person you want to deal with
オペンコレ!
indrakid
Noob
Noob
Posts: 3
Joined: 01 Feb 2010, 21:12
Noob?: Yes
Location: Indonesia, Depok

Re: BOT to BOT Trade using automacro. Is it possible?

#3 Post by indrakid »

This is work if the name doesn't contain any symbol.

if the player name is containing a symbol, this macro always return -1 even the player is visible.

example name:
`name~
%name2
.:name3:.
and etc

Any solution if the name contain any symbol or not word,, like above??
.::Learning Openkore Again::.
User avatar
SkylorD
Moderators
Moderators
Posts: 1196
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil

Re: BOT to BOT Trade using automacro. Is it possible?

#4 Post by SkylorD »

setsunaseiei wrote:There is a macro keyword or function called @player:

Code: Select all

@player (<name>)
Returns player index of player <name>. If player <name> is not found, it returns -1
from
http://wiki.openkore.com/index.php/Macro
First, move the char near the player then put this in your block:

Code: Select all

$playerID = @player("player name")
*player name is the person you want to deal with

@player (<name>)


$playerID = @player("player name")
Don't use quotes in bracket.
Use in deal,example :

Code: Select all

$player = @player (~~Mario K'art)
do deal "$player"
Never presented error with me.

The same example,is with Macro Plugin.
With this sintax :
$.lastpub
If you will return the message,from the last people,and this people have symbols on name,with this example :

Code: Select all

$player = @player("$.lastpub")
do pm $.lastpub(or $.lastpub) Hello boy
The message never will arrive.
But,with this :

Code: Select all

$player = @player ($.lastpub)
do pm "$player"(or "$.lastpub") Hello Boy
Will works.Because i used quotes on action (do deal, do pm) and no on especification ($player = ... , $playerID = ...)
Learn rules
PowerStrike
Noob
Noob
Posts: 9
Joined: 11 May 2011, 22:16
Noob?: Yes

Re: BOT to BOT Trade using automacro. Is it possible?

#5 Post by PowerStrike »

indrakid wrote:This is work if the name doesn't contain any symbol.

if the player name is containing a symbol, this macro always return -1 even the player is visible.

example name:
`name~
%name2
.:name3:.
and etc

Any solution if the name contain any symbol or not word,, like above??
It works correctly, you are doing something wrong.

You can´t put spaces between the curved brackets and the name, or it will give you always the -1 return for your calls.

Code: Select all

log @player(`name~)
returns the right answer, while

Code: Select all

log @player( `name~ )
will return -1.


I´d tested this:

Code: Select all

macro un {
	log @player(`name~)
}
and this:

Code: Select all

macro un {
	log @player(%the name2)
}
and received the correct response.

Note: `name~ differs from 'name~, so you have to pay attention to these detais.
indrakid
Noob
Noob
Posts: 3
Joined: 01 Feb 2010, 21:12
Noob?: Yes
Location: Indonesia, Depok

Re: BOT to BOT Trade using automacro. Is it possible?

#6 Post by indrakid »

SkylorD wrote:
setsunaseiei wrote:There is a macro keyword or function called @player:

Code: Select all

@player (<name>)
Returns player index of player <name>. If player <name> is not found, it returns -1
from
http://wiki.openkore.com/index.php/Macro
First, move the char near the player then put this in your block:

Code: Select all

$playerID = @player("player name")
*player name is the person you want to deal with

@player (<name>)


$playerID = @player("player name")
Don't use quotes in bracket.
Use in deal,example :

Code: Select all

$player = @player (~~Mario K'art)
do deal "$player"
Never presented error with me.

The same example,is with Macro Plugin.
With this sintax :
$.lastpub
If you will return the message,from the last people,and this people have symbols on name,with this example :

Code: Select all

$player = @player("$.lastpub")
do pm $.lastpub(or $.lastpub) Hello boy
The message never will arrive.
But,with this :

Code: Select all

$player = @player ($.lastpub)
do pm "$player"(or "$.lastpub") Hello Boy
Will works.Because i used quotes on action (do deal, do pm) and no on especification ($player = ... , $playerID = ...)
Oh I see,,,

Thanks for your explanation, now a bug in my AutoWarp had been clear,,,

Even tough it was not smooth yet... :D

Thank you so much... ;)
.::Learning Openkore Again::.