Sujet Resolu :)
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é :)
Code:
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é :)
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é."