Valhalla Legends Forums Archive | Battle.net Bot Development | Acces lists

AuthorMessageTime
Gangz
[code]Dim splt() As String
Dim i As Integer
Dim strAccess As String
For i = 0 To Form1.cboUsers.ListCount
splt() = Split(Form1.cboUsers.List(i), " ")
If LCase(splt(0)) = LCase(Username) Then
Select Case LCase(splt(0))
Case "M"
strAccess = "M"
Case "O"
strAccess = "O"
Case "S"
strAccess = "S"
Case "B"
strAccess = "B"
End Select
End If
Next i
While InStr(Message, " ") Or InStr(Message, ",") Or Right(Message, 1) = " "
Message = Replace(Message, " ", " ")
Message = Replace(Message, ",", " ")
If Right(Message, 1) = " " Then Message = Left(Message, Len(Message) - 1)
Wend
'''
lentrig = Len(Form1.varTrigger): givencommand = Split(UCase(Message))(0): lengiven = Len(givencommand)
If lengiven > lentrig Then
If Left(givencommand, lentrig) = Form1.varTrigger Then
upperusername = UCase(Split(Username, "#")(0))
Select Case Right(givencommand, lengiven - lentrig)
Case "SAY"
If strAccess = "M" Then Form1.Send Right(Message, (Len(Message) - 5))[/code] Wont work =\ and i cant figure out why
December 7, 2003, 7:42 AM
Stealth
[quote author=Gangz link=board=17;threadid=4126;start=0#msg34097 date=1070782959]
[code]...
If LCase(splt(0)) = LCase(Username) Then
Select Case LCase(splt(0))
Case "M"
strAccess = "M"
...
[/code][/quote]

I'm assuming your database is held as "username flags". At this point in your code you compare splt(0), or "username", to their username. If they match (and you're probably better off using StrComp() to determine this) then your Select Case statement should be applied to splt(1) ("flags").

Also, you should not be lowercasing then selecting uppercase letters.
[quote][code]...
Select Case LCase(splt(0))
Case "M"
...[/code][/quote]

Since that value was just lowercased, it can't possibly be "M".
December 7, 2003, 8:09 AM
Gangz
Wow, that was confusing as hell. From what you said I gathered that is not comparing correctly. I have tried matching many different ways and cannot get them to work. This is just was i have found to by mose effiecent and it seems as it wont work.
December 7, 2003, 8:14 AM

Search