| View previous topic :: View next topic |
| Author |
Message |
Buffy_25 Halfop
Joined: 22 Nov 2003 Posts: 63
|
Posted: Tue Nov 01, 2005 7:09 am Post subject: Check for first char of sentence |
|
|
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
| Quote: | | [What] do you prefer? |
Then my Bot replies:
| Quote: | | The '[' has been found! |
I have the following code, but it doesn't work
| Code: |
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 |
|
| Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Tue Nov 01, 2005 8:19 am Post subject: |
|
|
| Code: | bind pubm - * tclcode
proc tclcode {nick uhost hand chan arg} {
if {[string index $arg 0]=="\["} {
puthelp "PRIVMSG $chan :The \[ has been found!"
}
} |
|
|
| Back to top |
|
 |
Buffy_25 Halfop
Joined: 22 Nov 2003 Posts: 63
|
Posted: Tue Nov 01, 2005 9:50 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
|
| Back to top |
|
 |
Buffy_25 Halfop
Joined: 22 Nov 2003 Posts: 63
|
Posted: Wed Nov 02, 2005 4:41 am Post subject: |
|
|
Thank you very much avilon !
Working great
Buffy |
|
| Back to top |
|
 |
|