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.

Help with a small tcl script that triggers on the bots nick

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
mopar
Halfop
Posts: 87
Joined: Sat Oct 26, 2002 3:38 pm
Location: Grebbestad Sweden

Help with a small tcl script that triggers on the bots nick

Post by mopar »

Hi,

First of all, I really don't know much about tcl coding i'm quite a n00b.

I would however like to have a small tcl to add on one of my bots that would work something like this.

If someone says the bots nick, and / or another specified word (not more than 2 in all) I would like the bot to reply with a short string.

If someone has the time and feel like it i would really apreciate if you could help me out.

Thanks in advance
mopar
It's never to late to give up..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

set word "bla bla"

bind pubm - "#yourchan $botnick $word*" reply

proc reply {nick uhost hand chan arg} {
 puthelp "privmsg $chan :hey $nick, I got your $::word"
}
Example:
<nick> botnick bla bla
<botnick> hey nick, I got your bla bla
m
mopar
Halfop
Posts: 87
Joined: Sat Oct 26, 2002 3:38 pm
Location: Grebbestad Sweden

Post by mopar »

Thank you Sir_Fz

I did not get it to work however, I saved the code into a file called "my.tcl" and added to the end of the bots conf.file

I changed your code to this;

set word "test"

bind pubm - "#testchannel $botnick $word*" reply

proc reply {nick uhost hand chan arg} {
puthelp "privmsg $chan :hey $nick, testreply $::word"
}

The bot load just fine, and i don't get a tcl error or anything, but on the other hand i don't get a reply either. What else do i need to change, and was i right by putting it in a file like is did.

Really soory for my stupid questions but I have never done anything but added already exsisting tcl's to my bots.

Apreciate the help
mopar
It's never to late to give up..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

The script worked fine for me, save it to my.tcl and put it in the scripts/ directory. In the .conf file add

Code: Select all

source scripts/my.tcl
and make sure your bot is on #testchannel and you type the text in the channel (not in private).
m
mopar
Halfop
Posts: 87
Joined: Sat Oct 26, 2002 3:38 pm
Location: Grebbestad Sweden

Post by mopar »

Ok thanks mate :)

/mopar
It's never to late to give up..
Post Reply