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 

+e Execption TCL?

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


Joined: 15 Dec 2007
Posts: 10

PostPosted: Sat Mar 28, 2015 6:17 pm    Post subject: +e Execption TCL? Reply with quote

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?
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Mar 28, 2015 10:46 pm    Post subject: Re: +e Execption TCL? Reply with quote

Code:


# 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/1.6.21/tcl-commands.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.
Back to top
View user's profile Send private message
Smartiees
Voice


Joined: 15 Dec 2007
Posts: 10

PostPosted: Wed Apr 08, 2015 7:26 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Wed Apr 08, 2015 9:09 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Apr 08, 2015 9:47 pm    Post subject: Reply with quote

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

Smile
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Apr 08, 2015 9:50 pm    Post subject: Reply with quote

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:

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.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Apr 09, 2015 1:29 am    Post subject: Reply with quote

Code:

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