'Params: Server, Channel, Sender, Msg
dim Name
dim Number
dim Holder
Dim List
if StrUtils.Contains(Msg, "plus initiative roll:") = True Then
rem parse the name and number from Msg
'Name
Name = StrUtils.NParam(2,Msg)
Name = StrUtils.DeleteRight(Name, StrUtils.ParamCount(Name), 2)
'Number
Number = StrUtils.NParam(StrUtils.ParamCount(Msg),Msg)
'Format the info
Holder = "{" & Number & "}" & Name
'Place the value in the variable
if variables.GetVariant(List) = "" then
variables.SetVariant List, variables.GetVariant(List) & holder
else
variables.SetVariant List, variables.GetVariant(List) & ", " & holder
end if
'Alphebetize the List
Dim MyArray()
for item = 0 to strutils.ParamCount(variables.GetVariant(List))
MyArray(item) = strutils.NParam((item+1), variables.GetVariant(List))
Next
MyArray.Sort
Variables.SetVariant List, ""
For each item in MyArray
if Variables.GetVariant(List) = "" then
Variables.SetVariant List, MyArray(item)
Else
Variables.SetVariant List, variables.GetVariant(List) & ", " & MyArray(item)
End if
Next
'Display the info
variables.SetVariant initorder, strutils.RemoveChars(variables.GetVariant(List), "1234567890{}")
Channel.Command "say 4[5The Initiative order is:7 (" & Variables.GetVariant(InitOrder) & ")4]"
end if