Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Noreg Script

  1. #1
    TCB & Ratings projects Member, #Mythic representative arcade's Avatar
    Join Date
    Jun 2004
    Location
    /dev/null
    Posts
    237
    Rep Power
    92

    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" }

  2. #2
    Member lsn's Avatar
    Join Date
    Jun 2004
    Location
    In the NeXuS
    Posts
    161
    Rep Power
    92

    Default

    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 ....
    Last edited by UniversaliA; 09-04-2006 at 16:15. Reason: merged 2 posts

  3. #3
    TCB & Ratings projects Member, #Mythic representative arcade's Avatar
    Join Date
    Jun 2004
    Location
    /dev/null
    Posts
    237
    Rep Power
    92

    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]

  4. #4
    Member lsn's Avatar
    Join Date
    Jun 2004
    Location
    In the NeXuS
    Posts
    161
    Rep Power
    92

    Default

    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."}}}
    si daca vrei ca sa poti scoate modifici in a:parser
    Code:
    } elseif {![string equal $comm join] && ![string equal $comm stats]} {
    cu
    Code:
    } elseif {![string equal $comm join] && ![string equal $comm stats] && ![string equal $comm delnoreg]} {

  5. #5
    Junior Member aNormaLu's Avatar
    Join Date
    Feb 2007
    Location
    BANAT, Capitala: TIMISOARA
    Age
    25
    Posts
    37
    Rep Power
    0

    Default

    @ 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 aNormaLu; 14-09-2007 at 12:46.

  6. #6
    Junior Member
    Join Date
    Jun 2009
    Posts
    12
    Rep Power
    0

    Cool

    Salut,poate sa ma ajuta cineva sa`l faca sa salveze si la restart si sa zice listnoreg sa arate canalele care sunt in noreg si motivul.


    mersi mult.

  7. #7
    TCB & Ratings projects Member, #Mythic representative arcade's Avatar
    Join Date
    Jun 2004
    Location
    /dev/null
    Posts
    237
    Rep Power
    92

    Default

    am rescris putin codul la functia de noreg, am atasat la sfarsitul postului patchul
    Attached Files Attached Files
    Fuck oFF!

  8. #8
    Junior Member aNormaLu's Avatar
    Join Date
    Feb 2007
    Location
    BANAT, Capitala: TIMISOARA
    Age
    25
    Posts
    37
    Rep Power
    0

    Default eroare

    am luat packul tau si am pus noreg`ul pe noul a&a script :-)

    eroare la !noreg #chan <days> <reason> :
    Code:
    [12:50] <<aNormaLu>> aNormaLu!grecu@anormalu.users.undernet.org #testeri NOREG can't read "noregExpire": no such variable
    [12:50:29] <lols> Tcl error: invalid command name "can't read "noregExpire": no such variable
    [12:50:29] <lols> Tcl error:     while executing
    [12:50:29] <lols> Tcl error: "$noregExpire = [expr $time * 86400 + [unixtime]]"
    [12:50:29] <lols> Tcl error:     (procedure "pub:noreg" line 7)
    [12:50:29] <lols> Tcl error:     invoked from within
    [12:50:29] <lols> Tcl error: "[a:command -proc $comm] $hand $chan $args $x $mix""
    in packu tau is kteva greseli (probabil de scriere ) , de ex
    Code:
    stats:channel -exist ....
    , de fapt e -exists

    linia care ai zis k trebuie pusa in pub:join are un cuvant nepotrivit :P
    Code:
     [stats:channel -get $chan noregExpiretime ......
    , de fapt e noregExpire

    ai uitat sa mentionezi (ce a zis lsn) k trebuie modificat in a: parser
    Code:
    } elseif {![string equal $comm join] && ![string equal $comm stats]} {
    cu
    Code:
    } elseif {![string equal $comm join] && ![string equal $comm stats] && ![string equal $comm delnoreg]} {
    .....altfel nu merge .delnoreg

    alta problema, dupa ce am dat .delnoreg #chan , nu merge join-ul inapoi
    Code:
    ..pe canal:
    [13:01:27] <@aNormaLu> .delnoreg #testeri
    [13:01:28] <@lols>  aNormaLu removed noreg on #testeri
    .. in botnet :
    [13:01:27] <lols> [13:01] <<aNormaLu>> aNormaLu!grecu@anormalu.users.undernet.org #muema DELNOREG #muema
    ..inapoi pe canal :
    [13:04:20] <@aNormaLu> .join #testeri
    [13:04:20] <@lols> aNormaLu #testeri has noreg status
    ... stiu ca ai mentionat k nu ai cum sa probezi tclurile ce le faci...asa ca am pus erorile si greselile de scriere (kre le-am gasit..) ca sa corectezi packu nu ca sa te critic..sper k te-ai prins :d
    http://forum.bots.land/image.php?type=sigpic&userid=1045&dateline=1228562  901

  9. #9
    TCB & Ratings projects Member, #Mythic representative arcade's Avatar
    Join Date
    Jun 2004
    Location
    /dev/null
    Posts
    237
    Rep Power
    92

    Default

    anormalu, multumesc pentru testat, dar l-am rescris, si va fi inclusa in a&a light v00.04.10 o varianta imbunatatita. Am postat patchul aici, daca ai timp sa il testezi si sa dai reply cu eventualele probleme aici ti-as fi foarte recunoscator.

    Mentionez ca am schimbat putin structura, in principiu comanda !noreg a fost inclusa in !purge, timpii de noreg sunt setati in settings.conf, iar un canal primeste noreg in functie de purge reason.

    Also trebuie sa mentionez ca noreg functioneaza doar cu settings(strict_reason) si settings(noreg) activate

    PS: te rog sa imi scuzi typo-urile din patchul anterior, l-am scris destul de obosit si am facut cateva greseli, printre care cea mai amuzanta a fost prima cu $noregExpire = blabla (sintaxa de atribuire din php)
    Fuck oFF!

  10. #10
    Junior Member aNormaLu's Avatar
    Join Date
    Feb 2007
    Location
    BANAT, Capitala: TIMISOARA
    Age
    25
    Posts
    37
    Rep Power
    0

    Default

    in patch ai scris cva gresit.. in global m :
    Code:
    +	if { [stats:channel -exists $chan purgeExpire] && $settings(noreg) && ([stats:channel -get $chan noregExpiretime] <= [unixtime]) }  {a:tell $x 17 "FAILED: $chan has noreg status" ; return "FAILED: $chan has noreg status" }
    +	if { [stats:channel -exists $chan purgeExpire] && $settings(noreg) && ([stats:channel -get $chan noregExpiretime] == 0) }  {a:tell $x 17 "FAILED: $chan is blacklisted" ; return "FAILED: $chan is blacklisted" }
    - aici trebuie inlocuit noregExpiretime cu purgeExpire, odata pt ca noregExpiretime nu exista niciune altundeva in patch deci ar da eroare, 2 la mana pt ca am incercat doar cu noregExpire si da eroarea de mai jos:

    Code:
    [17:35:01] <@aNormaLu> .delnoreg #datedraq
    [17:35:01] <@lols>  aNormaLu removed #datedraq from noreg list
    [17:35:05] <@aNormaLu> .join #datedraq
    ..... nu intra pe canal ..
    
    - si in dcc:
    
    [17:35:05] <lols> [17:35] <<aNormaLu>> aNormaLu!grecu@anormalu.users.undernet.org #datedraq JOIN can't read "stats(#datedraq,noregExpire)": no such element in array
    dupa ce am modificat aia in global m nu mai da eroarea "can't read stats..." dar tot nu intra pe canal si imi da ca raspuns:
    Code:
    <@lols> aNormaLu FAILED: #asdfsdf has noreg status
    .. tu sti ce trebuie facut

    ..si alte erori.. :
    Code:
    [17:32:40] <@aNormaLu> .purge abuse
    [17:32:41] * lols (~lols@79.114.40.246) has left #datedraq
    - nu arata mesajul de purge :-) (si nu era +m pe canal)

    si in dcc zice, dupa purge:
    Code:
    [17:32:41] <lols> [17:32] <<aNormaLu>> aNormaLu!grecu@anormalu.users.undernet.org #datedraq PURGE invalid command name "else"
    http://forum.bots.land/image.php?type=sigpic&userid=1045&dateline=1228562  901

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •