| View previous topic :: View next topic |
| Author |
Message |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Wed Aug 19, 2020 6:59 pm Post subject: Kill 1st Gline 2nd |
|
|
So just made this rough code on my mobile, it's meant to kill a user if they flood on 1st, and if they flood when they reconnect it will gline, is this code close to correct?
| Code: |
bind flud - pub flud:ban
proc flud:ban { n u h t c } {
global badguy
if {(![info exists badguy])} { set badguy "0" }
if {($badguy != "1")} {
putnow "gline $n 30m Network_Flood"
set badguy "0"
} else {
putnow "KILL $n Spamming is not allowed on TechNet"
set badguy "1"
}
}
|
i want to make this for each user, and not set a global variable
Cheers in advanced guys  _________________ ComputerTech |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Wed Aug 19, 2020 11:15 pm Post subject: |
|
|
Heh, figured it out by myself
| Code: |
bind flud - pub flud:ban
proc flud:ban { n u h t c } {
global badguy
if {(![info exists badguy])} { set badguy "0" }
if {($badguy == "1")} {
putnow "gline $n 30m Network_Flood"
set badguy "0"
} else {
putnow "KILL $n Spamming is not allowed on TechNet"
set badguy "1"
}
}
|
And of course, all is welcome to edit and give ideas to improve  _________________ ComputerTech |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Thu Aug 20, 2020 2:15 am Post subject: |
|
|
Well, your script will gline a lot of flooders:
If UserA floods, the proc is called and badguy is set to 1.
If anyone else floods, the proc is called again and then, he's glined, even if he's not UserA.
Here is a way to make it gline the user already advertised, by using his host as key for $badguy
| Code: | bind flud - pub flud:ban
proc flud:ban { n u h t c } {
if {(![info exists ::badguy($u)])} { set ::badguy($u) 0 }
if {($::badguy($u) == "1")} {
putnow "gline $n 30m Network_Flood"
set ::badguy($u) 0
} else {
putnow "KILL $n Spamming is not allowed on TechNet"
set ::badguy($u) 1
}
} |
I didn't correct your gline command which won't work, the gline syntax is gline host duration :reason _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Thu Aug 20, 2020 9:05 am Post subject: |
|
|
Cheers CrazyCat, what about ip? if i wanted to gzline them, what would i change?
Thanks in advanced for effort  _________________ ComputerTech |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Thu Aug 20, 2020 9:59 am Post subject: |
|
|
Um, your version didn't work until I added a namespace, now it works Perfect
| Code: |
namespace eval ::badguy {
bind flud - pub flud:ban
proc flud:ban { n u h t c } {
if {(![info exists ::badguy($u)])} { set ::badguy($u) 0 }
if {($::badguy($u) == "3")} {
putnow "gline $n 30m Network_Flood"
set ::badguy($u) 0
} else {
putnow "KILL $n Spamming is not allowed on TechNet"
set ::badguy($u) 1
}
if {($::badguy($u) == "2")} {
putnow "privmsg $n :You Are Flooding/Spamming, Please Stop Or You Will Be Network Banned"
} else {
return
}
}
} |
Cheers CrazyCat  _________________ ComputerTech |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Thu Aug 20, 2020 10:32 am Post subject: |
|
|
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-access-filter/-/blob/master/checker.tcl
If I adapt for your usage:
| Code: | 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. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Aug 20, 2020 11:16 am Post subject: |
|
|
Don't know why you need to issue the whois since you already got the host in the flud proc, but why not move the unset in the flud:gline proc and with a if you can also make sure you don't punish innocent people. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Thu Aug 20, 2020 12:12 pm Post subject: |
|
|
Sorry, but the flud proc only have the cloacked IP, you have to do a whois to get the real IP and then be able to gline/gzline. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Thu Aug 20, 2020 6:16 pm Post subject: |
|
|
Thanks CrazyCat! i'll go test it to be sure, and report back
*salute* _________________ ComputerTech
Last edited by ComputerTech on Mon May 17, 2021 8:24 pm; edited 1 time in total |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Thu Aug 20, 2020 6:19 pm Post subject: |
|
|
So just to be sure, if i want to add more options do i do it like this?
| Code: |
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 {
putquick "privmsg $chan :your a sucker, you know that?"
}
4 {
putnow "WHOIS $n"
unset ::badguy::bad($u)
}
}
return 1
} |
If so, that is super duper awesome  _________________ ComputerTech |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Fri Aug 21, 2020 9:17 am Post subject: |
|
|
Sweeeettt
Thanks a lot CrazyCat  _________________ ComputerTech |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Fri Aug 21, 2020 7:28 pm Post subject: |
|
|
Is it possible if the bot has snomask +f, and a user exceed's recvq limit, that the bot joins the channel the user exceeded the recvq limit?
Cheers in advanced
Unrealircd 5.0.5.1
Anope 2.0.7 _________________ ComputerTech |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Aug 22, 2020 9:23 am Post subject: |
|
|
| no not possible cause it cannot determine the channel |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Sat Aug 22, 2020 9:51 am Post subject: |
|
|
Hmm, i guessed that, what of the notice or excessive flood, can it be noticed to a particular channel?
for example
Excessive Flood by guest123
on #test
Guest123 did Excessive Flood
that possible?
to catch the notice, and project to a specified channel _________________ ComputerTech |
|
| Back to top |
|
 |
|