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.
Old posts that have not been replied to for several years.
indigo
Voice
Posts: 10 Joined: Fri Mar 12, 2004 2:09 pm
Post
by indigo » Thu Apr 01, 2004 11:41 am
i need a very basic script... your say "hello" for example (in the channel) and the bot then says "good day $nick" ... could someone give me a line of code on how to do this?
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Thu Apr 01, 2004 12:17 pm
Ok, here it is:
Code: Select all
bind pub -|- "hello" pub:hello
proc pub:hello {nick host handle chan arg} {
putquick "PRIVMSG $chan :Good Day $nick"
}
indigo
Voice
Posts: 10 Joined: Fri Mar 12, 2004 2:09 pm
Post
by indigo » Thu Apr 01, 2004 3:39 pm
thx :+ exactly what i needed
but what if i need a space in the 'activation text' ??
the bot doesn't seem to accept that
indigo
Voice
Posts: 10 Joined: Fri Mar 12, 2004 2:09 pm
Post
by indigo » Fri Apr 02, 2004 3:10 am
can anyone help me? :+
egghead
Master
Posts: 481 Joined: Mon Oct 29, 2001 8:00 pm
Contact:
Post
by egghead » Fri Apr 02, 2004 5:09 am
indigo wrote: can anyone help me? :+
Read the difference between a PUB binding and a PUBM binding in tcl-commands.doc.
indigo
Voice
Posts: 10 Joined: Fri Mar 12, 2004 2:09 pm
Post
by indigo » Fri Apr 02, 2004 7:43 am
i'll do that, thx for the pointer
[edit]
i tried
Code: Select all
bind pubm -|- "hello little bot" pub:bot
proc pub:bot {nick host handle chan arg} {
putquick "PRIVMSG $chan :hello to you too" }
but it doesn't seem to do the trick, what did i do wrong? oh yeah, already tried replacing pub:bot with pubm:bot ... i don't know how that affects tcl, but it doesn't work either...
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Fri Apr 02, 2004 10:10 am
indigo wrote: Code: Select all
bind pubm -|- "hello little bot" pub:bot
tcl-commands.doc wrote: The mask is matched against the channel name followed by the text and can contain wildcards.
...so try including a % to match any channel name, or include the name of the channel you want the script to work in.
Code: Select all
bind pubm - "% hello little bot" pub:bot
Have you ever read "The Manual"?
indigo
Voice
Posts: 10 Joined: Fri Mar 12, 2004 2:09 pm
Post
by indigo » Fri Apr 02, 2004 12:43 pm
so % is a wildcard in tcl? and i can type %hello% to fetch any sentence containing hello? ok
[update]
hello% seems to work, but 'how%doing' doesn't when i type 'how are you doing' ... what's up with that?
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Fri Apr 02, 2004 1:06 pm
Check the end of tcl-commands.doc...
? matches any single character
* matches 0 or more characters of any type
% matches 0 or more non-space characters (can be used to match a single word)
~ matches 1 or more space characters (can be used for whitespace between words)
Have you ever read "The Manual"?
indigo
Voice
Posts: 10 Joined: Fri Mar 12, 2004 2:09 pm
Post
by indigo » Fri Apr 02, 2004 1:08 pm
sorry for my foolish questions... i'll try and read the document again and in more detail