scritp tcl !bombe
#3
salut ....
j'ai retrouvé un vieux code qui pourrais sans doute etre amelioré, mais je pense qu'il devrait te suffire ....

tcl
# BOMBE - v1.0.2
set bombe_version "1.0.2"
# par ToM (2004)
##########################################################################################################
#
# DESCRIPTION :
# Le jeu de la patate chaude
###############################################################################
# UTILISATION :
# !allume
#	pour allumer une bombe
# !bombe <nick>
#	pour passer la bombe à <nick>
# !feinte
#	pour faire semblant de passer la bombe à <nick>
# !desamorce
#	pour désamorcer la bombe
###############################################################################
# CHANGELOG :
# v1
#	Création du script d'après Jokes.tcl par Tozz
# v1.0.1
#	Correction d'un bug !
# v1.0.2
#	Correction d'un bug ! (oui encore)
###############################################################################
# TODO :
# !desamorce : devrait prendre un certain temps avant de désamorcer
# !desamorce : devrait foirer de temps en temps :)
###############################################################################
###############################################################################
# CONFIGURATION DU SCRIPT
###############################################################################

# Le message d'aide qui sera envoyé au nick qui reçoit la bombe
set bombe_message_aide "Pour passer la bombe tape !bombe suivi du nom de la personne ; tu peux aussi feinter avec !feinte nick. Si tu veux désamorcer tape !desamorce"

#salon ou  le script ne  dois PAS fonctionner
set bomb_forbidchan "#salon1 #salon2"

###############################################################################
# FIN DE LA CONFIGURATION
# Ne pas éditer plus bas tant que vous ne savez pas ce que vous faites :p
############################################################################### 

# COMMANDES BOMBE
bind pub - !allume bombe_allumage
bind pub - !bombe		bombe_passe
bind pub - !feinte	bombe_feinte
bind pub - !desamorce	bombe_desamorce

 
### Initialisation des variables globales
 
set bombe_en_cours 0

 
### !allume
 
proc bombe_allumage {nick host hand chan arg} {
 
	global bomb_forbidchan
 
	if {$chan == $bomb_forbidchan} {
		putserv "notice $nick :On ne s'explose pas la face sur $bombe_forbidchan !"
		return 1
	}
 
 
global bombe_en_cours bombe_allumeur bombe_porteur bombe_timer_moitie bombe_timer_fini bombe_chan bombe_a_tourne bombe_message_aide
 
	if {$bombe_en_cours == 0} {
		putserv "PRIVMSG $chan :$nick sifflote, sort une bombe de sa poche et l'allume... Psssshhhhhhhhhhh..."
		putnotc $nick "$bombe_message_aide"
 
		set bombe_en_cours 1
		set bombe_chan $chan
		set bombe_porteur $nick
		set bombe_allumeur $nick
		set bombe_a_tourne 0
		set bombe_timer_moitie [utimer 60 bombe_timer_moitie]
		set bombe_timer_fini [utimer 120 bombe_timer_fini]
	} else {
		if {[strlwr $nick] == [strlwr $bombe_allumeur]} {
			puthelp "PRIVMSG $chan :$nick t'as déjà amorcé une bombe, pas la peine de tout faire exploser !!"
		} else {
			puthelp "PRIVMSG $chan :$bombe_allumeur a déjà piégé le chan $bombe_chan. C'est $bombe_porteur qui l'a entre les mains ... jusqu'à ce qu'il tape !bombe $nick ;)"
		}
	}
 
}

 
 
### !bombe
 
proc bombe_passe {nick host hand chan arg} {
 
	global bombe_en_cours bombe_allumeur bombe_porteur bombe_timer_moitie bombe_timer_fini bombe_chan bombe_a_tourne bombe_message_aide
 
	if {$bombe_en_cours==0} { 
		puthelp "PRIVMSG $chan :$nick tu veux passer quoi là ? T'as pas de bombe encore... [underline]!allume[reset] en une :)"
		return 0
	}
 
	if {[strlwr $nick] != [strlwr $bombe_porteur]} {
		puthelp "PRIVMSG $chan :Euh $nick c'est pas toi qui a la bombe c'est $bombe_porteur ... tant qu'il tape pas !bombe $nick :)"
		return 0
	}
 
	if {$arg==""} {
		puthelp "PRIVMSG $chan :Ce serait sympa de préciser à qui tu veux refiler le bébé $nick :)"
		return 0	
	}
 
	if {[strlwr $arg] == [strlwr $nick]} {
		puthelp "PRIVMSG $chan :Euh $nick tu jongles avec la bombe là ? :)"
		return 0	
	}
 
	if {![onchan $arg $bombe_chan]} {
		puthelp "PRIVMSG $chan :Euh $nick je vois personne qui s'appelle $arg ici... Tu ferais mieux de la passer à quelqu'un de présent sur $bombe_chan :)"
	return 0	
	}
 
	if {[strlwr $arg] == [strlwr $bombe_allumeur]} {
		puthelp "PRIVMSG $chan :Ah ! La bombe a fait un tour et revient dans les mains de $bombe_allumeur sans que ça ait pété ! Beau jeu d'équipe !"
	} else {
		puthelp "PRIVMSG $chan :$nick jette la bombe à $arg... Vas-y débrouille toi avec ça !"
	}
 
	putnotc $arg "$bombe_message_aide"
	set bombe_porteur $arg
	set bombe_a_tourne 1
 
	return 0
 
}

### !feinte
 
proc bombe_feinte {nick host hand chan arg} {
 
	global bombe_en_cours bombe_allumeur bombe_porteur bombe_timer_moitie bombe_timer_fini bombe_chan bombe_a_tourne
 
	if {$bombe_en_cours==0} { 
		puthelp "PRIVMSG $chan :$nick tu veux feinter avec quoi ! Tape déjà !allume tu verras après :)"
		return 0
	}
 
	if {[strlwr $nick] != [strlwr $bombe_porteur]} {
		puthelp "PRIVMSG $chan :Euh $nick c'est pas toi qui a la bombe c'est $bombe_porteur ... tant qu'il tape pas !bombe $nick :)"
		return 0
	}
 
	if {$arg==""} {
		puthelp "PRIVMSG $chan :$nick tu devrais dire qui tu veux feinter..."
		return 0	
	}
 
	if {[strlwr $arg] == [strlwr $nick]} {
		puthelp "PRIVMSG $chan :lol y'a $nick qui se feinte tout seul :p"
		return 0	
	}
 
	if {![onchan $arg $bombe_chan]} {
		puthelp "PRIVMSG $chan :Euh $nick je vois personne qui s'appelle $arg ici... Tu ferais mieux de feinter quelqu'un de présent sur $bombe_chan :)"
		return 0	
	}
 
	if {[strlwr $arg] == [strlwr $bombe_allumeur]} {
		puthelp "PRIVMSG $chan :Ah ! C'est $bombe_allumeur qui l'a allumée cette bombe, c'est normal qu'il y ait des représailles :)"
	} else {
		puthelp "PRIVMSG $chan :$nick s'approche de $arg comme s'il allait l'embrasser ... lui fourre la bombe sous le nez... puis repart avec. Quel talent d'acteur !!"
	}
 
	return 0
 
}

### !desamorce
 
proc bombe_desamorce {nick host hand chan arg} {
 
	global bombe_en_cours bombe_allumeur bombe_porteur bombe_timer_moitie bombe_timer_fini bombe_chan bombe_a_tourne
 
	if {$bombe_en_cours==0} { 
		puthelp "PRIVMSG $chan :$nick tu veux désamorcer quoi là, t'as chaud ? Tape déjà !allume tu verras après :)"
		return 0
	}
 
	if {[strlwr $nick] != [strlwr $bombe_porteur]} {
		puthelp "PRIVMSG $chan :Euh $nick c'est pas toi qui a la bombe c'est $bombe_porteur ... tant qu'il tape pas !bombe $nick :)"
		return 0
	}
 
	if {$bombe_a_tourne==0} {
		puthelp "PRIVMSG $chan :$nick désamorce la tranquillement la bombe, sans avoir menacé personne avec. C'est une variante de la !roulette ? T'as de la chance qu'elle t'ait pas explosé en pleine tronche..."
	} else {
		puthelp "PRIVMSG $chan :$nick sort fébrilement sa p'tite pince et coupe le fil rouge. Il était temps, à mon avis ça allait pas tarder à péter !"
	}
 
	set bombe_en_cours 0
	if {[utimerexists bombe_timer_moitie]!=""} {killutimer $bombe_timer_moitie}
	if {[utimerexists bombe_timer_fini]!=""} {killutimer $bombe_timer_fini}
 
	return 0
 
}

### bombe_timer_moitie
 
proc bombe_timer_moitie {} {
 
global bombe_en_cours bombe_allumeur bombe_porteur bombe_timer_moitie bombe_timer_fini bombe_chan bombe_a_tourne
 
	if {$bombe_en_cours==0} { 
		return 0
	}
 
	if {$bombe_a_tourne==0} {
		puthelp "PRIVMSG $bombe_chan :La mèche de la bombe s'est déjà à moitié consumée, et c'est toujours $bombe_allumeur qui l'a dans les mains... $bombe_allumeur t'es pétrifié par la trouille ? :)"
	} else {
		puthelp "PRIVMSG $bombe_chan :$bombe_porteur s'aperçoit que la mèche de la bombe s'est déjà à moitié consumée..."
	}
 
}

### bombe_timer_fini
 
proc bombe_timer_fini {} {
 
	global bombe_en_cours bombe_allumeur bombe_porteur bombe_timer_moitie bombe_timer_fini bombe_chan bombe_a_tourne
 
	if {$bombe_en_cours==0} { 
		return 0
	}
 
	if {$bombe_a_tourne==0} {
		puthelp "PRIVMSG $bombe_chan :La mèche est totalement consumée, et $bombe_allumeur la tient toujours dans ses mains... C'était un suicide !"
		putserv "kick $bombe_chan $bombe_allumeur :[bold]BAOUM !!![bold] :'( Adieu on t'aimait bien !"
	} else {
		puthelp "PRIVMSG $bombe_chan :$bombe_porteur n'a pas le temps de passer la bombe qu'elle explose ! Saleté de $bombe_allumeur tu le paieras ! :)"
		putserv "kick $bombe_chan $bombe_porteur :[bold]BAOUM !!![bold] Ta mort sera vengée."
	}
 
	set bombe_en_cours 0
 
}

 
############################
# debug
############################
 
bind pub - !bdebug bombe_debug
proc bombe_debug {nick host hand chan arg} {
 
	global bombe_en_cours bombe_allumeur bombe_porteur bombe_timer_moitie bombe_timer_fini bombe_chan bombe_a_tourne bombe_message_aide
	puthelp "PRIVMSG $bombe_chan :bombe_en_cours -> $bombe_en_cours | bombe_chan -> $bombe_chan | bombe_a_tourne -> $bombe_a_tourne"
	puthelp "PRIVMSG $bombe_chan :bombe_allumeur -> $bombe_allumeur | bombe_porteur -> $bombe_porteur"
	puthelp "PRIVMSG $bombe_chan :bombe_timer_moitie -> $bombe_timer_moitie | bombe_timer_fini -> $bombe_timer_fini"
	puthelp "PRIVMSG $bombe_chan :$bombe_message_aide"
}
 
 
 
 
 
 
putlog "[bold]Bombe[bold] v$bombe_version par AzazeL. Tapez [underline]!allume[reset] :)"



voilà, a toi de le configurer pour ton chan /eggdrop et au besoin de le modifier, merci de l'aiser le nom de l'auteur.
Répondre Avertir


Messages dans ce sujet
scritp tcl !bombe - par cecile155 - 29/12/2010, 17:14
RE: scritp tcl !bombe - par CrazyCat - 29/12/2010, 17:23
RE: scritp tcl !bombe - par cestlemien - 29/12/2010, 17:27
RE: scritp tcl !bombe - par cecile155 - 29/12/2010, 17:32
RE: scritp tcl !bombe - par cestlemien - 29/12/2010, 17:36
RE: scritp tcl !bombe - par cecile155 - 29/12/2010, 17:36
RE: scritp tcl !bombe - par CrazyCat - 29/12/2010, 18:48
RE: scritp tcl !bombe - par cestlemien - 29/12/2010, 18:55
RE: scritp tcl !bombe - par CrazyCat - 29/12/2010, 19:01
RE: scritp tcl !bombe - par cestlemien - 29/12/2010, 19:07
RE: scritp tcl !bombe - par cestlemien - 29/12/2010, 20:20
RE: scritp tcl !bombe - par cestlemien - 29/12/2010, 20:56
RE: scritp tcl !bombe - par CrazyCat - 29/12/2010, 22:35
RE: scritp tcl !bombe - par cestlemien - 29/12/2010, 23:12
RE: scritp tcl !bombe - par CrazyCat - 30/12/2010, 13:14
RE: scritp tcl !bombe - par cecile155 - 30/12/2010, 14:12
RE: scritp tcl !bombe - par CrazyCat - 30/12/2010, 21:24
RE: scritp tcl !bombe - par cecile155 - 30/12/2010, 22:29

Atteindre :


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