Novembre 2024 | Lun | Mar | Mer | Jeu | Ven | Sam | Dim |
---|
| | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | Calendrier |
|
|
| Poker Machine | |
| | Auteur | Message |
---|
Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Poker Machine Lun 10 Oct 2016 - 19:51 | |
| Voilà, je vous livre tel qu' il est actuellement mon jeu de machine à poker. Je vous ai mis un zip sur mon webdav car j' utilise une librairie d' image. Il vous faudra modifier l' adresse de kgf.dll à la ligne 27. Ceci est une version en travaux mais des travaux avancés... Ha, en plus, il parle... | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 10 Oct 2016 - 20:23 | |
| Et voilà le premier correctif (v0_2). le webdav est à jour. | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Poker Machine Lun 10 Oct 2016 - 21:44 | |
| Erreur en ligne 555 dés que je clique sur nouveau et jouer ! | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Re Mar 11 Oct 2016 - 10:40 | |
| Curieux, il ne me le faisait pas hier soir et j' y ai droit aussi ce matin. Et je ne vois pas où est le pb sur la ligne 555. | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Poker Machine Mar 11 Oct 2016 - 12:13 | |
| Salut ygeronimi ! Je n'en sait rien... D'autant plus que la première version fonctionnait parfaitement | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mar 11 Oct 2016 - 12:40 | |
| Salut Minibug. La première version avait un bug dans la détection des "Quinte". Et dans celle ci, j' ai ajouté la détection des valeurs des cartes des combinaisons gagnantes. ( 1,2,...vallet,dame,roi) et des couleurs (coeur,carreau...). Apparemment il y a un souci sur cette ligne 555 mais dès que je place un message de verif, je n' arrive plus à reproduire le bug. | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mar 11 Oct 2016 - 13:04 | |
| Eureka ! Voilà le source modifié. - Code:
-
hide 0 variables() constantes() labels() init() gui() show 0 end ' ------------------------------------------------------------------------------ sub variables() dim no% dim voc% dim carte%(5) dim etatcarte%(5) dim valcartes%(51,3) dim banque% dim mise% dim Gains% dim par_banque% dim par_mise% dim par_voc% end_sub ' ------------------------------------------------------------------------------ sub constantes() dim_local i% ' fichier dll dim kgf$ : kgf$="C:\KGF\KGF.dll" ' fichier imagelist dim ImgList$ : ImgList$=dir_current$+"\cartes2.ilb" ' fichier paramètres dim Param$ : Param$=dir_current$+"\param.inf" ' fichiers images temporaires dim bmp$(5) : for i%=1 to 5 : bmp$(i%)=dir_current$+"\img"+str$(i%)+".bmp" : next i% dim dos$ : dos$ =dir_current$+"\dos.bmp" ' objets panoramic dim mm% : no%=no%+1 : mm%=no% dim sm%(12) : for i%=1 to 12 : no%=no%+1 : sm%(i%)=no% : next i% dim pan%(3) : for i%=0 to 3 : no%=no%+1 : pan%(i%)=no% : next i% dim edibq% : no%=no%+1 : edibq%=no% dim alphmise%: no%=no%+1 : alphmise%=no% dim spmise% : no%=no%+1 : spmise%=no% dim pict%(5) : for i%=1 to 5 : no%=no%+1 : pict%(i%)=no% : next i% dim alphG% : no%=no%+1 : alphG%=no% dim btn%(4) : for i%=0 to 4 : no%=no%+1 :btn%(i%)=no% : next i% dim Tabgains%(9): for i%=1 to 9 : no%=no%+1 : Tabgains%(i%)=no% : next i% dim Tabgains2%(9): for i%=1 to 9 : no%=no%+1 : Tabgains2%(i%)=no% : next i% dim paramlist% : no%=no%+1 : paramlist%=no% ' objets kgf dim IMGL% ' du jeu dim NomCarte$(13) dim NomCouleur$(3) end_sub ' ------------------------------------------------------------------------------ sub labels() label clic,change end_sub ' ------------------------------------------------------------------------------ sub init() dim_local res%,i%,v%,x%,a$ dll_on kgf$ IMGL% = dll_call2("CreateImageList",57,84) res% = dll_call2("LoadImageList",IMGL%,adr(ImgList$)) res% = dll_call5("ExtractImageFromImageList",IMGL%,52,0,0,adr(dos$)) wait 1000 for i%=0 to 12 for x%=0 to 3 valcartes%(v%,1)=i%+1 valcartes%(v%,2)=x% v%=v%+1 next x% next i%
a$="un,deux,trois,quattre,cinq,six,sept,huit,neuf,dix,vallet,dame,roi," for i%=1 to 13 NomCarte$(i%)=NomCarte$(i%)+left$(a$,instr(a$,",")-1) if i%<13 a$=right$(a$,len(a$)-instr(a$,",")) end_if next i% a$="coeur,carreau,pique,treffle," for i%=0 to 3 NomCouleur$(i%)=NomCouleur$(i%)+left$(a$,instr(a$,",")-1) if i%<3 a$=right$(a$,len(a$)-instr(a$,",")) end_if next i% if file_exists(param$)=1 file_load paramlist%,param$ banque%=par_banque% mise%=par_mise% voc%=par_voc% else par_banque%=1000 par_mise%=1 par_voc%=0 end_if end_sub ' ------------------------------------------------------------------------------ sub gui() dim_local res%,i%,l%,pw%,ph%,Tg$,Tg2$,Bg%
height 0,350 width 0,750 top 0,(screen_y-height(0))/2 left 0,(screen_x-width(0))/2 color 0,26,107,12 caption 0,"Poker Machine" font_name 0,"arial" font_size 0,8 main_menu mm% sub_menu sm%(1) : parent sm%(1),mm% : caption sm%(1),"Jeu" sub_menu sm%(2) : parent sm%(2),mm% : caption sm%(2),"Paramètres" sub_menu sm%(3) : parent sm%(3),mm% : caption sm%(3),"A Propos" sub_menu sm%(4) : parent sm%(4),mm% : caption sm%(4),"Aide" sub_menu sm%(5) : parent sm%(5),sm%(1) : caption sm%(5),"Nouveau" : on_click sm%(5),clic sub_menu sm%(6) : parent sm%(6),sm%(1) : caption sm%(6),"Ouvrir" : on_click sm%(6),clic sub_menu sm%(7) : parent sm%(7),sm%(1) : caption sm%(7),"Enregistrer" : on_click sm%(7),clic sub_menu sm%(8) : parent sm%(8),sm%(1) : caption sm%(8),"-" sub_menu sm%(9) : parent sm%(9),sm%(1) : caption sm%(9),"Quitter" : on_click sm%(9),clic
sub_menu sm%(10) : parent sm%(10),sm%(4) : caption sm%(10),"*.chm" : on_click sm%(10),clic sub_menu sm%(11) : parent sm%(11),sm%(4) : on_click sm%(11),clic if par_voc%=1 mark_on sm%(11) caption sm%(11),"Vocale - On" voc%=1 else mark_off sm%(11) caption sm%(11),"Vocale - Off" voc%=0 end_if panel pan%(0) full_space pan%(0) pw%=width(pan%(0)) ph%=height(pan%(0)) delete pan%(0) panel pan%(1) height pan%(1),ph% width pan%(1),pw%-250 top pan%(1),0 left pan%(1),0 color pan%(1),26,107,12 edit edibq% parent edibq%,pan%(1) width edibq%,80 top edibq%,5 left edibq%,5 font_name edibq%,"arial" font_size edibq%,10 font_bold edibq% color edibq%,0,0,0 font_color edibq%,255,255,255 text edibq%,"€ 0" inactive edibq% spin spmise% parent spmise%,pan%(1) width spmise%,60 height spmise%,height(edibq%) top spmise%,5 left spmise%,width(pan%(1))-(width(spmise%)+5) font_name spmise%,"arial" font_size spmise%,10 font_bold spmise% color spmise%,0,0,0 font_color spmise%,255,255,255 min spmise%,1 max spmise%,100 position spmise%,par_mise% on_change spmise%,change alpha alphmise% parent alphmise%,pan%(1) top alphmise%,7 left alphmise%,left(spmise%)-width(alphmise%) font_name alphmise%,"arial" font_size alphmise%,10 font_bold alphmise% font_color alphmise%,246,254,1 caption alphmise%,"Mise :" l%=10 for i%=1 to 5 l%=l%+67 picture pict%(i%) parent pict%(i%),pan%(1) height pict%(i%),84 width pict%(i%),57 top pict%(i%),80 left pict%(i%),l% cursor_point pict%(i%) on_click pict%(i%),clic next i% for i%=1 to 5 if file_exists(dos$)=1 file_load pict%(i%),dos$ carte%(i%)=52 etatcarte%(i%)=1 inactive pict%(i%) end_if next i% alpha alphG% parent alphG%,pan%(1) top alphG%,180 left alphG%,60 font_name alphG%,"Times" font_size alphG%,12 font_color alphG%,246,254,1 color alphG%,26,107,12 button btn%(1) parent btn%(1),pan%(1) width btn%(1),100 top btn%(1),210 left btn%(1),(width(pan%(1))/2)-210 caption btn%(1),"Jouer" cursor_point btn%(1) on_click btn%(1),clic inactive btn%(1) button btn%(2) parent btn%(2),pan%(1) width btn%(2),100 top btn%(2),210 left btn%(2),(width(pan%(1))/2)-105 caption btn%(2),"Changer" cursor_point btn%(2) on_click btn%(2),clic inactive btn%(2) button btn%(3) parent btn%(3),pan%(1) width btn%(3),100 top btn%(3),210 left btn%(3),(width(pan%(1))/2)+5 caption btn%(3),"Double" cursor_point btn%(3) on_click btn%(3),clic inactive btn%(3) button btn%(4) parent btn%(4),pan%(1) width btn%(4),100 top btn%(4),210 left btn%(4),(width(pan%(1))/2)+110 caption btn%(4),"Encaisser" cursor_point btn%(4) on_click btn%(4),clic inactive btn%(4) panel pan%(2) height pan%(2),ph% width pan%(2),250 top pan%(2),0 left pan%(2),width(pan%(1)) color pan%(2),26,107,12 Tg$="Quinte flush royale,Quinte flush,Carré,Full,Couleur,Quinte,Brelan,2 Paires,1 Paire," for i%=1 to 9 alpha Tabgains%(i%) parent Tabgains%(i%),pan%(2) width Tabgains%(i%),width(pan%(2))-6 top Tabgains%(i%),25*i% left Tabgains%(i%),3 font_name Tabgains%(i%),"Times" font_size Tabgains%(i%),12 font_bold Tabgains%(i%) font_color Tabgains%(i%),170,240,160 caption Tabgains%(i%),left$(Tg$,instr(Tg$,",")-1) if i%<9 Tg$=right$(Tg$,len(Tg$)-instr(Tg$,",")) end_if next i% Tg2$="10,8,7,6,5,4,3,2,1," for i%=1 to 9 alpha Tabgains2%(i%) parent Tabgains2%(i%),pan%(2) width Tabgains2%(i%),width(pan%(2))-6 top Tabgains2%(i%),25*i% font_name Tabgains2%(i%),"Times" font_size Tabgains2%(i%),12 font_bold Tabgains2%(i%) font_color Tabgains2%(i%),170,240,160 Bg%=val(left$(Tg2$,instr(Tg2$,",")-1)) caption Tabgains2%(i%),str$(position(spmise%)*Bg%)+" €" left Tabgains2%(i%),width(pan%(2))-(width(Tabgains2%(i%))+5) if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if next i% dlist paramlist% end_sub ' ------------------------------------------------------------------------------ clic: if number_click = sm%(5) text edibq%,"€ "+str$(par_banque%) banque%=par_banque% position spmise%,par_mise% init_flop() return end_if if number_click = sm%(11) if voc%=1 voc%=0 mark_off sm%(11) caption sm%(11),"Vocale - Off" else voc%=1 mark_on sm%(11) caption sm%(11),"Vocale - On" end_if return end_if if number_click = btn%(1) mise% = position(spmise%) banque%=banque%-mise% text edibq%,"€ "+str$(banque%) tirage() inactive btn%(1) inactive spmise% active pict%(1) active pict%(2) active pict%(3) active pict%(4) active pict%(5) active btn%(2) if Gains%>0 : active btn%(4) : end_if return end_if if number_click = btn%(2) Gains%=0 tirage() inactive btn%(1) inactive btn%(2) if Gains%>0 active btn%(4) active btn%(3) else caption AlphG%,"Désolé, vous avez perdu." if voc%=1 parler("Désolé, vous avez perdu.") end_if pause 2000 init_flop() end_if return end_if if number_click = btn%(3) return end_if if number_click = btn%(4) banque%=banque%+Gains% text edibq%,"€ "+str$(banque%) init_flop() if banque%=1000000 : message "Bravo !"+chr$(13)+"Vous êtes Millionaire !" : end_if return end_if if number_click = pict%(1) if etatcarte%(1) = 1 etatcarte%(1) = 0 file_load pict%(1),bmp$(1) else etatcarte%(1) = 1 file_load pict%(1),dos$ end_if return end_if if number_click = pict%(2) if etatcarte%(2) = 1 etatcarte%(2) = 0 file_load pict%(2),bmp$(2) else etatcarte%(2) = 1 file_load pict%(2),dos$ end_if return end_if if number_click = pict%(3) if etatcarte%(3) = 1 etatcarte%(3) = 0 file_load pict%(3),bmp$(3) else etatcarte%(3) = 1 file_load pict%(3),dos$ end_if return end_if if number_click = pict%(4) if etatcarte%(4) = 1 etatcarte%(4) = 0 file_load pict%(4),bmp$(4) else etatcarte%(4) = 1 file_load pict%(4),dos$ end_if return end_if if number_click = pict%(5) if etatcarte%(5) = 1 etatcarte%(5) = 0 file_load pict%(5),bmp$(5) else etatcarte%(5) = 1 file_load pict%(5),dos$ end_if return end_if return ' ------------------------------------------------------------------------------ change: if number_change = spmise% mise%=position(spmise%) ChangeTabGains() return end_if return ' ------------------------------------------------------------------------------ sub tirage() dim_local i%,dif%,img$,res% for i%=1 to 5 if etatcarte%(i%)=1 repeat if dif%<>4 : dif%=0 : end_if carte%(i%)=int(rnd(51)) if carte%(i%)<>carte%(1): dif%=dif%+1 : end_if if carte%(i%)<>carte%(2): dif%=dif%+1 : end_if if carte%(i%)<>carte%(3): dif%=dif%+1 : end_if if carte%(i%)<>carte%(4): dif%=dif%+1 : end_if if carte%(i%)<>carte%(5): dif%=dif%+1 : end_if until dif%=4 end_if next i% for i%=1 to 5 img$ = bmp$(i%) res% = dll_call5("ExtractImageFromImageList",IMGL%,carte%(i%),0,0,adr(img$)) if file_exists(bmp$(i%))=1 file_load pict%(i%),bmp$(i%) etatcarte%(i%)=0 end_if next i% verif() end_sub ' ------------------------------------------------------------------------------ sub verif() dim_local i%,vc%(5),cc%(5),a$,b$,c$,combin%(13),combinCol$,coul%,f%,gagne%,mes$,mesvoc$,vcg$,vcg%(2),ncoul$,ncarte$ for i%=1 to 5 vc%(i%)= valcartes%(carte%(i%),1) c$=c$+str$(vc%(i%))+"," cc%(i%)= valcartes%(carte%(i%),2) combin%(vc%(i%))=combin%(vc%(i%))+1 combinCol$= combinCol$+str$(cc%(i%)) next i%
for i%=1 to 13 if combin%(i%)>1 a$=a$+str$(combin%(i%)) vcg$=vcg$+str$(i%)+"," end_if if combin%(i%)=1 b$=b$+str$(combin%(i%)) end_if next i% if len(a$)=1 : a$=a$+"0" : end_if if len(a$)=0 : a$="00" : end_if
if len(vcg$)=0 vcg$=vcg$+"0,0," else if instr(vcg$,",")=len(vcg$) vcg$=vcg$+"0," end_if end_if ' message a$+chr$(13)+b$+chr$(13)+combinCol$
if a$="20" or a$="02" : gagne%=9 : end_if if a$="22" : gagne%=8 : end_if if a$="30" or a$="03" : gagne%=7 : end_if if a$="32" or a$="23" : gagne%=4 : end_if if a$="40" or a$="04" : gagne%=3 : end_if
if combinCol$="00000" or combinCol$="11111" or combinCol$="22222" or combinCol$="33333" coul%=1 for i%=0 to 3 if val(left$(combinCol$,1))=i% ncoul$=NomCouleur$(i%) exit_for end_if next i% end_if if b$="11111" ' message b$+chr$(13)+c$ for i%=0 to 12 if instr(c$,str$(i%+1))>0 and instr(c$,str$(i%+2))>0 and instr(c$,str$(i%+3))>0 and instr(c$,str$(i%+4))>0 and instr(c$,str$(i%+5))>0 if coul%=1 f%=1 gagne%=2 exit_for else f%=1 gagne%=6 exit_for end_if end_if next i% if instr(c$,"10")>0 and instr(c$,"11")>0 and instr(c$,"12")>0 and instr(c$,"13")=1 and instr(c$,"1")>0 if coul%=1 f%=1 gagne%=1 end_if end_if
if f%=0 if coul%=1 gagne%=5 end_if end_if end_if illumineGains(gagne%) vcg%(1)=val(left$(vcg$,instr(vcg$,",")-1)) vcg$=right$(vcg$,len(vcg$)-instr(vcg$,",")) vcg%(2)=val(left$(vcg$,instr(vcg$,",")-1))
if val(left$(a$,1))>0 or val(right$(a$,1))>0 if val(left$(a$,1))=0 or val(right$(a$,1))=0 if val(left$(a$,1))=0 ncarte$=NomCarte$(vcg%(2)) else ncarte$=NomCarte$(vcg%(1)) end_if else if val(left$(a$,1))=val(right$(a$,1)) ncarte$=NomCarte$(vcg%(1))+" et de "+NomCarte$(vcg%(2)) else if val(left$(a$,1))>val(right$(a$,1)) ncarte$=NomCarte$(vcg%(1))+" par les "+NomCarte$(vcg%(2)) else if val(right$(a$,1))>val(left$(a$,1)) ncarte$=NomCarte$(vcg%(2))+" par les "+NomCarte$(vcg%(1)) end_if end_if end_if end_if end_if select gagne% case 0 : mes$="" case 1 : mes$="Vous avez une quinte flush royale à "+ncoul$+" !" : Gains%=mise%*10 case 2 : mes$="Vous avez une quinte flush à "+ncoul$+" !" : Gains%=mise%*8 case 3 : mes$="Vous avez un carré de "+ncarte$+" !" : Gains%=mise%*7 case 4 : mes$="Vous avez un full de "+ncarte$+" !" : Gains%=mise%*6 case 5 : mes$="Vous avez une couleur à "+ncoul$+" !" : Gains%=mise%*5 case 6 : mes$="Vous avez une quinte !" : Gains%=mise%*4 case 7 : mes$="Vous avez un brelan de "+ncarte$+" !" : Gains%=mise%*3 case 8 : mes$="Vous avez deux paires de "+ncarte$+" !" : Gains%=mise%*2 case 9 : mes$="Vous avez une paire de "+ncarte$+" !" : Gains%=mise% end_select caption alphG%,mes$ if voc%=1 parler(mes$) end_if end_sub ' ------------------------------------------------------------------------------ sub illumineGains(G%) dim_local i% for i%=1 to 9 font_color Tabgains%(i%),170,240,160 font_color Tabgains2%(i%),170,240,160 next i% if G%>0 font_color Tabgains%(G%),246,254,1 font_color Tabgains2%(G%),246,254,1 end_if end_sub ' ------------------------------------------------------------------------------ sub init_flop() dim_local i% Gains%=0 inactive btn%(2) inactive btn%(3) inactive btn%(4) for i%=1 to 5 file_load pict%(i%),dos$ etatcarte%(i%)=1 inactive pict%(i%) next i% caption alphG%,"" for i%=1 to 9 font_color Tabgains%(i%),170,240,160 font_color Tabgains2%(i%),170,240,160 next i% active btn%(1) active spmise% end_sub ' ------------------------------------------------------------------------------ sub ChangeTabGains() dim_local i%,Bg%,Tg2$ Tg2$="10,8,7,6,5,4,3,2,1," for i%=1 to 9 Bg%=val(left$(Tg2$,instr(Tg2$,",")-1)) caption Tabgains2%(i%),str$(mise%*Bg%)+" €" left Tabgains2%(i%),width(pan%(2))-(width(Tabgains2%(i%))+5) if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if next i% end_sub ' ------------------------------------------------------------------------------ SUB parler(tex$) dim_local f$,g$ if dir_exists("c:\temp")=0 then dir_make "c:\temp" f$ = "c:\temp\parler.vbs" g$ = chr$(34) FILE_OPEN_WRITE 9999, f$ file_writeln 9999, "Dim speaks, speech" file_writeln 9999, "speaks = " + g$ + tex$ + g$ file_writeln 9999, "Set speech = CreateObject(" + g$ + "sapi.spvoice" + g$+ ")" file_writeln 9999, "speech.Speak speaks" FILE_CLOSE 9999 EXECUTE_WAIT f$ : FILE_DELETE f$ END_SUB | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Poker Machine Mar 11 Oct 2016 - 13:40 | |
| Cool ! Je regarderai ce soir... | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mar 11 Oct 2016 - 20:29 | |
| Je viens de mettre à jour le zip sur mon webdav. Le menu "Paramètres" est disponible. Le son se coupe ou se met en marche en cliquant sur l' icône sur le form 0 Les fichiers créés se créent dans un dossier temporaire qui est supprimé à la fermeture du jeu sauf celui des paramètres. il faut toujours modifier le chemin de kgf mais cela sera modifié dans la prochaine version. | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Poker Machine Mer 12 Oct 2016 - 7:20 | |
| J'ai un message OUT OF RANGE ligne 91 au démarrage... | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 12 Oct 2016 - 11:16 | |
| Salut Minibug Là, c' est ton éditeur qui a un blême, la ligne 91 est une déclaration de constante : | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Poker Machine Mer 12 Oct 2016 - 17:41 | |
| Ok, ça c'est encore passé entre la chaise et l'écran... Mais là par contre quelque chose m'échappe... | |
| | | JL35
Nombre de messages : 7112 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: Poker Machine Mer 12 Oct 2016 - 17:42 | |
| À tes souhaits ! | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 12 Oct 2016 - 18:12 | |
| Effectivement... Il ne me l' avait pas encore faite celle là. Sur ce coup là, ce serait bien entre ma chaise et mon écran. | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 12 Oct 2016 - 22:19 | |
| Voilà le source de travail : Avec cette version : - Les fichiers temporaires sont créés dans un sous dossier du dossier "C:\temp" et sont détruits à la fermeture. - Le fichier du meilleur score est créé dans un sous dossier de "Mes documents" - Les fichiers *.inf sont créé dans les dossier du source, plus tard ils seront eux aussi dans le sous dossier dans "Mes documents". Tous les fichiers externes nécessaires sont créés par le programme sauf KGF.dll et la librairie *.ilb. Je n' exclus pas que ceux ci soit eux aussi créés par le programme mais pas pour l' instant. - Code:
-
hide 0 Application_title "Poker Machine" variables() constantes() labels() init() gui() show 0 hide F_Attente% end
' ------------------------------------------------------------------------------ ' DECLARATION DES VARIABLES ' ------------------------------------------------------------------------------
sub variables() dim no%,ti% dim voc% dim carte%(5) dim etatcarte%(5) dim valcartes%(51,3) dim banque% dim mise% dim Gains% dim NumPartie% dim BestScore% dim MesBScore$ ' temp dim TempObj% dim TempTg% dim TempCd% ' paramètres par defaut dim par_banque% dim par_mise% dim par_voc% dim par_misemax% dim par_Tg$ dim par_cartedos% end_sub
' ------------------------------------------------------------------------------ ' DECLARATION DES CONSTANTES ' ------------------------------------------------------------------------------
sub constantes() dim_local i% ' dossier dim path$ : path$=dir_current$ if right$(path$,1)="\" : path$=left$(path$,len(path$)-1) : end_if path$=path$+"\" dim temp$ : temp$="C:\Temp\TempPokerMachine\" dim user$ dim Parties$ ' fichier trace dim bureau$ ' fichier dll dim kgf$ : kgf$=path$+"\KGF.dll" ' fichier imagelist dim ImgList$ : ImgList$=path$+"\cartes2.ilb" ' autres fichiers image dim PictSonOn$ : PictSonOn$ = temp$+"\son_on.bmp" dim PictSonOff$ : PictSonOff$ = temp$+"\son_off.bmp" dim TempCard$ : TempCard$ = temp$+"Tpdos.bmp" ' fichier paramètres dim Param$ : Param$ = path$+"\param.inf" dim Kgfpar$ : Kgfpar$= path$+"\kgf.inf" ' fichier aide dim PMhelp$ : PMhelp$= path$+"\help.html" ' fichiers images temporaires dim bmp$(5) : for i%=1 to 5 : bmp$(i%)=temp$+"img"+str$(i%)+".bmp" : next i% dim dos$ : dos$ = temp$+"dos.bmp" ' objets panoramic ' form 0 dim mm% : no%=no%+1 : mm%=no% dim sm%(12) : for i%=1 to 12 : no%=no%+1 : sm%(i%)=no% : next i% dim pan%(3) : for i%=0 to 3 : no%=no%+1 : pan%(i%)=no% : next i% dim edibq% : no%=no%+1 : edibq%=no% dim alphmise%: no%=no%+1 : alphmise%=no% dim spmise% : no%=no%+1 : spmise%=no% dim pict%(5) : for i%=1 to 5 : no%=no%+1 : pict%(i%)=no% : next i% dim alphG% : no%=no%+1 : alphG%=no% dim btn%(4) : for i%=0 to 4 : no%=no%+1 :btn%(i%)=no% : next i% dim Tabgains%(9): for i%=1 to 9 : no%=no%+1 : Tabgains%(i%)=no% : next i% dim Tabgains2%(9): for i%=1 to 9 : no%=no%+1 : Tabgains2%(i%)=no% : next i% dim pictson% : no%=no%+1 : pictson%=no% dim Tracelist% : no%=no%+1 : Tracelist%=no% ' form paramètres dim F_Param% : no%=no%+1 : F_Param%=no% dim alphpar%(5) : for i%=1 to 5 : no%=no%+1 : alphpar%(i%)=no% : next i% dim pictpar% : no%=no%+1 : pictpar%=no% dim btnprecpar% : no%=no%+1 : btnprecpar%=no% dim btnsuivpar% : no%=no%+1 : btnsuivpar%=no% dim optsonpar% : no%=no%+1 : optsonpar%=no% dim spnbanqpar% : no%=no%+1 : spnbanqpar%=no% dim spnmisemaxpar% : no%=no%+1 : spnmisemaxpar%=no% dim alphTgpar1%(9) : for i%=1 to 9 : no%=no%+1 : alphTgpar1%(i%)=no% : next i% dim alphTgpar2%(9) : for i%=1 to 9 : no%=no%+1 : alphTgpar2%(i%)=no% : next i% dim btnValTgPlus% : no%=no%+1 : btnValTgPlus%=no% dim btnValTgMoins% : no%=no%+1 : btnValTgMoins%=no% dim btnsavepar% : no%=no%+1 : btnsavepar%=no% ' form a propos dim F_App% : no%=no%+1 : F_App%=no% dim panApp% : no%=no%+1 : panApp%=no% dim alphApp% : no%=no%+1 : alphApp%=no% ' form help dim F_help% : no%=no%+1 : F_help%=no% dim viewhlp% : no%=no%+1 : viewhlp%=no% dim panhlp% : no%=no%+1 : panhlp%=no% ' form attente dim F_Attente% : no%=no%+1 : F_Attente%=no% dim alphAtt%(3) : for i%=1 to 3 : no%=no%+1 : alphAtt%(i%)=no% : next i% dim PbarAtt% : no%=no%+1 : PbarAtt%=no% ' objets ouverture/fermeture de fichiers dim F_OW% : no%=no%+1 : F_OW%=no% dim F_OR% : no%=no%+1 : F_OR%=no% ' objets boites de dialog dim Odial% : no%=no%+1 : Odial%=no% dim Sdial% : no%=no%+1 : Sdial%=no% ' objets kgf dim IMGL% ' du jeu dim NomCarte$(13) dim NomCouleur$(3) end_sub
' ------------------------------------------------------------------------------ ' DECLARATION DES LABELS ' ------------------------------------------------------------------------------
sub labels() label clic,change,close end_sub
' ------------------------------------------------------------------------------ ' INITIALISATIONS ' ------------------------------------------------------------------------------
sub init() dim_local res%,i%,v%,x%,a$ if dir_exists("C:\Temp")=0 then dir_make "C:\Temp" if dir_exists(temp$)=0 then dir_make temp$ if file_exists(Kgfpar$)=0 if file_exists(Kgf$)=0 if message_warning_yes_no("La dll KGF.dll n' a pas été trouvée !"+Chr$(13)+"Voulez vous indiquer son emplacement sur votre ordinateur ?")=1 Open_dialog Odial% dir_dialog Odial%,"C:\" filter Odial%,"*.dll|*.dll" a$=file_name$(Odial%) delete Odial%
if a$<>"_" KGF$=a$ file_open_write F_OW%,Kgfpar$ file_writeln F_OW%,KGF$ file_close F_OW% else Message "Vous ne disposez pas de cette dll."+chr$(13)+"Vous pouvez la télécharger à cette adresse :"+chr$(13)+"http://klauspanoramic.comxa.com/versions/KGF.zip" Quitter() end_if else Quitter() end_if end_if else File_open_read F_OR%,Kgfpar$ file_readln F_OR%,KGF$ file_close F_OR% end_if dll_on kgf$ form_Attente() bureau$=string$(511," ") res% = dll_call2("GetWindowsFoldersPath",0,adr(bureau$)) bureau$=trim$(bureau$)
user$=string$(511," ") res% = dll_call2("GetWindowsFoldersPath",5,adr(user$)) user$=trim$(user$) Parties$=User$+"\PokerMachineGames\" RecupBestScore() if dir_exists(Parties$)=0 : dir_make Parties$ : end_if position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"1/4" display
IMGL% = dll_call2("CreateImageList",57,84) res% = dll_call2("LoadImageList",IMGL%,adr(ImgList$)) wait 1000 position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"2/4" display CreateImgSonOff() position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"3/4" display CreateImgSonOn() position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"4/4" display for i%=0 to 12 for x%=0 to 3 valcartes%(v%,1)=i%+1 valcartes%(v%,2)=x% v%=v%+1 next x% next i%
a$="un,deux,trois,quattre,cinq,six,sept,huit,neuf,dix,vallet,dame,roi," for i%=1 to 13 NomCarte$(i%)=NomCarte$(i%)+left$(a$,instr(a$,",")-1) if i%<13 a$=right$(a$,len(a$)-instr(a$,",")) end_if next i%
a$="coeur,carreau,pique,treffle," for i%=0 to 3 NomCouleur$(i%)=NomCouleur$(i%)+left$(a$,instr(a$,",")-1) if i%<3 a$=right$(a$,len(a$)-instr(a$,",")) end_if next i%
if file_exists(param$)=1 file_open_read F_OR%,param$ file_readln F_OR%,a$ : par_banque% =val(a$) file_readln F_OR%,a$ : par_misemax% =val(a$) file_readln F_OR%,a$ : par_voc% =val(a$) : voc% = par_voc% file_readln F_OR%,a$ : par_cartedos% =val(a$) file_readln F_OR%,a$ : par_Tg$ =a$ file_close F_OR% else ' paramètres par defaut par_banque%=1000 par_misemax%=10 par_voc%=1 : voc%=1 par_Tg$="10,8,7,6,5,4,3,2,1," par_cartedos%=52 end_if par_mise%=1 TempCd% = par_cartedos% res% = dll_call5("ExtractImageFromImageList",IMGL%,par_cartedos%,0,0,adr(dos$)) end_sub
' ------------------------------------------------------------------------------ ' INTERFACE UTILISATEUR ' ------------------------------------------------------------------------------
' FENETRE PRINCIPALE
sub gui() dim_local res%,i%,l%,pw%,ph%,Tg$,Tg2$,Bg%
height 0,350 width 0,750 top 0,(screen_y-height(0))/2 left 0,(screen_x-width(0))/2 color 0,26,107,12 caption 0,"Poker Machine" font_name 0,"arial" font_size 0,8 on_close 0,close
main_menu mm% sub_menu sm%(1) : parent sm%(1),mm% : caption sm%(1),"Jeu" sub_menu sm%(2) : parent sm%(2),mm% : caption sm%(2),"Paramètres" : on_click sm%(2),clic sub_menu sm%(3) : parent sm%(3),mm% : caption sm%(3),"A Propos" : on_click sm%(3),clic sub_menu sm%(4) : parent sm%(4),mm% : caption sm%(4),"Aide" : on_click sm%(4),clic sub_menu sm%(7) : parent sm%(7),mm% : caption sm%(7),string$(100," ") : on_click sm%(7),clic sub_menu sm%(6) : parent sm%(6),mm% : caption sm%(6),"Best score : "+str$(BestScore%) : on_click sm%(6),clic sub_menu sm%(5) : parent sm%(5),sm%(1) : caption sm%(5),"Nouveau" : on_click sm%(5),clic sub_menu sm%(8) : parent sm%(8),sm%(1) : caption sm%(8),"-" sub_menu sm%(9) : parent sm%(9),sm%(1) : caption sm%(9),"Quitter" : on_click sm%(9),clic
panel pan%(0) full_space pan%(0) pw%=width(pan%(0)) ph%=height(pan%(0)) delete pan%(0)
panel pan%(1) height pan%(1),ph% width pan%(1),pw%-250 top pan%(1),0 left pan%(1),0 color pan%(1),26,107,12
edit edibq% parent edibq%,pan%(1) width edibq%,80 top edibq%,5 left edibq%,5 font_name edibq%,"arial" font_size edibq%,10 font_bold edibq% color edibq%,0,0,0 font_color edibq%,255,255,255 text edibq%,"€ 0" inactive edibq%
spin spmise% parent spmise%,pan%(1) width spmise%,60 height spmise%,height(edibq%) top spmise%,5 left spmise%,width(pan%(1))-(width(spmise%)+5) font_name spmise%,"arial" font_size spmise%,10 font_bold spmise% color spmise%,0,0,0 font_color spmise%,255,255,255 min spmise%,1 max spmise%,par_misemax% position spmise%,par_mise% on_change spmise%,change
alpha alphmise% parent alphmise%,pan%(1) top alphmise%,7 left alphmise%,left(spmise%)-width(alphmise%) font_name alphmise%,"arial" font_size alphmise%,10 font_bold alphmise% font_color alphmise%,246,254,1 caption alphmise%,"Mise :"
l%=10 for i%=1 to 5 l%=l%+67 picture pict%(i%) parent pict%(i%),pan%(1) height pict%(i%),84 width pict%(i%),57 top pict%(i%),80 left pict%(i%),l% cursor_point pict%(i%) on_click pict%(i%),clic next i%
for i%=1 to 5 if file_exists(dos$)=1 file_load pict%(i%),dos$ carte%(i%)=par_cartedos% etatcarte%(i%)=1 inactive pict%(i%) end_if next i%
alpha alphG% parent alphG%,pan%(1) top alphG%,180 left alphG%,60 font_name alphG%,"Times" font_size alphG%,12 font_color alphG%,246,254,1 color alphG%,26,107,12
button btn%(1) parent btn%(1),pan%(1) width btn%(1),100 top btn%(1),210 left btn%(1),(width(pan%(1))/2)-210 caption btn%(1),"Jouer" cursor_point btn%(1) on_click btn%(1),clic inactive btn%(1)
button btn%(2) parent btn%(2),pan%(1) width btn%(2),100 top btn%(2),210 left btn%(2),(width(pan%(1))/2)-105 caption btn%(2),"Changer" cursor_point btn%(2) on_click btn%(2),clic inactive btn%(2)
button btn%(3) parent btn%(3),pan%(1) width btn%(3),100 top btn%(3),210 left btn%(3),(width(pan%(1))/2)+5 caption btn%(3),"Double" cursor_point btn%(3) on_click btn%(3),clic inactive btn%(3)
button btn%(4) parent btn%(4),pan%(1) width btn%(4),100 top btn%(4),210 left btn%(4),(width(pan%(1))/2)+110 caption btn%(4),"Encaisser" cursor_point btn%(4) on_click btn%(4),clic inactive btn%(4)
picture pictson% parent pictson%,pan%(1) height pictson%,24 width pictson%,24 top pictson%,height(pan%(1))-34 left pictson%,width(pan%(1))-34 if par_voc%=1 if file_exists(PictSonOn$)=1 : file_load pictson%,PictSonOn$ : end_if hint pictson%,"Son : On" else if file_exists(PictSonOff$)=1 : file_load pictson%,PictSonOff$ : end_if hint pictson%,"Son : Off" end_if cursor_point pictson% on_click pictson%,clic
panel pan%(2) height pan%(2),ph% width pan%(2),250 top pan%(2),0 left pan%(2),width(pan%(1)) color pan%(2),26,107,12
Tg$="Quinte flush royale,Quinte flush,Carré,Full,Couleur,Quinte,Brelan,2 Paires,1 Paire,"
for i%=1 to 9 alpha Tabgains%(i%) parent Tabgains%(i%),pan%(2) width Tabgains%(i%),width(pan%(2))-6 top Tabgains%(i%),25*i% left Tabgains%(i%),3 font_name Tabgains%(i%),"Times" font_size Tabgains%(i%),12 font_bold Tabgains%(i%) font_color Tabgains%(i%),170,240,160 caption Tabgains%(i%),left$(Tg$,instr(Tg$,",")-1)
if i%<9 Tg$=right$(Tg$,len(Tg$)-instr(Tg$,",")) end_if next i%
Tg2$=Par_Tg$
for i%=1 to 9 alpha Tabgains2%(i%) parent Tabgains2%(i%),pan%(2) width Tabgains2%(i%),width(pan%(2))-6 top Tabgains2%(i%),25*i% font_name Tabgains2%(i%),"Times" font_size Tabgains2%(i%),12 font_bold Tabgains2%(i%) font_color Tabgains2%(i%),170,240,160 Bg%=val(left$(Tg2$,instr(Tg2$,",")-1)) caption Tabgains2%(i%),str$(position(spmise%)*Bg%)+" €" left Tabgains2%(i%),width(pan%(2))-(width(Tabgains2%(i%))+5)
if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if next i%
dlist Tracelist% end_sub
' FENETRE DES PARAMETRES
sub form_parametres() dim_local i%,c$,Tg$,Tg2$,t%,res%
if object_exists(F_Param%)=1 show F_Param% else form F_param% height F_param%,580 width F_param%,350 top F_param%,(screen_y-height(F_param%))/2 left F_param%,(screen_x-width(F_param%))/2 color F_param%,26,107,12 font_name F_param%,"arial" font_size F_param%,8 font_bold F_param% font_color F_param%,246,254,1 caption F_param%,"Paramètres"
c$="Banque départ :,Mise maximum :,Son au démarrage :,Dos des cartes :,Table des gains :," for i%=1 to 5 alpha alphpar%(i%) parent alphpar%(i%),F_param% if i%<5 top alphpar%(i%),i%*35 else top alphpar%(i%),i%*50 end_if left alphpar%(i%),10 caption alphpar%(i%),left$(c$,instr(c$,",")-1) if i%<5 c$=right$(c$,len(c$)-instr(c$,",")) end_if next i%
spin spnbanqpar% parent spnbanqpar%,F_param% top spnbanqpar%,top(alphpar%(1))-4 left spnbanqpar%,width(alphpar%(1))+20 width spnbanqpar%,80 min spnbanqpar%,1000 max spnbanqpar%,5000 font_size spnbanqpar%,10 color spnbanqpar%,0,0,0 font_color spnbanqpar%,255,255,255
spin spnmisemaxpar% parent spnmisemaxpar%,F_param% top spnmisemaxpar%,top(alphpar%(2))-4 left spnmisemaxpar%,width(alphpar%(2))+20 width spnmisemaxpar%,50 min spnmisemaxpar%,10 max spnmisemaxpar%,100 font_size spnmisemaxpar%,10 color spnmisemaxpar%,0,0,0 font_color spnmisemaxpar%,255,255,255
check optsonpar% parent optsonpar%,F_param% top optsonpar%,top(alphpar%(3)) left optsonpar%,width(alphpar%(3))+20 on_click optsonpar%,clic
picture pictpar% parent pictpar%,F_param% top pictpar%,top(alphpar%(4))+20 left pictpar%,width(F_param%)/2 height pictpar%,84 width pictpar%,57 if file_exists(dos$)=1 : file_load pictpar%,dos$ : end_if
button btnprecpar% parent btnprecpar%,F_param% height btnprecpar%,height(pictpar%) width btnprecpar%,12 top btnprecpar%,top(pictpar%) left btnprecpar%,left(pictpar%)-14 font_name btnprecpar%,"Webdings" caption btnprecpar%,"3" hint btnprecpar%,"Précedent" cursor_point btnprecpar% on_click btnprecpar%,clic
button btnsuivpar% parent btnsuivpar%,F_param% height btnsuivpar%,height(pictpar%) width btnsuivpar%,12 top btnsuivpar%,top(pictpar%) left btnsuivpar%,left(pictpar%)+width(pictpar%)+2 font_name btnsuivpar%,"Webdings" caption btnsuivpar%,"4" hint btnsuivpar%,"Suivant" cursor_point btnsuivpar% on_click btnsuivpar%,clic
Tg$="Quinte flush royale,Quinte flush,Carré,Full,Couleur,Quinte,Brelan,2 Paires,1 Paire," t%=top(alphpar%(5))+10 for i%=1 to 9 t%=t%+25 alpha alphTgpar1%(i%) parent alphTgpar1%(i%),F_param% top alphTgpar1%(i%),t% left alphTgpar1%(i%),30 font_color alphTgpar1%(i%),255,255,255 caption alphTgpar1%(i%),left$(Tg$,instr(Tg$,",")-1) if i%<9 Tg$=right$(Tg$,len(Tg$)-instr(Tg$,",")) end_if next i%
Tg2$=par_Tg$ t%=top(alphpar%(5))+10 for i%=1 to 9 t%=t%+25 alpha alphTgpar2%(i%) parent alphTgpar2%(i%),F_param% top alphTgpar2%(i%),t% font_color alphTgpar2%(i%),255,255,255 caption alphTgpar2%(i%),left$(Tg2$,instr(Tg2$,",")-1) if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if left alphTgpar2%(i%),width(F_param%)-(width(alphTgpar2%(i%))+100) cursor_point alphTgpar2%(i%) on_click alphTgpar2%(i%),clic next i%
create_hide button btnValTgPlus% parent btnValTgPlus%,F_param% height btnValTgPlus%,16 width btnValTgPlus%,16 top btnValTgPlus%,top(alphTgpar2%(1)) left btnValTgPlus%,width(F_param%)-(width(alphTgpar2%(1))+80) font_bold btnValTgPlus% caption btnValTgPlus%,"+" cursor_point btnValTgPlus% hint btnValTgPlus%,"Augmenter le mutiplicateur" on_click btnValTgPlus%,clic
button btnValTgMoins% parent btnValTgMoins%,F_param% height btnValTgMoins%,18 width btnValTgMoins%,18 top btnValTgMoins%,top(alphTgpar2%(1))-2 left btnValTgMoins%,left(alphTgpar2%(1))-50 font_bold btnValTgMoins% caption btnValTgMoins%,"-" cursor_point btnValTgMoins% hint btnValTgMoins%,"Diminuer le mutiplicateur" on_click btnValTgMoins%,clic create_show button btnsavepar% parent btnsavepar%,F_param% caption btnsavepar%,"Enregistrer" top btnsavepar%,height(F_param%)-60 left btnsavepar%,width(F_param%)-(width(btnsavepar%)+10) cursor_point btnsavepar% on_click btnsavepar%,clic
end_if position spnbanqpar%,par_banque% position spnmisemaxpar%,par_misemax% if par_voc%=1 : mark_on optsonpar% : end_if if checked(optsonpar%)=1 :caption optsonpar%,"On" :else:caption optsonpar%,"Off" :end_if res% = DLL_call2("WindowTopMost",handle(F_param%),1) end_sub
' FENETRE D ATTENTE
sub form_Attente() dim_local res% if object_exists(F_Attente%)=1 show F_Attente% else form F_Attente% height F_Attente%,120 width F_Attente%,300 top F_Attente%,(screen_y-height(F_Attente%))/2 left F_Attente%,(screen_x-width(F_Attente%))/2 color F_Attente%,26,107,12 font_name F_Attente%,"arial" font_size F_Attente%,8 font_bold F_Attente% font_color F_Attente%,246,254,1 caption F_Attente%,"Patientez"
alpha alphAtt%(1) parent alphAtt%(1),F_Attente% top alphAtt%(1),20 left alphAtt%(1),20 caption alphAtt%(1),"Création des fichiers temporaires..."
progress_bar PbarAtt% parent PbarAtt%,F_Attente% top PbarAtt%,40 left PbarAtt%,20 width PbarAtt%,width(F_Attente%)-40 min PbarAtt%,0 max PbarAtt%,4 position PbarAtt%,0
alpha alphAtt%(2) parent alphAtt%(2),F_Attente% top alphAtt%(2),top(PbarAtt%)+25 caption alphAtt%(2),"0/4" left alphAtt%(2),(left(PbarAtt%)+width(PbarAtt%))-width(alphAtt%(2)) end_if res% = DLL_call2("WindowTopMost",handle(F_Attente%),1) end_sub
' FENETRE A PROPOS
sub form_APp() dim_local res%,h%,w%,mesApp$ if object_exists(F_App%)=1 show F_App% else form F_App% height F_App%,150 width F_App%,300 top F_App%,top(0)+100 left F_App%,left(0)+((width(0)-width(F_App%))/2) caption F_App%,"A Propos..." color F_App%,26,107,12 font_name F_App%,"arial" font_size F_App%,8 font_bold F_App% font_color F_App%,246,254,1 panel panApp% parent panApp%,F_App% full_space panApp% h%=height(panApp%) w%=width(panApp%) delete panApp% mesApp$ = "POKER MACHINE"+chr$(13)+chr$(13)+"Créé par ygeronimi"+chr$(13)+"Avec Panoramic Vs 0.9.27i8"+chr$(13)+"Utilise KGF.dll, créée par Klaus" alpha alphApp% parent alphApp%,F_App% top alphApp%,30 left alphApp%,30 caption alphApp%,mesApp$ end_if res% = DLL_call2("WindowTopMost",handle(F_App%),1) end_sub
' FENETRE DE L AIDE
sub form_help() dim_local res%,h%,w% if object_exists(F_help%)=1 show F_help% else form F_help% height F_help%,350 width F_help%,500 top F_help%,top(0)+100 left F_help%,left(0)+((width(0)-width(F_help%))/2) caption F_help%,"Aide" color F_help%,26,107,12 panel panhlp% parent panhlp%,F_help% full_space panhlp% h%=height(panhlp%) w%=width(panhlp%) delete panhlp% hviewer viewhlp% parent viewhlp%,F_help% top viewhlp%,5 left viewhlp%,5 height viewhlp%,h%-10 width viewhlp%,w%-10 if file_exists(PMhelp$)=1 : file_load viewhlp%,PMhelp$ : end_if end_if res% = DLL_call2("WindowTopMost",handle(F_help%),1) end_sub ' ------------------------------------------------------------------------------ ' MENUS ' ------------------------------------------------------------------------------
' CLIC
clic: if number_click =sm%(2) form_parametres() return end_if ' ------------------------- if number_click = sm%(3) form_APp() return end_if ' ------------------------- if number_click = sm%(4) form_help() return end_if ' ------------------------- if number_click = sm%(5) FCT_SaveBestScore() NumPartie%=NumPartie%+1 text edibq%,"€ "+str$(par_banque%) banque%=par_banque% position spmise%,par_mise% init_flop() return end_if ' ------------------------- if number_click = sm%(7) file_save Tracelist%,bureau$+"\Trace.txt" return end_if ' ------------------------- if number_click = sm%(6) message MesBScore$ return end_if ' ------------------------- if number_click = sm%(9) FCT_SaveBestScore() Quitter() return end_if ' ------------------------- if number_click = pictson% if voc%=1 voc%=0 if file_exists(PictSonOff$)=1 : file_load pictson%,PictSonOff$ : end_if hint pictson%,"Son : Off" else voc%=1 if file_exists(PictSonOn$)=1 : file_load pictson%,PictSonOn$ : end_if hint pictson%,"Son : On" end_if return end_if ' ------------------------- if number_click = btn%(1) mise% = position(spmise%) banque%=banque%-mise% text edibq%,"€ "+str$(banque%) tirage() inactive btn%(1) inactive spmise% active pict%(1) active pict%(2) active pict%(3) active pict%(4) active pict%(5) active btn%(2) if Gains%>0 : active btn%(4) : end_if return end_if ' ------------------------- if number_click = btn%(2) Gains%=0 tirage() inactive btn%(1) inactive btn%(2) if Gains%>0 active btn%(4) active btn%(3) else caption AlphG%,"Désolé, vous avez perdu." if voc%=1 parler("Désolé, vous avez perdu.") end_if pause 2000 init_flop() end_if return end_if ' ------------------------- if number_click = btn%(3) return end_if ' ------------------------- if number_click = btn%(4) banque%=banque%+Gains% text edibq%,"€ "+str$(banque%) init_flop() if banque%=1000000 : message "Bravo !"+chr$(13)+"Vous êtes Millionaire !" : end_if return end_if ' ------------------------- if number_click = pict%(1) if etatcarte%(1) = 1 etatcarte%(1) = 0 file_load pict%(1),bmp$(1) else etatcarte%(1) = 1 file_load pict%(1),dos$ end_if return end_if ' ------------------------- if number_click = pict%(2) if etatcarte%(2) = 1 etatcarte%(2) = 0 file_load pict%(2),bmp$(2) else etatcarte%(2) = 1 file_load pict%(2),dos$ end_if return end_if ' ------------------------- if number_click = pict%(3) if etatcarte%(3) = 1 etatcarte%(3) = 0 file_load pict%(3),bmp$(3) else etatcarte%(3) = 1 file_load pict%(3),dos$ end_if return end_if ' ------------------------- if number_click = pict%(4) if etatcarte%(4) = 1 etatcarte%(4) = 0 file_load pict%(4),bmp$(4) else etatcarte%(4) = 1 file_load pict%(4),dos$ end_if return end_if ' ------------------------- if number_click = pict%(5) if etatcarte%(5) = 1 etatcarte%(5) = 0 file_load pict%(5),bmp$(5) else etatcarte%(5) = 1 file_load pict%(5),dos$ end_if return end_if ' ------------------------- if object_exists(F_param%)=1 if number_click = optsonpar% if checked(optsonpar%)=1 caption optsonpar%,"On" else caption optsonpar%,"Off" end_if return end_if if number_click = btnprecpar% if TempCd%>52 TempCd%=TempCd%-1 FCT_ExtractTempCard(TempCd%) file_load pictpar%,TempCard$ file_delete TempCard$ end_if return end_if if number_click = btnsuivpar% if TempCd%<58 TempCd%=TempCd%+1 FCT_ExtractTempCard(TempCd%) file_load pictpar%,TempCard$ file_delete TempCard$ end_if return end_if
if (number_click > (alphTgpar2%(1)-1)) and (number_click < (alphTgpar2%(9)+1)) TempObj%=number_click top btnValTgMoins%,top(TempObj%) top btnValTgPlus%,top(TempObj%) show btnValTgMoins% show btnValTgPlus% TempTg%=val(caption$(TempObj%)) return end_if if number_click = btnValTgMoins% if TempTg%>1 TempTg%=TempTg%-1 caption TempObj%,str$(TempTg%) left TempObj%,width(F_param%)-(width(TempObj%)+100) end_if return end_if if number_click = btnValTgPlus% if TempTg%<25 TempTg%=TempTg%+1 caption TempObj%,str$(TempTg%) left TempObj%,width(F_param%)-(width(TempObj%)+100) end_if return end_if if number_click = btnsavepar% FCT_SaveParam() hide F_param% return end_if
end_if return
close: FCT_SaveBestScore() for ti%=1 to 5 if file_exists(bmp$(ti%))=1 : file_delete bmp$(ti%) : end_if next ti% if file_exists(dos$)=1 : file_delete dos$ : end_if if file_exists(PictSonOn$)=1 : file_delete PictSonOn$ : end_if if file_exists(PictSonOff$)=1 : file_delete PictSonOff$ : end_if dir_remove temp$ return
' CHANGE
change: if number_change = spmise% mise%=position(spmise%) ChangeTabGains() return end_if return
' ------------------------------------------------------------------------------ ' FONCTIONS ' ------------------------------------------------------------------------------
sub tirage() dim_local i%,dif%,img$,res% for i%=1 to 5 if etatcarte%(i%)=1 repeat if dif%<>4 : dif%=0 : end_if carte%(i%)=int(rnd(51)) if carte%(i%)<>carte%(1): dif%=dif%+1 : end_if if carte%(i%)<>carte%(2): dif%=dif%+1 : end_if if carte%(i%)<>carte%(3): dif%=dif%+1 : end_if if carte%(i%)<>carte%(4): dif%=dif%+1 : end_if if carte%(i%)<>carte%(5): dif%=dif%+1 : end_if until dif%=4 end_if next i%
for i%=1 to 5 img$ = bmp$(i%) res% = dll_call5("ExtractImageFromImageList",IMGL%,carte%(i%),0,0,adr(img$)) if file_exists(bmp$(i%))=1 file_load pict%(i%),bmp$(i%) etatcarte%(i%)=0 end_if next i% verif() end_sub ' ------------------------------------------------------------------------------ sub verif() dim_local i%,vc%(5),cc%(5),a$,b$,c$,combin%(13),combinCol$,coul%,f%,gagne%,mes$,mesvoc$,vcg$,vcg%(2),ncoul$,ncarte$,t$ clear Tracelist%
for i%=1 to 5 vc%(i%)= valcartes%(carte%(i%),1) c$=c$+NomCarte$(vc%(i%))+"," cc%(i%)= valcartes%(carte%(i%),2) combin%(vc%(i%))=combin%(vc%(i%))+1 combinCol$= combinCol$+str$(cc%(i%)) next i% item_add Tracelist%,"valeur des cartes "+c$ item_add Tracelist%,"combinaison de couleur "+combincol$ for i%=1 to 13 if combin%(i%)>1 a$=a$+str$(combin%(i%)) vcg$=vcg$+str$(i%)+"," end_if if combin%(i%)=1 b$=b$+str$(combin%(i%)) end_if next i% if len(a$)=1 : a$=a$+"0" : end_if if len(a$)=0 : a$="00" : end_if item_add Tracelist%,"combinaison de carte "+a$ item_add Tracelist%,"combinaison de carte "+b$ if len(vcg$)=0 vcg$=vcg$+"0,0," else if instr(vcg$,",")=len(vcg$) vcg$=vcg$+"0," end_if end_if
item_add Tracelist%,"valeur des cartes "+vcg$ ' message a$+chr$(13)+b$+chr$(13)+combinCol$
if a$="20" or a$="02" : gagne%=9 : end_if if a$="22" : gagne%=8 : end_if if a$="30" or a$="03" : gagne%=7 : end_if if a$="32" or a$="23" : gagne%=4 : end_if if a$="40" or a$="04" : gagne%=3 : end_if
if combinCol$="00000" or combinCol$="11111" or combinCol$="22222" or combinCol$="33333" coul%=1 for i%=0 to 3 if val(left$(combinCol$,1))=i% ncoul$=NomCouleur$(i%) exit_for end_if next i% end_if
if b$="11111" ' message b$+chr$(13)+c$ for i%=0 to 8 t$=NomCarte$(i%+1)+"-" if instr(c$,NomCarte$(i%+1))>0 t$=t$+NomCarte$(i%+2)+"-" if instr(c$,NomCarte$(i%+2))>0 t$=t$+NomCarte$(i%+3)+"-" if instr(c$,NomCarte$(i%+3))>0 t$=t$+NomCarte$(i%+4)+"-" if instr(c$,NomCarte$(i%+4))>0 t$=t$+NomCarte$(i%+5)+"-" if instr(c$,NomCarte$(i%+5))>0 if coul%=1 f%=1 gagne%=2 t$=t$+"|-"+str$(coul%)+"-|-2-" exit_for else f%=1 gagne%=6 t$=t$+"|-"+str$(coul%)+"-|-6-" exit_for end_if end_if end_if end_if end_if end_if item_add Tracelist%,"verif quinte "+t$ next i%
if f%=0 if instr(c$,"10")>0 if instr(c$,"11")>0 if instr(c$,"12")>0 if instr(c$,"13")>0 if instr(c$,"1")>0 if coul%=1 f%=1 gagne%=1 end_if end_if end_if end_if end_if end_if end_if
if f%=0 if coul%=1 gagne%=5 end_if end_if end_if
illumineGains(gagne%)
vcg%(1)=val(left$(vcg$,instr(vcg$,",")-1)) vcg$=right$(vcg$,len(vcg$)-instr(vcg$,",")) vcg%(2)=val(left$(vcg$,instr(vcg$,",")-1))
if val(left$(a$,1))>0 or val(right$(a$,1))>0 if val(left$(a$,1))=0 or val(right$(a$,1))=0 if val(left$(a$,1))=0 ncarte$=NomCarte$(vcg%(2)) else ncarte$=NomCarte$(vcg%(1)) end_if else if val(left$(a$,1))=val(right$(a$,1)) ncarte$=NomCarte$(vcg%(1))+" et de "+NomCarte$(vcg%(2)) else if val(left$(a$,1))>val(right$(a$,1)) ncarte$=NomCarte$(vcg%(1))+" par les "+NomCarte$(vcg%(2)) else if val(right$(a$,1))>val(left$(a$,1)) ncarte$=NomCarte$(vcg%(2))+" par les "+NomCarte$(vcg%(1)) end_if end_if end_if end_if end_if
select gagne% case 0 : mes$="" case 1 : mes$="Vous avez une quinte flush royale à "+ncoul$+" !" : Gains%=mise%*10 case 2 : mes$="Vous avez une quinte flush à "+ncoul$+" !" : Gains%=mise%*8 case 3 : mes$="Vous avez un carré de "+ncarte$+" !" : Gains%=mise%*7 case 4 : mes$="Vous avez un full de "+ncarte$+" !" : Gains%=mise%*6 case 5 : mes$="Vous avez une couleur à "+ncoul$+" !" : Gains%=mise%*5 case 6 : mes$="Vous avez une quinte !" : Gains%=mise%*4 case 7 : mes$="Vous avez un brelan de "+ncarte$+" !" : Gains%=mise%*3 case 8 : mes$="Vous avez deux paires de "+ncarte$+" !" : Gains%=mise%*2 case 9 : mes$="Vous avez une paire de "+ncarte$+" !" : Gains%=mise% end_select caption alphG%,mes$ if voc%=1 parler(mes$) end_if end_sub ' ------------------------------------------------------------------------------ sub illumineGains(G%) dim_local i% for i%=1 to 9 font_color Tabgains%(i%),170,240,160 font_color Tabgains2%(i%),170,240,160 next i% if G%>0 font_color Tabgains%(G%),246,254,1 font_color Tabgains2%(G%),246,254,1 end_if end_sub ' ------------------------------------------------------------------------------ sub init_flop() dim_local i% Gains%=0 inactive btn%(2) inactive btn%(3) inactive btn%(4) for i%=1 to 5 file_load pict%(i%),dos$ etatcarte%(i%)=1 inactive pict%(i%) next i% caption alphG%,"" for i%=1 to 9 font_color Tabgains%(i%),170,240,160 font_color Tabgains2%(i%),170,240,160 next i% active btn%(1) active spmise% end_sub ' ------------------------------------------------------------------------------ sub ChangeTabGains() dim_local i%,Bg%,Tg2$ Tg2$="10,8,7,6,5,4,3,2,1," for i%=1 to 9 Bg%=val(left$(Tg2$,instr(Tg2$,",")-1)) caption Tabgains2%(i%),str$(mise%*Bg%)+" €" left Tabgains2%(i%),width(pan%(2))-(width(Tabgains2%(i%))+5) if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if next i% end_sub ' ------------------------------------------------------------------------------ SUB parler(tex$) dim_local f$,g$ if dir_exists("c:\temp")=0 then dir_make "c:\temp" f$ = "c:\temp\parler.vbs" g$ = chr$(34) FILE_OPEN_WRITE 9999, f$ file_writeln 9999, "Dim speaks, speech" file_writeln 9999, "speaks = " + g$ + tex$ + g$ file_writeln 9999, "Set speech = CreateObject(" + g$ + "sapi.spvoice" + g$+ ")" file_writeln 9999, "speech.Speak speaks" FILE_CLOSE 9999 EXECUTE_WAIT f$ : FILE_DELETE f$ END_SUB ' ------------------------------------------------------------------------------ sub FCT_ExtractTempCard(n%) dim_local res% res% = dll_call5("ExtractImageFromImageList",IMGL%,n%,0,0,adr(TempCard$)) end_sub ' ------------------------------------------------------------------------------ sub FCT_SaveParam() dim_local i%,res% par_banque% = position(spnbanqpar%) par_misemax% = position(spnmisemaxpar%) if checked(optsonpar%)=1 par_voc% = 1 else par_voc% = 0 end_if par_cartedos% = TempCd% res% = dll_call5("ExtractImageFromImageList",IMGL%,TempCd%,0,0,adr(dos$)) for i%=1 to 9 : par_Tg$ = par_Tg$+caption$(alphTgpar2%(i%))+"," : next i%
file_open_write F_OW%,param$ file_writeln F_OW%,str$(par_banque%) file_writeln F_OW%,str$(par_misemax%) file_writeln F_OW%,str$(par_voc%) file_writeln F_OW%,str$(par_cartedos%) file_writeln F_OW%,par_Tg$ file_close F_OW% end_sub ' ------------------------------------------------------------------------------ sub Quitter() for ti%=1 to 5 if file_exists(bmp$(ti%))=1 : file_delete bmp$(ti%) : end_if next ti% if file_exists(dos$)=1 : file_delete dos$ : end_if if file_exists(PictSonOn$)=1 : file_delete PictSonOn$ : end_if if file_exists(PictSonOff$)=1 : file_delete PictSonOff$ : end_if dir_remove temp$ terminate end_sub ' ------------------------------------------------------------------------------ sub FCT_SaveBestScore() dim_local Memory$,a$,NScore% if NumPartie%>0 Memory$=Parties$+"Scores.inf" NScore%=Banque% if NScore%>BestScore% BestScore%=NScore% a$=date$+","+str$(NumPartie%)+","+str$(NScore%) file_open_write F_OW%,Memory$ file_writeln F_OW%,a$ file_close F_OW% caption sm%(6),"Best score : "+str$(BestScore%) MesBScore$="Date : "+date$+chr$(13)+"à : "+Time$+chr$(13)+"Score : "+str$(BestScore%) end_if end_if end_sub ' ------------------------------------------------------------------------------ sub RecupBestScore() dim_local Memory$,a$,bs$ Memory$=Parties$+"Scores.inf" if file_exists(Memory$)=1 file_open_read F_OR%,Memory$ file_readln F_OR%,a$ file_close F_OR% MesBScore$="Date : "+left$(a$,instr(a$,",")-1)+chr$(13) a$=right$(a$,len(a$)-instr(a$,",")) MesBScore$=MesBScore$+"à : "+left$(a$,instr(a$,",")-1)+chr$(13) bs$=right$(a$,len(a$)-instr(a$,",")) MesBScore$=MesBScore$+"Score : "+bs$ BestScore%=val(bs$) end_if end_sub
' ------------------------------------------------------------------------------ ' DATA IMAGE ' ------------------------------------------------------------------------------
sub CreateImgSonOff() dim_local img$,imgcount%,v,i% ImgCount%=1654 img$="66,77,118,6,0,0,0,0,0,0,54,4,0,0,40,0,0,0,24,0,0,0,24,0,0,0,1,0,8,0,0,0,0,0,0,0,0,0,196,14," img$=img$+"0,0,196,14,0,0,0,1,0,0,0,1,0,0,12,107,26,255,11,105,29,255,10,93,54,255,10,90,61,255,11,101,36,255,11,98,43,255,10,96," img$=img$+"47,255,9,88,65,255,9,81,79,255,8,78,87,255,7,68,108,255,7,66,112,255,5,46,154,255,3,30,190,255,4,36,175,255,3,35,179,255,3,26," img$=img$+"197,255,2,25,201,255,2,20,211,255,1,13,226,255,1,10,233,255,0,6,240,255,0,5,244,255,0,1,251,255,0,0,255,255,0,3,254,255,0,7," img$=img$+"254,255,0,11,254,255,0,23,254,255,0,59,252,255,0,79,252,255,0,83,252,255,0,103,251,255,0,111,251,255,0,170,248,255,0,174,248,255,0,186," img$=img$+"248,255,0,202,247,255,0,194,248,255,0,214,247,255,0,242,246,255,0,250,246,255,1,254,246,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,42,0,0,0,0,0,0,0,0,3,16,6,0,0," img$=img$+"0,0,0,0,0,0,40,15,39,0,42,0,0,0,0,0,0,0,3,20,24,17,4,0,0,42,0,0,0,4,29,24,28,3,42,0,0,0,0,0," img$=img$+"0,0,18,24,24,24,17,4,42,42,0,0,41,13,24,24,24,18,42,0,0,0,0,0,0,0,3,20,24,24,24,31,41,42,0,1,31,24,24,24," img$=img$+"28,3,42,0,0,0,0,0,0,0,0,7,22,24,24,24,31,41,0,14,24,24,24,22,37,0,42,0,0,0,0,0,0,0,0,0,8,27,24,24," img$=img$+"24,33,12,24,24,24,26,8,42,0,42,0,0,0,0,0,42,42,42,42,42,36,25,24,24,24,24,24,24,23,34,0,42,0,42,0,0,0,0,0," img$=img$+"42,42,42,42,42,42,34,25,24,24,24,24,24,10,42,0,42,0,42,0,0,0,0,0,42,42,42,42,42,42,42,33,24,24,24,24,30,0,42,0," img$=img$+"42,0,42,0,0,0,0,0,42,42,42,42,42,42,34,25,24,24,24,24,24,11,42,0,42,0,42,0,0,0,0,0,42,42,42,42,42,35,25,24," img$=img$+"24,24,24,24,24,23,34,0,42,0,42,0,0,0,0,0,42,42,42,42,38,27,24,24,24,33,12,24,24,24,25,9,42,0,42,0,0,0,0,0," img$=img$+"0,0,0,8,22,24,24,24,32,42,0,12,24,24,24,22,38,0,42,0,0,0,0,0,0,0,3,21,24,24,24,31,41,42,0,1,31,24,24,24," img$=img$+"27,7,42,0,0,0,0,0,0,0,16,24,24,24,16,41,42,42,0,0,41,15,24,24,24,16,42,0,0,0,0,0,0,0,6,19,24,17,4,0," img$=img$+"42,42,0,0,0,4,29,24,28,2,42,0,0,0,0,0,0,0,0,3,16,5,0,0,0,42,0,0,0,0,40,15,39,0,42,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,42,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"42,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,42,0,0,0," filebin_open_write F_OW%,PictSonOff$ for i%=1 to imgcount% v=val(left$(img$,instr(img$,",")-1)) filebin_write F_OW%,v if i%<imgcount% img$=right$(img$,len(img$)-instr(img$,",")) end_if next i% filebin_close F_OW% end_sub
' ------------------------------------------------------------------------------
sub CreateImgSonOn() dim_local img$,imgcount%,v,i%
ImgCount%=1654 img$="66,77,118,6,0,0,0,0,0,0,54,4,0,0,40,0,0,0,24,0,0,0,24,0,0,0,1,0,8,0,0,0,0,0,0,0,0,0,196,14," img$=img$+"0,0,196,14,0,0,0,1,0,0,0,1,0,0,12,107,26,255,1,254,246,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,0,0,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,1,0," img$=img$+"1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1," img$=img$+"1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0," img$=img$+"1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0," img$=img$+"1,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1," img$=img$+"1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0," img$=img$+"0,0,0,0,0,1,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,1,0," img$=img$+"1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"1,1,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,1,0,0,0,"
filebin_open_write F_OW%,PictSonOn$ for i%=1 to imgcount% v=val(left$(img$,instr(img$,",")-1)) filebin_write F_OW%,v if i%<imgcount% img$=right$(img$,len(img$)-instr(img$,",")) end_if next i% filebin_close F_OW% end_sub | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 12 Oct 2016 - 22:26 | |
| Dans ce source, l' espace entre "Aide" et "Best score" dans le "main_menu" est actif. Il permet de créer un fichier "Trace.txt" sur le bureau. Si vous avez un tirage incohérent avec l' annonce, comme Minibug plus haut, cliquez et postez le contenu de fichier SVP. | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Jeu 13 Oct 2016 - 0:18 | |
| Tentez de doubler vos gains !
[code:1:e1aa]hide 0 Application_title "Poker Machine" variables() constantes() labels() init() gui() show 0 hide F_Attente% end
' ------------------------------------------------------------------------------ ' DECLARATION DES VARIABLES ' ------------------------------------------------------------------------------
sub variables() dim no%,ti% dim voc% dim carte%(5) dim etatcarte%(5) dim valcartes%(51,3) dim banque% dim mise% dim Gains% dim double% dim carteret% dim NumPartie% dim BestScore% dim MesBScore$ ' temp dim TempObj% dim TempTg% dim TempCd% ' paramètres par defaut dim par_banque% dim par_mise% dim par_voc% dim par_misemax% dim par_Tg$ dim par_cartedos% end_sub
' ------------------------------------------------------------------------------ ' DECLARATION DES CONSTANTES ' ------------------------------------------------------------------------------
sub constantes() dim_local i% ' dossier dim path$ : path$=dir_current$ if right$(path$,1)="" : path$=left$(path$,len(path$)-1) : end_if path$=path$+"" dim temp$ : temp$="C:\Temp\TempPokerMachine" dim user$ dim Parties$ ' fichier trace dim bureau$ ' fichier dll dim kgf$ : kgf$=path$+"\KGF.dll" ' fichier imagelist dim ImgList$ : ImgList$=path$+"\cartes2.ilb" ' autres fichiers image dim PictSonOn$ : PictSonOn$ = temp$+"\son_on.bmp" dim PictSonOff$ : PictSonOff$ = temp$+"\son_off.bmp" dim TempCard$ : TempCard$ = temp$+"Tpdos.bmp" ' fichier paramètres dim Param$ : Param$ = path$+"\param.inf" dim Kgfpar$ : Kgfpar$= path$+"\kgf.inf" ' fichier aide dim PMhelp$ : PMhelp$= path$+"\help.html" ' fichiers images temporaires dim bmp$(5) : for i%=1 to 5 : bmp$(i%)=temp$+"img"+str$(i%)+".bmp" : next i% dim dos$ : dos$ = temp$+"dos.bmp" ' objets panoramic ' form 0 dim mm% : no%=no%+1 : mm%=no% dim sm%(12) : for i%=1 to 12 : no%=no%+1 : sm%(i%)=no% : next i% dim pan%(3) : for i%=0 to 3 : no%=no%+1 : pan%(i%)=no% : next i% dim edibq% : no%=no%+1 : edibq%=no% dim alphmise%: no%=no%+1 : alphmise%=no% dim spmise% : no%=no%+1 : spmise%=no% dim pict%(5) : for i%=1 to 5 : no%=no%+1 : pict%(i%)=no% : next i% dim alphG% : no%=no%+1 : alphG%=no% dim btn%(4) : for i%=0 to 4 : no%=no%+1 :btn%(i%)=no% : next i% dim Tabgains%(9): for i%=1 to 9 : no%=no%+1 : Tabgains%(i%)=no% : next i% dim Tabgains2%(9): for i%=1 to 9 : no%=no%+1 : Tabgains2%(i%)=no% : next i% dim pictson% : no%=no%+1 : pictson%=no% dim Tracelist% : no%=no%+1 : Tracelist%=no% ' form paramètres dim F_Param% : no%=no%+1 : F_Param%=no% dim alphpar%(5) : for i%=1 to 5 : no%=no%+1 : alphpar%(i%)=no% : next i% dim pictpar% : no%=no%+1 : pictpar%=no% dim btnprecpar% : no%=no%+1 : btnprecpar%=no% dim btnsuivpar% : no%=no%+1 : btnsuivpar%=no% dim optsonpar% : no%=no%+1 : optsonpar%=no% dim spnbanqpar% : no%=no%+1 : spnbanqpar%=no% dim spnmisemaxpar% : no%=no%+1 : spnmisemaxpar%=no% dim alphTgpar1%(9) : for i%=1 to 9 : no%=no%+1 : alphTgpar1%(i%)=no% : next i% dim alphTgpar2%(9) : for i%=1 to 9 : no%=no%+1 : alphTgpar2%(i%)=no% : next i% dim btnValTgPlus% : no%=no%+1 : btnValTgPlus%=no% dim btnValTgMoins% : no%=no%+1 : btnValTgMoins%=no% dim btnsavepar% : no%=no%+1 : btnsavepar%=no% ' form a propos dim F_App% : no%=no%+1 : F_App%=no% dim panApp% : no%=no%+1 : panApp%=no% dim alphApp% : no%=no%+1 : alphApp%=no% ' form help dim F_help% : no%=no%+1 : F_help%=no% dim viewhlp% : no%=no%+1 : viewhlp%=no% dim panhlp% : no%=no%+1 : panhlp%=no% ' form attente dim F_Attente% : no%=no%+1 : F_Attente%=no% dim alphAtt%(3) : for i%=1 to 3 : no%=no%+1 : alphAtt%(i%)=no% : next i% dim PbarAtt% : no%=no%+1 : PbarAtt%=no% ' objets ouverture/fermeture de fichiers dim F_OW% : no%=no%+1 : F_OW%=no% dim F_OR% : no%=no%+1 : F_OR%=no% ' objets boites de dialog dim Odial% : no%=no%+1 : Odial%=no% dim Sdial% : no%=no%+1 : Sdial%=no% ' objets kgf dim IMGL% ' du jeu dim NomCarte$(13) dim NomCouleur$(3) end_sub
' ------------------------------------------------------------------------------ ' DECLARATION DES LABELS ' ------------------------------------------------------------------------------
sub labels() label clic,change,close end_sub
' ------------------------------------------------------------------------------ ' INITIALISATIONS ' ------------------------------------------------------------------------------
sub init() dim_local res%,i%,v%,x%,a$ if dir_exists("C:\Temp")=0 then dir_make "C:\Temp" if dir_exists(temp$)=0 then dir_make temp$ if file_exists(Kgfpar$)=0 if file_exists(Kgf$)=0 if message_warning_yes_no("La dll KGF.dll n' a pas été trouvée !"+Chr$(13)+"Voulez vous indiquer son emplacement sur votre ordinateur ?")=1 Open_dialog Odial% dir_dialog Odial%,"C:" filter Odial%,"*.dll|*.dll" a$=file_name$(Odial%) delete Odial%
if a$<>"_" KGF$=a$ file_open_write F_OW%,Kgfpar$ file_writeln F_OW%,KGF$ file_close F_OW% else Message "Vous ne disposez pas de cette dll."+chr$(13)+"Vous pouvez la télécharger à cette adresse :"+chr$(13)+"http://klauspanoramic.comxa.com/versions/KGF.zip" Quitter() end_if else Quitter() end_if end_if else File_open_read F_OR%,Kgfpar$ file_readln F_OR%,KGF$ file_close F_OR% end_if dll_on kgf$ form_Attente() bureau$=string$(511," ") res% = dll_call2("GetWindowsFoldersPath",0,adr(bureau$)) bureau$=trim$(bureau$)
user$=string$(511," ") res% = dll_call2("GetWindowsFoldersPath",5,adr(user$)) user$=trim$(user$) Parties$=User$+"\PokerMachineGames" RecupBestScore() if dir_exists(Parties$)=0 : dir_make Parties$ : end_if position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"1/4" display
IMGL% = dll_call2("CreateImageList",57,84) res% = dll_call2("LoadImageList",IMGL%,adr(ImgList$)) wait 1000 position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"2/4" display CreateImgSonOff() position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"3/4" display CreateImgSonOn() position PbarAtt%,position(PbarAtt%)+1 caption ALphAtt%(2),"4/4" display for i%=0 to 12 for x%=0 to 3 valcartes%(v%,1)=i%+1 valcartes%(v%,2)=x% v%=v%+1 next x% next i%
a$="un,deux,trois,quattre,cinq,six,sept,huit,neuf,dix,vallet,dame,roi," for i%=1 to 13 NomCarte$(i%)=NomCarte$(i%)+left$(a$,instr(a$,",")-1) if i%<13 a$=right$(a$,len(a$)-instr(a$,",")) end_if next i%
a$="coeur,carreau,pique,treffle," for i%=0 to 3 NomCouleur$(i%)=NomCouleur$(i%)+left$(a$,instr(a$,",")-1) if i%<3 a$=right$(a$,len(a$)-instr(a$,",")) end_if next i%
if file_exists(param$)=1 file_open_read F_OR%,param$ file_readln F_OR%,a$ : par_banque% =val(a$) file_readln F_OR%,a$ : par_misemax% =val(a$) file_readln F_OR%,a$ : par_voc% =val(a$) : voc% = par_voc% file_readln F_OR%,a$ : par_cartedos% =val(a$) file_readln F_OR%,a$ : par_Tg$ =a$ file_close F_OR% else ' paramètres par defaut par_banque%=1000 par_misemax%=10 par_voc%=1 : voc%=1 par_Tg$="10,8,7,6,5,4,3,2,1," par_cartedos%=52 end_if par_mise%=1 TempCd% = par_cartedos% res% = dll_call5("ExtractImageFromImageList",IMGL%,par_cartedos%,0,0,adr(dos$)) end_sub
' ------------------------------------------------------------------------------ ' INTERFACE UTILISATEUR ' ------------------------------------------------------------------------------
' FENETRE PRINCIPALE
sub gui() dim_local res%,i%,l%,pw%,ph%,Tg$,Tg2$,Bg%
height 0,350 width 0,750 top 0,(screen_y-height(0))/2 left 0,(screen_x-width(0))/2 color 0,26,107,12 caption 0,"Poker Machine" font_name 0,"arial" font_size 0,8 on_close 0,close
main_menu mm% sub_menu sm%(1) : parent sm%(1),mm% : caption sm%(1),"Jeu" sub_menu sm%(2) : parent sm%(2),mm% : caption sm%(2),"Paramètres" : on_click sm%(2),clic sub_menu sm%(3) : parent sm%(3),mm% : caption sm%(3),"A Propos" : on_click sm%(3),clic sub_menu sm%(4) : parent sm%(4),mm% : caption sm%(4),"Aide" : on_click sm%(4),clic sub_menu sm%(7) : parent sm%(7),mm% : caption sm%(7),string$(100," ") : on_click sm%(7),clic : inactive sm%(7) sub_menu sm%(6) : parent sm%(6),mm% : caption sm%(6),"Best score : "+str$(BestScore%) : on_click sm%(6),clic sub_menu sm%(5) : parent sm%(5),sm%(1) : caption sm%(5),"Nouveau" : on_click sm%(5),clic sub_menu sm%(8) : parent sm%(8),sm%(1) : caption sm%(8),"-" sub_menu sm%(9) : parent sm%(9),sm%(1) : caption sm%(9),"Quitter" : on_click sm%(9),clic
panel pan%(0) full_space pan%(0) pw%=width(pan%(0)) ph%=height(pan%(0)) delete pan%(0)
panel pan%(1) height pan%(1),ph% width pan%(1),pw%-250 top pan%(1),0 left pan%(1),0 color pan%(1),26,107,12
edit edibq% parent edibq%,pan%(1) width edibq%,80 top edibq%,5 left edibq%,5 font_name edibq%,"arial" font_size edibq%,10 font_bold edibq% color edibq%,0,0,0 font_color edibq%,255,255,255 text edibq%,"€ 0" inactive edibq%
spin spmise% parent spmise%,pan%(1) width spmise%,60 height spmise%,height(edibq%) top spmise%,5 left spmise%,width(pan%(1))-(width(spmise%)+5) font_name spmise%,"arial" font_size spmise%,10 font_bold spmise% color spmise%,0,0,0 font_color spmise%,255,255,255 min spmise%,1 max spmise%,par_misemax% position spmise%,par_mise% on_change spmise%,change
alpha alphmise% parent alphmise%,pan%(1) top alphmise%,7 left alphmise%,left(spmise%)-width(alphmise%) font_name alphmise%,"arial" font_size alphmise%,10 font_bold alphmise% font_color alphmise%,246,254,1 caption alphmise%,"Mise :"
l%=10 for i%=1 to 5 l%=l%+67 picture pict%(i%) parent pict%(i%),pan%(1) height pict%(i%),84 width pict%(i%),57 top pict%(i%),80 left pict%(i%),l% cursor_point pict%(i%) on_click pict%(i%),clic next i%
for i%=1 to 5 if file_exists(dos$)=1 file_load pict%(i%),dos$ carte%(i%)=par_cartedos% etatcarte%(i%)=1 inactive pict%(i%) end_if next i%
alpha alphG% parent alphG%,pan%(1) top alphG%,180 left alphG%,60 font_name alphG%,"Times" font_size alphG%,12 font_color alphG%,246,254,1 color alphG%,26,107,12
button btn%(1) parent btn%(1),pan%(1) width btn%(1),100 top btn%(1),210 left btn%(1),(width(pan%(1))/2)-210 caption btn%(1),"Jouer" cursor_point btn%(1) on_click btn%(1),clic inactive btn%(1)
button btn%(2) parent btn%(2),pan%(1) width btn%(2),100 top btn%(2),210 left btn%(2),(width(pan%(1))/2)-105 caption btn%(2),"Changer" cursor_point btn%(2) on_click btn%(2),clic inactive btn%(2)
button btn%(3) parent btn%(3),pan%(1) width btn%(3),100 top btn%(3),210 left btn%(3),(width(pan%(1))/2)+5 caption btn%(3),"Double" cursor_point btn%(3) on_click btn%(3),clic inactive btn%(3)
button btn%(4) parent btn%(4),pan%(1) width btn%(4),100 top btn%(4),210 left btn%(4),(width(pan%(1))/2)+110 caption btn%(4),"Encaisser" cursor_point btn%(4) on_click btn%(4),clic inactive btn%(4)
picture pictson% parent pictson%,pan%(1) height pictson%,24 width pictson%,24 top pictson%,height(pan%(1))-34 left pictson%,width(pan%(1))-34 if par_voc%=1 if file_exists(PictSonOn$)=1 : file_load pictson%,PictSonOn$ : end_if hint pictson%,"Son : On" else if file_exists(PictSonOff$)=1 : file_load pictson%,PictSonOff$ : end_if hint pictson%,"Son : Off" end_if cursor_point pictson% on_click pictson%,clic
panel pan%(2) height pan%(2),ph% width pan%(2),250 top pan%(2),0 left pan%(2),width(pan%(1)) color pan%(2),26,107,12
Tg$="Quinte flush royale,Quinte flush,Carré,Full,Couleur,Quinte,Brelan,2 Paires,1 Paire,"
for i%=1 to 9 alpha Tabgains%(i%) parent Tabgains%(i%),pan%(2) width Tabgains%(i%),width(pan%(2))-6 top Tabgains%(i%),25*i% left Tabgains%(i%),3 font_name Tabgains%(i%),"Times" font_size Tabgains%(i%),12 font_bold Tabgains%(i%) font_color Tabgains%(i%),170,240,160 caption Tabgains%(i%),left$(Tg$,instr(Tg$,",")-1)
if i%<9 Tg$=right$(Tg$,len(Tg$)-instr(Tg$,",")) end_if next i%
Tg2$=Par_Tg$
for i%=1 to 9 alpha Tabgains2%(i%) parent Tabgains2%(i%),pan%(2) width Tabgains2%(i%),width(pan%(2))-6 top Tabgains2%(i%),25*i% font_name Tabgains2%(i%),"Times" font_size Tabgains2%(i%),12 font_bold Tabgains2%(i%) font_color Tabgains2%(i%),170,240,160 Bg%=val(left$(Tg2$,instr(Tg2$,",")-1)) caption Tabgains2%(i%),str$(position(spmise%)*Bg%)+" €" left Tabgains2%(i%),width(pan%(2))-(width(Tabgains2%(i%))+5)
if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if next i%
dlist Tracelist% end_sub
' FENETRE DES PARAMETRES
sub form_parametres() dim_local i%,c$,Tg$,Tg2$,t%,res%
if object_exists(F_Param%)=1 show F_Param% else form F_param% height F_param%,580 width F_param%,350 top F_param%,(screen_y-height(F_param%))/2 left F_param%,(screen_x-width(F_param%))/2 color F_param%,26,107,12 font_name F_param%,"arial" font_size F_param%,8 font_bold F_param% font_color F_param%,246,254,1 caption F_param%,"Paramètres"
c$="Banque départ :,Mise maximum :,Son au démarrage :,Dos des cartes :,Table des gains :," for i%=1 to 5 alpha alphpar%(i%) parent alphpar%(i%),F_param% if i%<5 top alphpar%(i%),i%*35 else top alphpar%(i%),i%*50 end_if left alphpar%(i%),10 caption alphpar%(i%),left$(c$,instr(c$,",")-1) if i%<5 c$=right$(c$,len(c$)-instr(c$,",")) end_if next i%
spin spnbanqpar% parent spnbanqpar%,F_param% top spnbanqpar%,top(alphpar%(1))-4 left spnbanqpar%,width(alphpar%(1))+20 width spnbanqpar%,80 min spnbanqpar%,1000 max spnbanqpar%,5000 font_size spnbanqpar%,10 color spnbanqpar%,0,0,0 font_color spnbanqpar%,255,255,255
spin spnmisemaxpar% parent spnmisemaxpar%,F_param% top spnmisemaxpar%,top(alphpar%(2))-4 left spnmisemaxpar%,width(alphpar%(2))+20 width spnmisemaxpar%,50 min spnmisemaxpar%,10 max spnmisemaxpar%,100 font_size spnmisemaxpar%,10 color spnmisemaxpar%,0,0,0 font_color spnmisemaxpar%,255,255,255
check optsonpar% parent optsonpar%,F_param% top optsonpar%,top(alphpar%(3)) left optsonpar%,width(alphpar%(3))+20 on_click optsonpar%,clic
picture pictpar% parent pictpar%,F_param% top pictpar%,top(alphpar%(4))+20 left pictpar%,width(F_param%)/2 height pictpar%,84 width pictpar%,57 if file_exists(dos$)=1 : file_load pictpar%,dos$ : end_if
button btnprecpar% parent btnprecpar%,F_param% height btnprecpar%,height(pictpar%) width btnprecpar%,12 top btnprecpar%,top(pictpar%) left btnprecpar%,left(pictpar%)-14 font_name btnprecpar%,"Webdings" caption btnprecpar%,"3" hint btnprecpar%,"Précedent" cursor_point btnprecpar% on_click btnprecpar%,clic
button btnsuivpar% parent btnsuivpar%,F_param% height btnsuivpar%,height(pictpar%) width btnsuivpar%,12 top btnsuivpar%,top(pictpar%) left btnsuivpar%,left(pictpar%)+width(pictpar%)+2 font_name btnsuivpar%,"Webdings" caption btnsuivpar%,"4" hint btnsuivpar%,"Suivant" cursor_point btnsuivpar% on_click btnsuivpar%,clic
Tg$="Quinte flush royale,Quinte flush,Carré,Full,Couleur,Quinte,Brelan,2 Paires,1 Paire," t%=top(alphpar%(5))+10 for i%=1 to 9 t%=t%+25 alpha alphTgpar1%(i%) parent alphTgpar1%(i%),F_param% top alphTgpar1%(i%),t% left alphTgpar1%(i%),30 font_color alphTgpar1%(i%),255,255,255 caption alphTgpar1%(i%),left$(Tg$,instr(Tg$,",")-1) if i%<9 Tg$=right$(Tg$,len(Tg$)-instr(Tg$,",")) end_if next i%
Tg2$=par_Tg$ t%=top(alphpar%(5))+10 for i%=1 to 9 t%=t%+25 alpha alphTgpar2%(i%) parent alphTgpar2%(i%),F_param% top alphTgpar2%(i%),t% font_color alphTgpar2%(i%),255,255,255 caption alphTgpar2%(i%),left$(Tg2$,instr(Tg2$,",")-1) if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if left alphTgpar2%(i%),width(F_param%)-(width(alphTgpar2%(i%))+100) cursor_point alphTgpar2%(i%) on_click alphTgpar2%(i%),clic next i%
create_hide button btnValTgPlus% parent btnValTgPlus%,F_param% height btnValTgPlus%,16 width btnValTgPlus%,16 top btnValTgPlus%,top(alphTgpar2%(1)) left btnValTgPlus%,width(F_param%)-(width(alphTgpar2%(1))+80) font_bold btnValTgPlus% caption btnValTgPlus%,"+" cursor_point btnValTgPlus% hint btnValTgPlus%,"Augmenter le mutiplicateur" on_click btnValTgPlus%,clic
button btnValTgMoins% parent btnValTgMoins%,F_param% height btnValTgMoins%,18 width btnValTgMoins%,18 top btnValTgMoins%,top(alphTgpar2%(1))-2 left btnValTgMoins%,left(alphTgpar2%(1))-50 font_bold btnValTgMoins% caption btnValTgMoins%,"-" cursor_point btnValTgMoins% hint btnValTgMoins%,"Diminuer le mutiplicateur" on_click btnValTgMoins%,clic create_show button btnsavepar% parent btnsavepar%,F_param% caption btnsavepar%,"Enregistrer" top btnsavepar%,height(F_param%)-60 left btnsavepar%,width(F_param%)-(width(btnsavepar%)+10) cursor_point btnsavepar% on_click btnsavepar%,clic
end_if position spnbanqpar%,par_banque% position spnmisemaxpar%,par_misemax% if par_voc%=1 : mark_on optsonpar% : end_if if checked(optsonpar%)=1 :caption optsonpar%,"On" :else:caption optsonpar%,"Off" :end_if res% = DLL_call2("WindowTopMost",handle(F_param%),1) end_sub
' FENETRE D ATTENTE
sub form_Attente() dim_local res% if object_exists(F_Attente%)=1 show F_Attente% else form F_Attente% height F_Attente%,120 width F_Attente%,300 top F_Attente%,(screen_y-height(F_Attente%))/2 left F_Attente%,(screen_x-width(F_Attente%))/2 color F_Attente%,26,107,12 font_name F_Attente%,"arial" font_size F_Attente%,8 font_bold F_Attente% font_color F_Attente%,246,254,1 caption F_Attente%,"Patientez"
alpha alphAtt%(1) parent alphAtt%(1),F_Attente% top alphAtt%(1),20 left alphAtt%(1),20 caption alphAtt%(1),"Création des fichiers temporaires..."
progress_bar PbarAtt% parent PbarAtt%,F_Attente% top PbarAtt%,40 left PbarAtt%,20 width PbarAtt%,width(F_Attente%)-40 min PbarAtt%,0 max PbarAtt%,4 position PbarAtt%,0
alpha alphAtt%(2) parent alphAtt%(2),F_Attente% top alphAtt%(2),top(PbarAtt%)+25 caption alphAtt%(2),"0/4" left alphAtt%(2),(left(PbarAtt%)+width(PbarAtt%))-width(alphAtt%(2)) end_if res% = DLL_call2("WindowTopMost",handle(F_Attente%),1) end_sub
' FENETRE A PROPOS
sub form_APp() dim_local res%,h%,w%,mesApp$ if object_exists(F_App%)=1 show F_App% else form F_App% height F_App%,150 width F_App%,300 top F_App%,top(0)+100 left F_App%,left(0)+((width(0)-width(F_App%))/2) caption F_App%,"A Propos..." color F_App%,26,107,12 font_name F_App%,"arial" font_size F_App%,8 font_bold F_App% font_color F_App%,246,254,1 panel panApp% parent panApp%,F_App% full_space panApp% h%=height(panApp%) w%=width(panApp%) delete panApp% mesApp$ = "POKER MACHINE"+chr$(13)+chr$(13)+"Créé par ygeronimi"+chr$(13)+"Avec Panoramic Vs 0.9.27i8"+chr$(13)+"Utilise KGF.dll, créée par Klaus" alpha alphApp% parent alphApp%,F_App% top alphApp%,30 left alphApp%,30 caption alphApp%,mesApp$ end_if res% = DLL_call2("WindowTopMost",handle(F_App%),1) end_sub
' FENETRE DE L AIDE
sub form_help() dim_local res%,h%,w% if object_exists(F_help%)=1 show F_help% else form F_help% height F_help%,350 width F_help%,500 top F_help%,top(0)+100 left F_help%,left(0)+((width(0)-width(F_help%))/2) caption F_help%,"Aide" color F_help%,26,107,12 panel panhlp% parent panhlp%,F_help% full_space panhlp% h%=height(panhlp%) w%=width(panhlp%) delete panhlp% hviewer viewhlp% parent viewhlp%,F_help% top viewhlp%,5 left viewhlp%,5 height viewhlp%,h%-10 width viewhlp%,w%-10 if file_exists(PMhelp$)=1 : file_load viewhlp%,PMhelp$ : end_if end_if res% = DLL_call2("WindowTopMost",handle(F_help%),1) end_sub ' ------------------------------------------------------------------------------ ' MENUS ' ------------------------------------------------------------------------------
' CLIC
clic: if number_click =sm%(2) form_parametres() return end_if ' ------------------------- if number_click = sm%(3) form_APp() return end_if ' ------------------------- if number_click = sm%(4) form_help() return end_if ' ------------------------- if number_click = sm%(5) FCT_SaveBestScore() NumPartie%=NumPartie%+1 text edibq%,"€ "+str$(par_banque%) banque%=par_banque% position spmise%,par_mise% init_flop() return end_if ' ------------------------- if number_click = sm%(7) file_save Tracelist%,bureau$+"\Trace.txt" return end_if ' ------------------------- if number_click = sm%(6) message MesBScore$ return end_if ' ------------------------- if number_click = sm%(9) FCT_SaveBestScore() Quitter() return end_if ' ------------------------- if number_click = pictson% if voc%=1 voc%=0 if file_exists(PictSonOff$)=1 : file_load pictson%,PictSonOff$ : end_if hint pictson%,"Son : Off" else voc%=1 if file_exists(PictSonOn$)=1 : file_load pictson%,PictSonOn$ : end_if hint pictson%,"Son : On" end_if return end_if ' ------------------------- if number_click = btn%(1) mise% = position(spmise%) banque%=banque%-mise% text edibq%,"€ "+str$(banque%) tirage() inactive btn%(1) inactive spmise% active pict%(1) active pict%(2) active pict%(3) active pict%(4) active pict%(5) active btn%(2) if Gains%>0 : active btn%(4) : end_if return end_if ' ------------------------- if number_click = btn%(2) inactive btn%(4) Gains%=0 tirage() inactive btn%(1) inactive btn%(2) if Gains%>0 active btn%(4) active btn%(3) else caption AlphG%,"Désolé, vous avez perdu." if voc%=1 parler("Désolé, vous avez perdu.") end_if pause 2000 init_flop() end_if return end_if ' ------------------------- if number_click = btn%(3) inactive btn%(1) inactive btn%(2) inactive btn%(3) inactive btn%(4) tiragedouble() return end_if ' ------------------------- if number_click = btn%(4) banque%=banque%+Gains% text edibq%,"€ "+str$(banque%) init_flop() if banque%=1000000 : message "Bravo !"+chr$(13)+"Vous êtes Millionaire !" : end_if return end_if ' ------------------------- if number_click = pict%(1) if etatcarte%(1) = 1 etatcarte%(1) = 0 file_load pict%(1),bmp$(1) if double%=1 Fct_InactiveAllCard() verif2(1) pause 3000 init_flop() end_if else etatcarte%(1) = 1 file_load pict%(1),dos$ end_if return end_if ' ------------------------- if number_click = pict%(2) if etatcarte%(2) = 1 etatcarte%(2) = 0 file_load pict%(2),bmp$(2) if double%=1 Fct_InactiveAllCard() verif2(2) pause 3000 init_flop() end_if else etatcarte%(2) = 1 file_load pict%(2),dos$ end_if return end_if ' ------------------------- if number_click = pict%(3) if etatcarte%(3) = 1 etatcarte%(3) = 0 file_load pict%(3),bmp$(3) if double%=1 Fct_InactiveAllCard() verif2(3) pause 3000 init_flop() end_if else etatcarte%(3) = 1 file_load pict%(3),dos$ end_if return end_if ' ------------------------- if number_click = pict%(4) if etatcarte%(4) = 1 etatcarte%(4) = 0 file_load pict%(4),bmp$(4) if double%=1 Fct_InactiveAllCard() verif2(4) pause 3000 init_flop() end_if else etatcarte%(4) = 1 file_load pict%(4),dos$ end_if return end_if ' ------------------------- if number_click = pict%(5) if etatcarte%(5) = 1 etatcarte%(5) = 0 file_load pict%(5),bmp$(5) if double%=1 Fct_InactiveAllCard() verif2(5) pause 3000 init_flop() end_if else etatcarte%(5) = 1 file_load pict%(5),dos$ end_if return end_if ' ------------------------- if object_exists(F_param%)=1 if number_click = optsonpar% if checked(optsonpar%)=1 caption optsonpar%,"On" else caption optsonpar%,"Off" end_if return end_if if number_click = btnprecpar% if TempCd%>52 TempCd%=TempCd%-1 FCT_ExtractTempCard(TempCd%) file_load pictpar%,TempCard$ file_delete TempCard$ end_if return end_if if number_click = btnsuivpar% if TempCd%<58 TempCd%=TempCd%+1 FCT_ExtractTempCard(TempCd%) file_load pictpar%,TempCard$ file_delete TempCard$ end_if return end_if
if (number_click > (alphTgpar2%(1)-1)) and (number_click < (alphTgpar2%(9)+1)) TempObj%=number_click top btnValTgMoins%,top(TempObj%) top btnValTgPlus%,top(TempObj%) show btnValTgMoins% show btnValTgPlus% TempTg%=val(caption$(TempObj%)) return end_if if number_click = btnValTgMoins% if TempTg%>1 TempTg%=TempTg%-1 caption TempObj%,str$(TempTg%) left TempObj%,width(F_param%)-(width(TempObj%)+100) end_if return end_if if number_click = btnValTgPlus% if TempTg%<25 TempTg%=TempTg%+1 caption TempObj%,str$(TempTg%) left TempObj%,width(F_param%)-(width(TempObj%)+100) end_if return end_if if number_click = btnsavepar% FCT_SaveParam() hide F_param% return end_if
end_if return
close: FCT_SaveBestScore() for ti%=1 to 5 if file_exists(bmp$(ti%))=1 : file_delete bmp$(ti%) : end_if next ti% if file_exists(dos$)=1 : file_delete dos$ : end_if if file_exists(PictSonOn$)=1 : file_delete PictSonOn$ : end_if if file_exists(PictSonOff$)=1 : file_delete PictSonOff$ : end_if dir_remove temp$ return
' CHANGE
change: if number_change = spmise% mise%=position(spmise%) ChangeTabGains() return end_if return
' ------------------------------------------------------------------------------ ' FONCTIONS ' ------------------------------------------------------------------------------
sub tirage() dim_local i%,dif%,img$,res% for i%=1 to 5 if etatcarte%(i%)=1 repeat if dif%<>4 : dif%=0 : end_if carte%(i%)=int(rnd(51)) if carte%(i%)<>carte%(1): dif%=dif%+1 : end_if if carte%(i%)<>carte%(2): dif%=dif%+1 : end_if if carte%(i%)<>carte%(3): dif%=dif%+1 : end_if if carte%(i%)<>carte%(4): dif%=dif%+1 : end_if if carte%(i%)<>carte%(5): dif%=dif%+1 : end_if until dif%=4 end_if next i%
for i%=1 to 5 img$ = bmp$(i%) res% = dll_call5("ExtractImageFromImageList",IMGL%,carte%(i%),0,0,adr(img$)) if file_exists(bmp$(i%))=1 file_load pict%(i%),bmp$(i%) etatcarte%(i%)=0 end_if next i% verif() end_sub ' ------------------------------------------------------------------------------ sub verif() dim_local i%,vc%(5),cc%(5),a$,b$,c$,combin%(13),combinCol$,coul%,f%,gagne%,mes$,mesvoc$,vcg$,vcg%(2),ncoul$,ncarte$,t$ clear Tracelist%
for i%=1 to 5 vc%(i%)= valcartes%(carte%(i%),1) c$=c$+NomCarte$(vc%(i%))+"," cc%(i%)= valcartes%(carte%(i%),2) combin%(vc%(i%))=combin%(vc%(i%))+1 combinCol$= combinCol$+str$(cc%(i%)) next i%
item_add Tracelist%,"valeur des cartes "+c$ item_add Tracelist%,"combinaison de couleur "+combincol$
for i%=1 to 13 if combin%(i%)>1 a$=a$+str$(combin%(i%)) vcg$=vcg$+str$(i%)+"," end_if if combin%(i%)=1 b$=b$+str$(combin%(i%)) end_if next i% if len(a$)=1 : a$=a$+"0" : end_if if len(a$)=0 : a$="00" : end_if
item_add Tracelist%,"combinaison de carte "+a$ item_add Tracelist%,"combinaison de carte "+b$
if len(vcg$)=0 vcg$=vcg$+"0,0," else if instr(vcg$,",")=len(vcg$) vcg$=vcg$+"0," end_if end_if
item_add Tracelist%,"valeur des cartes "+vcg$ ' message a$+chr$(13)+b$+chr$(13)+combinCol$
if a$="20" or a$="02" : gagne%=9 : end_if if a$="22" : gagne%=8 : end_if if a$="30" or a$="03" : gagne%=7 : end_if if a$="32" or a$="23" : gagne%=4 : end_if if a$="40" or a$="04" : gagne%=3 : end_if
if combinCol$="00000" or combinCol$="11111" or combinCol$="22222" or combinCol$="33333" coul%=1 for i%=0 to 3 if val(left$(combinCol$,1))=i% ncoul$=NomCouleur$(i%) exit_for end_if next i% end_if
if b$="11111" ' message b$+chr$(13)+c$ for i%=0 to 8 t$=NomCarte$(i%+1)+"-" if instr(c$,NomCarte$(i%+1))>0 t$=t$+NomCarte$(i%+2)+"-" if instr(c$,NomCarte$(i%+2))>0 t$=t$+NomCarte$(i%+3)+"-" if instr(c$,NomCarte$(i%+3))>0 t$=t$+NomCarte$(i%+4)+"-" if instr(c$,NomCarte$(i%+4))>0 t$=t$+NomCarte$(i%+5)+"-" if instr(c$,NomCarte$(i%+5))>0 if coul%=1 f%=1 gagne%=2 t$=t$+"|-"+str$(coul%)+"-|-2-" exit_for else f%=1 gagne%=6 t$=t$+"|-"+str$(coul%)+"-|-6-" exit_for end_if end_if end_if end_if end_if end_if item_add Tracelist%,"verif quinte "+t$ next i%
if f%=0 if instr(c$,"10")>0 if instr(c$,"11")>0 if instr(c$,"12")>0 if instr(c$,"13")>0 if instr(c$,"1")>0 if coul%=1 f%=1 gagne%=1 end_if end_if end_if end_if end_if end_if end_if
if f%=0 if coul%=1 gagne%=5 end_if end_if end_if
illumineGains(gagne%)
vcg%(1)=val(left$(vcg$,instr(vcg$,",")-1)) vcg$=right$(vcg$,len(vcg$)-instr(vcg$,",")) vcg%(2)=val(left$(vcg$,instr(vcg$,",")-1))
if val(left$(a$,1))>0 or val(right$(a$,1))>0 if val(left$(a$,1))=0 or val(right$(a$,1))=0 if val(left$(a$,1))=0 ncarte$=NomCarte$(vcg%(2)) else ncarte$=NomCarte$(vcg%(1)) end_if else if val(left$(a$,1))=val(right$(a$,1)) ncarte$=NomCarte$(vcg%(1))+" et de "+NomCarte$(vcg%(2)) else if val(left$(a$,1))>val(right$(a$,1)) ncarte$=NomCarte$(vcg%(1))+" par les "+NomCarte$(vcg%(2)) else if val(right$(a$,1))>val(left$(a$,1)) ncarte$=NomCarte$(vcg%(2))+" par les "+NomCarte$(vcg%(1)) end_if end_if end_if end_if end_if
select gagne% case 0 : mes$="" case 1 : mes$="Vous avez une quinte flush royale à "+ncoul$+" !" : Gains%=mise%*10 case 2 : mes$="Vous avez une quinte flush à "+ncoul$+" !" : Gains%=mise%*8 case 3 : mes$="Vous avez un carré de "+ncarte$+" !" : Gains%=mise%*7 case 4 : mes$="Vous avez un full de "+ncarte$+" !" : Gains%=mise%*6 case 5 : mes$="Vous avez une couleur à "+ncoul$+" !" : Gains%=mise%*5 case 6 : mes$="Vous avez une quinte !" : Gains%=mise%*4 case 7 : mes$="Vous avez un brelan de "+ncarte$+" !" : Gains%=mise%*3 case 8 : mes$="Vous avez deux paires de "+ncarte$+" !" : Gains%=mise%*2 case 9 : mes$="Vous avez une paire de "+ncarte$+" !" : Gains%=mise% end_select caption alphG%,mes$ if voc%=1 parler(mes$) end_if end_sub ' ------------------------------------------------------------------------------ sub illumineGains(G%) dim_local i% for i%=1 to 9 font_color Tabgains%(i%),170,240,160 font_color Tabgains2%(i%),170,240,160 next i% if G%>0 font_color Tabgains%(G%),246,254,1 font_color Tabgains2%(G%),246,254,1 end_if end_sub ' ------------------------------------------------------------------------------ sub init_flop() dim_local i% Gains%=0 inactive btn%(2) inactive btn%(3) inactive btn%(4) for i%=1 to 5 file_load pict%(i%),dos$ etatcarte%(i%)=1 inactive pict%(i%) next i% caption alphG%,"" for i%=1 to 9 font_color Tabgains%(i%),170,240,160 font_color Tabgains2%(i%),170,240,160 next i% active btn%(1) active spmise% end_sub ' ------------------------------------------------------------------------------ sub ChangeTabGains() dim_local i%,Bg%,Tg2$ Tg2$="10,8,7,6,5,4,3,2,1," for i%=1 to 9 Bg%=val(left$(Tg2$,instr(Tg2$,",")-1)) caption Tabgains2%(i%),str$(mise%*Bg%)+" €" left Tabgains2%(i%),width(pan%(2))-(width(Tabgains2%(i%))+5) if i%<9 Tg2$=right$(Tg2$,len(Tg2$)-instr(Tg2$,",")) end_if next i% end_sub ' ------------------------------------------------------------------------------ SUB parler(tex$) dim_local f$,g$ if dir_exists("c:\temp")=0 then dir_make "c:\temp" f$ = "c:\temp\parler.vbs" g$ = chr$(34) FILE_OPEN_WRITE 9999, f$ file_writeln 9999, "Dim speaks, speech" file_writeln 9999, "speaks = " + g$ + tex$ + g$ file_writeln 9999, "Set speech = CreateObject(" + g$ + "sapi.spvoice" + g$+ ")" file_writeln 9999, "speech.Speak speaks" FILE_CLOSE 9999 EXECUTE_WAIT f$ : FILE_DELETE f$ END_SUB ' ------------------------------------------------------------------------------ sub FCT_ExtractTempCard(n%) dim_local res% res% = dll_call5("ExtractImageFromImageList",IMGL%,n%,0,0,adr(TempCard$)) end_sub ' ------------------------------------------------------------------------------ sub FCT_SaveParam() dim_local i%,res% par_banque% = position(spnbanqpar%) par_misemax% = position(spnmisemaxpar%) if checked(optsonpar%)=1 par_voc% = 1 else par_voc% = 0 end_if par_cartedos% = TempCd% res% = dll_call5("ExtractImageFromImageList",IMGL%,TempCd%,0,0,adr(dos$)) for i%=1 to 9 : par_Tg$ = par_Tg$+caption$(alphTgpar2%(i%))+"," : next i%
file_open_write F_OW%,param$ file_writeln F_OW%,str$(par_banque%) file_writeln F_OW%,str$(par_misemax%) file_writeln F_OW%,str$(par_voc%) file_writeln F_OW%,str$(par_cartedos%) file_writeln F_OW%,par_Tg$ file_close F_OW% end_sub ' ------------------------------------------------------------------------------ sub Quitter() for ti%=1 to 5 if file_exists(bmp$(ti%))=1 : file_delete bmp$(ti%) : end_if next ti% if file_exists(dos$)=1 : file_delete dos$ : end_if if file_exists(PictSonOn$)=1 : file_delete PictSonOn$ : end_if if file_exists(PictSonOff$)=1 : file_delete PictSonOff$ : end_if dir_remove temp$ terminate end_sub ' ------------------------------------------------------------------------------ sub FCT_SaveBestScore() dim_local Memory$,a$,NScore% if NumPartie%>0 Memory$=Parties$+"Scores.inf" NScore%=Banque% if NScore%>BestScore% BestScore%=NScore% a$=date$+","+str$(NumPartie%)+","+str$(NScore%) file_open_write F_OW%,Memory$ file_writeln F_OW%,a$ file_close F_OW% caption sm%(6),"Best score : "+str$(BestScore%) MesBScore$="Date : "+date$+chr$(13)+"à : "+Time$+chr$(13)+"Score : "+str$(BestScore%) end_if end_if end_sub ' ------------------------------------------------------------------------------ sub RecupBestScore() dim_local Memory$,a$,bs$ Memory$=Parties$+"Scores.inf" if file_exists(Memory$)=1 file_open_read F_OR%,Memory$ file_readln F_OR%,a$ file_close F_OR% MesBScore$="Date : "+left$(a$,instr(a$,",")-1)+chr$(13) a$=right$(a$,len(a$)-instr(a$,",")) MesBScore$=MesBScore$+"à : "+left$(a$,instr(a$,",")-1)+chr$(13) bs$=right$(a$,len(a$)-instr(a$,",")) MesBScore$=MesBScore$+"Score : "+bs$ BestScore%=val(bs$) end_if end_sub ' ------------------------------------------------------------------------------ sub tiragedouble() dim_local i%,dif%,img$,res% double%=1 caption alphG%,"" for i%=1 to 9 font_color Tabgains%(i%),170,240,160 font_color Tabgains2%(i%),170,240,160 next i% for i%=1 to 5 img$ = dos$ file_load pict%(i%),dos$ etatcarte%(i%)=1 next i% for i%=1 to 5 if etatcarte%(i%)=1 repeat if dif%<>4 : dif%=0 : end_if carte%(i%)=int(rnd(51)) if carte%(i%)<>carte%(1): dif%=dif%+1 : end_if if carte%(i%)<>carte%(2): dif%=dif%+1 : end_if if carte%(i%)<>carte%(3): dif%=dif%+1 : end_if if carte%(i%)<>carte%(4): dif%=dif%+1 : end_if if carte%(i%)<>carte%(5): dif%=dif%+1 : end_if until dif%=4 end_if next i%
for i%=1 to 5 img$ = bmp$(i%) res% = dll_call5("ExtractImageFromImageList",IMGL%,carte%(i%),0,0,adr(img$)) next i% repeat carteret%=int(rnd(5)) until carteret%>0 file_load pict%(carteret%),bmp$(carteret%) etatcarte%(carteret%)=0 inactive pict%(carteret%) end_sub ' ------------------------------------------------------------------------------ sub Fct_InactiveAllCard() dim_local i% for i%=1 to 5 inactive pict%(i%) next i% end_sub ' ------------------------------------------------------------------------------ sub verif2(n%) dim_local Cordi%,Cjoueur%,i%,mesverif2$ Cordi%= valcartes%(carte%(carteret%),1) Cjoueur%= valcartes%(carte%(n%),1) if Cjoueur%>Cordi% gains%=gains%*2 banque%=banque%+gains% text edibq%,"€ "+str$(banque%) gains%=0 mesverif2$ = "Bravo ! Vous avez doublé vos gains." caption alphG%,mesverif2$ else mesverif2$ = "Désolé, Vous avez perdu." caption alphG%,mesverif2$ end_if if voc%=1 Parler(mesverif2$) end_if double%=0 for i%=1 to 5 active pict%(i%) next i% end_sub
' ------------------------------------------------------------------------------ ' DATA IMAGE ' ------------------------------------------------------------------------------
sub CreateImgSonOff() dim_local img$,imgcount%,v,i% ImgCount%=1654 img$="66,77,118,6,0,0,0,0,0,0,54,4,0,0,40,0,0,0,24,0,0,0,24,0,0,0,1,0,8,0,0,0,0,0,0,0,0,0,196,14," img$=img$+"0,0,196,14,0,0,0,1,0,0,0,1,0,0,12,107,26,255,11,105,29,255,10,93,54,255,10,90,61,255,11,101,36,255,11,98,43,255,10,96," img$=img$+"47,255,9,88,65,255,9,81,79,255,8,78,87,255,7,68,108,255,7,66,112,255,5,46,154,255,3,30,190,255,4,36,175,255,3,35,179,255,3,26," img$=img$+"197,255,2,25,201,255,2,20,211,255,1,13,226,255,1,10,233,255,0,6,240,255,0,5,244,255,0,1,251,255,0,0,255,255,0,3,254,255,0,7," img$=img$+"254,255,0,11,254,255,0,23,254,255,0,59,252,255,0,79,252,255,0,83,252,255,0,103,251,255,0,111,251,255,0,170,248,255,0,174,248,255,0,186," img$=img$+"248,255,0,202,247,255,0,194,248,255,0,214,247,255,0,242,246,255,0,250,246,255,1,254,246,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,42,0,0,0,0,0,0,0,0,3,16,6,0,0," img$=img$+"0,0,0,0,0,0,40,15,39,0,42,0,0,0,0,0,0,0,3,20,24,17,4,0,0,42,0,0,0,4,29,24,28,3,42,0,0,0,0,0," img$=img$+"0,0,18,24,24,24,17,4,42,42,0,0,41,13,24,24,24,18,42,0,0,0,0,0,0,0,3,20,24,24,24,31,41,42,0,1,31,24,24,24," img$=img$+"28,3,42,0,0,0,0,0,0,0,0,7,22,24,24,24,31,41,0,14,24,24,24,22,37,0,42,0,0,0,0,0,0,0,0,0,8,27,24,24," img$=img$+"24,33,12,24,24,24,26,8,42,0,42,0,0,0,0,0,42,42,42,42,42,36,25,24,24,24,24,24,24,23,34,0,42,0,42,0,0,0,0,0," img$=img$+"42,42,42,42,42,42,34,25,24,24,24,24,24,10,42,0,42,0,42,0,0,0,0,0,42,42,42,42,42,42,42,33,24,24,24,24,30,0,42,0," img$=img$+"42,0,42,0,0,0,0,0,42,42,42,42,42,42,34,25,24,24,24,24,24,11,42,0,42,0,42,0,0,0,0,0,42,42,42,42,42,35,25,24," img$=img$+"24,24,24,24,24,23,34,0,42,0,42,0,0,0,0,0,42,42,42,42,38,27,24,24,24,33,12,24,24,24,25,9,42,0,42,0,0,0,0,0," img$=img$+"0,0,0,8,22,24,24,24,32,42,0,12,24,24,24,22,38,0,42,0,0,0,0,0,0,0,3,21,24,24,24,31,41,42,0,1,31,24,24,24," img$=img$+"27,7,42,0,0,0,0,0,0,0,16,24,24,24,16,41,42,42,0,0,41,15,24,24,24,16,42,0,0,0,0,0,0,0,6,19,24,17,4,0," img$=img$+"42,42,0,0,0,4,29,24,28,2,42,0,0,0,0,0,0,0,0,3,16,5,0,0,0,42,0,0,0,0,40,15,39,0,42,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,42,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"42,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0," img$=img$+"0,0,0,0,0,0,0,0,0,0,42,0,0,0," filebin_open_write F_OW%,PictSonOff$ for i%=1 to imgcount% v=val(left$(img$,instr(img$,",")-1)) filebin_write F_OW%,v if i%<imgcount% img$=right$(img$,len(img$)-instr(img$,",")) end_if next i% filebin_close F_OW% end_sub
' ------------------------------------------------------------------------------
sub CreateImgSonOn() dim_local img$,imgcount%,v,i%
ImgCount%=1654 img$="66,77,118,6,0,0,0,0,0,0,54,4,0,0,40,0,0,0,24,0,0,0,24,0,0,0,1,0,8,0,0,0,0,0,0,0,0,0,196,14," img$=img$+"0,0,196,14,0,0,0,1,0,0,0,1,0,0,12,107,26,255,1,254,246,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img$=img$+"0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0," img&
Dernière édition par ygeronimi le Jeu 13 Oct 2016 - 14:39, édité 1 fois | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Jeu 13 Oct 2016 - 13:40 | |
| Une sub pour faire un tableau de valeur des cartes de la librairie cartes2.ilb Je l' ai créé en me rendant compte que j' aurai pu faire plus simple mais bon, trop tard, le prog est assez complexe pour y remettre le bazard. - Code:
-
list 1 full_space 1
CreateTableCardsValues() end
sub CreateTableCardsValues() if variable("CardsValue$")=0 then dim CardsValues$(52,3) dim_local i%,cpt%,x%,v%,fig$,col$,Lfig$,Lcol$ Lfig$="123456789DJQK" :' D=10 J=Vallet Q=Dame K=Roi Lcol$="CKPT" :' Coeur,Carreau,Pique,Treffle for i%=1 to 52 step 4 cpt%=0 v%=v%+1 repeat x%=x%+1 cpt%=cpt%+1 CardsValues$(x%,0)= str$(x%-1) :' position de la carte dans la librairie ( position >51 dos de carte ) CardsValues$(x%,1)= str$(v%) :' valeur de la carte fig$ = mid$(Lfig$,v%,1) CardsValues$(x%,2)= fig$ :' figure de la carte col$ = mid$(Lcol$,cpt%,1) :' couleur de la carte CardsValues$(x%,3)= col$ item_add 1,CardsValues$(x%,0)+" - "+CardsValues$(x%,1)+" - "+CardsValues$(x%,2)+" - "+CardsValues$(x%,3) until cpt%=4 next i% | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Poker Machine Jeu 13 Oct 2016 - 14:04 | |
| Salut ygeronimi Je testerai ce soir... Ca serai bien d'avoir des adversaires, tu y penses peut être ? Autre chose, parfois il n"y a aucun gain (perdu) et le bouton ENCAISSER est encore valide. Aller bon courage ! | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Jeu 13 Oct 2016 - 14:25 | |
| Avoir des adversaires serait un autre jeu. Là il s' agit d' une imitation d' un video-poker de casino. Pour le bouton encaisser il faut que je vais regarder çà. Bon, c' est fait et corrigé dans le source du post "Doubler vos gains". | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Poker Machine Jeu 13 Oct 2016 - 18:59 | |
| Bon et bien dommage pour les adversaires... tu étais pourtant bien parti... | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Jeu 13 Oct 2016 - 20:23 | |
| Je ne suis pas assez bon pour créer une IA et pour jouer à plusieurs sur le même pc, tout le monde connait le jeu de tout le monde... | |
| | | Contenu sponsorisé
| Sujet: Re: Poker Machine | |
| |
| | | | Poker Machine | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |