Communauté Eggdrop
Commande SAY pour Windrop [Résolu] - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : Commande SAY pour Windrop [Résolu] (/showthread.php?tid=1273)



Commande SAY pour Windrop [Résolu] - tow - 19/11/2012

Bonjour,
je cherche à reproduire l'équivalent de ce script mIRC sur mon Windrop. Le soucis c'est que je n'arrive vraiment pas à comprendre le fonctionnement du TCL...

Code :
On *:TEXT:SAY #*:?:{
if ($nick ison #opers) { msg $2 $3- }
}
Merci d'avance... Smile


RE: Commande SAY pour Windrop - aliasangelius - 19/11/2012

Salut,

TCL
bind msg - "say" say
proc say { nick uhost hand text } {
		 set chan [string tolower [lindex $text 0]]
    if { [nick2hand $nick] eq "*" } {
         puthelp "notice $nick :aucun axx"
    return 0
    }
	if {![string match #* [lindex $text 0]]} {
	     puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick say <#salon> <text> ) !"
	return 0
	}
	if {![validchan [lindex $text 0]]} {
         puthelp "notice $nick :Désolé $nick mais le salon que tu demandes est inconnu !"
    return 0
    }
	if {![matchattr $hand o|o $chan]} {
         puthelp "notice $nick :Vous n'avez pas le level suffisant dans $::botnick pour utiliser cette commande $nick !"
    return 0
    }
	if {![botonchan [lindex $text 0]]} {
         puthelp "notice $nick :Désolé $nick mais je suis absent du salon $chan !"
    return 0
    }
		 set chann "[lindex [channels] [lsearch [string tolower [channels]] [string tolower [lindex $text 0]]]]"
         putserv "privmsg [lindex $text 0] :[join [lrange $text 1 end]]"
	return
}



Sa devrais fonctionner comme sa


RE: Commande SAY pour Windrop - tow - 19/11/2012

Merci bien, ça marche Smile


RE: Commande SAY pour Windrop - aliasangelius - 19/11/2012

De rien marque ton sujet resolu Smile