![]() |
|
|||||||
| a&a light script a&a light script support, suggestions & discussions |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
TCB & Ratings projects Member, #Mythic representative
|
Am vazut thread la care a postat lsn si mi-am amintit k am si eu nevoie de ceva asemanator. Amigo_X a incercat sa ma ajute cu un cod dar nu prea a iesit asa k intreb k sa va dati toti cu parerea si sa vedem ce nu mere. Eu vreau un script kre la comanda !noreg <$chan> <$time> sa faca ca canalul respectiv sa nu mai poata primi join pt perioada de timp specificata la $time.
Uitati script. Retusati pe unde nu e bine. K si eu m-am mai chinuit si nu gasesc nici un defect (doar k nush cum sa fac sa expire noreg) Code:
a:command -add noreg pub:noreg 1140 622 |n
routine:addcom unnoreg pub:unnoreg 1141 623 n 1
a:command -add unnoreg pub:unnoreg 1141 623 |n
set say(lang.1.333) "ADDED noreg: 足、 reason:2 ォ duration: ォ."
set say(lang.1.334) "FAILED: you specified nonexistent channel: 足、."
set say(lang.1.335) "2REMOVED noreg for chan: 足、."
set say(lang.1.336) "NOREG: 足、 - by 足、 reason:2 ォ, expire in:2 ォ."
set say(lang.1.337) "FAILED:2 NOREG list is4 EMPTY."
bind bot h noreg botnet:noreg
proc botnet:noreg {bot cmd arg} {
global noreg
set arg [split $arg]
set chan [lindex $arg 0]
set info [join [lrange $arg 1 end]]
set noreg($chan) $info
}
proc pub:noreg {hand chan args x mix} {
global noreg support settings owner chann
set time [lindex $args 0]
set reason [lrange $args 1 end]
set option none
set add ""
if { $time == "0" } { set time "permanently" }
if { $chan == "" } { set chan $chan }
::stats::channel -set $chan noregtime [unixtime]
::stats::channel -set $chan noregwhom $hand
::stats::channel -set $chan noregwhy "4noreged - $reason"
::stats::channel -set $chan purgetime [unixtime]
::stats::channel -set $chan purgewhom $hand
::stats::channel -set $chan purgewhy "noreged - $reason"
set noreg($chan) "[unixtime] $hand $reason"
putallbots "noreg $chan $hand $time $reason"
a:tell $x 287 "$chan $time $reason"
putquick "part $chan :channel noregED by $hand, for $time reason: $reason; for any help apply on $support(chan) & \037\00302$support(page)"
a:tell "{} [split $owner] [split $support(home)] pub" 294 "$hand [lindex $x 0] [lindex $mix 0] $chan"
if {[validchan $chan]} {channel remove $chan} {return};
}
bind bot h unnoreg botnet:unnoreg
proc botnet:unnoreg {bot cmd arg} {
global noreg
set arg [split $arg]
set chan [lindex $arg 0]
set info [join [lrange $arg 1 end]]
set noreg($chan) $info
}
proc pub:unnoreg {hand chan args x mix} {
global noreg support settings owner chann
if {![info exists noreg($chan)] } {return 0} { unset noreg($chan) }
putallbots "noreg_remove $chan"
a:tell "{} [split $owner] [split $support(home)] pub" 296 "$hand [lindex $x 0] [lindex $mix 0] $chan"
pub:save; return "$chan" }
|
|
|
|
|
|
#2 (permalink) |
|
Member
Join Date: Jun 2004
Location: In the NeXuS
Posts: 160
Rep Power: 37 ![]() |
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" }
###########
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 ....
Last edited by UniversaliA; 09-04-2006 at 16:15. Reason: merged 2 posts |
|
|
|
|
|
#3 (permalink) |
|
TCB & Ratings projects Member, #Mythic representative
|
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] |
|
|
|
|
|
#4 (permalink) |
|
Member
Join Date: Jun 2004
Location: In the NeXuS
Posts: 160
Rep Power: 37 ![]() |
Arcade, ai uitat bind pe timer
Code:
bind time - "00 00 * * *" timer:24
# si procesul
proc timer:24 {global noreg; foreach chan [array names noreg] {if {[lindex $noreg($chan) 0] < [unixtime]} {unset noreg($chan); puthelp "PRIVMSG $settings(homechan :Noreg for $chan has expired."}}}
Code:
} elseif {![string equal $comm join] && ![string equal $comm stats]} {
Code:
} elseif {![string equal $comm join] && ![string equal $comm stats] && ![string equal $comm delnoreg]} {
|
|
|
|
|
|
#5 (permalink) |
|
Junior Member
Join Date: Feb 2007
Age: 16
Posts: 27
Rep Power: 0 ![]() |
@ stiu k e vechi postu...da eo acu am "rasfoit" forumu ... si l`am gasit si m`a interesat
![]() deci..... am dat !noreg #canal 7 abuse / si kand dau !delnoreg #canal spune : FAILED: you specified an invalid channel (#canal), for any help apply on #..... ma ajuta careva pls ?! Last edited by Normal; 14-09-2007 at 12:46. |
|
|
|