| View previous topic :: View next topic |
| Author |
Message |
Smartiees Voice
Joined: 15 Dec 2007 Posts: 10
|
Posted: Sat Mar 28, 2015 6:17 pm Post subject: +e Execption TCL? |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Mar 28, 2015 10:46 pm Post subject: Re: +e Execption TCL? |
|
|
| 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 |
|
 |
Smartiees Voice
Joined: 15 Dec 2007 Posts: 10
|
Posted: Wed Apr 08, 2015 7:26 pm Post subject: |
|
|
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 |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Wed Apr 08, 2015 9:09 pm Post subject: |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Apr 08, 2015 9:47 pm Post subject: |
|
|
whew...
Thank you, Spike.
I thought I was going cross-eyed there for a moment. Glad to know that I did read it correctly.
 |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Apr 08, 2015 9:50 pm Post subject: |
|
|
| 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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Apr 09, 2015 1:29 am Post subject: |
|
|
| 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 |
|
 |
|