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 in tcl script

Old posts that have not been replied to for several years.
Locked
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

Help in tcl script

Post by Jag »

hi,

i want to build a script that if someone write 6 times "?" in a sentence the eggdrop will kick him.

this command is the same as:

Code: Select all

$count
in mirc-scripting

or the if command in mirc-scripting:

Code: Select all

if ($count($1-,?) > 6)
Thanks for the help :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

set count [regexp -all {[?]} $text]
replace text with what you got in your proc..
Once the game is over, the king and the pawn go back in the same box.
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

Post by Jag »

so, the command supposed to be:

Code: Select all

set count [regexp -all {[?]} $text]
if {$count == "6"} { ....
? :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

yes, or:

Code: Select all

if {[regexp -all {[?]} $text] > 6} { do something.. }
notice the > that indicates bigger than x.. you should use it in case someone uses more than x..
Once the game is over, the king and the pawn go back in the same box.
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

Post by Jag »

OK, 10x a lot! :P
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

your welcome. 8)
Once the game is over, the king and the pawn go back in the same box.
Locked