Matching numerous substrings.

Post Reply
User avatar
Posts: 27
Joined: Sun May 08, 2016 4:57 pm

Matching numerous substrings.

Post by Proxy »


I am a total noob to mudlet, so please bear with me.

Can anyone please tell me how to get a trigger to echo, whenevr it matches a list of substrings in a group?

For example:

0 => substring
1 *breeep* substring
2 picks up a H&K P7 substring

cecho("\n<blue:black>Someone picked up your gun!")

The above would be what I would want to have printed if substring 2 were matched, but how do I get an output for the other two, without having to create a new trigger item? I assume this would involve some if then statements, but I have no idea how to do this.

These would be the echo outputs I would want to have on the screen for the other substring matches.

cecho("\n<blue:black>Private message!") =>

cecho("\n<blue:black>Phone call!") *breeep*

I would fill out about 45 substrings and would want to get a separate echo message for all.

Thank you all for the help!

Post Reply