The Lua pattern matching in the automatizer can't handle certain characters, and dumps a stack trace when it encounters them. For example, I have a character that doesn't care about Runes, but I figured there might be other items mentioning "Rune" that I would want (I got bitten by an automatizer entry for Essences when I tried to buy an Essence of Speed spellbook; oops), so I used the pattern "Rune [". Lua doesn't like that (typed out by hand because I can't select text from the message buffer to paste):
- LUA: Error: malformed pattern (missing ']') LUA: stack traceback: LUA: 1: function `strfind' [C]
LUA: 2: function <202:file `...s/ToME 234.app/Contents/Resources/core/auto.l
LUA: 3: function rf' at line 185 [file ...s/ToME 234.app/Contents/Resource
LUA: 4: function <289:file `...s/ToME 234.app/Contents/Resources/core/auto.l LUA: 5: function `call' [C]
LUA: 6: function apply_rules' at line 326 [file ...s/ToME 234.app/Contents LUA: ERROR in lua_call while calling 'apply_rules'.
What I'd recommend in this situation is assuming, by default, that the player does not know about Unix-style pattern matching, and therefore to escape special characters for them. But have an option to turn off the escaping if the player knows what they're doing.
ToME Wiki