I am having some trouble getting the right part of the matched text send to a script. What I am trying now is the following:
with this script (in perlscript)
when I put in "target bigbadwolf" I expected the following to come out:
what comes out is:
what I want is to get that argument bigbadwolf, but I can't seem to get it. I'm probably doing it completely wrong, and I would really appreciate a hand.
<alias
script="target_tester"
match="^target (\w+)"
enabled="y"
ignore_case="y"
regexp="y"
>
</alias>
with this script (in perlscript)
sub setTarget{
my $i = 0;
for my $arg (@_){
$world->note("arg ".$i." is ".$arg);
$i++;
}
}
when I put in "target bigbadwolf" I expected the following to come out:
arg 0 is target bigbadwolf
arg 1 is bigbadwolf
what comes out is:
arg 0 is
arg 1 is target bigbadwolf
arg 2 is ARRAY(0xf8ed9c)
what I want is to get that argument bigbadwolf, but I can't seem to get it. I'm probably doing it completely wrong, and I would really appreciate a hand.