Caled wrote:I'm having trouble with selectString in general, I think.
Code: Select all
Pattern: You have recovered equilibrium.
Script:
selectString( "You have recovered equilibrium." )
fg( "blue" )
I tried the above with various different pattern types (Pattern starts at beginning of line, pattern is entire line, and regex "^You have recovered equilibrium\.$"). It never colours the line.
You made a syntax error. It's selectString( what, numberOfMatch )
Code: Select all
Pattern: You have recovered equilibrium.
Script:
selectString( "You have recovered equilibrium.", 1 )
fg( "blue" )
explanation:
Let's assume the line
Tom gets a ride to Tom's house.
selectString( "Tom", 1 ) will select the first occurence of Tom
selectString( "Tom", 2 ) will select the second Tom in the line.
General Tip for debugging your triggers: Use the debug console (-> click on the bug icon in trigger editor)
This will give you a truckload of info on what is the current line, what trigger matched, what the capture groups contain, what scripts ran etc..
Here is a link to the latest version of the manual that is updated regularly:
http://mudlet.git.sourceforge.net/git/g ... ml;hb=HEAD