egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

preventing empty strings (only spaces) in channel

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
jdart
Voice


Joined: 06 Oct 2007
Posts: 6

PostPosted: Fri Dec 28, 2007 8:58 am    Post subject: preventing empty strings (only spaces) in channel Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Fri Dec 28, 2007 4:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
jdart
Voice


Joined: 06 Oct 2007
Posts: 6

PostPosted: Mon Dec 31, 2007 9:42 am    Post subject: Reply with quote

Many thanks! Cool
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber