| View previous topic :: View next topic |
| Author |
Message |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jan 26, 2006 5:02 pm Post subject: |
|
|
| Code: | bind pubm - * donate
proc donate {nick uhost hand chan arg} {
if {[string match -nocase *!donate* [string range $arg 0 9]]} {
puthelp "privmsg $chan :!msg Donate is OFF!"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Thu Jan 26, 2006 5:53 pm Post subject: |
|
|
| I tried exactly your script but it didnt work. And no error message appears. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jan 26, 2006 7:03 pm Post subject: |
|
|
Ok, before explaining anything, this triggers on a public message (chan msg not private). You wanted it to check the first 10 letters if they contain the word !donate; this is what this code does, so make sure "!donate" is in the first 10 letters. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Fri Jan 27, 2006 11:31 am Post subject: |
|
|
| Is it also possible that the bot only reacts when a certain nick types !donate. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jan 27, 2006 11:50 am Post subject: |
|
|
Bind to a certain flag (i.e. if you use n instead of - then the bot will only answer the global owner (who has the +n) flag). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Fri Jan 27, 2006 12:02 pm Post subject: |
|
|
But its not possible to set it with a certain name?
And that the bot considers the first 10 letters is unimportant now. But can the bot considers only the first word? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jan 27, 2006 6:25 pm Post subject: |
|
|
Don't you learn anything from what you're given here? What you've got in this thread is more than enough to teach you how to do it yourself. To check if $nick equals a certain nick use:
| Code: | if {[string equal -nocase "youenick" $nick]} {
# got match
} |
Good luck. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Sat Jan 28, 2006 9:55 am Post subject: |
|
|
It is working now.
Thank you very much for your help Sir_Fz. |
|
| Back to top |
|
 |
|