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.

simple code

Old posts that have not been replied to for several years.
Locked
u
up^to^you

simple code

Post by up^to^you »

hi...i want to know how to make a tcl that allow user to send my bot a text
and then my bot will say that text to the channel
the user use command like this:
/msg mybot !say saxophone

but if the text/sentence dont have "x" alphabeth/character the bot will send the nick "sorry, your sentence doesnt contain x character, please type another sentence/word that have an "x" character on it


thx for anyhelp, this maybe a simple script, but i dont know how to make the code, so i need your help :)
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

Umm, you would need to provide a bit more info is someone is going to write that script for you (I am not going to , sorry). However, here are some pointers:

1) Create a trigger that will call procedure checkforx upon reciving of a msg to bot that starts with !say:
bind msg - "!say" checkforx


2) in procedure checkforx you can check if the text that has been sent contains letter x (example given is case insensitive):

if {[regexp -nocase x $text]} { x was was found say it on channel } else {
x was not found... msg user to change the text
}

To see how to send text to channel or to a specific user, or to see exact syntax for declaration of procedure that will be called by bind msg - consult doc/tcl-commands.doc
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
Locked