Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Thu Feb 12, 2009 1:24 pm Post subject: |
|
|
Hi jeroen_005
You can use strings to do that. If you want to see if a certain nick IamJeroen has "Jeroen", just use this:
| Code: |
proc { ... } {
if { ([string first jeroen $nick] !=-1) } { ... }
}
|
Here's an explanation for the "string first" command:
| Quote: |
string first string1 string2
Search string2 for a sequence of characters that exactly match the
characters in string1. If found, return the index of the first character
in the first such match within string2. If not found, return -1.
|
(Taken from: http://johoho.eggheads.org/eggdrop/other/guide2tcl.html)
Which means that, in this case, if the return is different from -1, *jeroen* is in the specified nickname. You don't want the index of the first character tha tmatch the other string, so you just have to say the bot that when this is different from -1, make the procedure you'll write.
Understood that?
See ya,
Fill |
|