| View previous topic :: View next topic |
| Author |
Message |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Jan 22, 2009 2:37 am Post subject: |
|
|
Welcome, and sorry for the delay.
It should be fixed now, or at least it worked for me
Code _________________ TCL the misunderstood |
|
| Back to top |
|
 |
symbian001 Voice
Joined: 17 Jan 2009 Posts: 32
|
Posted: Thu Jan 22, 2009 10:22 am Post subject: |
|
|
Yessssss work Fine thank you very much
I hop you will improve it in the future to verify every X minutes the banlist and add newest.Or when the eggdrop make a new ban hi put it in X.
Thanks again  |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Feb 09, 2009 2:29 pm Post subject: |
|
|
This is the version 2 that should do what you asked for in pvt/above. I've tested it a bit and it seems to work, so i hope this will be ok. You should be aware that this still uses the "internal" ban list for eggdrop if X isn't on the channel or the script isn't enabled for that channel. | Code: | # sbx.tcl by TCL_no_TK
set sbx_version "1.3b"
#
# Version 2 of sbx.tcl.
# This script "sends" new channel bans to X (As long as X is on the channel).
# Depending if +sbx-enable is a valid option on the channel.
# This script relays on the same "per channel" options as sbx.tcl version 1 dose.
# Please see the syntax from version 1 below.
#
# Usage: (in DCC/telnet)
#
# .chanset <#channel> +sbx-enable - will enable the script on the given channel.
# .chanset <#channel> -sbx-enable - will disable the script.
# .chanset <#channel> sbx-duration <hours> - sets the ban duration, in hours for this channel.
# .chanset <#channel> sbx-level <level> - sets the ban level, for this channel.
# .chanset <#channel> sbx-reason <reason> - sets the ban reason, to use when adding the bans
# to X for this channel.
#
# see http://cservice.undernet.org/docs/xcmds.txt for help when setting the script.
# Usage: (in DCC/telnet)
#
##
set ban-default-level "500" ;# The default ban level for the ban command in X.
set ban-default-reason "Requested" ;# The default ban reason for the ban command in X.
if {([info commands old_newchanban] != "old_newchanban")} {
rename newchanban old_newchanban
}
proc newchanban {channel ban creator {comment ""} {lifetime ""} {options ""}} {
global ban-default-level ban-default-reason
set syntax "ban"
if {($channel != "") && ($ban != "")} {
if {(![validchan "$channel"])} {
error "invalid channel: $channel"
}
if {(![string match "*!*@*" "$ban"])} {
set _ban "$ban!*@*"
} else {
set _ban "$ban"
}
if {(![channel get "$channel" "sbx-enable"])} {
if {($lifetime != "") && ($options != "")} {
return [old_newchanban $channel $ban $creator "$comment" $lifetime $options]
} elseif {($lifetime != "") && ($options == "")} {
return [old_newchanban $channel $ban $creator "$comment" $lifetime]
} elseif {($lifetime == "") && ($options != "")} {
return [old_newchanban $channel $ban $creator "$comment" $options]
} else {
return [old_newchanban $channel $ban $creator "$comment"]
}
}
if {([bansme "$ban"])} {
putlog "Wanted to ban myself--deflected."
return
}
append syntax " $channel $ban"
if {($lifetime != "") && ($lifetime != "0")} {
append syntax " $lifetime"
} else {
if {(([channel get "$channel" "sbx-duration"] != ""))} {
append syntax " [channel get "$channel" "sbx-duration"]"
}
}
if {([channel get "$channel" "sbx-level"] != "")} {
append syntax " [channel get "$channel" "sbx-level"]"
} else {
if {([info exists ban-default-level]) && (${ban-default-level} != "")} {
append syntax " ${ban-default-level}"
}
}
if {($comment != "")} {
append syntax " $comment"
} elseif {([channel get "$channel" "sbx-reason"] != "")} {
append syntax " [channel get "$channel" "sbx-reason"]"
} elseif {([info exists default-ban-reason]) && (${default-ban-reason} != "")} {
append syntax " ${default-ban-reason}"
} else {
append syntax " no reason"
}
if {([xonchan "$channel"])} {
puthelp "PRIVMSG X@channels.undernet.org :$syntax"
return
} else {
if {($lifetime != "") && ($options != "")} {
return [old_newchanban $channel $ban $creator "$comment" $lifetime $options]
} elseif {($lifetime != "") && ($options == "")} {
return [old_newchanban $channel $ban $creator "$comment" $lifetime]
} elseif {($lifetime == "") && ($options != "")} {
return [old_newchanban $channel $ban $creator "$comment" $options]
} else {
return [old_newchanban $channel $ban $creator "$comment"]
}
}
} else {
error "wrong # args: should be \"newchanban channel ban creator comment ?lifetime? ?options?\""
}
}
# used for checking if we are banning are selfs.
proc bansme {ban} {
global botnick botname
if {([string match -nocase "*$botname" "$ban"]) || ([string match -nocase "*$botnick*!*@*" "$ban"])} {
return 1
}
return 0
}
# used for checking if X is on the channel or not.
proc xonchan {channel} {
if {([onchan "X" "$channel"])} {
return 1
} else {
return 0
}
}
setudef flag sbx-enable
setudef str sbx-duration
setudef str sbx-reason
setudef str sbx-level
putlog "loaded sbx-v2.tcl version $sbx_version by TCL_no_TK"
return | I'd remove version 1 if you will be using this script. _________________ TCL the misunderstood
Last edited by TCL_no_TK on Mon Feb 09, 2009 6:25 pm; edited 1 time in total |
|
| Back to top |
|
 |
symbian001 Voice
Joined: 17 Jan 2009 Posts: 32
|
Posted: Mon Feb 09, 2009 3:41 pm Post subject: |
|
|
Thanks for your effort.
When I activate the script ( chanset <#channel> +sbx-enable ),
The eggdrop don't do any X or internal ban.
He just kick.
PS : X is present |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Feb 09, 2009 6:24 pm Post subject: |
|
|
| Quote: | if {([xonchan "$channel"])} {
puthelp "PRIVMSG #tcltest :$syntax"
return | Forgot to change that, was from when i was testing. It should be sending this to X not to #tcltest ..hehe my bad
Just change that line in your copy of the script, or use the one above since i've fixed this in that one.  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
symbian001 Voice
Joined: 17 Jan 2009 Posts: 32
|
Posted: Mon Feb 09, 2009 7:06 pm Post subject: |
|
|
I have two problems :
1 ) The duration of bans is always 62 days even if I change it.
2 ) When the ban come from my proxycheck.tcl,I get this Messenge from X : I can't find *@187.11.246.222 on channel #mychan .
It should be *!*@187.11.246.222
Do you want I send you the script ?
Last edited by symbian001 on Mon Feb 09, 2009 7:26 pm; edited 1 time in total |
|
| Back to top |
|
 |
symbian001 Voice
Joined: 17 Jan 2009 Posts: 32
|
Posted: Mon Feb 09, 2009 7:23 pm Post subject: |
|
|
| symbian001 wrote: | I have two problems :
1 ) The duration of bans is always 62 days even if I change it.
|
Resolved : The eggdrop use the origine scripts bantime.So I have just to modify ban duration in my scripts. |
|
| Back to top |
|
 |
symbian001 Voice
Joined: 17 Jan 2009 Posts: 32
|
Posted: Mon Feb 09, 2009 8:51 pm Post subject: |
|
|
| symbian001 wrote: | I have two problems :
2 ) When the ban come from my proxycheck.tcl,I get this Messenge from X : I can't find *@187.11.246.222 on channel #mychan .
It should be *!*@187.11.246.222
Do you want I send you the script ? |
Resolved
The script work very fine
thank you so much for your help  |
|
| Back to top |
|
 |
|