Do you know you're really lucky ?
I did a small script a few week ago to gline potential bad bots...
Here is the source:
https://gitlab.com/tcl-scripts/chan-acc ... hecker.tcl
If I adapt for your usage:
Code: Select all
namespace eval badguy {
variable bad
bind flud - pub flud:ban
proc flud:ban { n u h t c } {
if {(![info exists ::badguy::bad($u)])} { set ::badguy::bad($u) 0 }
incr ::badguy::bad($u)
switch $::badguy::bad($u) {
1 {
putquick "privmsg $n :You Are Flooding/Spamming, Please Stop Or You Will Be Network Banned"
}
2 {
putquick "KILL $n Spamming is not allowed on TechNet"
}
3 {
putnow "WHOIS $n"
unset ::badguy::bad($u)
}
}
return 1
}
bind raw - 378 flud:gline
proc flud:gline {from kw text} {
set host [lindex [split $text " "] end]
putnow "gzline *@$host +30m :Network flood"
}
}
Note that there is no security: if eggdrop receive a response to a /whois, it will gzline the user.
Small other notes:
- you decide to use a namespace but your variable was in the global namespace, so I rename it and put it in your namespace
- I changed your if / else to a switch, allowing to add more options
- the flood counter is now using incr, you don't have to set it to the next level each time
- I reserved putnow for actions needing high priority (/whois and gline), others can simply use putquick. Don't use putnow everywhere.