Start here, and read a few posts.sotengboy wrote:... so the bot can kick ops
thank you for suggestingwillyw wrote:Start here, and read a few posts.sotengboy wrote:... so the bot can kick ops
http://forum.egghelp.org/viewtopic.php?p=87383#87383
I hope that helps.
Yes, the first parameter (which is clones-number) should be set to 0 to turn the option off.Luminous wrote:The initial "0" should be all that is required to turn it off. Or, perhaps, the +/- thing can be employed in that section, since it seems to work well for other things. Setting it to a setting higher than the server allows seems to work fine, so I'm going to leave it alone for now.
Yes it's possible, a way to do it would be to add the following lineTorrevado wrote:On "revolving door":
Would it be possible to send a private msg to users that have been banned?.
Thanks.
Code: Select all
puthelp "privmsg $nick :You've been banned from the channel for revolving-door offense."
Code: Select all
punish $pmeth [list $nick $uhost] $chan [mapr $revdoor(kmsg) "[expr {$ut-$gcj}] sec(s) revolution"] $revdoor(wmsg) $btype $btime $revdoor(klmsg) $revdoor(ktime) $revdoor(ktype) [string tolower $uhost]:revdoor
Code: Select all
set antispam(next) -1
set antispam(tip) ${my-ip}
set antispam(thost) ${my-hostname}
proc antispamcore {m h args} {
variable antispam; variable Sec
if {![info exists antispam(idx)] || ![valididx $antispam(idx)]} {
if {[info exists antispam(idx)]} {unset antispam(idx)}
if {[info exists antispam(cnick)]} {unset antispam(cnick)}
foreach {s p} [split [lindex [lindex $::servers [expr {[incr antispam(next)]%[llength $::servers]}]] 0] :] {break}
foreach c [channels] {
if {[vcg $c ap:antispam] && [lindex [split [channel get $c ap:antispam]] 0] == "+"} {
set ::my-ip $antispam(ip); set ::my-hostname $antispam(host)
control [connect $s $p] [namespace current]::antispambot
putlog "\002AP\002: AntiSpamBot: Connecting to $s:$p..."
break
}
}
return
}
set asbc 0
foreach c [channels] {
set mins [expr {[scan $m %d]+([scan $h %d]*60)}]
foreach {off greet cycle idle} [split [channel get $c ap:antispam]] {break}
if {$off == "+"} {incr asbc}
if {[onchan $antispam(cnick) $c] && $off != "+"} {
putdcc $antispam(idx) "part $c"
} elseif {$cycle != 0 && $mins%$cycle == 0 && [onchan $antispam(cnick) $c]} {
if {![info exists antispam([set e [string tolower $c]:idle])]} {set antispam($e) [unixtime]}
if {[unixtime]-$antispam($e) < $idle*60 && [botisop $c]} {
putlog "\002AP\002: AntiSpamBot: Cycling $c..."
putdcc $antispam(idx) "part $c"
putdcc $antispam(idx) "join $c"
}
} {if {![onchan $antispam(cnick) $c] && $off == "+"} {putdcc $antispam(idx) "join $c"}}
}
if {!$asbc} {
putdcc $antispam(idx) quit
putlog "\002AP\002: AntiSpamBot: Disconnected (disabled on all channels)..."
}
}
proc antispambot {idx arg} {
variable antispam; variable adv; variable greetexempts; variable antiSpamOnline
if {${::my-ip} != $antispam(tip)} {set ::my-hostname $antispam(thost); set ::my-ip $antispam(tip)}
if {$arg == ""} {
if {[info exists antispam(idx)]} {unset antispam(idx)}
if {[info exists antispam(cnick)]} {unset antispam(cnick)}
if {[info exists antiSmapOnline]} {unset antiSpamOnline}
if {[info exists antispam(qrsn)]} {set rsn $antispam(qrsn); unset antispam(qrsn)} {set rsn (dead)}
putlog "\002AP\002: AntiSpamBot: Disconnected $rsn..."
return
}
if {![info exists antispam(idx)] && ![info exists antispam(cnick)]} {
set antispam(idx) $idx ; set antispam(cnick) $antispam(nick)
putdcc $idx "user $antispam(user) 8 * :$antispam(realname)"
putdcc $idx "nick $antispam(cnick)"
return
}
if {![info exists antiSpamOnline]} {
set antiSpamOnline 1
if {[istimer [namespace current]::dumpqueues utimers]==""} {
variable Sec -1
utimer 1 [namespace current]::dumpqueues
}
}
switch -- [string tolower [lindex [split $arg] 0]] {
"ping" {putdcc $idx "pong [lindex [split $arg] 1]"}
"error" {set antispam(qrsn) [join [lrange [split $arg] 4 end]]; return}
}
switch -- [set raw [string tolower [lindex [split $arg] 1]]] {
"privmsg" - "notice" {
set src [lindex [split $arg] 0]
set asbn [lindex [split $arg] 2]
if {![string equal -nocase $asbn $antispam(cnick)]} {return}
if {[scan $src {:%[^!]!%s} nick uhost] != 2} {return}
set text [join [lrange [split $arg] 3 end]]
if {[set advword [isspam $text]] == ""} {
if {$raw == "privmsg" && [string match ":\001DCC Send *\001" $text]} {set advword "DCC SEND"}
}
if {$advword == ""} {
foreach {o s} [split $antispam(mprot) :] {break}
if {[follow $s asbm $o 1 1] != -1} {return}
set ism 0
foreach t $antispam(t) {if {[string match -nocase $t $text]} {set ism 1; break}}
set l $greetexempts(global)
set f 0; foreach ge $l { if {[string match -nocase $ge $nick!$uhost]} {set f 1;break} }
if {$ism && !$f} {asb:queue $nick [lindex $antispam(r) [rand [llength $antispam(r)]]]}
}
}
"invite" {
set src [lindex [split $arg] 0]
if {[scan $src {:%[^!]!%s} nick uhost] != 2} {return}
set advword "INVITE"
}
"001" {
putlog "\002AP\002: AntiSpamBot: Connected and registered as $antispam(cnick)."
set antispam(pong) 1; set antispam(idx) $idx
foreach c [channels] {
if {![vcg $c ap:antispam]} {continue}
if {[lindex [split [channel get $c ap:antispam]] 0] == "+"} {
putdcc $idx "join $c"
}
}
}
"433" {
if {$antispam(cnick) == $antispam(nick)} {set antispam(cnick) $antispam(altnick)} {
set antispam(cnick) [string replace $antispam(nick) end end [rand 10]]
}
putdcc $idx "nick $antispam(cnick)"
}
"nick" {
if {[string trimleft [lindex [split [lindex [split $arg] 0] @] 0] :] == $antispam(cnick)} {
set antispam(cnick) [string trimleft [lindex [split $arg] 2] :]
}
}
"join" {
foreach {o s} [split $antispam(jprot) :] {break}
set c [string trim [string tolower [string trimleft [lindex [split $arg] end] :]]]
if {![validchan $c]} {return}
foreach {off greet cy i} [split [channel get $c ap:antispam]] {break}
if {[vcg $c ap:antispam] && $off == "+"} {
if {[scan [lindex [split $arg] 0] {:%[^!]!%s} nick uhost] != 2} {return}
if {[string equal -nocase $nick $antispam(cnick)] || [follow $s asbj:$c $o 1 1] != -1} {return}
set antispam($c:idle) [unixtime]
if {[info exists greetexempts($c)]} {set l $greetexempts($c)} {set l $greetexempts(global)}
set f 0; foreach ge $l { if {[string match -nocase $ge $nick!$uhost]} {set f 1;break} }
if {!$f && $greet == "+" && ![invalid:apc $nick [finduser $nick!$uhost] $c]} {
asb:queue $nick [string map [list %nick $nick] $antispam(greet)]
}
}
}
}
^^ um, you need to add this in eggdrop.conf not in scriptI try'd adding putquick "PRIVMSG NickServ :Identify mypass" on several places in the code,
Thank you. But, I was referring to the AllProtection AntSpam bot itself, and not my actual eggdrop bot (eggdrop.conf).Anahel wrote:^^ um, you need to add this in eggdrop.conf not in scriptI try'd adding putquick "PRIVMSG NickServ :Identify mypass" on several places in the code,
look here where to put it - http://forum.egghelp.org/viewtopic.php?p=58401#58401
Code: Select all
"001" {
putlog "\002AP\002: AntiSpamBot: Connected and registered as $antispam(cnick)."
set antispam(pong) 1; set antispam(idx) $idx
# Add the identification line here:
putdcc $idx "privmsg nickserv :identify <password>"
foreach c [channels] {
if {![vcg $c ap:antispam]} {continue}
if {[lindex [split [channel get $c ap:antispam]] 0] == "+"} {
putdcc $idx "join $c"
}
}
}
Works like a charm! Thank you, Sir_Fz =)Sir_Fz wrote:@Razor: It should work if you add the identification line in the "001" clause, try something like thisCode: Select all
"001" { putlog "\002AP\002: AntiSpamBot: Connected and registered as $antispam(cnick)." set antispam(pong) 1; set antispam(idx) $idx # Add the identification line here: putdcc $idx "privmsg nickserv :identify <password>" foreach c [channels] { if {![vcg $c ap:antispam]} {continue} if {[lindex [split [channel get $c ap:antispam]] 0] == "+"} { putdcc $idx "join $c" } } }