[Script] Petit TCL de gestion
#77
Sujet Resolu Smile

Un grd merci a aliasangelius pour m'avoir aidé pour ce code et un grd merci aussi a CrazyCat pour avoir trouvé la solution au probleme de link.. :p

Voicis le code corrigé Smile

Code:
tcl
#*************************************************#
# Système de sockets pour le réseaux Aurel-Tchat. #
# Fait par alias_angelius avec BaGrift.          #
#*************************************************#
 
namespace eval ::socks {
   variable aurore
 
#********************#
# Service.Socket 1.0 #
#********************#
 
#**************************#
# Information link reseau. #
#**************************#
 
set aurore(serv) "Socket.*******.fr"
set aurore(ip) "IP"
set aurore(port) "PORT"
set aurore(pwdlink) "********"
set aurore(info) "Aurore Services"
 
#****************************#
# Configuration des sockets. #
#****************************#
 
set aurore(nick) "Aurore"
set aurore(identd) "Aurore"
set aurore(host) "Aurore.********.fr"
set aurore(nom) "Aurore Service Moderation"
 
#***************************#
# Salon de log des sockets. #
#***************************#
 
set aurore(log) "#Anonymes"
set aurore(salon) "#Accueil"
set aurore(staff) "#Staff"
set aurore(quit01) "Redemarage Aurore-Service."
set aurore(quit02) "Fermeture Aurore-Service."
 
#****************************************#
# Lancement de la procédure des sockets. #
#****************************************#
 
proc checkconnect {} {
   if {![info exists aurore(idx)]} { utimer 30 [namespace current]::checkconnect } else { xconnect:serv }
}
 
proc xconnect:serv {} {
   variable aurore
   if [catch {set aurore(idx) [connect $aurore(ip) $aurore(port)]} err] {
      putlog "Connection error :$err"
      return
   }
   putdcc $aurore(idx) "PASS $aurore(pwdlink)"
   putdcc $aurore(idx) "SERVER $aurore(serv) [unixtime] :$aurore(info)"
   putdcc $aurore(idx) ":$aurore(serv) NICK $aurore(nick) '' '' $aurore(identd) $aurore(host) $aurore(serv) '' :$aurore(nom)"
   putdcc $aurore(idx) ":$aurore(nick) MODE $aurore(nick) +oOSqsw"
   putdcc $aurore(idx) ":$aurore(nick) JOIN $aurore(log)"
   putdcc $aurore(idx) ":$aurore(nick) JOIN $aurore(salon)"
   putdcc $aurore(idx) ":$aurore(nick) MODE $aurore(log) +ntsv $aurore(nick)"
   control $aurore(idx) [namespace current]::controling_server
   utimer 10 [namespace current]::verify
}
 
#***********************************#
# Verify si le serveur est Connecté #
#***********************************#
 
proc verify {} {
   variable aurore
   if [valididx [set [namespace current]::aurore(idx)]] {
      utimer 30 [namespace current]::verify
   } else {
      xconnect:serv
   }
}
 
proc controling_server {idx arg} {
   variable aurore
   set arg1 [lindex [split $arg " "] 0]
   set arg2 [lindex [split $arg " "] 1]
   set arg3 [lindex [split $arg " "] 2]
   set arg4 [lindex [split $arg " "] 3]
   set arg5 [lindex [split $arg " "] 4]
   set arg6 [lindex [split $arg " "] 5]
   set arg7 [lindex [split $arg " "] 6]
   set arg8 [lindex [split $arg " "] 7]
   set arg10 [string trim [lrange [split $arg " "] 3 end] :]
   if {$arg2=="PING"} {
      putdcc $aurore(idx) ":$aurore(serv) PONG $aurore(ip) :$aurore(serv)"
    }   
}
 
#**********************#
# Restart des sockets. #
#**********************#
 
bind evnt - prerestart [namespace current]::eva:restart
proc eva:restart {args} {
   variable aurore
   putdcc $aurore(idx) ":$aurore(serv) SQUIT $aurore(serv) :Restart Sockets."
   catch {close $aurore(idx)}
}
 
#********************#
# Rehash du Service. #
#********************#
 
bind dcc n xrehash [namespace current]::eggy:xrehash
proc eggy:xrehash {nick idx arg} {
   variable aurore
   putdcc $idx "\002Rehash de Aurore-Service et des fichiers\002"
   utimer 4 rehash
}
 
#*********************#
# Restart du Service. #
#*********************#
 
bind dcc n xrestart [namespace current]::eggy:xrestart
proc eggy:xrestart {nick idx arg} {
   variable aurore
   putdcc $idx "\002Redémarrage de Laura-service\002"
   if [valididx [set [namespace current]::aurore(idx)]] {
      putdcc $aurore(idx) ":$aurore(nick) QUIT :$aurore(quit01)"
      putdcc $aurore(idx) ":$aurore(serv) SQUIT :$aurore(serv)"
      catch {close $aurore(idx)}
      foreach kill [utimers] {
          if {[lindex $kill 1]=="[namespace current]::verify"} { killutimer [lindex $kill 2] }
      }
    }
    xconnect:serv
}
 
#*****************#
# Die du Service. #
#*****************#
 
bind dcc n xdie [namespace current]::eggy:xdie
proc eggy:xdie {nick idx arg} {
   variable aurore
    putdcc $idx "\002Arrêt de Aurore-Service\002"
    if [valididx [set [namespace current]::aurore(idx)]] {
       putdcc $aurore(idx) ":$aurore(nick) QUIT : $aurore(quit02)"
       putdcc $aurore(idx) ":$aurore(serv) SQUIT :$aurore(quit02)"
       catch {close $aurore(idx)}
       foreach kill [utimers] {
          if {[lindex $kill 1]=="[namespace current]::verify"} { killutimer [lindex $kill 2] }
       }
   }
}
 
#**********************#
# Xvoice pour anim      #
#**********************#
 
bind pub n "!xvoice" [namespace current]::xvoice
proc xvoice { nick handle uhost chan text } {
   variable aurore
   putdcc $aurore(idx) ":$aurore(nick) MODE $chan +v $nick"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Bonne Moderation !"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Pour savoir mais commandes de modération tape !modere"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Pence Bien a te devoice quand tu anim plus ! => !xdevoice Merci"
   putquick "SAJOIN $nick $aurore(staff)"
}
 
#********************#
# Xdevoice pour anim #
#********************#
 
bind pub n "!xdevoice" [namespace current]::xdevoice
proc xdevoice { nick handle uhost chan text } {
   variable aurore
   putdcc $aurore(idx) ":$aurore(nick) MODE $chan -v $nick"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Merci d'avoir animé $nick"
}
 
#**************#
# Kick Pseudo. #
#**************#
 
bind pub n "!kick" [namespace current]::kick
proc kick { nick hand host chan arg } {
   variable aurore
   set nick [lindex $arg 0]
   putdcc $aurore(idx) ":$aurore(nick) KICK $chan $nick Merci de rester calme !"
   return 0
}
 
#*************#
# Ban Pseudo. #
#*************#
 
bind pub n "!kb" pub:kb
proc pub:kb { nick hand host chan arg } {
   variable aurore
    # Ici j'ai changer ton set, pour split sur un host.
   set nik [lindex [split $nick !] 0]
    # Ici je re split sur l'host.
   set host [lindex [split $nick !] 1]
    # Ici je re set arg, au cas ou plus tard faudra faire une modification.
   set arg [lindex [split $args] 1 end]
    # Maintenant ont ban sur le nick et le host.
   putdcc $aurore(idx) ":$aurore(nick) $chan +b $nik!$host"
   putdcc $aurore(idx) ":$aurore(nick) KICK $chan $nick Reste Cool Banni !"
}
 
#**************#
# Appel Ircop. #
#**************#
 
bind pub n "!appel" [namespace current]::appel
proc appel { nick uhost handle chan arg } {
   variable aurore
   putdcc $aurore(idx) ":$aurore(nick) PRIVMSG $aurore(log) $nick Appel un IRCop sur $chan"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Les IRCops on ete appelé"
}
 
#****************#
# Help Commande. #
#****************#
 
bind pub X "!modere" [namespace current]::help
proc help { nick uhost handle chan arg } {
   variable aurore
   set commande [lindex $arg 1]
   set commande [stripcodes abcu [lindex $arg 0]]
   if {$commande == ""} {
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\00314Commande Help du Robot \002\0034$::botnick\002\0034"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\017"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!xvoice\0034 \0031a utilisé que quand vous moderé sous peine de sanction!\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!xdevoice\0034 \0031a faire quand vous avez fini de moderé !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!kick\0034 \0031sert a kické un user du salon !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!kb\0034 \0031Sert a kick/ban un user du salon !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!appel\0034 \0031sert a appelé les IRCop en cas de grosse perturbation sur le salon !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!chut\0034 \0031sert a coupé la parole a un user pendant 3minute !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\00314Fin Help du Robot \002\0034$::botnick\002\0034"
   }
}
 
#****************************#
# Fin du Service Sockets 1.0 #
#****************************#
# connection 
[namespace current]::xconnect:serv
}
 
putlog "\0031Service Sockets 1.0 \0034Chargé."


Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir


Messages dans ce sujet
Petit TCL de gestion - par BaGrift - 19/03/2014, 20:33
RE: Petit TCL de gestion - par KeeViiNou - 20/03/2014, 10:46
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 12:09
RE: Petit TCL de gestion - par Pia - 20/03/2014, 12:44
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 14:02
RE: Petit TCL de gestion - par Pia - 20/03/2014, 15:12
RE: Petit TCL de gestion - par BaGrift - 20/03/2014, 15:24
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 16:05
RE: Petit TCL de gestion - par BaGrift - 20/03/2014, 16:12
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 16:30
RE: Petit TCL de gestion - par BaGrift - 20/03/2014, 16:35
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 17:48
RE: Petit TCL de gestion - par BaGrift - 20/03/2014, 18:24
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 18:34
RE: Petit TCL de gestion - par BaGrift - 20/03/2014, 18:50
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 18:58
RE: Petit TCL de gestion - par BaGrift - 20/03/2014, 19:12
RE: Petit TCL de gestion - par aliasangelius - 20/03/2014, 19:22
RE: Petit TCL de gestion - par BaGrift - 20/03/2014, 21:05
RE: Petit TCL de gestion - par MenzAgitat - 21/03/2014, 00:11
RE: Petit TCL de gestion - par aliasangelius - 21/03/2014, 10:08
RE: Petit TCL de gestion - par CrazyCat - 21/03/2014, 14:06
RE: Petit TCL de gestion - par BaGrift - 21/03/2014, 17:17
RE: Petit TCL de gestion - par aliasangelius - 22/03/2014, 15:07
RE: Petit TCL de gestion - par BaGrift - 23/03/2014, 00:55
RE: Petit TCL de gestion - par aliasangelius - 23/03/2014, 14:04
RE: Petit TCL de gestion - par BaGrift - 23/03/2014, 14:14
RE: Petit TCL de gestion - par aliasangelius - 24/03/2014, 13:49
RE: Petit TCL de gestion - par BaGrift - 24/03/2014, 14:37
RE: Petit TCL de gestion - par aliasangelius - 24/03/2014, 17:08
RE: Petit TCL de gestion - par BaGrift - 24/03/2014, 17:20
RE: Petit TCL de gestion - par aliasangelius - 24/03/2014, 17:59
RE: Petit TCL de gestion - par aliasangelius - 24/03/2014, 21:30
RE: Petit TCL de gestion - par BaGrift - 24/03/2014, 22:30
RE: Petit TCL de gestion - par aliasangelius - 25/03/2014, 13:19
RE: Petit TCL de gestion - par BaGrift - 25/03/2014, 13:35
RE: Petit TCL de gestion - par aliasangelius - 25/03/2014, 19:51
RE: Petit TCL de gestion - par BaGrift - 25/03/2014, 21:10
RE: Petit TCL de gestion - par aliasangelius - 25/03/2014, 21:24
RE: Petit TCL de gestion - par BaGrift - 25/03/2014, 21:28
RE: Petit TCL de gestion - par aliasangelius - 25/03/2014, 21:38
RE: Petit TCL de gestion - par BaGrift - 25/03/2014, 21:40
RE: Petit TCL de gestion - par aliasangelius - 25/03/2014, 21:40
RE: Petit TCL de gestion - par BaGrift - 25/03/2014, 21:44
RE: Petit TCL de gestion - par aliasangelius - 25/03/2014, 21:47
RE: Petit TCL de gestion - par BaGrift - 25/03/2014, 21:52
RE: Petit TCL de gestion - par aliasangelius - 25/03/2014, 22:04
RE: Petit TCL de gestion - par BaGrift - 25/03/2014, 22:08
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 09:21
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 11:30
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 13:01
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 13:14
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 13:15
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 13:22
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 13:28
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 13:32
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 13:34
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 13:41
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 13:44
RE: Petit TCL de gestion - par CrazyCat - 26/03/2014, 13:46
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 13:46
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 13:47
RE: Petit TCL de gestion - par CrazyCat - 26/03/2014, 13:53
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 13:57
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 14:13
RE: Petit TCL de gestion - par CrazyCat - 26/03/2014, 14:26
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 14:30
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 14:37
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 14:39
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 14:46
RE: Petit TCL de gestion - par CrazyCat - 26/03/2014, 14:52
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 14:48
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 14:49
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 14:50
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 15:07
RE: Petit TCL de gestion - par CrazyCat - 26/03/2014, 15:13
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 16:36
RE: Petit TCL de gestion - par Pia - 26/03/2014, 16:49
RE: Petit TCL de gestion - par aliasangelius - 26/03/2014, 20:49
RE: Petit TCL de gestion - par BaGrift - 26/03/2014, 21:47
RE: Petit TCL de gestion - par aliasangelius - 27/03/2014, 09:04
RE: Petit TCL de gestion - par BaGrift - 27/03/2014, 13:43
RE: Petit TCL de gestion - par aliasangelius - 10/04/2014, 11:52
RE: Petit TCL de gestion - par BaGrift - 12/04/2014, 22:31
RE: Petit TCL de gestion - par aliasangelius - 13/04/2014, 16:03
RE: Petit TCL de gestion - par BaGrift - 15/04/2014, 10:45
RE: Petit TCL de gestion - par aliasangelius - 15/04/2014, 11:49
RE: Petit TCL de gestion - par BaGrift - 17/04/2014, 13:39
RE: Petit TCL de gestion - par MenzAgitat - 17/04/2014, 19:29
RE: Petit TCL de gestion - par aliasangelius - 17/04/2014, 19:17
RE: Petit TCL de gestion - par aliasangelius - 17/04/2014, 19:50
RE: Petit TCL de gestion - par MenzAgitat - 17/04/2014, 20:01
RE: Petit TCL de gestion - par aliasangelius - 17/04/2014, 21:05
RE: Petit TCL de gestion - par BaGrift - 17/04/2014, 21:52
RE: Petit TCL de gestion - par BaGrift - 18/04/2014, 11:52
RE: Petit TCL de gestion - par aliasangelius - 18/04/2014, 18:02
RE: Petit TCL de gestion - par BaGrift - 18/04/2014, 19:04
RE: Petit TCL de gestion - par aliasangelius - 18/04/2014, 20:32
RE: Petit TCL de gestion - par BaGrift - 23/04/2014, 16:36
RE: Petit TCL de gestion - par Lisa-Alias - 23/04/2014, 22:22
RE: Petit TCL de gestion - par aliasangelius - 08/05/2014, 14:22

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté