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.

very basic

Old posts that have not been replied to for several years.
Locked
i
indigo
Voice
Posts: 10
Joined: Fri Mar 12, 2004 2:09 pm

very basic

Post by indigo »

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?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

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"
} 
i
indigo
Voice
Posts: 10
Joined: Fri Mar 12, 2004 2:09 pm

Post by indigo »

thx :+ exactly what i needed

but what if i need a space in the 'activation text' ??

the bot doesn't seem to accept that
i
indigo
Voice
Posts: 10
Joined: Fri Mar 12, 2004 2:09 pm

Post by indigo »

can anyone help me? :+
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

indigo wrote:can anyone help me? :+
Read the difference between a PUB binding and a PUBM binding in tcl-commands.doc.
i
indigo
Voice
Posts: 10
Joined: Fri Mar 12, 2004 2:09 pm

Post by indigo »

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 avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
i
indigo
Voice
Posts: 10
Joined: Fri Mar 12, 2004 2:09 pm

Post by indigo »

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 avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
i
indigo
Voice
Posts: 10
Joined: Fri Mar 12, 2004 2:09 pm

Post by indigo »

sorry for my foolish questions... i'll try and read the document again and in more detail :)
Locked