limitserv.disabled (2940B)
1 $::maintype sendUid $::sock($::cs(netname)) "L" "limitserv" "services." "services." 47 "Channel Limit Adjustment Services" 2 foreach {chan is} [nda get "limitserv/regchan"] { 3 if {1!=$is} {continue} 4 $::maintype putjoin $::sock($::cs(netname)) 47 [::base64::decode [string map {[ /} $chan]] [nda get "regchan/$chan/ts"] 5 tnda set "channels/$chan/ts" [nda get "regchan/$chan/$::netname($::sock($::cs(netname)))/ts"] 6 } 7 bind $::sock($::cs(netname)) request "l" "-" limitservjoin 8 bind $::sock($::cs(netname)) request "limitserv" "-" limitservjoin 9 bind $::sock($::cs(netname)) join "-" "-" limitservup 10 bind $::sock($::cs(netname)) part "-" "-" limitservdown 11 bind $::sock($::cs(netname)) pub "-" "!dolimit" limitservdochan 12 13 after 300000 {limitservdo} 14 15 proc limitservup {chan msg} { 16 set ndacname [string map {/ [} [::base64::encode [string tolower $chan]]] 17 if {""==[tnda get "limitserv/$::netname($::sock($::cs(netname)))/$ndacname"]} {set i 1} {set i [expr {[tnda get "limitserv/$::netname($::sock($::cs(netname)))/$ndacname"] + 1}]} 18 tnda set "limitserv/$::netname($::sock($::cs(netname)))/$ndacname" $i 19 # intlimitservdochan $chan 20 } 21 22 proc limitservdown {chan msg} { 23 set ndacname [string map {/ [} [::base64::encode [string tolower $chan]]] 24 if {""==[tnda get "limitserv/$::netname($::sock($::cs(netname)))/$ndacname"]} {set i 0} {set i [expr {[tnda get "limitserv/$::netname($::sock($::cs(netname)))/$ndacname"] - 1}]} 25 tnda set "limitserv/$::netname($::sock($::cs(netname)))/$ndacname" $i 26 # intlimitservdochan $chan 27 } 28 29 proc limitservjoin {chan ft} { 30 set ndacname [string map {/ [} [::base64::encode [string tolower $chan]]] 31 $::maintype putjoin $::sock($::cs(netname)) 47 $chan [nda get "regchan/$ndacname/ts"] 32 nda set "limitserv/regchan/$ndacname" 1 33 } 34 35 proc limitservdo {} { 36 foreach {chan is} [nda get "limitserv/regchan"] { 37 if {1!=$is} {continue} 38 $::maintype putmode $::sock($::cs(netname)) 47 [::base64::decode [string map {[ /} $chan]] "+l" [expr {[tnda get "limitserv/$::netname($::sock($::cs(netname)))/$chan"] + 10}] [nda get "regchan/$chan/ts"] 39 } 40 after 300000 {limitservdo} 41 } 42 43 proc limitservdochan {cname msg} { 44 set chan [string map {/ [} [::base64::encode [string tolower $cname]]] 45 set from [lindex $msg 0 0] 46 if {150>[nda get "regchan/$chan/levels/[string tolower [tnda get "login/$::netname($::sock($::cs(netname)))/$from"]]"]} { 47 $::maintype privmsg $::sock($::cs(netname)) 47 $cname "You must be at least halfop to manually trigger autolimit on the channel." 48 return 49 } 50 $::maintype putmode $::sock($::cs(netname)) 47 $cname "+l" [expr {[tnda get "limitserv/$::netname($::sock($::cs(netname)))/$chan"] + 14}] [nda get "regchan/$chan/ts"] 51 } 52 53 proc intlimitservdochan {cname} { 54 set chan [string map {/ [} [::base64::encode [string tolower $cname]]] 55 $::maintype putmode $::sock($::cs(netname)) 47 $cname "+l" [expr {[tnda get "limitserv/$::netname($::sock($::cs(netname)))/$chan"] + 14}] [nda get "regchan/$chan/ts"] 56 }