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.

enforce kick matching nicks

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

enforce kick matching nicks

Post by simo »

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: Select all

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:
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.
s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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: Select all

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"
}

s
simo
Revered One
Posts: 1106
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

basicly this is what i want this is the msl version

https://pastebin.com/y48eYFcL
Post Reply