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.

+e Execption TCL?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
S
Smartiees
Voice
Posts: 10
Joined: Sat Dec 15, 2007 2:15 pm

+e Execption TCL?

Post by Smartiees »

is there any tcl available which about like if you type:

!mode +e *!*test@test.com

then bot set it that IP as like:

nomnom sets mode: +e *!*@test.com

is there available or anyone can make that code please?
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: +e Execption TCL?

Post by willyw »

Code: Select all


# 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]"

}

References:
http://www.eggheads.org/support/egghtml ... mands.html
http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm

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.

I hope this helps.
S
Smartiees
Voice
Posts: 10
Joined: Sat Dec 15, 2007 2:15 pm

Post by Smartiees »

its work but its not the set ident:

(09:02:26) <Salafi> !mode +e *!*test@test.com
(09:02:26) * uhud sets mode: +e *!*@test.com

its should be like:
* uhud sets mode: +e *!*test@test.com
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Yes, but it exactly what you asked for:)
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

whew...
Thank you, Spike.
I thought I was going cross-eyed there for a moment. Glad to know that I did read it correctly.

:)
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Smartiees wrote:
...
its should be like:
* uhud sets mode: +e *!*test@test.com

See tcl-commands.doc at the link I've already posted in this thread.

Text search tcl-commands.doc for:
maskhost
and read that section.

Then examine this line in the script:

Code: Select all

putserv "mode $chan +e [maskhost [lindex [split $text] 1] 2]" 
and experiment with changing the type number that of the maskhost command.
Are you wanting number 3 ?

I hope this helps.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

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.
Post Reply