# March 28, 2015
# http://forum.egghelp.org/viewtopic.php?t=19904
bind pub - "!mode" do_mode_e
proc do_mode_e {nick uhost handle chan text} {
#Check to see if user sent just !mode by itself.
if {[llength [split $text]] == 0} {
putserv "privmsg $chan :Syntax: !mode +e *!*test@test.com"
return 0
}
#Check to see if user used anything other than +e
if {[lindex [split $text] 0] ne "+e" } {
putserv "privmsg $chan :Syntax: !mode +e *!*test@test.com"
return 0
}
#Check to see if user sent just !mode +e
if {[lindex [split $text] 1] == ""} {
putserv "privmsg $chan :Syntax: !mode +e *!*test@test.com"
return 0
}
putserv "mode $chan +e [maskhost [lindex [split $text] 1] 2]"
}
First, load the script and test it. I tested only briefly, and it appeared to do what you requested.
Next, take a few minutes and click the links that I noted for you - for references.
This is a VERY simple script, and a good one for someone that wants to begin to grasp TCL for Eggdrop to study and understand.
There are probably other ideas of how to go about doing this. Some might be shorter. This was written to be easy to follow.
bind pub - !except push:except
proc push:except {nick uhost hand chan text} {
if {![botisop $chan]} return
if {[scan $text {%s%[^!]!%[^@]@%s} mode nik user host] != 4 || $mode ne "+e"} {
puthelp "PRIVMSG $chan :Syntax: !except +e *!*test@test.com"
return
} else {
pushmode $chan +e "*!*@$host"
}
}
Mode and host-mask check in place. Give this a try. Tested it on Undernet but there's no exceptions list so don't know if it pushes the exception as should.
Once the game is over, the king and the pawn go back in the same box.