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 

no version tcl
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Plinsky
Voice


Joined: 26 Aug 2005
Posts: 7

PostPosted: Fri Aug 26, 2005 4:37 am    Post subject: no version tcl Reply with quote

hi and thanks for all scripters Smile
i have a problem for ctcp script version,it don't ban the people don't respond to version reply.
i use this tcl,there is a solution for ban they?
i am a very newbie for bot,and i have problems with some spam client with no ctcp reply.
Salute.


Code:
### Settings ###

## Punish the people who have one of the following words in the ctcp-version reply.
set nv_versions {"Excursion" "Bottler" "Masterdrone" "xdcc"}

## Ask ctcp-version if user joins one of these channels.
# Note: Set this to "" to enable punishing on all channels.
set nv_chans "#Quizzer"

## [0/1] If user has a lame IRC-client/script then punish him/her only on $nv_chans?
# Note: If this is set to 0 then the bot punish user on all channels where the bot and the user are.
set nv_onlynvchans 1

## What is the reason for the punishment?
set nv_reason "Bad Client!"

## [0/1] Kick the user?
set nv_kick 1

## [0/1] Give the user a warning?
set nv_givewarning 1

## Give what kind of warning?
set nv_warning "No lame client please!!"

## [0/1] Ban the user?
set nv_ban 1

## Ban for how long time (min)?
set nv_bantime 3

## [0/1] Ignore the user?
set nv_ignore 0

## Ignore for how long time (min)?
set nv_ignoretime 4

## What users can use the nvcheck command?
set nv_chkflag "m"

## Don't ask ctcp-version from the users with the following global flags.
set nv_globflags "m n o b"

## Don't ask ctcp-version from the users with the following channel flags.
set nv_chanflags "m n o f"

###### You don't need to edit below this ######

### Misc Things ###

set nv_ver "1.05"

### Bindings ###

bind join - * join:nv_askver
bind ctcr - VERSION ctcr:nv_ctcp
bind notc - * notc:nv_notice
bind dcc $nv_chkflag nvcheck dcc:nvcheck

### Main Procs ###

proc join:nv_askver {nick uhost hand chan} {
global botnick nv_chans nv_globflags nv_chanflags
   if {[string tolower $nick] != [string tolower $botnick]} {
      foreach globflag $nv_globflags { if {[matchattr $hand $globflag]} { return 1 } }
      foreach chanflag $nv_chanflags { if {[matchattr $hand |$chanflag $chan]} { return 1 } }
      if {($nv_chans == "") || ([lsearch -exact [split [string tolower $nv_chans]] [string tolower $chan]] != -1)} {
         putserv "PRIVMSG $nick :\001VERSION\001"
      }
   }
}

proc ctcr:nv_ctcp {nick uhost hand dest key arg} {
global botnick nv_versions nv_globflags nv_chanflags
   if {[string tolower $nick] != [string tolower $botnick]} {
      foreach version $nv_versions {
         if {[string match "*[string tolower $version]*" [string tolower $arg]]} {
            nv_punish $nick $uhost
         }
      }
   }
}

proc notc:nv_notice {nick uhost hand text {dest ""}} {
global botnick nv_versions nv_globflags nv_chanflags
if {$dest == ""} { set dest $botnick }
   if {([string tolower $nick] != [string tolower $botnick]) && ([string match "*version*" [lindex [string tolower $text] 0]])} {
      foreach version $nv_versions {
         if {[string match "*[string tolower $version]*" [lrange [string tolower $text] 1 end]]} {
            nv_punish $nick $uhost
         }
      }
   }
}

proc dcc:nvcheck {hand idx arg} {
set target [lindex [split $arg] 0]
   putcmdlog "#$hand# nvcheck $arg"
   if {$target == ""} {
      putidx $idx "Usage: .nvcheck <nick|channel>"
   } else {
      putidx $idx "Asking ctcp-version from $target..."
      putserv "PRIVMSG $target :\001VERSION\001"
   }
}

### Other Procs ###

proc nv_punish {nick uhost} {
global botnick nv_chans nv_onlynvchans nv_reason nv_kick nv_givewarning nv_warning nv_ban nv_bantime nv_ignore nv_ignoretime
set hostmask "*!*[string range $uhost [string first "@" $uhost] end]"
set dowhat ""
   if {[string tolower $nick] != [string tolower $botnick]} {
      if {$nv_givewarning} {
         lappend dowhat "giving warning"
         putserv "PRIVMSG $nick :$nv_warning"
      }
      if {($nv_ignore) && (![isignore $hostmask])} {
         lappend dowhat "ignoring"
         newignore $hostmask $botnick $nv_reason $nv_ignoretime
      }
      foreach chan [channels] {
         if {($nv_onlynvchans) && ([lsearch -exact [split [string tolower $nv_chans]] [string tolower $chan]] == -1)} { continue }
         if {($nv_ban) && (![isban $hostmask $chan]) && ([onchan $nick $chan])} {
            if {![string match "*banning*" $dowhat]} { lappend dowhat "banning" }
            newchanban $chan $hostmask $botnick $nv_reason $nv_bantime
         }
         if {($nv_kick) && ([botisop $chan]) && ([onchan $nick $chan])} {
            if {![string match "*kicking*" $dowhat]} { lappend dowhat "kicking" }
            putserv "KICK $chan $nick :$nv_reason"
         }
      }
      if {$dowhat != ""} {
         set dowhat "-- [join $dowhat " & "]"
      }
      putlog "noversions: $nick ($uhost) is using lame IRC-client/script $dowhat"
   }
}

### End ###

putlog "TCL loaded: noversions.tcl v$nv_ver by Sup"
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Aug 26, 2005 4:48 am    Post subject: Reply with quote

this punishes for sh*tlisted version replies only, not for an absence of version reply
Back to top
View user's profile Send private message Visit poster's website
Plinsky
Voice


Joined: 26 Aug 2005
Posts: 7

PostPosted: Fri Aug 26, 2005 6:12 am    Post subject: Reply with quote

yes,but for to ban on no reply?
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Aug 26, 2005 2:23 pm    Post subject: Reply with quote

Code:

set r "no version"
bind join - * foo
bind ctcr - VERSION bar
bind time - * moo
proc foo {n u h c} {
   if {[matchattr $h o|o]} return
   set ::ver($n) [list [unixtime] $u]
   puthelp "privmsg $n :\001VERSION\001"
}
proc bar {n u h d k t} {
   if {[isbotnick $d] && [info exists ::ver($n)]} {
      unset ::ver($n)
   }
}
proc moo {m h d mo y} {
   if {[info exists ::ver]} {
   foreach {n e} [array get ::ver] {
      set t [lindex $e 0]
      set u [lindex $e 1]
      if {[unixtime] - $t > 30} {
         unset ::ver($n)
         newban [maskhost $n!$u] $::nick $::r
         foreach c [channels] {
            if {[botisop $c] && [onchan $n $c]} {
               putkick $c $n $::r
            }
         }
      }
   }}
}
Back to top
View user's profile Send private message Visit poster's website
Plinsky
Voice


Joined: 26 Aug 2005
Posts: 7

PostPosted: Fri Aug 26, 2005 3:54 pm    Post subject: Reply with quote

demond many thanks,work!
But is possible an execption for op?Because someone have bnc and it don't give ctcp reply?The ban is possible in *!*@host.domain ?
Excuse me but i'm a very newbie
Very thanks for the help
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Aug 26, 2005 5:39 pm    Post subject: Reply with quote

change the [matchattr] mask to of|of and add your bnc buddies with +f flag (if you don't know how to do that, go back to reading eggdrop user manuals, this site has plenty of those)
Back to top
View user's profile Send private message Visit poster's website
Plinsky
Voice


Joined: 26 Aug 2005
Posts: 7

PostPosted: Tue Aug 30, 2005 6:52 pm    Post subject: Reply with quote

demond wrote:
change the [matchattr] mask to of|of and add your bnc buddies with +f flag (if you don't know how to do that, go back to reading eggdrop user manuals, this site has plenty of those)

I have change this setting,but the eggy version and ban all on no reply Rolling Eyes
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Aug 30, 2005 7:49 pm    Post subject: Reply with quote

Have you added users with global/channel +f flag?

Code:
.chattr <handle> [flags] [channel]

_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Plinsky
Voice


Joined: 26 Aug 2005
Posts: 7

PostPosted: Tue Aug 30, 2005 8:07 pm    Post subject: Reply with quote

yes,they are added with flag of for other tcl,only this don't "see" the setting.
I have change the ban in *!*@host.domain format and work.
Smile
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 30, 2005 9:09 pm    Post subject: Reply with quote

Plinsky wrote:
yes,they are added with flag of for other tcl,only this don't "see" the setting.
I have change the ban in *!*@host.domain format and work.
Smile


the ban mask has nothing to do with your purported problem, you must have messed up something else
Back to top
View user's profile Send private message Visit poster's website
Plinsky
Voice


Joined: 26 Aug 2005
Posts: 7

PostPosted: Tue Aug 30, 2005 10:00 pm    Post subject: Reply with quote

yes i have changed the ban mask,but the problem for the ban to +v or +o is another problem.
Other script recognize the flag,this no,ban all Laughing
I have put this script in another 2 bot for test,and i have always this problem.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Wed Aug 31, 2005 12:03 am    Post subject: Reply with quote

then you either don't have [matchattr $h of|of] in the code (which will skip the version check for users who are +o or +f, global or channel flag) or you don't have your bnc friends added with +f or +o flag, or both - either way, it's your fault, you were told how to fix that but apparently you haven't done so, so just do it and stop complaining already
Back to top
View user's profile Send private message Visit poster's website
Plinsky
Voice


Joined: 26 Aug 2005
Posts: 7

PostPosted: Wed Aug 31, 2005 9:05 am    Post subject: Reply with quote

yes now work,but only with global flag and not only channel flag.
thanks for the script but,fly down,you are not god demond Wink
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Wed Aug 31, 2005 11:05 am    Post subject: Reply with quote

add $c to that [matchattr]... and no need of further reporting your results or/and thanking again Wink
Back to top
View user's profile Send private message Visit poster's website
MrBeta
Voice


Joined: 28 Dec 2013
Posts: 35

PostPosted: Thu Mar 10, 2016 2:21 pm    Post subject: Reply with quote

Yes is a very old post but I have this useful tcl and wanted to know how to put a time of 5 minutes for ban
thank you

Code:

set r "No client version reply!"
bind join - * foo
bind ctcr - VERSION bar
bind time - * moo
proc foo {n u h c} {
   if {[matchattr $h ovf|ovf]} return
   set ::ver($n) [list [unixtime] $u]
   puthelp "privmsg $n :\001VERSION\001"
}
proc bar {n u h d k t} {
   if {[isbotnick $d] && [info exists ::ver($n)]} {
      unset ::ver($n)
   }
}
proc moo {m h d mo y} {
   if {[info exists ::ver]} {
   foreach {n e} [array get ::ver] {
      set t [lindex $e 0]
      set u [lindex $e 1]
      if {[unixtime] - $t > 30} {
         unset ::ver($n)
         newban "*!*[string range $u [string first "@" $u] end]" $::nick $::r
         foreach c [channels] {
            if {[botisop $c] && [onchan $n $c]} {
               putkick $c $n $::r
            }
         }
      }
   }}
}
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 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