Thread: Noreg Script
View Single Post
Old 28-03-2006, 17:17   #1 (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 Noreg Script

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" }
arcade is offline   Reply With Quote