Valhalla Legends Forums Archive | Visual Basic Programming | Someone help me with this!

AuthorMessageTime
Yegg
In another post i started about wildcards, ppl told me to use either InStr() or Like
Neither of these r working bcuz i have no clue how to do them the correct way.
I tried using like and hers the code i used:

[code]If LCase(splt(0)) = Trigger & "own" And LCase(username) = Master Then
lstWild.AddItem splt(1)
End If
GoTo Done277
Done277:[/code]

and then i did, under userinchannel and userjoins:

[code]If username Like "* " & lstWild.List(0) & " *" Then
lstWild.AddItem username
Form1.tmrWild.Interval = "3000"
Form1.tmrWild.Enabled = True
End If[/code]

i have no clue at all wut i do to ban the users or even wut items to add to the listbox, some1 help.
September 29, 2004, 11:31 PM
CrAz3D
[code]Dim x as integer
If LCase(splt(0)) = Trigger & "own" And LCase(username) = Master Then
For x=1 to CHANNELLIST.ListItems.Count (assuming you're using a listview for your channel list)
if lcase(channellist.listitems.item(x)) Like lcase(splt(1))  then
'ban that boob
end if
next x
[/code]

Now this will only work if you use a listview for your channel list.


Basically what it does though is checks your channellist for the username or wildcarded name that you are looking for.  splt(1) would be something like CrA* or *Az*... the USER IN THE BNET CHANNEL supplies you with that info(including the *)
September 29, 2004, 11:46 PM
Yegg
ok, ty for the code, but im getting an error, and i've never used my code the way u have, so mayb u'll know wut it is:

Compile Error:

Next without For


heres my code:

[code]Dim x As Integer
If LCase(splt(0)) = Trigger & "own" And LCase(username) = Master Then
For x = 1 To lvChannel.ListItems.Count
If LCase(lvChannel.ListItems.Item(x)) Like LCase(splt(1)) Then
lstWild.AddItem username
Form1.tmrWild.Interval = "5000"
Form1.tmrWild.Enabled = True
Form1.tmrWild2.Interval = "5000"
Form1.tmrWild2.Enabled = True
Form1.tmrWild3.Interval = "5000"
Form1.tmrWild3.Enabled = True
Next x:
End If[/code]
September 29, 2004, 11:52 PM
Yegg
ok, i changed my code to:

[code]Dim x As Integer
If LCase(splt(0)) = Trigger & "own" And LCase(username) = Master Then
For x = 1 To lvChannel.ListItems.Count
If LCase(lvChannel.ListItems.Item(x)) Like LCase(splt(1)) Then
lstWild.AddItem username
Form1.tmrWild.Interval = "5000"
Form1.tmrWild.Enabled = True
Form1.tmrWild2.Interval = "5000"
Form1.tmrWild2.Enabled = True
Form1.tmrWild3.Interval = "5000"
Form1.tmrWild3.Enabled = True
End If
Next x:
x:
End If[/code]

but now, the bot doesn't add ne to the listbox to ban them, wut do i do now?
September 30, 2004, 12:02 AM
Yegg
ok, i changed the code a little, it works now.
September 30, 2004, 1:56 AM

Search