Yeah, that trigger was script-less, it was just the trigger. I figured I might as well post that, since I needed to ask you what language anyway.
This is what I have thus far for the script (obviously it doesn't work).
The problem (as far as I can tell) is the trigger. Since it's not returning one word per wildcard. The commented lines (at the beginning) should (once everything works correctly) have one word per line.
I'm going to reread some of the basics of MC and scripts, since obviously I'm forgetting something (there are always 10 array pieces passed, regardless of how many wildcards there actually are?).
If that's true, then it looks like doing it via send to script may end up being more convenient (and feasible) anyway.
Option Explicit
Sub colorize (sName, sLine, aryWild)
dim size
dim Colored
dim codes
'DEBUG TRIGGER
' for i = LBound(aryWild) to UBound(aryWild)
' note i & ": " & aryWild(i)
' next
codes = Array("^o","^W","^^") 'color codes
size = UBound(aryWild) '1+3X+1?
'except its length-1, so we dont need to
'subtract the 1 for the say/ic/yell
Colored = aryWild(1)
dim i
For i = 2 to size Step 3
'aryWild(i) whole thing
'aryWild(i+1) whitespace
'aryWild(i+2) word
Colored = Colored & aryWild(i+1)
Colored = Colored & codes(((i-1) mod 9)/(UBound(codes)+1))
'append the color code (i-1) mod 9 is 0,3,6
'divided by codes length (Ubound + 1) gives a corresponding
'array element (0,1,2), this way you can simply change the
'codes aray and not have to change anything else
Colored = Colored & aryWild(i+2) 'append word
Next
Colored = Colored & aryWild(size) 'last bit
Send Colored 'can't forget this
End Sub
|