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.
Help for those learning Tcl or writing their own scripts.
Buffy_25
Halfop
Posts: 63 Joined: Sat Nov 22, 2003 6:36 am
Post
by Buffy_25 » Tue Nov 01, 2005 7:09 am
Hello,
What i would like to do is:
When a person types a msg in the room, i would like that my bot detects when the first char of the first word of the sentence is a "["
For example
[What] do you prefer?
Then my Bot replies:
The '[' has been found!
I have the following code, but it doesn't work
Code: Select all
bind pub - * tclcode
proc tclcode {nick uhost hand chan arg} {
set firstword [lindex [split $arg] 0]
if {[string index $firstword 0]=="["} {puthelp "PRIVMSG #channel : The [ has been found! "}
}
Thank you for your help.
Buffy
avilon
Halfop
Posts: 64 Joined: Tue Jul 13, 2004 6:58 am
Location: Germany
Post
by avilon » Tue Nov 01, 2005 8:19 am
Code: Select all
bind pubm - * tclcode
proc tclcode {nick uhost hand chan arg} {
if {[string index $arg 0]=="\["} {
puthelp "PRIVMSG $chan :The \[ has been found!"
}
}
Buffy_25
Halfop
Posts: 63 Joined: Sat Nov 22, 2003 6:36 am
Post
by Buffy_25 » Tue Nov 01, 2005 9:50 am
Hi avilon.
This is working perfect if i use no colours.
If the [What] is in colour, it's not being recognized
Is this normal?
Can colours influence this?
Buffy
Buffy_25
Halfop
Posts: 63 Joined: Sat Nov 22, 2003 6:36 am
Post
by Buffy_25 » Wed Nov 02, 2005 4:41 am
Thank you very much avilon !
Working great
Buffy