AutoIt Français

Nouveau forum : http://www.autoitscript.fr/
 
AccueilFAQRechercherS'enregistrerMembresGroupesConnexionhttp://www.autoitscript.fr

Partagez | 
 

 Random Dice

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Crad-Vador
Membre


Nombre de messages : 23
Age : 30
Localisation : Clermont-Ferrand
Date d'inscription : 04/01/2007

MessageSujet: Random Dice   2007-03-15, 19:23

Random Dice est petit script (mais néanmoins utile...) qui simule le lancé de dé dans les jeux de rôle papier.

Code :

[color=Red]#include[/color]
[color=Red][/color]
[color=MediumBlue]$Form1[/color] [color=Green]=[/color] [b]GUICreate[/b] ( "RANDOM DICE [color=Green]for[/color] RPG v1.0" [color=Green],[/color] 466 [color=Green],[/color] 300 [color=Green],[/color] 194 [color=Green],[/color] 115 )
[b]GUISetIcon[/b] ( "C:Documents and SettingsnicoBureau11266.ico" )
[color=MediumBlue]$Button1[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D2" [color=Green],[/color] 16 [color=Green],[/color] 24 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button2[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D4" [color=Green],[/color] 80 [color=Green],[/color] 24 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button3[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D6" [color=Green],[/color] 16 [color=Green],[/color] 72 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button4[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D8" [color=Green],[/color] 80 [color=Green],[/color] 72 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button5[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D10" [color=Green],[/color] 16 [color=Green],[/color] 120 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button6[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D12" [color=Green],[/color] 80 [color=Green],[/color] 120 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button7[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D20" [color=Green],[/color] 16 [color=Green],[/color] 168 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button8[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "D100" [color=Green],[/color] 80 [color=Green],[/color] 168 [color=Green],[/color] 41 [color=Green],[/color] 41 [color=Green],[/color] 0 )
[color=MediumBlue]$Button9[/color] [color=Green]=[/color] [b]GUICtrlCreateButton[/b] ( "Clear" [color=Green],[/color] 16 [color=Green],[/color] 240 [color=Green],[/color] 105 [color=Green],[/color] 33 [color=Green],[/color] 0 )
[color=MediumBlue]$Aedit1[/color] [color=Green]=[/color] [b]GUICtrlCreateEdit[/b] ( "" [color=Green],[/color] 136 [color=Green],[/color] 24 [color=Green],[/color] 305 [color=Green],[/color] 249 [color=Green],[/color] [b]BitOR[/b] ( [color=MediumBlue]$ES_AUTOVSCROLL[/color] [color=Green],[/color] [color=MediumBlue]$ES_AUTOHSCROLL[/color] [color=Green],[/color] [color=MediumBlue]$ES_READONLY[/color] [color=Green],[/color] [color=MediumBlue]$ES_WANTRETURN[/color] [color=Green],[/color] [color=MediumBlue]$ES_NUMBER[/color] ) )
[b]GUICtrlSetLimit[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] 900 )
[b]GUISetState[/b] ( [color=Fuchsia]@SW_SHOW[/color] )
[color=Red][/color][color=Red][/color]
[color=Green]While[/color] 1
[color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [b]GUIGetMsg[/b] ( )
[b]Select[/b]
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$GUI_EVENT_CLOSE[/color]
[b]Exit[/b]
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button1[/color]
[color=MediumBlue]$D2[/color] [color=Green]=[/color] RDice ( 2 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D2[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button2[/color]
[color=MediumBlue]$D4[/color] [color=Green]=[/color] RDice ( 4 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D4[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button3[/color]
[color=MediumBlue]$D6[/color] [color=Green]=[/color] RDice ( 6 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D6[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button4[/color]
[color=MediumBlue]$D8[/color] [color=Green]=[/color] RDice ( 8 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D8[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button5[/color]
[color=MediumBlue]$D10[/color] [color=Green]=[/color] RDice ( 10 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D10[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button6[/color]
[color=MediumBlue]$D12[/color] [color=Green]=[/color] RDice ( 12 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D12[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button7[/color]
[color=MediumBlue]$D20[/color] [color=Green]=[/color] RDice ( 20 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D20[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button8[/color]
[color=MediumBlue]$D100[/color] [color=Green]=[/color] RDice ( 100 )
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] [color=MediumBlue]$D100[/color] [color=Green],[/color] [b]Default[/b] )
Case [color=MediumBlue]$nMsg[/color] [color=Green]=[/color] [color=MediumBlue]$Button9[/color]
[b]GUICtrlSetData[/b] ( [color=MediumBlue]$Aedit1[/color] [color=Green],[/color] "" )
EndSelect
[color=Green]WEnd[/color]
[color=Green]
Func[/color] RDice ( [color=MediumBlue]$D[/color] )
[color=MediumBlue]$Result[/color] [color=Green]=[/color] "D" [color=Green]&[/color] [color=MediumBlue]$D[/color] [color=Green]&[/color] " : " [color=Green]&[/color] Random ( 1 [color=Green],[/color] [color=MediumBlue]$D[/color] [color=Green],[/color] 1 ) [color=Green]&[/color] " [color=Green],[/color] " [color=Green]&[/color] [color=Fuchsia]@CRLF[/color]
[color=Green]Return[/color] [color=MediumBlue]$Result[/color]
[color=Green]EndFunc


...

[url=ftp://crad-vador.is-a-geek.net/script/Random_Dice/randomdice.zip]Télécharger l'archive[/url]

L'icône est dans l'archive, n'oubliez pas de changé le chemin de l'icône dans le script.
[/color]
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://www.crad-vador.net
 
Random Dice
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» documentation de random
» random plusieurs choix
» Random Dungeon Generator
» random background [résolu]
» space ship sprite generator

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
AutoIt Français :: AutoIt v3 :: Scripts-
Sauter vers: