| View previous topic :: View next topic |
| Author |
Message |
mopar Halfop
Joined: 26 Oct 2002 Posts: 87 Location: Grebbestad Sweden
|
Posted: Thu Jan 05, 2006 11:31 am Post subject: Help with a small tcl script that triggers on the bots nick |
|
|
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.. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jan 05, 2006 1:24 pm Post subject: |
|
|
| Code: | 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:
| Quote: | <nick> botnick bla bla
<botnick> hey nick, I got your bla bla |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
mopar Halfop
Joined: 26 Oct 2002 Posts: 87 Location: Grebbestad Sweden
|
Posted: Thu Jan 05, 2006 3:03 pm Post subject: |
|
|
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.. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jan 05, 2006 8:44 pm Post subject: |
|
|
The script worked fine for me, save it to my.tcl and put it in the scripts/ directory. In the .conf file add
| Code: | | source scripts/my.tcl |
and make sure your bot is on #testchannel and you type the text in the channel (not in private). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
mopar Halfop
Joined: 26 Oct 2002 Posts: 87 Location: Grebbestad Sweden
|
Posted: Fri Jan 06, 2006 12:11 pm Post subject: |
|
|
Ok thanks mate
/mopar _________________ It's never to late to give up.. |
|
| Back to top |
|
 |
|