All pastes #498708 Raw Edit

Shoat

public text v1 · immutable
·published 2007-05-20 16:56 UTC
rendered paste body
'Declare my variables
dim Name
dim Number
dim Holder
'Dim List()
'Set sl = StringList.NewObject()
'sl.Sorted = true
'sl.Delimiter = " "

' Gather the info
' See if the bot has said the proper thing before we begin.
if StrUtils.Contains(Msg, "plus initiative roll:") = True Then
	' parse the name and number from the Msg
	'Gather the Name from the Bot
	Name = StrUtils.NParam(2,Msg)
	Name = StrUtils.DeleteRight(Name, StrUtils.ParamCount(Name), 2)
	'Gather the score Number from the Bot
    Number = strutils.padleft(StrUtils.NParam(StrUtils.ParamCount(Msg),Msg),"0",3)
    'if number = "0" or number = "1" or  number = "2" or  number = "3" or  number = "4" or  number = "5" or  number = "6" or  number = "7" or  number = "8" or  number = "9" then number = "0" & number

	' Format the info gathered properly
	Holder =  Number & Name

	' Check for identicals scores
	'if there are any, STOP AND DO NOTHING
	if strUtils.Contains(Variables.GetVariant(List), Holder) = True then
    	Holder = ""
	end if

	' Arrange the order of the gathered scores
if Holder <> "" then
    for x = 1 to strutils.ParamCount(variables.GetVariant(List)) step 1
        Channel.command "echo 8List:" & variables.getvariant(List) & " Holder:" & Holder & " Number:" & strUtils.LeftStr(Holder,2) & " MAX:" & strutils.ParamCount(variables.GetVariant(List)) 'Just checking myself
        if Variables.GetVariant(List) = "" Then
			Variables.SetVariant List, Holder & " "
			if strutils.LeftStr(Variables.GetVariant(List),1) = " " Then strutils.LeftTrimChars Variables.GetVariant(List), 1
			exit for
		end if
		if CInt(strUtils.LeftStr(Holder, 3)) > CInt(strutils.LeftStr(strutils.NParam(x,Variables.GetVariant(List)), 3)) Then
			Variables.SetVariant List, strutils.Insert(Variables.GetVariant(List),Holder & " ", x-1)
			if strutils.LeftStr(Variables.GetVariant(List),1) = " " Then strutils.LeftTrimChars Variables.GetVariant(List), 1
			exit for
		end if
	Next

    if strUtils.Contains(Variables.GetVariant(List), Holder) = False then
    	Variables.SetVariant List, Variables.GetVariant(List) & " " & Holder
		if strutils.LeftStr(Variables.GetVariant(List),1) = " " Then strutils.LeftTrimChars Variables.GetVariant(List), 1
	end if
'***************************************
' put it in the StringList
'sl.Add( Holder )

' Sort the list
'sl.Sort

' put them in the array
'for i = sl.Count() to 0 step -1
'    Variables.GetVariant(List(i+1)) = sl.Item(i)
'next
'*******************************************
End if

'	Clean My Plate
'	<Oliver_Twist> Please, sir, may I have some more?
	Holder = ""
	Name = ""
	Number = ""

    'Place all the gathered info into order in a single string "InitOrder"
	'For x = UBound(variables.GetVariant(List())) to LBound(variables.GetVariant(List())) Step -1
	'	Variables.SetVariant initorder, variables.GetVariant(InitOrder) & Variables.GetVariant(List(x))
	'Next

	'Display the Updated Info
	Variables.SetVariant initorder, Variables.GetVariant(List)
	Channel.Command "echo 4[5The Initiative order is:7 (" & CStr(Variables.GetVariant(InitOrder)) & ")4]"

end if