I deserve it.
(But don't be too confident about it, it'd be too beautiful to be true that it worked finally. xD)
The $::char->{look}{body} is anti-clockwise, that is not wrong, I tested it many times. xD
Here's the new "final" macro. xD
Code: Select all
automacro login {
hook in_game
exclusive 1
run-once 1
call {
do eval @_areas = ( [[0,4],[0,3],[-1,3],[1,3],[-1,4],[1,4],[-1,5],[1,5],[0,5],[0,2],[-1,2],[1,2],[-2,2],[2,2],[-2,3],[2,3],[-2,4],[2,4],[-2,5],[2,5],[-2,6],[2,6],[-1,6],[1,6],[0,6]] , [[-3,3],[-3,2],[-2,3],[-4,3],[-3,4],[-2,2],[-3,1],[-1,3],[-4,2],[-2,4],[-5,3],[-3,5],[-4,4],[-2,1],[-1,2],[-3,0],[0,3],[-4,1],[-1,4],[-5,2],[-2,5],[-6,3],[-3,6],[-5,4],[-4,5]] , [[-4,0],[-3,0],[-3,-1],[-3,1],[-4,-1],[-4,1],[-5,-1],[-5,1],[-5,0],[-2,0],[-2,-1],[-2,1],[-2,-2],[-2,2],[-3,-2],[-3,2],[-4,-2],[-4,2],[-5,-2],[-5,2],[-6,-2],[-6,2],[-6,-1],[-6,1],[-6,0]] , [[-3,-3],[-2,-3],[-3,-2],[-3,-4],[-4,-3],[-2,-2],[-1,-3],[-3,-1],[-2,-4],[-4,-2],[-3,-5],[-5,-3],[-4,-4],[-1,-2],[-2,-1],[0,-3],[-3,0],[-1,-4],[-4,-1],[-2,-5],[-5,-2],[-3,-6],[-6,-3],[-4,-5],[-5,-4]] , [[0,-4],[0,-3],[1,-3],[-1,-3],[1,-4],[-1,-4],[1,-5],[-1,-5],[0,-5],[0,-2],[1,-2],[-1,-2],[2,-2],[-2,-2],[2,-3],[-2,-3],[2,-4],[-2,-4],[2,-5],[-2,-5],[2,-6],[-2,-6],[1,-6],[-1,-6],[0,-6]] , [[3,-3],[3,-2],[2,-3],[4,-3],[3,-4],[2,-2],[3,-1],[1,-3],[4,-2],[2,-4],[5,-3],[3,-5],[4,-4],[2,-1],[1,-2],[3,0],[0,-3],[4,-1],[1,-4],[5,-2],[2,-5],[6,-3],[3,-6],[5,-4],[4,-5]] , [[4,0],[3,0],[3,1],[3,-1],[4,1],[4,-1],[5,1],[5,-1],[5,0],[2,0],[2,1],[2,-1],[2,2],[2,-2],[3,2],[3,-2],[4,2],[4,-2],[5,2],[5,-2],[6,2],[6,-2],[6,1],[6,-1],[6,0]] , [[3,3],[2,3],[3,2],[3,4],[4,3],[2,2],[1,3],[3,1],[2,4],[4,2],[3,5],[5,3],[4,4],[1,2],[2,1],[0,3],[3,0],[1,4],[4,1],[2,5],[5,2],[3,6],[6,3],[4,5],[5,4]] );
}
}
automacro warpCall {
console /\(From: (.*)\) : open warp portal/i
exclusive 1
call {
if (@eval (defined $::overallAuth{"$.lastMatch1"} ? $::overallAuth{"$.lastMatch1"}:"None") != 1) stop
if (@invamount (Blue Gemstone) > 0) goto blue
do pm "$.lastMatch1" I need a Blue Gemstone.
stop
:blue
do eval undef $::Macro::Data::varStack{loc};my $_l = $::char->{look}{body};return if (!defined $_l);my $_skip = 1;my @_area = @{$_areas[$_l]};foreach my $_z (@_area) {my ($_x, $_y) = ($::char->{pos}{x} + $_z->[0], $::char->{pos}{y} + $_z->[1]);next if (!$::field->isWalkable($_x, $_y));$_skip = 0;foreach my $_npc (@{$::npcsList->getItems()}) {next if ($_npc->{pos_to}{x} != $_x || $_npc->{pos_to}{y} != $_y);$_skip = 1;last;} next if ($_skip);foreach my $_pl (@{$::playersList->getItems()}) {next if ($_pl->{pos_to}{x} != $_x || $_pl->{pos_to}{y} != $_y);$_skip = 1;last;} next if ($_skip);$::Macro::Data::varStack{loc} = $_x ." ". $_y;last} if ($_skip) {$::Macro::Data::varStack{loc} = "none";}
if ($loc = "") goto look
if ("$loc" == "none") goto noSkill
do sl 27 $loc
pause 2
call warpList
do pm "$.lastMatch1" where to?
stop
:look
do look @rand (0,7)
goto blue
:noSkill
do pm "$.lastMatch1" I don't have place for the skill.
}
}
This time I changed it so when the look variable is not defined the bot will do random look and try again. I did again the tables, but now I don't feel too confident so I'd love if someone checked it for me too, even being so much numbers it's not too difficult because they usually go in pairs ([-1,2] and [1,2], for example)... I'll test it and go to eat.