Thread: Noreg Script
View Single Post
Old 08-04-2006, 21:41   #3 (permalink)
arcade
TCB & Ratings projects Member, #Mythic representative
 
arcade's Avatar
 
Join Date: Jun 2004
Location: In fatza calculatorului!!
Age: 19
Posts: 222
Rep Power: 37
arcade is on a distinguished road
Send a message via Yahoo to arcade
Default

hmm sunt pe aproape dar totusi nu mere. Adica adauga canalul la lista de noreg doar k nu sterge noreg nici cand expira nici cu !delnoreg. Uitati codul:
Code:
a:command -add noreg pub:noreg 1140 622 n
a:command -add delnoreg pub:delnoreg 1141 623 n
bind bot B noreg botnet:noreg
proc botnet:noreg {bot cmd arg} {
global noreg
set cmd [lindex [split $arg] 0]
set chan [lindex [split $arg] 1]
set info [join [lrange $arg 2 end]]
 
switch -exact -- $cmd {
-add {set noreg($chan) $info}
-del {if {[info exists noreg($chan)]} {unset noreg($chan)}}
}
}
proc pub:noreg {hand chan args x mix} {
global noreg settings noregtimeadd
set chan [string tolower $chan]
 
if {![isdynamic $chan]} { a:tell $x 129 $chan; return "FAILED: static chan ($chan)"}
 
set time [a:validate -digit [lindex $args 0]]
if {$time} {set reason [lrange $args 1 end]} {set time 30; set reason [lrange $args 0 end]}
set noregtime [expr $time * 86400]
set noregtimeadd [expr $noregtime + [unixtime]]
 
set noreg($chan) "$noregtimeadd [unixtime] $hand $reason"
 
putallbots "noreg -add $chan $noregtimeadd [unixtime] $hand $reason"
putquick "part $chan :channel noregED by $hand, for [duration $noregtime] reason: $reason; for any help apply on $settings(suppchan) & \037\00302$settings(homepage)"
 
a:announce -home 17 "$hand added to noreg $chan for [duration $noregtime] time."
if {[validchan $chan]} {
::stats::channel -set $chan purgetime [unixtime]
::stats::channel -set $chan purgewhom $hand
::stats::channel -set $chan purgewhy "noreged - $reason"
 
channel remove $chan
 
save
}
}
proc pub:delnoreg {hand chan args x mix} {
global noreg

if {![info exists noreg($chan)] } {return 0} { unset noreg($chan) }
putallbots "noreg -del $chan"
 
a:announce -home 17 "$hand removed from noreg $chan"
save
return "$chan" 
}

timer 24 {  foreach chan [array names noreg] {if {[lindex $noreg($chan) 0] < [unixtime]} {unset noreg($chan); puthelp "PRIVMSG $settings(homechan :Noreg for $chan has expired."}}}

Last edited by lsn; 12-08-2006 at 23:52. Reason: Removed: set chan [lindex args 0]
arcade is offline   Reply With Quote