Automacro allways triggers

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

Moderator: Moderators

Shadowman
Noob
Noob
Posts: 2
Joined: 11 Dec 2011, 11:59
Noob?: Yes

Automacro allways triggers

#1 Post by Shadowman »

Code: Select all

automacro a_addchar {
	console /[(Von: ]+[a-z0-9]+[) : add char ]+[a-z0-9]+/
	call {
		$caller = $.lastMatch1
		$add_char = $.lastMatch2
		call addchar
	}
}
With this code I want to fetch if special people (this will be implemented later) talk to my bot. It's some kind of ingame remote commanding the bot.
The regexp allways triggers, but it should be only in cases like this:
(Von: pming_char) : add char adding_char

the pm'ing and adding char should be accessible in the macro addchar, correct?
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Automacro allways triggers

#2 Post by EternalHarvest »

Think about what "[(Von: ]" would match.

Also red text in macro plugin manual.
Shadowman
Noob
Noob
Posts: 2
Joined: 11 Dec 2011, 11:59
Noob?: Yes

Re: Automacro allways triggers

#3 Post by Shadowman »

sorry, i don't get what you're trying to point me to.

I've read the tutorial and many other stuff, but information how to create automacros with console command are very rare, or i'm too blind :(