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.

Respond to specific nick

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Respond to specific nick

Post by starpossen »

I dont know how to make this, but im sure its possible
what im thinking of is a script where say Jack says
.dinner
The bot will then respond like
Bot gives Jack dinner

But only if Jack types the command

I know this might look or sound silly, but im just trying to learn it.
F
FossilAtrum
Voice
Posts: 2
Joined: Wed Sep 27, 2006 2:22 am

RE: Respond to specific nick

Post by FossilAtrum »

Your code would probly look something like this :

Code: Select all

bind pub - !dinner pub:dinner

proc pub:dinner {nick uhost hand channel arg} {

   set respondnick "jack"

   if {($nick == $respondnick)} {
         putserv "PRIVMSG $channel :\001ACTION gives $nick\001 dinner"
   }

}
To trigger the proc, one would type --> !dinner in the channel.

Now this is only to get you started, there is nothing fancy here, no checking of case-sensitive, no checking of nicks within lists etc. seeing as you want to learn, and wasn't asking for a full on script. (In that case, look for something like a Bar-script in the tcl-archives...)

Hope this helps

FossilAtrum
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Thanks for the quick reply, I will use this and try to add some stuff.
Post Reply