Help with @whereis

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

qwertyman123321
Noob
Noob
Posts: 4
Joined: 30 Dec 2013, 00:44
Noob?: Yes

Help with @whereis

#1 Post by qwertyman123321 »

Hi, i'm pretty new to this macro thing so yeah.
my question is how to make kore detect the maps when i type in the @whereis id command in the console
example:
c @whereis 1001

the console then displays:
Scorpion spawns in:
moc_fild20 (70)
moc_fild17 (5)

how can i make kore detect the moc_fild20 using reg exp? i tried this code:

Code: Select all

automacro autowarp{
console /(.*)_(.*)/
run-once 1
call {
$try = $.lastMatch1
$try1 = $.lastMatch2
do c @warp $.lastMatch1_$.lastMatch2
}
}
but it doesn't work.
qwertyman123321
Noob
Noob
Posts: 4
Joined: 30 Dec 2013, 00:44
Noob?: Yes

Re: Help with @whereis

#2 Post by qwertyman123321 »

bump
Puding
Human
Human
Posts: 38
Joined: 29 Jan 2009, 00:24
Noob?: No

Re: Help with @whereis

#3 Post by Puding »

Here we go:

Code: Select all

automacro autowarp{
console /(.*)_(.*)/i
exclusive 1
call {
$maps = $.lastLogMsg
$warp = getMap ("$maps")
do c @warp $warp
log $warp
}
}

sub getMap {
  my ($map) = @_;
  my @array = split (undef, $map);
  my @new;
  my $size = @array;
  for (my $j = 0; $j <= $size; $j++){
  if ($array[$j] eq ' '){
	last;
	}
	else{
		$new[$j] = $array[$j];
		}
  }
  my $final = join("",@new);
 
  return $final;
}
qwertyman123321
Noob
Noob
Posts: 4
Joined: 30 Dec 2013, 00:44
Noob?: Yes

Re: Help with @whereis

#4 Post by qwertyman123321 »

thanks :D