Код: Выделить всё
message "myPos = $myPos, pos = $pos\n";
Модератор: 4epT
Код: Выделить всё
message "myPos = $myPos, pos = $pos\n";
Код: Выделить всё
+use Text::Balanced qw/extract_bracketed/;
sub parseKw {
- my @pair = $_[0] =~ /@($macroKeywords)s*(s*(.*?)s*)/i;
+ my @full = $_[0] =~ /@($macroKeywords)s*((s*(.*?)s*).*)$/i;
+ my @pair = ($full[0]);
+ my ($bracketed) = extract_bracketed ($full[1], '()');
+ return unless $bracketed;
+ push @pair, substr ($bracketed, 1, -1);
return unless @pair;
if ($pair[0] eq 'arg') {
return $_[0] =~ /@(arg)s*(s*(".*?",s*d+)s*)/
} elsif ($pair[0] eq 'random') {
return $_[0] =~ /@(random)s*(s*(".*?")s*)/
}
while ($pair[1] =~ /@($macroKeywords)s*(/) {
- @pair = $pair[1] =~ /@($macroKeywords)s*((.*)/
+ @pair = parseKw ($pair[1])
}
return @pair
}
Код: Выделить всё
macro testlos {
$x1 = ...
$y1 = ...
$x2 = ...
$y2 = ...
log @eval (Misc::checkLineSnipable ({x => $x1, y => $y1}, {x => $x2, y => $y2}))
}
Код: Выделить всё
Died at this line:
my @pair = ($full[0]);
* my ($bracketed) = extract_bracketed ($full[1], '()');
return unless $bracketed;
Код: Выделить всё
OpenKore version what-will-become-2.0.6 (SVN version)
@ai_seq = macro
Network state = 5
Network handler = Network::DirectConnection
SVN revision: unknown
Loaded plugins:
plugins/alertsound.pl (alertsound)
plugins/craft.pl (craft)
plugins/handsFree.pl (handsFree)
plugins/likehuman.pl (likehuman)
plugins/macro.pl (macro)
Error message:
Undefined subroutine &Macro::Parser::extract_bracketed called at plugins/Macro/Parser.pm line 135.
Stack trace:
Undefined subroutine &Macro::Parser::extract_bracketed called at plugins/Macro/Parser.pm line 135.
at plugins/Macro/Parser.pm line 135
Macro::Parser::parseKw('c @autolootitem 607') called at plugins/Macro/Parser.pm line 184
Macro::Parser::parseCmd('c @autolootitem 607') called at plugins/Macro/Script.pm line 344
Macro::Script::next('Macro::Script=HASH(0x2d986a8)') called at plugins/Macro/Utilities.pm line 340
Macro::Utilities::callMacro() called at plugins/Macro/Automacro.pm line 482
Macro::Automacro::automacroCheck('AI_pre', 'undef', 'undef') called at src/Plugins.pm line 440
Plugins::callHook('AI_pre') called at src/AI/CoreLogic.pm line 112
AI::CoreLogic::iterate() called at src/functions.pl line 593
main::mainLoop_initialized() called at src/functions.pl line 70
main::mainLoop() called at src/Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x21b1f18)') called at openkore.pl line 96
main::__start() called at start.pl line 119
Died at this line:
my @pair = ($full[0]);
* my ($bracketed) = extract_bracketed ($full[1], '()');
return unless $bracketed;
Код: Выделить всё
sub parseKw {
my @full = $_[0] =~ /@($macroKeywords)s*((s*(.*?)s*).*$)/i;
my @pair = ($full[0]);
my ($bracketed) = extract_bracketed ($full[1], '()');
return unless $bracketed;
push @pair, substr ($bracketed, 1, -1);
return unless @pair;
if ($pair[0] eq 'arg') {
return $_[0] =~ /\@(arg)\s*\(\s*(".*?",\s*\d+)\s*\)/
} elsif ($pair[0] eq 'random') {
return $_[0] =~ /\@(random)\s*\(\s*(".*?")\s*\)/
}
while ($pair[1] =~ /\@($macroKeywords)\s*\(/) {
@pair = parseKw ($pair[1])
}
return @pair
}
Код: Выделить всё
@eval (Misc::checkLineSnipable {x => $x1, y => $y1}, {x => $x2, y => $y2})
OoВы не можете отправить следующее сообщение сразу после предыдущего. Пожалуйста, попробуйте чуть позже.
Код: Выделить всё
@eval (Misc::checkLineSnipable ({x => $myx, y => $myy}, {x => $mobx, y => $moby}))
Код: Выделить всё
automacro yggbeat1 {
map prt_maze03
notMonster Baphomet Jr
run-once 1
priority 5
call beat1
}
macro beat1 {
pause @rand(1,2)
do free sl 79 ~ 10
pause 1
do c @warp prt_maze03
release yggbeat1
release yggbeat2
}
automacro yggbeat2 {
map prt_maze03
monster Baphomet Jr
run-once 1
priority 5
call beat2
}
macro beat2 {
pause 1
$mobx = @arg ("$.lastMonsterPos", 1)
$moby = @arg ("$.lastMonsterPos", 2)
$myx = @eval($::char->{pos}{x})
$myy = @eval($::char->{pos}{y})
$bool = @eval (Misc::checkLineSnipable ({x => $myx, y => $myy}, {x => $mobx, y => $moby}))
if ($bool != 1) goto nextstep
do sl 79 $mobx $moby 10
pause 1
goto warp
:nextstep
log NO LOS!
do free sl 79 ~ 10
pause 1
:warp
do c @warp prt_maze03
release yggbeat1
release yggbeat2
}