• Welcome to Valhalla Legends Archive.
 

WildCarding?

Started by TriCk, May 24, 2003, 09:08 PM

Previous topic - Next topic

TriCk

Ok It's TriCk again sorry for askin for so much help  :(
I want to know how to wildcard in code not case...
like /ban tr* and it will ban TriCk or something
Thanks

Kp

Quote from: TriCk on May 24, 2003, 09:08 PM
Ok It's TriCk again sorry for askin for so much help  :(
I want to know how to wildcard in code not case...
like /ban tr* and it will ban TriCk or something
Thanks
For each user, if the user matches your wildcarding function, enqueue a ban on that user.  Proceed to the next user and perform the text for them.  You'll need to loop through the list manually; afaik, there are no built-in functions that can wild-match.

P.S. You keep saying "in code not case": what do you mean?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

TriCk

P.S. You keep saying "in code not case": what do you mean?

i mean for Commands like:
Select Case(LCase)
Case "say"
and other stuff in here
End Select

by Code I mean:

'say command
If Username = Form2.txtMaster.Text Then
If Left((LCase(Message)), 5) = (Form2.txtTrigger.Text & "say ") Then
Dim saymessage As String
saymessage = Right(Message, (Len(Message) - 5))
CleanSlateBot1.Send saymessage
End If
End If

Kp

Quote from: TriCk on May 24, 2003, 09:37 PM
P.S. You keep saying "in code not case": what do you mean?

i mean for Commands like:
Select Case(LCase)
Case "say"
and other stuff in here
End Select


by Code I mean:

'say command
If Username = Form2.txtMaster.Text Then
If Left((LCase(Message)), 5) = (Form2.txtTrigger.Text & "say ") Then
Dim saymessage As String
saymessage = Right(Message, (Len(Message) - 5))
CleanSlateBot1.Send saymessage
End If
End If
So it's a way of saying you want us to give you code rather than an abstract description, correct?

Use [ code ] tags, btw.  They make your code easier to read and render.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

TriCk

yes i guess...   :-\
do u know how to do it ?

Kp

Quote from: TriCk on May 24, 2003, 10:27 PM
yes i guess...   :-\
do u know how to do it ?
I told you above how to do it. :)  Even ignoring that, it ought to be apparent given my works.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

TriCk

Kp i don't know how to Enqueue commands ...
How do u do that with csb ?

MrRaza

this topic has been discussed before, iirc

Search the forums for WildCard

http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=search

UserLoser

If "you should die" Like "*should*" Then MsgBox "You should die soon"

TheMinistered

#9
Yes, userlooser, you are correct.  For those of you who were to stupid to read between the lines, Userlooser is referring to the LIKE operator.  If you want to know how to use it, then, I suggest you look it up on msdn.

As to how to do a /ban tr* and have it ban user "trick"... you could have some sort of abstract data structure that i am going to call a list.  you would cycle through the list and use the LIKE operator to determine if that item in the list should be banned or not.  This thought may not be complete or right, but I'm insanely tired and I hope this helps

TriCk

Thanks for the help ill try and figure it out with the Like Commands I guess ...

Just a thought do u think something like this would be correct:



If UserName Like "a" Then
CleanSlateBot1.Send "/ban " & Username
???


iago

Like isn't a command, it's an operator.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


______

Quote from: TriCk on May 26, 2003, 12:57 AM
Thanks for the help ill try and figure it out with the Like Commands I guess ...

Just a thought do u think something like this would be correct:



If UserName Like "a" Then
CleanSlateBot1.Send "/ban " & Username
???



that wouldnt work very well u might wanna try Lcase(username) Like "a"   that would be a little better.
and also if a user joined you would flood off with that code for trying to ban the user(s) with an "a"  :-\

MrRaza

A while back i posted code that printed out the percentage of how much a string was "like" another string. Search the forums for my posts, say 3 pages back.