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.

preventing empty strings (only spaces) in channel

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
j
jdart
Voice
Posts: 6
Joined: Sat Oct 06, 2007 6:50 pm

preventing empty strings (only spaces) in channel

Post by jdart »

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. :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

use [string trim] on their $text, something like:

Code: Select all

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.
j
jdart
Voice
Posts: 6
Joined: Sat Oct 06, 2007 6:50 pm

Post by jdart »

Many thanks! 8)
Post Reply