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 

Bind msg input to be a string?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
flufsor
Voice


Joined: 22 Jan 2009
Posts: 4

PostPosted: Thu Jan 22, 2009 8:33 pm    Post subject: Bind msg input to be a string? Reply with quote

Hi,
I am trying to get my first script ready but i can't,
could use some help its probably very stupid.

Code:

set love "Do you love me Faith?"
bind pub - $love pub:love
proc pub:love {nick uhost hand chan args} {

puthelp "PRIVMSG $chan :I love you so hard $nick, you sexy beast !!!"

}

I just want the bot to respond on the string Do you love me Faith?
But i have no idea how Smile
help a newby Smile
Back to top
View user's profile Send private message
Papillon
Owner


Joined: 15 Feb 2002
Posts: 724
Location: *.no

PostPosted: Thu Jan 22, 2009 8:59 pm    Post subject: Reply with quote

we all have to start somewhere Smile
I suggest taking a look at the tcl-commands.doc that comes with your eggdrop.. lot's of nice commands in there, one you might find interesting is
Quote:
(6) PUBM (stackable)
bind pubm <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <text>

Description: just like MSGM, except it's triggered by things said
on a channel instead of things /msg'd to the bot. The mask is
matched against the channel name followed by the text and can
| contain wildcards. If the proc returns 1, Eggdrop will not log
| the message that triggered this bind. PUBM binds are processed
| before PUB binds. If the exclusive-binds setting is enabled,
| PUB binds will not be trigged by text that a PUBM bind has
| already handled.
Module: irc


one thing though:
Code:
proc pub:love {nick uhost hand chan args} {
args has a special meaning in tcl and I would us something like arg or text until you have properly learned how to handle args.
It will make no difference on your script since you are not using args further anyway, but keep it in mind if you should continue writing scripts
_________________
Elen sila lúmenn' omentielvo
Back to top
View user's profile Send private message MSN Messenger
flufsor
Voice


Joined: 22 Jan 2009
Posts: 4

PostPosted: Thu Jan 22, 2009 10:11 pm    Post subject: Reply with quote

Still don't get it, could you post an example maybe ?
Back to top
View user's profile Send private message
Papillon
Owner


Joined: 15 Feb 2002
Posts: 724
Location: *.no

PostPosted: Fri Jan 23, 2009 6:51 am    Post subject: Reply with quote

Code:
bind pubm - "* $love" pub:love

not that different as you see
_________________
Elen sila lúmenn' omentielvo
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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