ca sa expire singur, il refaci cu o optiune in +, adica timpul cand trebuie sa expire, + un proces care sa se execute sa zicem la 24 ore care sa verifice daca a expirat timpul de noreg sa scoata canalul de la noreg ...
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
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
set chan [string tolower $chan]
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"
}
Code:
######## pub:join
global noreg
if { [info exists noreg($chan)]} {a:tell $x 17 "$chan has noreg status" ; return "$chan has noreg status" }
###########
pentru ca sa scoti de la noreg faci un timer la 24 ore, si folosesti
foreach chan [array names noreg] {procesul tau}, ca sa afli daca a expirat
if {[lindex $noreg($chan) 0] < [unixtime]} {procesul tau}
sper ca e de ajuns ca sa faceti mai departe

sa n uitati sa salvati in file info despre noreg, un file care sa se reincarce la restart, .... cam atat

....