Trigger with multiple commands (Combination of Words)

Posted by Valentim on Thu 15 Aug 2013 06:02 PM — 4 posts, 16,058 views.

#0
How do I make a trigger according to information below:
Example: Words (Do It Do Do It)

Trigger: Words \( (. *) \)

Send:
Word = %1 -- Variable Word equal "Do It Do Do It"
Word = Replace (Word, "Do It", "DoIt") -- Variable Word equal "DoIt Do DoIt"

Then we separate the commands
Word = Split(Word, " ")

Now we have an array with the values
Word[1] = DoIt
Word[2] = Do
Word[3] = DoIt"

After sending word for word to Mud
"DoIt"
"Do"
"DoIt"

It is possible to make this trigger?
Amended on Thu 15 Aug 2013 06:08 PM by Valentim
Australia Forum Administrator #1
You could do a string.gmatch on the resulting string, and then do a "Send" on each word.
#2
I could not use the "string.gmatch", looked at some examples but is not working.

Does anyone have any other idea?
#3
Managed to create a simple form.


aWord = {}
cWord = "%2"
aWord = utils.split (cWord, " ")

for pos, value in pairs (aWord) do
  Send(value)
end -- For