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 

anti mass highlight per stored host

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


Joined: 22 Mar 2015
Posts: 941

PostPosted: Fri Jan 08, 2021 12:13 pm    Post subject: anti mass highlight per stored host Reply with quote

i took this small code from here http://forum.egghelp.org/viewtopic.php?p=71356 on the forum to tackle mass highlight abuse
exept it only seems to work if triggered by 1 user at a time if more than like 10 or more users type mass highlights of nicks it it doesnt seem to trigger:


Code:

bind PUBM -|- * check:hilight

proc check:hilight {nick host h chan arg} {
  set arg [split $arg];
  set hits 0;

  foreach piece $arg {
    if {[onchan $piece $chan]} {
      incr hits;
    }
  }

  if {$hits >= 5} {
    putquick "MODE $chan +b [maskhost $host 2]"
    putquick "KICK $chan $nick :Problem solved."
  }
}


i wonder how this could be edited to check per host of nicks that triggered it
to make sure it triggers no matter how much nicks triggered it

thanks in advance.
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Fri Jan 08, 2021 5:34 pm    Post subject: Reply with quote

Nothing in the above code would cause the script to "only work if triggered by 1 user at a time"

It processes each line of text to the channel as if nothing happened before or after it:)
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Fri Jan 08, 2021 6:25 pm    Post subject: Reply with quote

Hm ok i stress tested it and it seemed to set only certain bans not on all nicks that triggered it and if set by like 30 nicks or more it does nothing at all
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Jan 09, 2021 10:22 am    Post subject: Reply with quote

i did a test and it didnt trigger the tcl at all

https://pastebin.com/bu11Kqpc

i tested with 30 nicks and none triggered the tcl

i used pushmode to make sure modes gets compressed to set all ban modes

Code:

proc check:mass-highlight {nick host hand chan text} {
  if {[isatleasthalfopX8ZERO $nick $chan]} { return 0 }
  set text [split $text];
  set hits 0;

  foreach piece $text {
    if {[onchan $piece $chan]} {
      incr hits;
    }
  }

  if {$hits >= 5} {
 if {[isvoice $nick $chan]} { pushmode2 $chan -v $nick }
    pushmode $chan +b m:[maskhost $host 2]
  }
}
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Jan 09, 2021 10:55 am    Post subject: Reply with quote

tested few times again and it seemed ok thanks SpiKe^^
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