All pastes #919390 Raw Edit

Someone

public text v1 · immutable
#919390 ·published 2008-02-26 20:03 UTC
rendered paste body
proc pub:chanset {hand chan args x mix} {
	
	set mode   [string tolower [lindex $args 0]]
	set opti   [lindex $args 1]
        set chankey [lindex [getchanmode $chan] 1]

	if {([regexp {^aop-delay|flood-(chan|deop|kick|join|nick|ctcp)$} $mode] && [regexp {^\d{1,2}\:\d{1,3}$} $opti]) || ([string equal $mode stopnethack-mode] && [string match {[0-6]} $opti]) || ([string equal $mode idle-kick] && [a:check -digit $opti]) || ([string equal -nocase $mode idle-deop] && [a:check -digit $opti])  || ([string equal $mode revenge-mode] && [string match {[0-3]} $opti]) || ([regexp {^(ban|exempt|invite)-time$} $mode] && [a:check -digit $opti])} {channel set $chan $mode $opti} elseif { 
	     [string equal $mode -inactive] && [channel get $chan suspended]} {a:tell $x 127 $chan ; return "FAILED: chan suspended ($chan)"} elseif {     
           [string equal $mode +suspended] && [check:m:gl $hand]} {channel set $chan +inactive +suspended} elseif {
	     [string equal $mode -suspended] && [check:m:gl $hand]} {channel set $chan -inactive -suspended} elseif {
           [string equal $mode need-key]} { if { [string equal $opti none] || $opti == ""} { a:tell $x 1713 "$mode" ; return "FAILED: No key supplied"} {channel set $chan $mode [list putserv join $chan $opti] ; if {[string equal $chankey none]} {pushmode $chan +k $opti} else {pushmode $chan -k $chankey ; pushmode $chan +k $opti}}} elseif { 
           [string equal $mode +antitake]} { channel set $chan chanmode +tn-ik revenge-mode 1 flood-chan 7:20 flood-ctcp 2:20 flood-join 4:40 flood-kick 3:20 flood-deop 3:20 flood-nick 4:40 ban-time 0 +enforcebans +dynamicbans +protectops +protectfriends +dontkickops +revenge +cycle +bitch -autoop -op +antitake} elseif {
           [string equal $mode -antitake]} { channel set $chan chanmode +tn revenge-mode 0 flood-chan 0:00 flood-ctcp 0:00 flood-join 0:00 flood-kick 0:00 flood-deop 0:00 flood-nick 0:00 ban-time 120 -enforcebans -dynamicbans +protectops +protectfriends -dontkickops -revenge -cycle -bitch -autoop -op -antitake } elseif {
           [string equal $mode +antiflood]} { channel set $chan chanmode +tnm flood-chan 4:1 flood-ctcp 4:1 flood-join 4:1 flood-kick 3:1 flood-deop 5:1 flood-nick 4:1 ban-time 0 +enforcebans +dynamicbans -protectops -protectfriends -dontkickops +antiflood} elseif {
           [string equal $mode -antiflood]} { channel set $chan chanmode +tnm flood-chan 0:0 flood-ctcp 0:0 flood-join 0:0 flood-kick 0:0 flood-deop 0:0 flood-nick 0:0 ban-time 60 -enforcebans -dynamicbans +protectops +protectfriends +dontkickops -antiflood} elseif {
             [string equal $mode +strict]} { channel set $chan +antipub +anticolour +antibold +antireverse +antiunderline +antiurl +antinotice +antiaction +antirepeat +antiflood +strict} elseif {
             [string equal $mode -strict]} { channel set $chan -antipub -anticolour -antibold -antireverse -antiunderline -antiurl -antinotice -antiaction -antirepeat -strict} elseif {
             [string equal $mode reset]} { channel set $chan chanmode +tn-ki idle-kick 0 revenge-mode 0 flood-chan 0:0 flood-ctcp 0:0 flood-join 0:0 flood-kick 0:0 flood-deop 0:0 flood-nick 0:0 aop-delay 5:30 ban-time 120 exempt-time 60 invite-time 60 -enforcebans +dynamicbans +userbans -autoop -autohalfop -bitch -greet -protectops -protecthalfops -protectfriends +dontkickops -inactive -statuslog +revenge +revengebot -secret -shared -autovoice +cycle +seen +dynamicexempts +userexempts +dynamicinvites +userinvites +nodesynch -weather -joinpart -antispam -antinotice -antiaction -antipub -anticolour -antiunderline -antibold -antireverse -antiurl -antirepeat -limit -voice -op -locked -suspended -topic -enforcetopic -chanserv +secure -onjoin -paranoia -antiswear -next -antitake idle-deop 0 -stats -vorbeste -badnick -leave -welcome -greet -antiflood -strict} elseif {
             [string match {[-+]weather} $mode]} {channel set $chan $mode } elseif {
             [string match {[-+]vorbeste} $mode]} {channel set $chan $mode } elseif {
             [string match {[-+]next} $mode]} {channel set $chan $mode } elseif {
             [string match {[-+]joinpart} $mode]} {channel set $chan $mode } elseif {
             [string match {[-+]antispam} $mode]} {channel set $chan $mode } elseif {
             [string match {[-+]leave} $mode]} {channel set $chan $mode } elseif {
             [string match {[-+]welcome} $mode]} {channel set $chan $mode } elseif {
             [string match {[-+]greet} $mode]} {channel set $chan $mode } elseif {	     
             [string match {[-+]shoutcast} $mode]} {channel set $chan $mode } elseif {
             [regexp {^[+-](silence|badnick|onjoin|auto(op|voice)|bitch|cycle|revenge(bot|)|dontkickops|nodesynch|(dynamic|enforce|user)bans|inactive|protect(friends|ops)|secret|anti(pub|swear|colour|bold|underline|notice|url|reverse|repeat|action)|limit|secure|voice|op|enforcetopic)$} $mode]} {channel set $chan $mode} elseif { 
             [regexp {^[+-](paranoia|strict)$} $mode] } { set:multi $hand $chan $args $x $mix } elseif {
             [regexp -- {^(rules|url|faq|fuck|news|desc|mail|slap|kiss|(ban|kick)-reason)$} $mode]} {if { [string equal $opti none] || $opti == ""} {set opti ""; a:tell $x 136 "$chan $mode"; ::stats::channel -set $chan $mode $opti; return "$mode none"} {set opti [join [lrange $args 1 end]]; ::stats::channel -set $chan $mode $opti}} elseif {
	     [string equal $mode mode] || [string equal $mode modes] && [regexp {^[ntrimlkprs+-]+$} $opti]} {channel set $chan chanmode $opti} elseif {	
	     [string match {[-+]locked} $mode] && [check:N:gl $hand] } {channel set $chan $mode } else {a:help $x chanset ; return "FAILED: wrong options ($mode $opti)"}

	a:tell $x 126 "$chan $mode $opti"
	return "$mode $opti"
}