| View previous topic :: View next topic |
| Author |
Message |
jdart Voice
Joined: 06 Oct 2007 Posts: 6
|
Posted: Fri Dec 28, 2007 8:58 am Post subject: preventing empty strings (only spaces) in channel |
|
|
Hello guys,
..i assume this should be easy for experienced tcl wolfs. :)
Is it possible to create a tcl snippet that will temporary (say 30 minutes) kickban person from the channel in case he/she post empty string (only spaces). For example user can post "_blah___blah_" but can't post "_" or "___" or "______" etc where _ is space. If user attempts to do so he gets kickbanned from the channel for 30 minutes with message "Please don't post empty strings. ~30 minutes ban."
Another solution might be that bot puts person on ignore for 30 minutes with the notice "Please don't post empty strings. ~30 minutes timeout."
This is all related to certain trivia bot problems where posting of empty string might allow cheating.
Happy Holidays and thanks in advance. :) |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Dec 28, 2007 4:35 pm Post subject: |
|
|
use [string trim] on their $text, something like:
| Code: |
proc myproc nick uhost hand chan text} {
set text [string trim $text]
if {$text == ""} {
#punt!
}
}
|
The general idea anyway.
Would seem to me to be a flaw in the trivia script itself to even regard empty strings at all.. Might wanna send the author a bug report about it. |
|
| Back to top |
|
 |
jdart Voice
Joined: 06 Oct 2007 Posts: 6
|
Posted: Mon Dec 31, 2007 9:42 am Post subject: |
|
|
Many thanks!  |
|
| Back to top |
|
 |
|