Timer TCL
#12
Merci à tous pour votre aide, j'ai réussi à m'en sortir depuis le temps.
Et je vous fait donc part, en remerciement, du code qui en a découlé.

Je vous demanderai à tous, de respecter les conditions d'utilisation de ce code si vous décidez de vous en servir.

tcl
####################################################################
#        Script de demande d'animateurs par BlackNight             #
# ---------------------------------------------------------------- #
# Le principe est simple, vous avez plusieurs salons, des          #
# animateurs un peu partout, mais un salon a besoin d'animateur    #
# car celui du salon concerné s'absente, il peux donc se faire     #
# remplacer, en tapant !demande #salon , sur le salon du staff     #
# ---------------------------------------------------------------- #
# Requiert:                                                        #
#           - une Oline avec le flag netadmin pour l'eggdrop       #
# ---------------------------------------------------------------- #
# Conditions d'utilisation:                                        #
# Vous pouvez redistribuer ce code comme bon vous semble, le       #
# modifier, l'améliorer librement, tant que vous me faites part    #
# de ces modifications, et que vous mettiez ce code à disposition  #
# de tous, sans aucunes restrictions.                              #
# ---------------------------------------------------------------- #
# BlackNight : <magic.boss6@gmail.com>                             #
####################################################################

 
###configuration###
#salon où seront effectuées les demandes
set staff "#staff"
#liste de vhost autorisée a faire les demandes
set vhostniv0 {
	*@NetAdmin.domaine.tld
	*@ChanAdmin.domaine.tld
	*@ChanOp.domaine.tld
	*@Op.domaine.tld
	*@TechAdmin.domaine.tld
	*@IrcOp.domaine.tld
	*@global.domaine.tld
	*@anim.domaine.tld
}

 
 
 
## Ne modifiez rien ci-dessous sans connaisance du langage TCL ##
 
set chandemande "null"
bind pub - !demande demandestaff
proc demandestaff { nick host handle channel arg } {
 
global vhostniv0 staff chandemande
   if ![string compare -nocase $channel "$staff"] {
foreach vhostdemstaff $vhostniv0 {
 
  if [string match -nocase $vhostdemstaff $host]  {
      if ![string compare -nocase $chandemande "null"] {
 
  set chandemande "[lindex $arg 0]"
putquick "PRIVMSG $channel : Un animateur est demandé sur $chandemande par $nick. Tapez !ok pour accepter. Demande valable 1 minute."
putquick "NOTICE $channel : Un animateur est demandé sur $chandemande. Tapez !ok pour accepter. Demande valable 1 minute."
bind pub - !ok demandestaff:ok
utimer 60 { proc_expire }
 
		} else { putquick "PRIVMSG $channel :KO. Une demande est déjà en cours." }
 
	}
   }
 }
 
 }
 
 
proc proc_expire {} {
global staff chandemande 
set staffchan $staff
set demandechan $chandemande
if { $demandechan != "null" } {
   putquick "PRIVMSG $staffchan :La demande pour $demandechan à expirée. vous pouvez formuler une nouvelle demande."
set chandemande "null"
}
}
 
proc demandestaff:ok { nick host handle channel arg } {
 
global vhostniv0 staff chandemande
set staffchan $staff
set demandechan $chandemande
 
   if ![string compare -nocase $channel "$staffchan"] {
foreach vhostdemstaffok $vhostniv0 {
 
  if [string match -nocase $vhostdemstaffok $host]  {
if {$demandechan != "null"} {
 
  putquick "SAJOIN $nick $demandechan"
  putquick "PRIVMSG cerbere halfop $demandechan $nick"
  putquick "PRIVMSG $channel :$nick accèpte la demande sur $demandechan."
  putquick "PRIVMSG $channel :Vous pouvez formuler une nouvelle demande."
set chandemande "null"
 
		} else { putquick "PRIVMSG $channel :KO. Auncune demande n'est en cours." }
}
}
}
}
 
 
putlog "Demande.tcl Dévellopé par BlackNight"





Je n'ai par contre pas mit de vérifications des salons concernés par les demandes, par manque de temps sans doutes, aussi ne sachant pas vraiment comment faire.


Merci à la communauté d' Eggdrop.fr
Répondre Avertir


Messages dans ce sujet
Timer TCL - par BlackNight - 05/07/2009, 13:29
RE: Timer TCL - par fedora - 05/07/2009, 15:40
RE: Timer TCL - par BlackNight - 05/07/2009, 16:01
RE: Timer TCL - par fedora - 05/07/2009, 16:05
RE: Timer TCL - par Artix - 06/07/2009, 09:46
RE: Timer TCL - par fedora - 06/07/2009, 09:55
RE: Timer TCL - par Artix - 06/07/2009, 19:53
RE: Timer TCL - par fedora - 06/07/2009, 21:04
RE: Timer TCL - par djkenny - 07/07/2009, 02:11
RE: Timer TCL - par djkenny - 07/07/2009, 02:14
RE: Timer TCL - par David - 18/07/2009, 11:17
RE: Timer TCL - par BlackNight - 09/08/2009, 02:36
RE: Timer TCL - par Babytigrou16 - 09/08/2009, 18:13
RE: Timer TCL - par BlackNight - 09/08/2009, 19:48
RE: Timer TCL - par DodY - 13/02/2010, 19:11
RE: Timer TCL - par DodY - 13/02/2010, 19:42

Atteindre :


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