[Script] Petit TCL de gestion
#28
Salut, L'envie ma pris..
Alors j'ai refait ton code plus ou moins, J'ai pas tout fait.. Car tu aura des exemples et tu devrais y arrivée.
Alors je n'es pas fait les commandes par socket "pas encore manque de temps désoler.."
Ensuite je t'es refait certaines erreurs, Dont pour le système de ban "a tester comme tout le reste du code".

Je te transmet le code entier, basé sur le mien, mais modifié pour ton réseau, Par la suite nous feront certains changement je pense.
Pour ce qui et de la modération, jette sa à la poubelle.. Je te passerais ma version bêta à moi par mp, je ne l'ai jamais fini tu la testera comme sa.

Voici donc le code refait :

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) "Aurore.****.fr"
set aurore(ip) "ip"
set aurore(port) "port"
set aurore(pwdlink) "pass"
set aurore(info) "Aurore Services"
 
#****************************#
# Configuration des sockets. #
#****************************#
 
set aurore(nick) "Laura"
set aurore(identd) "Laura"
set aurore(host) "Services.****.fr"
set aurore(nom) "Laura Service Moderation"
 
#***************************#
# Salon de log des sockets. #
#***************************#
 
set aurore(log) "#Services"
set aurore(quit01) "Redemarage Laura-Service."
set aurore(quit02) "Fermeture Laura-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) 1 [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) 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 Aurore-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} {
    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 Anims. #
#********************#
 
bind pub n "!xdevoice" [namespace current]::xdevoice
proc xdevoice { nick handle uhost chan text } {
    pushmode $chan -v $nick
    puthelp "NOTICE $nick :Merci d'avoir animé $nick"
}

#**************#
# Kick Pseudo. #
#**************#
 
bind pub n "!kick" [namespace current]::kick
proc kick { nick hand host chan arg } {
    set nick [lindex $arg 0]
    putkick $chan $nick "Merci de rester calme !"
    return 0
}

#*************#
# Ban Pseudo. #
#*************#
 
bind pub n "!kb" pub:kb
proc pub:kb { nick hand host chan arg } {
    # 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.
    pushmode $chan +b $nik!$host
    putkick $chan $nick "Reste Cool !"
}

#**************#
# Appel Ircop. #
#**************#
 
bind pub n "!appel" [namespace current]::appel
proc appel { nick uhost handle chan arg } {
    variable aurore
    puthelp "PRIVMSG $aurore(log) $nick Appel un IRCop sur $chan"
    putserv "NOTICE $nick Les IRCops on ete appelé"
}

#****************#
# Help Commande. #
#****************#
 
bind pub X "!modere" [namespace current]::help
proc help { nick uhost handle chan arg } {
    set commande [lindex $arg 1]
    set commande [stripcodes abcu [lindex $arg 0]]
    if {$commande == ""} {
        puthelp "privmsg $nick :\00314Commande Help du Robot \002\0034$::botnick\002\0034"
        puthelp "privmsg $nick :\017"
        puthelp "privmsg $nick :\0034!xvoice\0034 \0031a utilisé que quand vous moderé sous peine de sanction!\0031"
        puthelp "privmsg $nick :\0034!xdevoice\0034 \0031a faire quand vous avez fini de moderé !\0031"
        puthelp "privmsg $nick :\0034!kick\0034 \0031sert a kické un user du salon !\0031"
        puthelp "privmsg $nick :\0034!kb\0034 \0031Sert a kick/ban un user du salon !\0031"
        puthelp "privmsg $nick :\0034!appel\0034 \0031sert a appelé les IRCop en cas de grosse perturbation sur le salon !\0031"
        puthelp "privmsg $nick :\0034!chut\0034 \0031sert a coupé la parole a un user pendant 3minute !\0031"
        # La commande !chute, je ne l'ai pas mise je te laisse le faire en regardant comment j'ai fait partout pour tes binds. Faut tu bosse un peut quand même !
        puthelp "privmsg $nick :\00314Fin Help du Robot \002\0034$::botnick\002\0034"
    }
}

#************************************************************************************************************#
# Tu as le principal, il te reste à ajouter/modifier ce que toi tu semble vouloir,                           #
# J'ai juste mis les commande par ton eggdrop, je n'es pas encore fait par socket.                           #
# Les commandes disponibles par sockets je le ferait une autre fois lorsquej'aurais plus de temps pour cela. #
# Je reste quand même à disposition au cas ou.                                                               #
#************************************************************************************************************#
 
#****************************#
# Fin du Service Sockets 1.0 #
#****************************#
# connection 
[namespace current]::xconnect:serv
}
 
putlog "\0031Service Sockets 1.0 \0034Chargé."


Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
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é