Mise en forme de code: pensez à utiliser les balises [ tcl ] et [ /tcl ] (sans les espaces bien sûr) autour de vos codes tcl afin d'avoir un meilleur rendu et une coloration syntaxique. x


SOS
#1
Alors voila j'ai un pti probléme j'ai un ami qui ma donner un code TCL de SOS mais sa me dit < -01:40:48- <Nemesis> [07:40] Tcl error [procsos]: can't read "saloni": no such variable > Alors si vous avais une idées d'ou sa vien ... car j'ai meme changé la variable et sa rien changé :/ alors j'ignore quoi faire ... merci d'avance :P

Coordialement Dragon061



tcl
bind pub - !secours procsos
bind pub - !secour procsos
proc procsos {nick host hand chan arg} {
global nosos vhostnetadmin sossalon countsossalon salonsecours nososoff saloni
   set arg [string tolower $arg]
   set timenow [ctime [unixtime] ]
   set salon [lindex $arg 1]
   set arg1 [lindex $arg 0]
   set arg2 [lindex $arg 0]
   set liste [lindex $arg 1]
   foreach salonsecoursok $salonsecours {
   if {[string match -nocase $salonsecoursok $chan]} {
   foreach admin $vhostnetadmin {
   if {[string match -nocase $admin $host]} {
   if { ($arg2 == "off") && ($liste == "all") } {
   putfast "PRIVMSG #admin :Commande !sos/attaque désactivé sur tous les salons off par $nick !"
   set sossalon($liste) "Tout"
   set datasossalon [open "./sossalon.db" "w"]
   puts $datasossalon [list array set sossalon [array get sossalon]]
   close $datasossalon
   set nososoff 1
   incr nososoff
   return 0
   }
   if { ($arg2 == "on") && ($liste == "all") } {
   putfast "PRIVMSG #admin :Commande !sos/attaque réactivé sur tous les salons off par $nick ."
   unset sossalon($liste)
   set datasossalon [open "./sossalon.db" "w"]
   puts $datasossalon [list array set sossalon [array get sossalon]]
   close $datasossalon
   unset nososoff
   return 0
   }
   if { ($arg2 == "off") && ($liste == "list") } {
    if {[array exists countsossalon]} {
        unset countsossalon
    }
    foreach run [array names sossalon] {
        foreach r $sossalon($run) {
            if {[info exists countsossalon($r)]} {
                incr countsossalon($r)
            } else { 
              set countsossalon($r) 1
            }
        }
    }
    putfast "PRIVMSG $chan :Liste des salons désactivée pour les SOS :"
    foreach cousossalon [lsort -dictionary [array names countsossalon]] {
        putquick "privmsg $chan :$cousossalon est désactivé ."
     } 
    putfast "PRIVMSG $chan : Fin Liste ."
  }
  foreach connus $saloni {
   if { ($arg1 == "off") && ($salon != "") && [string match -nocase $connus $salon] } {
    if {[array exists countsossalon]} {
        unset countsossalon
    }
    foreach run [array names sossalon] {
        foreach r $sossalon($run) {
            if {[info exists countsossalon($r)]} {
                incr countsossalon($r)
            } else {
                set countsossalon($r) 1
            }
        }
    }
    foreach cousossalon [lsort -dictionary [array names countsossalon]] {
      if {[string match -nocase $cousossalon $salon]} {
      putfast "NOTICE $nick :Commande !sos/attaque déjà désactivé sur $salon !"
      return 0
      } 
    } 
   putfast "PRIVMSG #admin :Commande !sos/attaque désactivé sur $salon par $nick !"
   set sossalon($salon) "$salon"
   set datasossalon [open "./sossalon.db" "w"]
   puts $datasossalon [list array set sossalon [array get sossalon]]
   close $datasossalon
   set nosos 1
   incr nosos
   return 0
   }
   set listsalon " [array names sossalon] "
   if { ($arg1 == "on") && ($salon != "") && [string match -nocase $connus $salon] && [string match -nocase "* $connus *" $listsalon] } {
   putfast "PRIVMSG #admin :Commande !sos/attaque réactivé  sur $salon par $nick ."
   unset sossalon($connus)
   set datasossalon [open "./sossalon.db" "w"]
   puts $datasossalon [list array set sossalon [array get sossalon]]
   close $datasossalon
   unset nosos
   return 0
      } elseif { ($arg1 == "on") && ($salon != "") && [string match -nocase $connus $salon] && ![string match -nocase "* $connus *" $listsalon] } {
      putfast "PRIVMSG $chan :Commande !sos/attaque déjà réactivé1 sur $salon ."
      return 0
      }
     }
    }
   }
  }
 }
}
 
if {[file exists "./sossalon.db"]} {
source "./sossalon.db"
}



Messages In This Thread
SOS - by Babytigrou16 - 08/08/2009, 07:48
RE: SOS - by heretoc - 08/08/2009, 12:33
RE: SOS - by BlackNight - 09/08/2009, 02:07
RE: SOS - by Babytigrou16 - 09/08/2009, 17:38
RE: SOS - by BlackNight - 09/08/2009, 21:29
RE: SOS - by Babytigrou16 - 09/08/2009, 22:34
RE: SOS - by CrazyCat - 09/08/2009, 22:37
RE: SOS - by BlackNight - 09/08/2009, 22:38
RE: SOS - by Babytigrou16 - 10/08/2009, 03:05
RE: SOS - by BdS - 10/08/2009, 10:08
RE: SOS - by heretoc - 10/08/2009, 17:53
RE: SOS - by Babytigrou16 - 11/08/2009, 00:19
RE: SOS - by BlackNight - 12/08/2009, 04:08
RE: SOS - by BlackNight - 12/08/2009, 04:10

Forum Jump:


Users browsing this thread: 1 Guest(s)