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.

Eggdrop banlist to Undernet X banlist

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Welcome, and sorry for the delay.
It should be fixed now, or at least it worked for me :P

Code
s
symbian001
Voice
Posts: 32
Joined: Sat Jan 17, 2009 1:13 pm

Post by symbian001 »

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 :)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

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: Select all

# 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.
Last edited by TCL_no_TK on Mon Feb 09, 2009 6:25 pm, edited 1 time in total.
s
symbian001
Voice
Posts: 32
Joined: Sat Jan 17, 2009 1:13 pm

Post by symbian001 »

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
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

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 :twisted:

Just change that line in your copy of the script, or use the one above since i've fixed this in that one. :D
s
symbian001
Voice
Posts: 32
Joined: Sat Jan 17, 2009 1:13 pm

Post by symbian001 »

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.
s
symbian001
Voice
Posts: 32
Joined: Sat Jan 17, 2009 1:13 pm

Post by symbian001 »

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.
s
symbian001
Voice
Posts: 32
Joined: Sat Jan 17, 2009 1:13 pm

Post by symbian001 »

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 :)
Post Reply