Substitution

Posted by Lisev_ on Mon 20 Sep 2004 05:05 AM — 4 posts, 18,936 views.

#0
Suggestion for you Nick.

It would be cool if triggers in Mush would have substitution option. The way they would work would be for example:

Trigger: ^You are strong\.$
Flags: enabled, regular expression, keep evaluating, SUBSTITUE
Send: Wee!

The substitue flag would tell that trigger, to replace match string with 'send' field. So instead of 'You are strong' we would see 'Wee!'. Of course this can be done by the script with no problem, but then colours of other triggers won't work so if i have fancy coloured line 'Big small male human says: I rock' and like to replace Big small male human with ie. the name of that player, final output would be mono-coloured so right now its not worth a shot.

Hope you understand my point :P


Lisev
USA #1

<triggers>
  <trigger
   enabled="y"
   match="You are strong."
   omit_from_output="y"
   send_to="2"
   sequence="100"
  >
  <send>Wee!</send>
  </trigger>
</triggers>

This omits what 'You are strong.' from the output and then sends Wee! to the output instead.
You can also adjust the color that it appears on the screen by using 'Change colour and style to:' in the edit trigger window.
Amended on Mon 20 Sep 2004 10:07 AM by Norbert
#2
You didn't read carefully.

I wrote, colour of OTHER triggers.

If ie. i have a trigger that changes colour of word 'strong' into red. And i would like to substitue words 'You are' into 'Wee!', The line 'You are strong' would be monocoloured (as set in that replacement trigger) and trigger that matches and changes colour of word 'strong' has zero effect in that case since whole line is omited from output by substitute trigger and generated by it.

Lisev
USA #3
There is plenty of other problems that come into play. How would you match? What happens if you wanted to match using color? (so you can distinguish colors) what happens if there is a color change in the middle of a word? (is [Blue]Te[Red]st the same as [Blue]Test?)

Search the forums for this, youll see it come up dozens of times. And you can read all the issues with implimenting it as well.