automacro pubmguild {
console /\[(距离|dist)=(.*)\] (.*) \((\d+)\): (鸟|套|中|斐)/
exclusive 1
call {
$i = $.lastMatch4
if ($.lastMatch2 > 9) goto stop
$g =
@eval (exists $::players{$::playersID[$i]}->{guild} ? $::players{$::playersID[$i]}->{guild}{name} : 'null')
if ("$.lastMatch3" == "黑名单人物") goto stop
#有需要可以自己填入人名扩充,太多可能会影响效率。
#相对的改成goto ok,就可以没工会使用。
if ("$g" == "精灵.王道.风云再起") goto ok
if ("$g" == "[暴力美学联盟皇家学院]") goto ok
if ("$g" == ":+:乱舞-ShowTime:+") goto ok
stop
:ok
if ($.lastMatch5 == "鸟") goto mac01
if ($.lastMatch5 == "套") goto mac02
if ($.lastMatch5 == "中") goto mac03
if ($.lastMatch5 == "斐") goto mac04
stop :mac01
$x = @arg("$.pos", 1)
$y = @arg("$.pos", 2)
$y2 = @eval($y + -1)
do sl 27 $x $y2
pause 2
do warp prontera
do c ↓租鸟↓
stop
:mac02
do sp 361 $i 5
pause 1
stop
:mac03
$x = @arg("$.pos", 1)
$y = @arg("$.pos", 2)
$x2 = @eval($x + -1)
do sl 27 $x2 $y
pause 2
do warp prt_gld
do c ←中55
stop
:mac04
$x = @arg("$.pos", 1)
$y = @arg("$.pos", 2)
$x2 = @eval($x + 1)
do sl 27 $x2 $y
pause 2
do warp pay_gld
do c 红楼→
stop
:stop
stop
}
}
或高深更智能点的
do eval foreach my $_player (@{$::playersList->getItems()}) { next if $_player->{name} eq ""; next if $_player->{actorType} ne "Player"; if ($_player->{'binID'} eq "$n") {$::Macro::Data::varStack{name} = $_player->{'name'}; $::Macro::Data::varStack{job} = $_player->job; $::Macro::Data::varStack{lvl} = $_player->{'lv'}; $::Macro::Data::varStack{sex} = $::sex_lut{$_player->{'sex'}}; $::Macro::Data::varStack{dist} = sprintf("%.1f", distance($::char->{pos_to}, $_player->{pos_to})); $::Macro::Data::varStack{guild} = $_player->{guild} ? $_player->{guild}{name} : ''; $::Macro::Data::varStack{id} = $_player->{'binID'}; $::Macro::Data::varStack{status} = join (", ", keys %{$_player->{statuses}});}}