• Welcome to Valhalla Legends Archive.
 

WildCards & Weird Repition

Started by CrAz3D, February 16, 2004, 09:44 AM

Previous topic - Next topic

CrAz3D

My wild card function will kick or ban the user I am looking for, however it will keep repeating the ban/kick the same user for the rest of the # of the channel users after the username is found then will go onto the next user.

Public Function WildBan(Username As String, Position As String, Thing As String)
On Error Resume Next
Dim user As String, sUser As String, intUser As Integer, iY As Integer
intUser = Len(Username)
For iY = 1 To Form1.RoomList.ListItems.Count
   sUser = Form1.RoomList.ListItems(iY).text
   sUser = LCase(sUser)
   Username = LCase(Username)

If Left(sUser, intUser) = Username Or Right(sUser, intUser) = Username Or Mid(sUser, intUser) Then

If Left(sUser, intUser) = Username And Position = "Right" Then
   user = sUser
ElseIf Right(sUser, intUser) = Username And Position = "Left" Then
   user = sUser
ElseIf InStr(sUser, Username) > 0 And Position = "Mid" Then
   user = sUser
End If

End If

Select Case LCase(Thing)
   Case "ban"
       Ban user, " (WILDCARD Ban)"
   Case "kick"
       Send "/kick " & user, True
       
End Select
   Next iY


End Function


Any HELP is apreciated.
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 ...

o.OV

place your case selection inside the if then block
and you should learn how to debug..
for starters.
learn to NOT use "On Error Resume Next"
If the facts don't fit the theory, change the facts. - Albert Einstein

Stealth

Yes, you can't even begin to figure out what's wrong until you remove On Error Resume Next.
- Stealth
Author of StealthBot