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 

Eggdrop banlist to Undernet X banlist
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Jan 22, 2009 2:37 am    Post subject: Reply with quote

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

Code
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
symbian001
Voice


Joined: 17 Jan 2009
Posts: 32

PostPosted: Thu Jan 22, 2009 10:22 am    Post subject: Reply with quote

Yessssss work Fine thank you very much Smile

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


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Mon Feb 09, 2009 2:29 pm    Post subject: Reply with quote

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. Exclamation
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
View user's profile Send private message Send e-mail
symbian001
Voice


Joined: 17 Jan 2009
Posts: 32

PostPosted: Mon Feb 09, 2009 3:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Mon Feb 09, 2009 6:24 pm    Post subject: Reply with quote

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 Wink ..hehe my bad Twisted Evil

Just change that line in your copy of the script, or use the one above since i've fixed this in that one. Very Happy
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
symbian001
Voice


Joined: 17 Jan 2009
Posts: 32

PostPosted: Mon Feb 09, 2009 7:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
symbian001
Voice


Joined: 17 Jan 2009
Posts: 32

PostPosted: Mon Feb 09, 2009 7:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
symbian001
Voice


Joined: 17 Jan 2009
Posts: 32

PostPosted: Mon Feb 09, 2009 8:51 pm    Post subject: Reply with quote

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 Smile
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
Goto page Previous  1, 2
Page 2 of 2

 
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