• Welcome to Valhalla Legends Archive.
 

Someone help me with this!

Started by Yegg, September 29, 2004, 06:31 PM

Previous topic - Next topic

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:

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


and then i did, under userinchannel and userjoins:

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


i have no clue at all wut i do to ban the users or even wut items to add to the listbox, some1 help.

CrAz3D

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


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 *)
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

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:

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

Yegg

#3
ok, i changed my code to:

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


but now, the bot doesn't add ne to the listbox to ban them, wut do i do now?

Yegg

ok, i changed the code a little, it works now.