Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Gangz on December 28, 2003, 07:27 PM

Title: Wildcards...I cant find error
Post by: Gangz on December 28, 2003, 07:27 PM
 Can you guys see any errors in this on why it wouldnt work?

 If strAccess = "M" Or strAccess = "O" Then
       If LCase(Mid(message, 1, 5)) = Form1.varTrigger & "ban " Then
           message = Replace(message, Form1.varTrigger & "ban ", "")
           For i = 0 To Form1.ul.ListCount
               If LCase(message) Like LCase(Form1.ul.List(i)) Then
                   Form1.cboQueue.AddItem "/ban " & Form1.ul.List(i)
               End If
           Next i
       End If

Title: Re:Wildcards...I cant find error
Post by: UserLoser. on December 28, 2003, 08:12 PM
LCase(message) Like LCase(Form1.ul.List(i))

Switch that around, it's String Like Pattern, not Pattern Like String

What you have, would do If *bob* Like JoeBobbity - which would return false
Title: Re:Wildcards...I cant find error
Post by: Gangz on December 28, 2003, 08:17 PM
thanks user...For thos eof you that are as newbie as me it works like  this.                 If LCase(Form1.ul.List(i)) Like "*" & LCase(message) & "*" Then
Title: Re:Wildcards...I cant find error
Post by: Yoni on December 29, 2003, 08:25 AM
Quote from: Gangz on December 28, 2003, 08:17 PM
thanks user...For thos eof you that are as newbie as me it works like  this.                 If LCase(Form1.ul.List(i)) Like "*" & LCase(message) & "*" Then
Not sure what you want it to do but that looks like a bad idea. "message" might contain wildcard characters and then you might get unwanted effects. You should probably just use InStr.