how can a bot read a name with space or special characters?

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

Moderator: Moderators

vonnclinkz
Noob
Noob
Posts: 1
Joined: 16 Jun 2011, 22:07
Noob?: Yes

how can a bot read a name with space or special characters?

#1 Post by vonnclinkz »

my bot can't heal or buff my char, it can't register the name of the master as $.lastMatch1, the character has a space on its name... i used to use it on a char with no space in name its working fine...

here is my code: im using PM to trigger macros...

Code: Select all

automacro heal {
console /\(From: (.*)\) : heal/i
exclusive 1
run-once 1
timeout 1.5
sp > 10%

call {
	$name = $.lastMatch1
	do sp 28 $name 10
	release all
	}
}
help pls...
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: how can a bot read a name with space or special characters?

#2 Post by EternalHarvest »

@player?
blackarrow++
Noob
Noob
Posts: 2
Joined: 09 May 2011, 01:11
Noob?: No
Location: Brazil

Re: how can a bot read a name with space or special characters?

#3 Post by blackarrow++ »

Why'd not use this way?
It's easy, simple and functional! ;)

Code: Select all

automacro heal {
console /(From: (.*)) : heal/i
exclusive 1
run-once 1
timeout 1.5
sp > 10%
call {
	$name = $.lastpm
	do sp 28 "$name" 10
	release all
	}
}
Mushroom
Perl Monk
Perl Monk
Posts: 427
Joined: 04 Apr 2008, 14:04
Noob?: No
Location: Brazil

Re: how can a bot read a name with space or special characters?

#4 Post by Mushroom »

You must backslash all regex metacharacters if they are representing the 'literal' characters, instead of regex effects.
So, it should me

Code: Select all

console /\(From: (.*)\) : heal/i
Quit.