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.

[SOLVED] Question about the bantype "BLACKLIST"

Help for those learning Tcl or writing their own scripts.
Post Reply
R
Riddler
Halfop
Posts: 60
Joined: Sun May 20, 2007 10:20 pm
Location: Brasov, Romania
Contact:

[SOLVED] Question about the bantype "BLACKLIST"

Post by Riddler »

Hello guys, I have a little question ... I want to make a blacklist ban command ( someting like .black <nick | *!*@host> [reason] ) and I don`t know what eggdrop command to use...
newban
or
newchanban (without setting a ban time)
the result will be something like this:
<me> .black *!*test*@*
* |Eggdrop sets mode: +b *!*test*@*
<me> .iban *!*test*@*
-|Eggdrop- Ban INFO: *!*test*@* , Expire: 0 seconds , (me) (BLACKLIST) Banned!
-|Eggdrop- End Ban-INFO searching ...
this is just an example .... I`m saw this type of command on a channel... its a interesting command...the ban will never expire from the bots internal banlist .....all I need to know is what type of command to use so that example will work...

any hints.. ? :shock:
Last edited by Riddler on Sat Nov 28, 2009 8:10 pm, edited 2 times in total.
I am a man of few words, but many riddles
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Read about [newban] and [newchanban] in Tcl-commands.doc (in your eggdrop's /doc directory). One is for global bans and the other is for channel-specific bans.
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Code: Select all

# What Channels should I work on? Ex. #octagon #eggdrop 
# Leave empty to enable on all channels the bot is on.
set lmrchn ""

# How long (in minutes) do you want to ban offender(s)
# (default 2)
set lmrbt "2880"

# Flags of users who are protected (default "bomn|omn")
set lmrflg "bomnf|omnfE"

# Kick-Reason
set lmrrsn "Blacklist host, you may take a deep breath.!"

# Announce Cleanup in the channel? (default 0)
set lmrtlk "0"

# And what do we want to tell them?
# Note: Announce must be 1 for this.
set lmrtxt "Processing..."

# Enable logging? (default 0)
set lmrlog "0"

## End of the configuration. ##

set lmr(version) "V1.6"
set lmr(rdate) "Sat 01 Dec 01"

bind pub m|E !loser lmr:kb

proc lmr:kb {nick uhost hand chan who} {
   global lmrbt lmrchn lmrflg lmrrsn lmrtlk lmrtxt lmrlog botnick
   if {(($lmrchn == "") || ([lsearch -exact $lmrchn [string tolower $chan]] != -1)) } {
      if {[botisop $chan] && [isvoice $nick $chan]} {
         if { $who != "" } {
            if { $lmrtlk == "1" } { putserv "PRIVMSG $chan $lmrtxt" -next}
            foreach targets $who {   
               set bwho [nick2hand $targets $chan]
               set bmatch [matchattr $bwho $lmrflg $chan]
               set bonchan [onchan $targets $chan]
               if { [string tolower $targets] != [string tolower $botnick] && $bmatch != "1" && $bonchan == "1" } { 
                  if { $lmrtlk == "1" } { putserv "PRIVMSG $chan $lmrtxt" -next; incr lmrtlk}
                  set bhost [getchanhost $targets $chan]
  		  set banmask "*!*@[lindex [split $bhost @] 1]"
                  putserv "MODE $chan +b $banmask"
                  newchanban $chan $banmask $nick $lmrrsn $lmrbt
                  putkick $chan $targets $lmrrsn
               }
            }
            if { $lmrtlk >= "1" } { set lmrtlk "1" }            
            if { $lmrlog == "1" } { putlog "LMR: called by $nick ($hand) on $chan. ($who)" }
         }
      }
   }
}
putlog "LMR: Lamer.tcl $lmr(version) - $lmr(rdate) by acenoid (ace@clan-octagon.de) loaded sucessfully."
I don't know who wrote this tcl and when did he write it.. But I have modified this TCL and giving it you not under my name. The owner is different I simply modified it to be used on my purposes. Anyway it is a nice blacklisting TCL, you may change it on your way.

Thanks
iamdeath
|AmDeAtH @ Undernet
Death is only the *Beginning*...
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

It s lamer.tcl done by acenoid on 2001. U can find this script in the archives section of the TCL scripts http://www.egghelp.org/tclhtml/3478-4-0 ... er-tcl.htm
R
Riddler
Halfop
Posts: 60
Joined: Sun May 20, 2007 10:20 pm
Location: Brasov, Romania
Contact:

Post by Riddler »

Sir_Fz wrote:Read about [newban] and [newchanban] in Tcl-commands.doc (in your eggdrop's /doc directory). One is for global bans and the other is for channel-specific bans.
Ok...so here is are the commands.
newchanban <channel> <ban> <creator> <comment> [lifetime] [options]
Description: adds a ban to the ban list of a channel; creator is given
credit for the ban in the ban list. lifetime is specified in
minutes. If lifetime is not specified, ban-time (usually 60) is
used. Setting the lifetime to 0 makes it a permanent ban.
Options:
sticky: forces the ban to be always active on a channel, even
with dynamicbans on
none: no effect
Returns: nothing
Module: channels
newban <ban> <creator> <comment> [lifetime] [options]
Description: adds a ban to the global ban list (which takes effect on
all channels); creator is given credit for the ban in the ban list.
lifetime is specified in minutes. If lifetime is not specified,
global-ban-time (usually 60) is used. Setting the lifetime to 0 makes
it a permanent ban.

Options:
sticky: forces the ban to be always active on a channel, even
with dynamicbans on
none: no effect
Returns: nothing
Module: channels
--------------
iamdeath wrote:I don't know who wrote this tcl and when did he write it.. But I have modified this TCL and giving it you not under my name. The owner is different I simply modified it to be used on my purposes. Anyway it is a nice blacklisting TCL, you may change it on your way.

Thanks
iamdeath
interesting script....I`ll give it a try but ..
# How long (in minutes) do you want to ban offender(s)
# (default 2)
set lmrbt "2880"
newchanban $chan $banmask $nick $lmrrsn $lmrbt


It has a bantime in the command...and this means that after 48 hours that ban will expire...so not what I`m looking for ...

OK... so now let`s try to make the command work..
I am a man of few words, but many riddles
R
Riddler
Halfop
Posts: 60
Joined: Sun May 20, 2007 10:20 pm
Location: Brasov, Romania
Contact:

Post by Riddler »

OK..

So I`ve added this code for the blacklist-ban:
newchanban $chan $blhost blacklist "($hand) (BLACKLISTED) $reason" 0
and
newignore $blhost blacklist "($hand) (BLACKLISTED) $reason" 0
and when I`ve tested the script, the results are:

<@me> .black *!*@127.0.0.0 lol
* |Learn sets mode: +b *!*@127.0.0.0
<@me> .findban *!*@127.0.0.0
-|Learn- Ban INFO: *!*@127.0.0.0 , Expire: 0 seconds , (me) (BLACKLISTED) lol
-|Learn- End Ban-INFO searching ...

----
<me> .ignore
<|Learn> [00:51] #me# ignores
<|Learn> Currently ignoring:
<|Learn> [ 1] *!*@127.0.0.0 (perm)
<|Learn> ban: (me) (BLACKLISTED) lol
<|Learn> Started 00:42
---

<@me> .unban *!*@127.0.0.0
* X sets mode: -b *!*@127.0.0.0
<me> .findban *!*@127.0.0.0
-|Learn- End Ban-INFO searching ...
This is just what I was looking for :D

Thanks Sir_Fz :D 8)
I am a man of few words, but many riddles
Post Reply