how to extract player's pos using eval?

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

Moderator: Moderators

ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

how to extract player's pos using eval?

#1 Post by ever_boy_ »

I need an eval which extracts a player's position (x, y). I know how to get my own pos, but i need to get someone else's pos, by name, ID, whatever, I just can't figure out how to build and eval that works.
Is there any tutorial that teaches how to build evals for kore?
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: how to extract player's pos using eval?

#2 Post by ever_boy_ »

got it...

$mx = @eval ($::players{$::playersID[$ID]}->{pos_to}{x})
$my = @eval ($::players{$::playersID[$ID]}->{pos_to}{y})
xxstreme
Human
Human
Posts: 20
Joined: 03 Dec 2008, 15:46
Noob?: Yes

Re: how to extract player's pos using eval?

#3 Post by xxstreme »

for more simple using player hook there was some save data needed,
but for long time i was forgot hook list and save data,
you can find at src network receive servertype0
or in src misc.pm
zexel0014
Human
Human
Posts: 43
Joined: 27 Oct 2011, 20:44
Noob?: No

Re: how to extract player's pos using eval?

#4 Post by zexel0014 »

$mx = @eval ($::players{$::playersID[$ID]}->{pos_to}{x})
$my = @eval ($::players{$::playersID[$ID]}->{pos_to}{y})

$mx--
$my--
how do you manage to make this work?
it gives me error when i try to use this to cast warp on my side
can you help me??
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: how to extract player's pos using eval?

#5 Post by ever_boy_ »

I'm sorry i didn't see this before... post your whole macro, and the erro's screen shot please.

edit: oh... maybe you're trying to use it in the wrong way... this eval is meant to get someone else's coordinates, not your own!

if you wanna cast portal "on your side", use the openkore's built-in variables.