Soul Linker macro

Moderator: Moderators

Message
Author
ptcarino
Plain Yogurt
Plain Yogurt
Posts: 62
Joined: 17 Jul 2010, 00:48
Noob?: No
Location: pRO Valkyrie

Soul Linker macro

#1 Post by ptcarino »

non-hook macro for soul link.

i only added 3rd jobs here. feel free to add other job class.

Code: Select all

automacro SL {
console /\[dist=(.*)\] (.*) \((\d+)\): (.*)(Flag)(.*)$/
call {
$dist = $.lastMatch1
$name = $.lastMatch2
$id = $.lastMatch3
$msg = $.lastMatch5
$skill = @eval({Sura => 447, Genetic => 445, 'Glt. Cross' => 457, 'Sorcerer' => 449, 'Warlock' => 453, 'Maestro' => 455, 'Wanderer' => 455, 'Shadow Chaser' => 456, 'Mechanic' => 458, 'Ranger' => 460, 'Arch Bishop' => 454, 'Rune Knight' => 452, 'Royal Guard' => 450}->{$::players{$::playersID[$id]}->job})

if ($dist > 6) goto end
if ($msg = Flag) goto accessGo
goto end

:accessGo
do sp $skill $id
pause 2
stop

:end
stop
}
}
for guild oriented Soul Link Buffer, add this one

Code: Select all

$g = @eval (exists $::players{$::playersID[$id]}->{guild} ? $::players{$::playersID[$id]}->{guild}{name} : 'null')
and change

Code: Select all

if ($msg = Flag) goto accessGo
to

Code: Select all

if ($g = Insert Guild Name Here) goto accessGo
of course change the "Insert Guild Name Here" to the name of your guild.

Credits:
thanks to ever_boy_ and rocknroll for shortening the code. now it's just 1 automacro ^^
thanks to EternalHarvest for making it shorter.

EDIT:
added info for guild buffer
Last edited by ptcarino on 01 May 2013, 06:50, edited 3 times in total.
Image

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

Re: Soul Linker macro

#2 Post by ever_boy_ »

you don't need to terminate your macro if distance ia greater than 6. just make the SL walk onto that person.

Code: Select all

$tx = @eval ($::players{$::playersID[$id]}->{pos_to}{x})
$ty = @eval ($::players{$::playersID[$id]}->{pos_to}{y})

if ($dist < 6) goto next
do move $tx $ty
:next
...
why doing 'pl' command?

Code: Select all

if (@eval($::players{$::playersID[$id]}->job) == 'jobNameHere') goto jobName
or something like that, can't test it right now.

rocknroll
Been there done that!
Been there done that!
Posts: 118
Joined: 19 Sep 2011, 07:30
Noob?: Yes

Re: Soul Linker macro

#3 Post by rocknroll »

Effective, but not efficient.

this thing

Code: Select all

if ($job = Sura) goto monk
if ....... goto .....
why not use,

Code: Select all

if ($job = Sura) call monk
if ....... call [macro_name]
Readme
Sorry, my english is very bad !

ptcarino
Plain Yogurt
Plain Yogurt
Posts: 62
Joined: 17 Jul 2010, 00:48
Noob?: No
Location: pRO Valkyrie

Re: Soul Linker macro

#4 Post by ptcarino »

rocknroll wrote:Effective, but not efficient.

this thing

Code: Select all

if ($job = Sura) goto monk
if ....... goto .....
why not use,

Code: Select all

if ($job = Sura) call monk
if ....... call [macro_name]
Readme
it's a work in progress. i haven't really put a lot of thought on this macro. that's why i posted it here for people to check my macro and possibly make it better.
ever_boy_ wrote:you don't need to terminate your macro if distance ia greater than 6. just make the SL walk onto that person.

Code: Select all

$tx = @eval ($::players{$::playersID[$id]}->{pos_to}{x})
$ty = @eval ($::players{$::playersID[$id]}->{pos_to}{y})

if ($dist < 6) goto next
do move $tx $ty
:next
...
i meant the soul linker to be stationary. don't want him to be walking around during guild seiges.
ever_boy_ wrote:why doing 'pl' command?

Code: Select all

if (@eval($::players{$::playersID[$id]}->job) == 'jobNameHere') goto jobName
or something like that, can't test it right now.
it was my only way of checking the character's job class. haven't studied eval yet so i used what i only know.
i'll give your code a try.
Image

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

Re: Soul Linker macro

#5 Post by EternalHarvest »

Code: Select all

$skill = @eval({Sura => 447, Genetic => 445, 'Glt. Cross' => 457, 'etc' => 'etc'}->{$::players{$::playersID[$id]}->job})

do sp $skill $id

ptcarino
Plain Yogurt
Plain Yogurt
Posts: 62
Joined: 17 Jul 2010, 00:48
Noob?: No
Location: pRO Valkyrie

Re: Soul Linker macro

#6 Post by ptcarino »

EternalHarvest wrote:

Code: Select all

$skill = @eval({Sura => 447, Genetic => 445, 'Glt. Cross' => 457, 'etc' => 'etc'}->{$::players{$::playersID[$id]}->job})

do sp $skill $id
where can i get tutorials for evals? i wanna learn them.

this simplifies everything. thank you again EternalHarvest.
Image

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

Re: Soul Linker macro

#7 Post by EternalHarvest »

@eval just executes Perl code, as already mentioned in macro plugin manual. No additional @eval-specific tutorials needed.

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

Re: Soul Linker macro

#8 Post by ever_boy_ »

Commands.pm is a good source of vars for you to build your eval-based macros.
Lets say you wanna make an eval based on your char's attributes, but you have no idea how.
'st' command shows your char's attributes, so let's take a look at it. As a command, it is stored in commands.pm.
There you can find something like that:

Code: Select all

$char->{'vit'}, $char->{'vit_bonus'}, $char->{'points_vit'}
and much more.

So now you know that if you wanna grab your char's bonus vit points, you do this:

Code: Select all

$var = @eval($::char->{'vit_bonus'})
There's also other files you can browse for a variety of options to your evals.

ptcarino
Plain Yogurt
Plain Yogurt
Posts: 62
Joined: 17 Jul 2010, 00:48
Noob?: No
Location: pRO Valkyrie

Re: Soul Linker macro

#9 Post by ptcarino »

thanks for the infos.. its a good start to study eval
Image

ptcarino
Plain Yogurt
Plain Yogurt
Posts: 62
Joined: 17 Jul 2010, 00:48
Noob?: No
Location: pRO Valkyrie

Re: Soul Linker macro

#10 Post by ptcarino »

sorry for the double post but, may i request a mod to move this to the section "Share your macros"? thank you
Image

Post Reply