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.

Kill 1st Gline 2nd

Help for those learning Tcl or writing their own scripts.
User avatar
CrazyCat
Revered One
Posts: 1215
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

the recvq is global for the server, the message could be in channel, in private or just sent to the server...
One day, I made a script to remove all glines so it did a lot of /gline -*@ip.address. It provocs exceed recvq without being on a channel.
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Yeah, but how would i make the bot catch that global server notice, and make it put it on a channel? :?
ComputerTech
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

you cant cause when they get disconnected they get disconnected from server and not from specific channels

ComputerTech wrote:Yeah, but how would i make the bot catch that global server notice, and make it put it on a channel? :?
and what does: make it put it on a channel mean ?
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

to output onto the channel using, e.g putserv :P
ComputerTech
User avatar
CrazyCat
Revered One
Posts: 1215
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

ComputerTech wrote:to output onto the channel using, e.g putserv :P
But WICH channel ? If you want to output on an admin channel, just define your channel in the script. Or hard-code it in your putserv.
Anyway, no script (or human oper) can see a recvq exceed and send a message to a channel in which was the killed user.
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Yeah, it seems i meant, that all kills made by the bot, will be sent to a specific channel.

E.g #admin will show all kills made by the eggdrop. so i changed your script to this.

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" 
            putserv "privmsg #admin :warning, Flood Happening in $c By $n"
         } 
         2 { 
            putquick "KILL $n Spamming is not allowed on TechNet" 
            putserv "privmsg #admin :Kill due to flood in $c By $n"
         } 
         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" 
      putserv "privmsg #admin :Gzline, Flood Happening in $c By $n"
   } 
}
I havent tested it yet, but will in a few :P
ComputerTech
User avatar
CrazyCat
Revered One
Posts: 1215
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Your privmsg in flud:gline proc won't work.
$c (I guess channel) and $n (nick ?) aren't defined.
You can peharps get nick fro $text (not really remember how is the raw 378 format), but you'll NEVER got the channel.
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Oh, i did not notice that CrazyCat, thank you for pointing that out :D

i guess i will do without pm'g #admin the origin channel on flud-gline *shrug*

Thanks Again CrazyCat
ComputerTech
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Is it possible to add a check, that makes the bot part the channel if no flood has happened in like 5 days, the bot will automatically part the channel, how can i add this? :?
ComputerTech
User avatar
CrazyCat
Revered One
Posts: 1215
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

It is possible, here is a short solution:

Code: Select all

setudef flag fludctrl
setudef int fludlast

set fluddelay 5 #in days
bind cron - "*/10 * * * *" fludcheck
proc fludcheck {min hour day month wd} {
   set delay [expr {$::fluddelay * 86400}]
   set now [clock seconds]
   foreach chan [channels] {
      if {[channel get $chan fludctrl] == 0} { continue }
      if {[channel get $chan fludlast]<[expr {$now - $delay}]} {
         channel remove $chan
      }
   }
}
You will have to modify your flud:ban procedure:

Code: Select all

proc flud:ban { n u h t c } {
   channel set $c fludlast [clock seconds]
   if {(![info exists ::badguy::bad($u)])} { set ::badguy::bad($u) 0 } 
...
And when you add a chan to monitor, you'll have to enable the fludctrl option on it: .chanset #channel +fludctrl
This is to allow you to have channels where the bot will stay, even if there are no flood in it.

Each time there flood is detected in $chan, the channel setting "fludlast" will have the timestamp of the last detection.
Each 10 minutes, the eggdrop will compare (for each monitored channel) the value of fludlast and the current time. If fludlast is older than 5 days, the channel is removed from the eggdrop records.

Not tested :)
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Wow, that's much better than i thought it would be, Thank you CrazyCat,
i will test it right away :D :D
ComputerTech
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

That worked Great CrazyCat, thanks a lot :D :D :D
ComputerTech
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Would this work?

Code: Select all

namespace eval badguy {
bind pub !gzline the:gzline

proc the:gzline {nick host hand chan text} {
set bnick [lindex [split $text] 0 ]
putserv "PRIVMSG $chan :GZline'n $bnick"
putnow "WHOIS $bnick" 
}
return 1

   bind raw - 378 flud:gline 
   proc flud:gline {from kw text} { 
      set host [lindex [split $text " "] end] 
      putnow "gzline *@$host +30m :Breakage of Network Policy" 
   } 
}
Not sure tbh, how to call proc flud:gline to use the whois raw :?
ComputerTech
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

I don't know yet if it will work. But here are a couple things that I did notice.

Code: Select all

bind pub !gzline the:gzline
Flags is missing.
Also, need to call the proc including the namespace:
badguy::the:gzline

bind raw - 378 flud:gline
Same. Need to call the proc using the namespace name.

Question:
Are you sure that raw 378 is what you want?

Something to consider:
Use a utimer to unbind that bind raw after xx seconds. This way it is not
operational all the time. Can't accidentally trigger.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
A
Armide83
Voice
Posts: 1
Joined: Tue Dec 22, 2020 3:16 pm

Post by Armide83 »

ComputerTech wrote: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 transfers Dieppe

that possible?

to catch the notice, and project to a specified channel
I don't understand, how can it be noticed on a particular channel?
Post Reply