This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Retrieve something with !

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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!"
 }
}
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

I tried exactly your script but it didnt work. And no error message appears.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Is it also possible that the bot only reacts when a certain nick types !donate.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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).
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

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?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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: Select all

if {[string equal -nocase "youenick" $nick]} {
 # got match
}
Good luck.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

It is working now.
Thank you very much for your help Sir_Fz.
Post Reply