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 

enforce kick matching nicks

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


Joined: 22 Mar 2015
Posts: 315

PostPosted: Thu May 09, 2019 9:24 am    Post subject: enforce kick matching nicks Reply with quote

could this be modified to check for part of a wildcard is in any nick in channel and store them in list to mass kick and mass ban

Code:

bind pub o|o .n pub:kicker31
proc pub:kicker31 {nick host hand chan text} {
   if {![botisop $chan]} {
      puthelp "NOTICE $nick :I'm not oped on $chan."
      return
   }
   set users [list]
   set umasks [list]
   set reason [join [lrange [split $text "."] 1 end] "."]
   set text  [lindex [split $text "."] 0]
   if {$reason eq ""} { set reason "This nick is not allowed please choose a more proper one thank you"  }
   foreach user $text {
            lappend umasks *$user*!*@*
      if {![onchan $user $chan]} {
         putserv "NOTICE $nick $user is not on channel $chan"
      } else {

            lappend users $user

         }
   }
   set count [llength $umasks]
   putquick "MODE $chan +[string repeat "b" $count] [join $umasks]"
   putquick "KICK $chan [join $users ","] :$reason"
}



for example:

Quote:

15:26:16 (simo) : .n doz edw aldr
15:26:16 -TCL-Tester- : doz is not on channel #testing
15:26:16 -TCL-Tester- : edw is not on channel #testing
15:26:16 -TCL-Tester- : aldr is not on channel #testing
15:26:16 ~TCL-Tester Sets Mode on #testing to: +bbb *doz*!*@* *edw*!*@* *aldr*!*@*
15:26:16 (3 Users) Are Banned Dozier Edward Aldrich


to kick all matching nicks but not using bind mode tho but rather searching thro nicklist for matching nicks but to make sure matching nicks arent in any access list of eggdrop and arent current opped halfopped and such in channel to protect those that need protection


Last edited by simo on Sun May 19, 2019 12:21 pm; edited 2 times in total
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 315

PostPosted: Fri May 10, 2019 4:58 pm    Post subject: Reply with quote

so far this is what i got it loops thro channel list to see if any nick matches the wildcard but i cant seem to stop kick if no one matches the wildcard and if user is protected

not sure if this is proper tho



Code:

bind pub -|- .n pub:kicker31
proc pub:kicker31 {nick host hand chan text} {
  if {![isatleasthalfop2017ewa $nick $chan]} { return 0 }
   if {![botisop $chan]} {
      puthelp "NOTICE $nick :I'm not oped on $chan."
      return
   }
   set users [list]
   set umasks [list]
   set reason [join [lrange [split $text "."] 1 end] "."]
   set text  [lindex [split $text "."] 0]
   if {$reason eq ""} { set reason "This nick is not allowed please choose a more proper one thank you"  }
              set userListx [chanlist $chan]
   foreach user $text {

                                 if {[matchattr [nick2hand $user $chan] mno] || [isop $user $chan] || [ishalfop $user $chan]} {
            putserv "notice $nick :$user is a protected user"
            break
         }

             lappend umasks *$user*!*@*
 foreach n [chanlist $chan] {
  if {[string match -nocase *$user* $n]} {
            lappend users $n
  }
 }
   }
   set count [llength $umasks]
   putquick "MODE $chan +[string repeat "b" $count] [join $umasks]"
   putquick "KICK $chan [join $users ","] :$reason"
}

Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 315

PostPosted: Tue May 14, 2019 7:35 pm    Post subject: Reply with quote

basicly this is what i want this is the msl version

http://dpaste.com/0J46B4V
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