Photos dans le fichier joint
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
DirCreate(@AppDataDir & "\machine a sou")
FileInstall("1.jpg", @AppDataDir & "\machine a sou\1.jpg")
FileInstall("2.jpg", @AppDataDir & "\machine a sou\2.jpg")
FileInstall("3.jpg", @AppDataDir & "\machine a sou\3.jpg")
FileInstall("4.jpg", @AppDataDir & "\machine a sou\4.jpg")
FileInstall("5.jpg", @AppDataDir & "\machine a sou\5.jpg")
FileInstall("6.jpg", @AppDataDir & "\machine a sou\6.jpg")
FileInstall("7.jpg", @AppDataDir & "\machine a sou\7.jpg")
FileInstall("8.jpg", @AppDataDir & "\machine a sou\8.jpg")
FileInstall("9.jpg", @AppDataDir & "\machine a sou\9.jpg")
FileInstall("10.jpg", @AppDataDir & "\machine a sou\10.jpg")
FileInstall("11.jpg", @AppDataDir & "\machine a sou\11.jpg")
FileInstall("12.jpg", @AppDataDir & "\machine a sou\12.jpg")
FileInstall("13.jpg", @AppDataDir & "\machine a sou\13.jpg")
FileInstall("14.jpg", @AppDataDir & "\machine a sou\14.jpg")
FileInstall("15.jpg", @AppDataDir & "\machine a sou\15.jpg")
FileInstall("16.jpg", @AppDataDir & "\machine a sou\16.jpg")
Global $image1, $image2, $image3, $compteur = 1, $creditgagne, $credit = 50
Global $actionimage1 = False
Global $actionimage2 = False
Global $actionimage3 = False
Global $Gaindonner = True
Global $Form1 = GUICreate("Form1", 794, 350, 192, 124)
Global $Input1 = GUICtrlCreateInput($credit, 88, 251, 65, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY))
Global $Label1 = GUICtrlCreateLabel("Credit :", 22, 250, 54, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
Global $Pic1 = GUICtrlCreatePic(@AppDataDir & "\machine a sou\16.jpg", 11, 9, 246, 141)
Global $Pic2 = GUICtrlCreatePic(@AppDataDir & "\machine a sou\16.jpg", 280, 10, 246, 141)
Global $Pic3 = GUICtrlCreatePic(@AppDataDir & "\machine a sou\16.jpg", 538, 12, 246, 141)
Global $Button1 = GUICtrlCreateButton("Stop", 63, 169, 128, 52)
Global $Button2 = GUICtrlCreateButton("Stop", 346, 169, 128, 52)
Global $Button3 = GUICtrlCreateButton("Stop", 593, 169, 128, 52)
Global $Label2 = GUICtrlCreateLabel("", 186, 245, 409, 64, $SS_CENTER)
GUICtrlSetFont(-1, 30)
Global $Button4 = GUICtrlCreateButton("Lancer", 596, 237, 128, 52)
GUISetState(@SW_SHOW)
AdlibRegister("actionimage1", 500)
AdlibRegister("actionimage2", 510)
AdlibRegister("actionimage3", 520)
While 1
If $actionimage1 = False And $actionimage2 = False And $actionimage3 = False And $Gaindonner = False Then
If $image1 = $image2 And $image1 = $image3 Then
If $image1 = 1 Then
$creditgagne = 0.01
ElseIf $image1 = 2 Then
$creditgagne = 0.02
ElseIf $image1 = 3 Then
$creditgagne = 0.05
ElseIf $image1 = 4 Then
$creditgagne = 0.10
ElseIf $image1 = 5 Then
$creditgagne = 0.20
ElseIf $image1 = 6 Then
$creditgagne = 0.50
ElseIf $image1 = 7 Then
$creditgagne = 1
ElseIf $image1 = 8 Then
$creditgagne = 2
ElseIf $image1 = 9 Then
$creditgagne = 5
ElseIf $image1 = 10 Then
$creditgagne = 10
ElseIf $image1 = 11 Then
$creditgagne = 20
ElseIf $image1 = 12 Then
$creditgagne = 50
ElseIf $image1 = 13 Then
$creditgagne = 100
ElseIf $image1 = 14 Then
$creditgagne = 200
ElseIf $image1 = 15 Then
$creditgagne = 500
ElseIf $image1 = 16 Then
$creditgagne = 1000
EndIf
$credit = $credit + $creditgagne
GUICtrlSetData($Input1, $credit)
GUICtrlSetColor($Label2, 0x008000)
GUICtrlSetData($Label2, "Tu as gagné " & $creditgagne & "€ !")
$creditgagne = 0
Else
GUICtrlSetColor($Label2, 0xffc000)
GUICtrlSetData($Label2, "Dommage tu as perdu")
EndIf
$Gaindonner = True
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
For $i = 1 To 16
FileDelete(@AppDataDir & "\machine a sou")
Next
Exit
Case $Button4
GUICtrlSetData($Label2, "")
If $credit < 1 Then
GUICtrlSetColor($Label2, 0xFF0000)
GUICtrlSetData($Label2, "Pas assez de credit !")
Else
$credit = $credit - 1
$actionimage1 = True
$actionimage2 = True
$actionimage3 = True
GUICtrlSetData($Input1, $credit)
EndIf
Case $Button1
$actionimage1 = False
If $actionimage2 = False And $actionimage3 = False Then $Gaindonner = False
Case $Button2
$actionimage2 = False
If $actionimage1 = False And $actionimage3 = False Then $Gaindonner = False
Case $Button3
$actionimage3 = False
If $actionimage1 = False And $actionimage2 = False Then $Gaindonner = False
EndSwitch
WEnd
Func actionimage1()
If $actionimage1 = True Then
$image1 = Random(1, 16, 1)
GUICtrlSetImage($Pic1, @AppDataDir & "\machine a sou\" & $image1 & ".jpg")
EndIf
EndFunc ;==>actionimage1
Func actionimage2()
If $actionimage2 = True Then
$image2 = Random(1, 16, 1)
GUICtrlSetImage($Pic2, @AppDataDir & "\machine a sou\" & $image2 & ".jpg")
EndIf
EndFunc ;==>actionimage2
Func actionimage3()
If $actionimage3 = True Then
$image3 = Random(1, 17, 1)
GUICtrlSetImage($Pic3, @AppDataDir & "\machine a sou\" & $image3 & ".jpg")
EndIf
EndFunc ;==>actionimage3