Sie sind auf Seite 1von 4

automacro avoidMon {

timeout 30
monster Eremes Guile, Fake Angel,
macro_delay 0.1
call {
$monX = @arg ("$.lastMonsterPos", 1)
$monY = @arg ("$.lastMonsterPos", 2)
$move = @eval (avoid($monX, $monY))
if ($move == "error") goto end
do as; log Avoid $.lastMonster ($monX $monY) move to $move
do move $move
:end
}
}
sub avoid {
my ($monX, $monY) = @_;
my $randX = 0;
my $randY = 0;
my $i = 100;
my $x = $::char->{pos_to}{x};
my $y = $::char->{pos_to}{y};
my $dx = $monX - $x;
my $dy = $monY - $y;
while (($randX == 0 && $randY == 0) || (--$i && !$::field->isWalkable($randX, $r
andY))) {
if ($dx >= 0) {
$randX = int(rand($x));
} else {
$randX = $x + int(rand($::field{width} - $x));
}
if ($dy >= 0) {
$randY = int(rand($y));
} else {
$randY = $y + int(rand($::field{height} - $y));
}
}
if (!$i) {
return "error";
} else {
return $randX . " " . $randY;
}
}
automacro avoid {
map iz_dun02
monster Merman, 12
#Notice the coma space and number 12 above? This avoid automacro only trigger if
any of the monster list
#distance is equal or less than the number given.
timeout 5
exclusive 1
set Move 4
#set Move to how many distance per trigger you want it to move.
call check
}
macro check {
[
$mon = $.lastMonster
$monID = $.lastMonsterID
$dist = $.lastMonsterDist
$monPos = $.lastMonsterPos
$map = $.map
$myPos = $.pos
$myPosX = @arg ("$myPos", 1)
$myPosY = @arg ("$myPos", 2)
$monPosX = @arg ("$monPos", 1)
$monPosY = @arg ("$monPos", 2)
$map = $.map
do eval message T("Macro Avoid: $::Macro::Data::varStack{mon} \($::Macro::Data::
varStack{monID}\)\n"), "teleport"; message T("Monster Dist\= $::Macro::Data::var
Stack{dist} \, Monster Loc\: \($::Macro::Data::varStack{monPosX},$::Macro::Data:
:varStack{monPosY}\) Map\= $::Macro::Data::varStack{map}\n"), "teleport";
]
do as
if ($myPosX > $monPosX) goto east
if ($myPosX < $monPosX) goto west
:X0
if ($myPosY < $monPosY) goto X0south
if ($myPosY > $monPosY) goto X0north
log We have the same co-ord to the Monster
do @random ("east", "west", "south", "north") $Move
log Move Random
stop
:X0south
log Monster Loc: North X-axis0
do south $Move
log Move South
stop
:X0north
log Monster Loc: South X-axis0
do north $Move
log Move North
stop
:east
if ($myPosY < $monPosY) goto eastSouth
if ($myPosY > $monPosY) goto eastNorth
:Y0east
log Monster Loc: West Y-axis0
do east $Move
log Move East
stop
:eastSouth
log Monster Loc: NorthWest
do southeast $Move
log Move South East
stop
:eastNorth
log Monster Loc: SouthWest
do northeast $Move
log Move North East
stop
:west
if ($myPosY < $monPosY) goto westSouth
if ($myPosY > $monPosY) goto westNorth
:Y0west
log Monster Loc: East Y-axis0
do west $Move
log Move West
stop
:westSouth
log Monster Loc: NorthEast
do southwest $Move
log Move South West
stop
:westNorth
log Monster Loc: SouthEast
do northwest $Move
log Move North West
stop
}
macro autodc2 {
do relog 10
release autodc
}
automacro aggressives {
aggressives > 7
run-once 1
call disconnect
}
macro disconnect {
do relog 30
pause 30
release aggressives
}
automacro paket {
exclusive 1
run-once 1
hp > 1%
call {
pause 2
do e e8
do move payon 166 222
pause 2
do sit
pause 1
do openshop
}
}
automacro quiver {
shop "Steel Arrow Quiver" == 0
run-once 1
exclusive 1
call cekshop
}
macro cekshop {
do closeshop
do stand
do e e2
pause 1
do talknpc 175 226 c r1 n
pause 2
log jumlah quiver Storage = @storamount (Steel Arrow Quiver)
pause 2
if (@storamount(Steel Arrow Quiver) == 0) call exit
if (@storamount(Steel Arrow Quiver) > 0) call aaa
stop
}
macro aaa {
do ai manual
pause 5
do talknpc 175 226 c r1 n
pause 5
do storage get Steel Arrow Quiver 240
do storage close
pause 5
do ai on
do cart add @inventory (Steel Arrow Quiver)
do e e9
do openshop
do reload mac
}
macro exit {
do e e14
do quit
}