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.

User CTCP finger reply

Old posts that have not been replied to for several years.
Locked
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

User CTCP finger reply

Post by Nexus6 »

Hi, I've noticed weird thing, this is from mirc:
-> [ctcp(adeline244)] FINGER
*** CTCP FINGER reply from adeline244: n/a
and eggdrop
(bot) Asking ctcp-finger from adeline244...
(bot) [00:26] CTCP reply FINGER: from adeline244 (~ident@172.134.160.147) to bot.
Finger reply is "n/a" and bot didn't get this, it's not script's fault, I've tried manually. I'd like bot get even n/a finger reply, it's common finger reply of spam drones.

Thanks for any info.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Can you paste the script, as both the CTCP binds work correclty here.
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

## Punish the people who have one of the following words in the ctcp-version reply.
set nv_versions {"n/a"}

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

## [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 "!Possible \002spam drone\002 has been detected!"

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

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

## Give what kind of warning?
set nv_warning "User has been banned from the channel"

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

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

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

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

## 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"

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

### Bindings ###

bind join - * join:nv_askver
bind ctcr - FINGER 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 :\001FINGER\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-finger from $target..."
putserv "PRIVMSG $target :\001FINGER\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 "NOTICE $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 spam drone/script $dowhat"
}
}

### End ###
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This will be because of this line

Code: Select all

set nv_versions {"n/a"}
In Tcl you, you can ,anualy create lists using the {} braces.

As such, the contents of this list is
"n/a"
Including the "'s.

You should change this value to a simple {n/a} or the more character safe {{n/a}}
Locked