egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

adding exemp on massconect

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Mon Jul 12, 2021 9:21 am    Post subject: adding exemp on massconect Reply with quote

Is possible to add exemp user to this script written by CrazyCat? Who are connected from webirc or *.irccloud.com and *.mibbit.com and secure connection and the bot dont send msg in channel when is match user client from this class, if i have netsplit or service down ?

as protected user on connect

Code:

set protect(user) "isweb  secure  *.irccloud.com *.mibbit.com"

foreach protect(user) $::protect(user)
if {[string match -nocase $protect(user) $mhrp(nicks)]}


Here the script

Code:

set mhrp(flood) 10:5
set mhrp(nicks) {}
set mhrp(on) 0

set commChan "#services"

bind raw - NOTICE massconnectflood
proc massconnectflood {frm key text} {
   if { $::mhrp(on) == 1 } { return }
   if {[string match *!*@* $frm] || ![string match -nocase "*client connecting*" $text]} { return }
   regexp {:\ ([^ ]+)\s\(([^@]+)@([^\)])+\)\s\[([^\]]+)} $text - nick ident host ip
   set target [split $::mhrp(flood) :]
   set max [lindex $target 0]
   set seconds [lindex $target 1]
   lappend ::mhrp(nicks) $nick
   # we append $mhrp(nicks) with the new connection
   utimer $seconds [list lreplace $::mhrp(nicks) [lsearch $::mhrp(nicks) $nick] [lsearch $::mhrp(nicks) $nick]]
   # we will remove this entry in $seconds (5)
   if {[llength $::mhrp(nicks)] >= $max} {
      # comparing size of mhrp(nicks) and target
      puthelp "PRIVMSG $::commChan :!gline on"
      set ::mhrp(on) 1
      timer 10 [list massconnectunflood]
   }
}

proc massconnectunflood {} {
   putserv "PRIVMSG $::commChan :!gline off"
   set ::mhrp(on) 0
}
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Mon Jul 12, 2021 10:06 am    Post subject: Reply with quote

Did you try by yourself ? Looks like you have 99% of the elements.

Code:
set mhrp(flood) 10:5
set mhrp(nicks) {}
set mhrp(on) 0
set mhrp(exclude) {"*isweb*" "*secure*" "*.irccloud.com" "*.mibbit.com"}

set commChan "#services"

bind raw - NOTICE massconnectflood
proc massconnectflood {frm key text} {
   if { $::mhrp(on) == 1 } { return }
   if {[string match *!*@* $frm] || ![string match -nocase "*client connecting*" $text]} { return }
   regexp {:\ ([^ ]+)\s\(([^@]+)@([^\)])+\)\s\[([^\]]+)} $text - nick ident host ip
   foreach exclude $::mhrp(exclude) {
      if {[string match -nocase $exclude $host] } { return }
   }
   set target [split $::mhrp(flood) :]
   set max [lindex $target 0]
   set seconds [lindex $target 1]
   lappend ::mhrp(nicks) $nick
   # we append $mhrp(nicks) with the new connection
   utimer $seconds [list lreplace $::mhrp(nicks) [lsearch $::mhrp(nicks) $nick] [lsearch $::mhrp(nicks) $nick]]
   # we will remove this entry in $seconds (5)
   if {[llength $::mhrp(nicks)] >= $max} {
      # comparing size of mhrp(nicks) and target
      puthelp "PRIVMSG $::commChan :!gline on"
      set ::mhrp(on) 1
      timer 10 [list massconnectunflood]
   }
}

proc massconnectunflood {} {
   putserv "PRIVMSG $::commChan :!gline off"
   set ::mhrp(on) 0
}

_________________
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
View user's profile Send private message Visit poster's website
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Mon Jul 12, 2021 10:12 am    Post subject: Hello Reply with quote

Great thx again CrazyCat
I Will test and i will let u know, thx again for ur patiance and time u spend to help.
Back to top
View user's profile Send private message
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Mon Jul 12, 2021 10:35 am    Post subject: hi Reply with quote

Now is send msg on chan before 10 connection, what is wrong ? like is countinue the count from the first 10 connect test maybe ? need to stop remove the 10 first connect counts, so can start count again the new 10 connection not 9+1 or 3+7 connection ?

Maybe is save nick and remember and send msg again or maybe need to be new conection nick ? so the right way is to match 10 connect not the ip who make bot send the msg trigger command

Code:

[17:32:28] <@InfoServ> USERS: Lethia!lethia@192.111.139.165 (32F07FFA.6BCFB625.C64C234B.IP) (Lethia) connected to the network
[17:32:28] <~X> !gline on
[17:32:29] <@InfoServ> USERS: Consuelo!consuelo@70.166.167.36 (69A377EE.4D4B93C6.9A1EF8E8.IP) (Consuelo) connected to the network
[17:32:29] <@InfoServ> USERS: Yvette!yvette@174.75.211.222 (13CFE653.EE5CFFC7.B83C2445.IP) (Yvette) connected to the network
[17:32:29] <@InfoServ> USERS: Margalit!margalit@184.181.217.204 (3CB0D412.B908AD8E.61D77C1C.IP) (Margalit) connected to the network
[17:32:29] <@InfoServ> USERS: Jenifer!jenifer@72.221.164.34 (715394D6.28271C50.C0D4321D.IP) (Jenifer) connected to the network
[17:32:30] <@InfoServ> USERS: Lynde!lynde@98.188.47.150 (BE059E5C.6EC7BCE1.4EDF4AE9.IP) (Lynde) connected to the network
[17:32:30] <@InfoServ> USERS: Del!del@72.221.196.145 (5A95481C.1159A157.C0D4321D.IP) (Del) connected to the network
[17:32:30] <@InfoServ> USERS: Sallyann!sallyann@91.219.237.21 (377F4C23.EF3571FD.E9DC59F1.IP) (Sallyann) connected to the network
[17:32:30] <@InfoServ> USERS: Dorree!dorree@192.111.137.35 (E020523E.ACDA578F.C64C234B.IP) (Dorree) connected to the network
[17:32:30] <@InfoServ> USERS: Isadora!isadora@98.185.94.76 (EE5C3F4.A9D4D4FB.3EDCEB4C.IP) (Isadora) connected to the network



Code:

[17:56:00] <~X> !gline off
[18:05:12] <~X> !gline on
[18:05:12] <@InfoServ> USERS: Bebe!bebe@192.111.139.165 (32F07FFA.6BCFB625.C64C234B.IP) (Bebe) connected to the network
[18:05:12] <@InfoServ> USERS: Leanna!leanna@70.166.167.36 (69A377EE.4D4B93C6.9A1EF8E8.IP) (Leanna) connected to the network
[18:05:12] <@InfoServ> USERS: Dorothy!dorothy@72.221.164.34 (715394D6.28271C50.C0D4321D.IP) (Dorothy) connected to the network
[18:05:12] <@InfoServ> USERS: Gillie!gillie@98.188.47.150 (BE059E5C.6EC7BCE1.4EDF4AE9.IP) (Gillie) connected to the network
[18:05:13] <@InfoServ> USERS: Katherine!katherine@184.181.217.204 (3CB0D412.B908AD8E.61D77C1C.IP) (Katherine) connected to the network
[18:05:13] <@InfoServ> USERS: Korie!korie@174.75.211.222 (13CFE653.EE5CFFC7.B83C2445.IP) (Korie) connected to the network
[18:05:13] <@InfoServ> USERS: Alejandrina!alejandrin@72.221.196.145 (5A95481C.1159A157.C0D4321D.IP) (Alejandrina) connected to the network
[18:05:14] <@InfoServ> USERS: Dorry!dorry@98.185.94.76 (EE5C3F4.A9D4D4FB.3EDCEB4C.IP) (Dorry) connected to the network
[18:05:14] <@InfoServ> USERS: Elene!elene@192.111.137.35 (E020523E.ACDA578F.C64C234B.IP) (Elene) connected to the network
[18:05:14] <@InfoServ> USERS: Eba!eba@ip72-212-63-101.ph.ph.cox.net (Test-DCB94153.ph.ph.cox.net) (Eba) [72.212.63.101] connected to the network
[18:05:16] <@InfoServ> USERS: Zoe!zoe@ninox.hoo.st (Test-CB0AC1FF.hoo.st) (Zoe) [142.44.136.197] connected to the network



here saving ip on connect is trigger the bot to send msg before new comes 10 connect how to fix this to not save ip or $host ?

Code:


[18:11:53] <@InfoServ> USERS: Tomasine!tomasine@72.221.164.34 (715394D6.28271C50.C0D4321D.IP) (Tomasine) connected to the network
[18:11:53] <@InfoServ> USERS: Hesther!hesther@70.166.167.36 (69A377EE.4D4B93C6.9A1EF8E8.IP) (Hesther) connected to the network
[18:11:53] <@InfoServ> USERS: Elvina!elvina@174.75.211.222 (13CFE653.EE5CFFC7.B83C2445.IP) (Elvina) connected to the network
[18:11:53] <@InfoServ> USERS: Ardra!ardra@98.188.47.150 (BE059E5C.6EC7BCE1.4EDF4AE9.IP) (Ardra) connected to the network
[18:11:53] <@InfoServ> USERS: Leta!leta@184.181.217.204 (3CB0D412.B908AD8E.61D77C1C.IP) (Leta) connected to the network
[18:11:54] <@InfoServ> USERS: Cris!cris@vps-3e661acc.vps.ovh.net (Test-AE99745C.vps.ovh.net) (Cris) [51.68.197.220] connected to the network
[18:11:54] <@InfoServ> USERS: Clea!clea@72.221.196.145 (5A95481C.1159A157.C0D4321D.IP) (Clea) connected to the network
[18:11:55] <@InfoServ> USERS: Leonelle!leonelle@ip72-212-63-101.ph.ph.cox.net (Test-DCB94153.ph.ph.cox.net) (Leonelle) [72.212.63.101] connected to the network
[18:11:55] <@InfoServ> USERS: Calla!calla@tor-exit-ro.letztermensch.com (Test-40301E9A.letztermensch.com) (Calla) [185.247.224.14] connected to the network
[18:11:55] <@InfoServ> USERS: Joelle!joelle@98.185.94.76 (EE5C3F4.A9D4D4FB.3EDCEB4C.IP) (Joelle) connected to the network
[18:11:55] <~X> !gline on
[18:21:00] <~X> !gline off
[18:22:50] <@InfoServ> USERS: Deonne!deonne@192.111.139.165 (32F07FFA.6BCFB625.C64C234B.IP) (Deonne) connected to the network
[18:22:50] <@InfoServ> USERS: Tiffy!tiffy@72.221.164.34 (715394D6.28271C50.C0D4321D.IP) (Tiffy) connected to the network
[18:22:50] <@InfoServ> USERS: Linnie!linnie@70.166.167.36 (69A377EE.4D4B93C6.9A1EF8E8.IP) (Linnie) connected to the network
[18:22:51] <@InfoServ> USERS: Lonni!lonni@184.181.217.204 (3CB0D412.B908AD8E.61D77C1C.IP) (Lonni) connected to the network
[18:22:51] <@InfoServ> USERS: Elfrida!elfrida@174.75.211.222 (13CFE653.EE5CFFC7.B83C2445.IP) (Elfrida) connected to the network
[18:22:51] <~X> !gline on


this way Bot read ircd notice on connect

Code:

[18:41:37] <X> [17:41:37] -NOTICE- *** Client connecting: Coralyn (coralyn@192.111.139.165) [192.111.139.165] [class: clients] [reputation: 1444]
[18:41:37] <X> [17:41:37] -NOTICE- *** Client connecting: Ramona (ramona@70.166.167.36) [70.166.167.36] [class: clients] [reputation: 1777]
[18:41:38] <X> [17:41:38] -NOTICE- *** Client connecting: Ardith (ardith@98.188.47.150) [98.188.47.150] [class: clients] [reputation: 813]
[18:41:38] <X> [17:41:38] -NOTICE- *** Client connecting: Petra (petra@174.75.211.222) [174.75.211.222] [class: clients] [reputation: 947]
[18:41:38] <X> [17:41:38] -NOTICE- *** Client connecting: Ivy (ivy@184.181.217.204) [184.181.217.204] [class: clients] [reputation: 1679]
[18:41:38] <X> [17:41:38] -NOTICE- *** Client connecting: Celeste (celeste@72.221.164.34) [72.221.164.34] [class: clients] [reputation: 1463]
Back to top
View user's profile Send private message
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Mon Jul 12, 2021 10:43 pm    Post subject: hi Reply with quote

CrazyCat can we make to send msg channel when the 10 connection dont have secure connetion and not to save ip or $host when is send msg in channel to remove what info is save in list and when users have secure connection or host *.irccloud.com and *.mibbit.com to not send msg cozz cant read who user is connect via webirc

Code:

-NOTICE- *** Client connecting: Test (uid479754@brockwell.irccloud.com) [192.184.10.118] [class: clients] [secure: TLSv1.2-ECDHE-ECDSA-AES256-GCM-SHA384] [reputation: 4666]


to use regex like this and to show on channel and those 10 connect is match
so to know what is make bot trriger

Code:

   regexp {{:\ ([^ ]+)\s\(([^@]+)@([^\)])+\)\s\[([^\]]+)} \(class (\S+)\) \(secure TLSv(\d\.\d)-(\S+) \(reputation (\d+)\)} $text - nick ident host ip class secure reputation

   puthelp "PRIVMSG $::infochan : CONNECT: Nick: $nick - Iden: $ident - Host: $host - IP: $ip - Class: $class - Secure: $secure - Reputation: $reputation "


Code:

set mhrp(flood) 10:5
set mhrp(nicks) {}
set mhrp(on) 0
set mhrp(exclude) {"*isweb*" "*secure*" "*.irccloud.com" "*.mibbit.com"}

set commChan "#services"

bind raw - NOTICE massconnectflood
proc massconnectflood {frm key text} {
   if { $::mhrp(on) == 1 } { return }
   if {[string match *!*@* $frm] || ![string match -nocase "*client connecting*" $text]} { return }
   regexp {:\ ([^ ]+)\s\(([^@]+)@([^\)])+\)\s\[([^\]]+)} $text - nick ident host ip
   foreach exclude $::mhrp(exclude) {
      if {[string match -nocase $exclude $host] } { return }
   }
   set target [split $::mhrp(flood) :]
   set max [lindex $target 0]
   set seconds [lindex $target 1]
   lappend ::mhrp(nicks) $nick
   # we append $mhrp(nicks) with the new connection
   utimer $seconds [list lreplace $::mhrp(nicks) [lsearch $::mhrp(nicks) $nick] [lsearch $::mhrp(nicks) $nick]]
   # we will remove this entry in $seconds (5)
   if {[llength $::mhrp(nicks)] >= $max} {
      # comparing size of mhrp(nicks) and target
      puthelp "PRIVMSG $::commChan :!gline on"
      set ::mhrp(on) 1
      timer 10 [list massconnectunflood]
   }
}

proc massconnectunflood {} {
   putserv "PRIVMSG $::commChan :!gline off"
   set ::mhrp(on) 0
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber