egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
mopar
Halfop


Joined: 26 Oct 2002
Posts: 87
Location: Grebbestad Sweden

PostPosted: Thu Jan 05, 2006 11:31 am    Post subject: Help with a small tcl script that triggers on the bots nick Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jan 05, 2006 1:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mopar
Halfop


Joined: 26 Oct 2002
Posts: 87
Location: Grebbestad Sweden

PostPosted: Thu Jan 05, 2006 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jan 05, 2006 8:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mopar
Halfop


Joined: 26 Oct 2002
Posts: 87
Location: Grebbestad Sweden

PostPosted: Fri Jan 06, 2006 12:11 pm    Post subject: Reply with quote

Ok thanks mate Smile

/mopar
_________________
It's never to late to give up..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber