AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

organizing poker tournaments

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
CROUCHEL



Joined: 24 Mar 2009
Posts: 79
Location: www.rouchel-cyril.fr

PostPosted: Tue Aug 04, 2009 5:05 pm    Post subject: organizing poker tournaments Reply with quote

Logiciel d'organisation de tournoi de poker
Je mets en téléchargement gratuit le fichier exécutable sur mon site :
www.rouchel-cyril.fr

I created a little program for organizing poker tournaments

The function are:
- Create a list of participants
- Creates a list of Blind
- Assigning participants to a table
- Timers for round Blind
- Eliminate participants at a table
- Calculations of the distribution of gains
- Change of seats during the game
.....




Code:

NbMaxiJoueurParTable:=8
Tapisdepart:=1000
DroitEntrée:=10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; =========/////////////=========
; =========//Fenetre 1//=========
; =========/////////////=========
;===Creation du fichier FichierTEXT
FileCreateDir,FichierTEXT\
;===Menu
Gui, -SysMenu
Gui, Font,Bold s15,Arial
Menu, MenuCreation, Add, 1 - Liste des participants, Menuparticipant
Menu, MenuCreation, Add, 2 - Liste des blinds, MenuBlinds
Menu, MenuCreation, Add, 3 - Parametres, MenuParametre
Menu, MenuCreation, Add, 4 - Placer les participants, MenuPlacer
Menu, MenuCreation, Add, 5 - Lancer le timer, MenuLancerLeTimer
Menu, MenuEncours, Add, 1 - Voir la liste des mouvements,MenuMouvements
Menu, MenuEncours, Add, 2 - Voir le classement des joueurs éliminés,MenuClassement
Menu, MenuGains, Add, Calculs des Gains,MenuGains
Menu, MyMenuBar, Add, Creation, :MenuCreation
Menu, MyMenuBar, Add, Encours, :MenuEncours
Menu, MyMenuBar, Add, Gains, :MenuGains
Menu, MyMenuBar, Add, Fermer, MenuFermer
Menu, MyMenuBar, Color, White
Gui, Menu, MyMenuBar
Gui, Color, White
;===Groupe Box
Gui, Font,Bold s15,Arial
Gui, Add, GroupBox, x15 y10 w300 h190 center, Blinds: Small / Big
Gui, Add, GroupBox, x15 y210 w300 h190 center, Antes:
Gui, Add, GroupBox, x15 y410 w300 h190 center, Prochaine augmentation:
Gui, Add, GroupBox, x640 y10 w300 h190 center , Tapis moyen:
Gui, Add, GroupBox, x640 y210 w300 h190 center , Joueurs restants:
Gui, Add, GroupBox, x640 y410 w300 h190 center , Tables restantes:
;===image
Gui, Add, Picture, x20 y35 w290 h-1,table.jpg
Gui, Add, Picture, x20 y235 w290 h-1,table.jpg
Gui, Add, Picture, x20 y435 w290 h-1,table.jpg
Gui, Add, Picture, x645 y35 w290 h-1,table.jpg
Gui, Add, Picture, x645 y235 w290 h-1,table.jpg
Gui, Add, Picture, x645 y435 w290 h-1,table.jpg
;===Liste des table encours
Gui, Add, GroupBox, x335 y10 w285 h32 center, Répartition des tables :
Gui, Add, ListView, x335 y40 R15 w285 Grid gMyListViewTable,Table|Joueurs
LV_ModifyCol(1,"125 Center")
LV_ModifyCol(2,"125 Center")
;===Signature
Gui, Font,Bold s8,Arial
Gui, Add, text,x335 y580 w285 center, Logiciel réalisé par C7R1L / AutoHotKey
;===Variable
Gui, Font,Bold s20,Arial
Gui, Add, text,x65 y95 w200 vBlindEnCours center ,
Gui, Add, text,x65 y295 w200 vAnteEnCours center ,
Gui, Add, text,x65 y495 w200 vTempsRestant center ,
Gui, Add, text,x690 y95 w200 vTapismoyen center ,
Gui, Add, text,x690 y295 w200 vJoueursRestant center ,
Gui, Add, text,x690 y495 w200 vtablerestante center,
Gui, Add, text,x335 y510 w285 vConsignes2 center,
;===Parametres et automatisation Fenetre
GoSub Automatisation
SetTimer,Automatisation,1000
Gui, Show,Autosize,TournoisPoker
Return
;=========///////////////////========
;=========//Automatisation//=========
;=========//Fenetre 1     //=========
;=========//////////////////=========
Automatisation:
;==Calculs du temps
ChangeBlind:=Delaiblind*60
ElapsedTime := round((A_TickCount - StartTime)/1000)
RestTemps:=round(ChangeBlind-ElapsedTime)
RestMinute:=RestTemps/60
StringSplit, ArrayMN, Restminute,.
RestMinute:=ArrayMN1
Restseconde:=RestTemps-(Restminute*60)
Restseconde:= Restseconde >= 10 ? Restseconde :"0" Restseconde
texttest:= Restminute  Restseconde
GuiControl, ,TempsRestant, %Restminute% : %Restseconde%
if texttest = 001
{
loop,3
{
SoundPlay, %A_WinDir%\Media\ringin.wav,wait
}
}
;==Calcul joueur restant
Totaljoueurrestant:=
ControlGet, ListA, List, , SysListView321,TournoisPoker
Loop, Parse, listA,`n ,`r
{
totaltablerestante:= a_index
if ErrorLevel
break
StringSplit, Array, A_LoopField, %a_tab%
Totaljoueurrestant+= Array2
}
;==Calcul joueur depart
FileRead, CalculJouers,FichierTEXT\List_Participants.txt
Loop, Parse, CalculJouers,`n ,`r
{
Jouersdepart= %a_index%
}
GuiControl, ,JoueursRestant, %Totaljoueurrestant% / %Jouersdepart%
GuiControl, ,tablerestante, %totaltablerestante%
;==Calcul Tapismoyen
Tapismoyen:= round(Tapisdepart * Jouersdepart /Totaljoueurrestant)
GuiControl, ,Tapismoyen, %Tapismoyen%
Return
;=========///////////////////========
;=========//MyListViewTable//========
;=========//Fenetre 1     //=========
;=========//////////////////=========
MyListViewTable:
if A_GuiEvent = DoubleClick
{
SoundPlay, %A_WinDir%\Media\notify.wav
LV_GetText(TableEliminer, A_EventInfo,1)
Gui,5: Destroy
;==Menu
Menu, MyMenuBar5, Add, Eliminer, Eliminer5
Menu, MyMenuBar5, Add, Sauvegarder, Save5
Gui,5: Menu, MyMenuBar5
;===pied de page
Gui,5: Add, StatusBar
;===texte et valeurs
Gui,5: Add, text,x10 y25 w30,Nom :
Gui,5: Add, text,x160 y25 w50,Prénom :
Gui,5: Add, Edit, x45 y22 w100 h22 vNom,
Gui,5: Add, Edit, x210 y22 w100 h22 vPrénom,
;=== liste des joueurs a cette table
Gui,5: Add, ListView, Grid NoSortHdr x10 y60 R8 W325 gMyListViewJoueur,Nom|Prénom
Gui,5: default
LV_ModifyCol(1,"150 Left")
LV_ModifyCol(2,"150 Left")
LV_ModifyCol(3,AutoHdr)
StringSplit, Array, TableEliminer,%A_Space%,%A_Space%
Tablechosi:=Array1
FileRead,line,FichierTEXT\Tirage\%Tablechosi%.txt
Loop, Parse, line,`n ,`r
{
StringSplit, Array, A_LoopField, %a_tab%
Noms:= Array1
Prénoms:= Array2
Gui,5: default
LV_add("",Noms,Prénoms)
}
;===Parametres et automatisation Fenetre
Gui,5: Show,Autosize,List_Restant
GoSub Automatisation5
SetTimer,Automatisation5,100
}
Return
;=========///////////////////=========
;=========//Menuparticipant//=========
;=========//Fenetre 1      //=========
;=========///////////////////=========
Menuparticipant:
Gui,2: Destroy
SoundPlay, %A_WinDir%\Media\notify.wav
;===Menu
Menu, MyMenuBar2, Add, Charger, Charger2
Menu, MyMenuBar2, Add, Ajouter, Ajouter2
Menu, MyMenuBar2, Add, Supprimer, Supprimer2
Menu, MyMenuBar2, Add, Sauvegarder, Save2
Gui,2: Menu, MyMenuBar2
;===pied de page
Gui,2: Add, StatusBar
;===texte et valeurs
Gui,2: Add, text,x10 y25 w30,Nom :
Gui,2: Add, text,x160 y25 w50,Prénom :
Gui,2: Add, Edit, x45 y22 w100 h22 vNom,
Gui,2: Add, Edit, x210 y22 w100 h22 vPrénom,
;===liste des particpants
Gui,2: Add, ListView,Grid NoSortHdr x10 y60 R24 W325 gMyListViewParticipant,Nom|Prénom
Gui,2: default
LV_ModifyCol(1,"150 Left")
LV_ModifyCol(2,"150 Left")
FileRead, line,FichierTEXT\List_Participants.txt
Loop, Parse, line,`n ,`r
{
StringSplit, Array, A_LoopField, %a_tab%
ligne:=a_index
Noms:= Array1
Prénoms:= Array2
Gui,2: default
LV_add("",Noms,Prénoms)
}
;===Parametres et automatisation Fenetre2
GoSub Automatisation2
SetTimer,Automatisation2,100
Gui,2: Show,Autosize,Liste_Participants
Return
;=========//////////////=========
;=========//MenuBlinds//=========
;=========//Fenetre 1 //=========
;=========//////////////=========
MenuBlinds:
Gui,4: Destroy
SoundPlay, %A_WinDir%\Media\notify.wav
;===Menu
Menu, MyMenuBar4, Add, Charger, Charger4
Menu, MyMenuBar4, Add, Ajouter, Ajouter4
Menu, MyMenuBar4, Add, Supprimer, Supprimer4
Menu, MyMenuBar4, Add, Sauvegarder, Save4
Gui,4: Menu, MyMenuBar4
;===pied de page
Gui,4: Add, StatusBar
;===texte et valeurs
Gui,4: Add, text,x10 y25 w80,BigBlind:
Gui,4: Add, Edit, x55 y22 w50 h22 vBigBlind,
Gui,4: Add, text,x110 y25 w50,Ante :
Gui,4: Add, Edit, x140 y22 w50 h22 vAnte,
Gui,4: Add, text,x200 y25 w50,Temps(Mn):
Gui,4: Add, Edit, x260 y22 w50 h22 vTempsBlind,
;===liste des blinds
Gui,4: Add, ListView,Grid NoSortHdr x10 y70 R15 w310 gMyListViewBlind ,SmallBlind|BigBlind|Ante|Temps
Gui,4: default
LV_ModifyCol(1,"70 Center")
LV_ModifyCol(2,"70 Center")
LV_ModifyCol(3,"70 Center")
LV_ModifyCol(4,"70 Center")
FileRead, line,FichierTEXT\List_Blind.txt
Loop, Parse, line,`n ,`r
{
StringSplit, Array, A_LoopField, %a_tab%
smallBlind:= Array1
Bigblind:=Array2
Ante:= Array3
TempsBlind:=Array4
Gui,4: default
LV_add("",Smallblind,BigBlind,Ante,TempsBlind)
}
;===Parametres et automatisation Fenetre4
Gui,4: Show,Autosize,List_Blind
Return
;=========/////////////////=========
;=========//MenuParametre//=========
;=========//Fenetre 1    //=========
;=========/////////////////=========
MenuParametre:
Gui,99:Destroy
Menu, MyMenuBar99, Add, Sauvegarder, Save99
Gui,99: Menu, MyMenuBar99
Gui,99: Add, text,x10 y25 w140,Nb Maxi Joueur Par Table :
Gui,99: Add, Edit, x150 y22 w50 h22 vParametre1,%NbMaxiJoueurParTable%
Gui,99: Add, text,x10 y55 w140,Tapis de depart :
Gui,99: Add, Edit, x150 y52 w50 h22 vParametre2,%Tapisdepart%
Gui,99: Add, text,x10 y85 w140,Droit d'entrée :
Gui,99: Add, Edit, x150 y82 w50 h22 vParametre3,%DroitEntrée%
Gui,99: -SysMenu
Gui,99: Show,Autosize,Parametre
Return
;=========//////////////=========
;=========//MenuPlacer//=========
;=========//Fenetre 1 //=========
;=========//////////////=========
MenuPlacer:
FileRemoveDir, FichierTEXT\Tirage\,1
FileCreateDir,FichierTEXT\Tirage\
Ligne=
;==calcules le nbre de joueur par nbre table
FileRead, TirageSort,FichierTEXT\List_Participants.txt
Loop, parse, TirageSort, `n, `r
NbParticipants=%A_Index%
NBtables:=NbParticipants/NbMaxiJoueurParTable
ARONDISUP:= (NBtables-Round(NBtables,0)) <= 0 ? 0 : 1
NBtables:=Round(Round(NBtables,0)+ARONDISUP,0)
JPT:=NbParticipants/NBtables
ARONDISUP:= (JPT-Round(JPT,0)) <= 0 ? 0 : 1
JPT:=Round(Round(JPT,0)+ARONDISUP,0)
;==trier la liste participants
Sort, TirageSort, Random
FileAppend,%TirageSort%,TirageSort.txt
;==Crée les liste de joueurs par tables
Loop, read,TirageSort.txt
{
Loop, parse, A_LoopReadLine, `n ,`r
{
Ligne += %A_Index%
ALATABLE:= Ligne/JPT
ARONDISUP:= (ALATABLE-Round(ALATABLE,0)) <= 0 ? 0 : 1
ALATABLE:=Round(Round(ALATABLE,0)+ARONDISUP,0)
Text:=A_LoopField
Nomfichier=Table%ALATABLE%
IfExist,FichierTEXT\Tirage\%Nomfichier%.txt
FileAppend,`n%Text%,FichierTEXT\Tirage\%Nomfichier%.txt
IfNotExist,FichierTEXT\Tirage\%Nomfichier%.txt
FileAppend,%Text%,FichierTEXT\Tirage\%Nomfichier%.txt
}
}
FileDelete,TirageSort.txt
FileDelete,FichierTEXT\List_table.txt
;===automatisation Fenetre 1
GoSub Raffraichirtableau
sleep, 1000
GoSub CALCULDESCHANGEMENTSDEPLACE
Gui,3: Destroy
SoundPlay, %A_WinDir%\Media\notify.wav
;===pied de page
Gui,3: Add, StatusBar
;===liste de joueurs avec leur table
Gui,3: Add, ListView,Grid NoSortHdr x10 y0 R15 w420,Nom|Prenom|Table|Siege
;===Recherche toutes les tables
Loop FichierTEXT\Tirage\*.txt
{
FichierLu = %A_LoopFileName%
numeroTable:= A_index
;===Recherche toutes les joueurs
FileRead,Table, FichierTEXT\Tirage\%FichierLu%
Loop, parse, table , `n, `r
{
StringSplit, Array, A_LoopField, %a_tab%
Chaise%A_Index%:= A_index
Nom%A_Index% := Array1
Prenom%A_Index% := Array2
Gui,3: default
LV_add(Ligne,Nom%A_Index%,Prenom%A_Index%,numeroTable,Chaise%A_Index%)
}
}
Gui,3: default
LV_ModifyCol(1,"150 Left")
LV_ModifyCol(2,"150 Left")
LV_ModifyCol(3,"45 Center")
LV_ModifyCol(4,"45 Center")
;===Parametres et automatisation Fenetre3
Gui,3: Show,Autosize,List
GoSub Automatisation3
SetTimer,Automatisation3,100
Return
;=========/////////////////////=========
;=========//MenuLancerLeTimer//=========
;=========//      Fenetre 1  //=========
;=========/////////////////////=========
MenuLancerLeTimer:
FileRead, List_Blind,FichierTEXT\List_Blind.txt
Loop, Parse, List_Blind,`n ,`r
{
StringSplit, Array, A_LoopField, %a_tab%
SmallBlind:= Array1
Bigblind:=Array2
Ante:= Array3
DelaiBlind:=Array4
SecondePourSleep:=DelaiBlind*60*1000
Gui, default
GuiControl, ,BlindEnCours, %SmallBlind% / %Bigblind%
GuiControl, ,AnteEnCours, %Ante%
StartTime := A_TickCount
Sleep,%SecondePourSleep%
}
Return
;=========///////////////////=========
;=========//MenuMouvements://=========
;=========//   Fenetre 1   //=========
;=========///////////////////=========
MenuMouvements:
Gui,6: Destroy
;===liste de mouvements avec leur joueur
Gui,6: Add, ListView,Grid NoSortHdr x10 y0 R15 w430,N°|Nom|Prenom|Table depart|Table arrivée
;===Recherche toutes les mouvements
FileRead,Mouvementstable, FichierTEXT\Mouvementstable.txt
Loop, parse, Mouvementstable , `n, `r
{
StringSplit, Array, A_LoopField, %a_tab%
numero%A_Index%:= A_index
Nom%A_Index% := Array1
Prenom%A_Index% := Array2
Tdepart%A_Index%  := Array3
Tarrivé%A_Index% := Array4
Gui,6: default
LV_add("",numero%A_Index%,Nom%A_Index%,Prenom%A_Index%,Tdepart%A_Index%,Tarrivé%A_Index%)
}
Gui,6: default
LV_ModifyCol(1,"40 Left")
LV_ModifyCol(2,"120 Left")
LV_ModifyCol(3,"120 Left")
LV_ModifyCol(4,"60 Center")
LV_ModifyCol(5,"60 Center")
;===Parametres et automatisation Fenetre4
Gui,6: Show,Autosize,ListMouvements
Return
;=========///////////////////=========
;=========//MenuClassement://=========
;=========//   Fenetre 1   //=========
;=========///////////////////=========
MenuClassement:
;===liste de mouvements avec leur joueur
Gui,7: destroy
Gui,7: Add, ListView,Grid NoSortHdr x10 y0 R15 w430,N°|Nom|Prenom|
;===Recherche toutes les mouvements
FileRead, Contents, FichierTEXT\Classement.txt
if not ErrorLevel  ; Successfully loaded.
{
    Sort, Contents
}
Loop, parse, Contents , `n, `r
{
StringSplit, Array, A_LoopField, %a_tab%
Classe%A_Index% := Array1
Nom%A_Index% := Array2
Prenom%A_Index% := Array3
Gui,7: default
LV_add("",Classe%A_Index%,Nom%A_Index%,Prenom%A_Index%)
}
Gui,7: default
LV_ModifyCol(1,"40 Left")
LV_ModifyCol(2,"120 Left")
LV_ModifyCol(3,"120 Left")
;===Parametres et automatisation Fenetre4
Gui,7: Show,Autosize,Classement
Return
;=========//////////////=========
;=========//MenuGains://=========
;=========//Fenetre 1 //=========
;=========//////////////=========
MenuGains:
Gui,8: destroy
FileRead, CalculJouers,FichierTEXT\List_Participants.txt
Loop, Parse, CalculJouers,`n ,`r
{
Jouersdepart= %a_index%
}
Gui,8: Add, ListView, x200 y10 R15 W230 Grid ,Position|Gains|`%/Total|
Gui,8: default
LV_ModifyCol(1,"Integer")
LV_ModifyCol(2,"75 Center")
LV_ModifyCol(3,"75 Center")
Gui,8: Font,Bold s10,Arial
Gui,8: Add, text,x10 y12 w120 ,Nb particpant :
Gui,8: Add, text,x10 y42 w120,Droit d'entrée :
Gui,8: Add, text,x10 y72 w120,`% de gains :
Gui,8: Add, text,x10 y102 w120,Total :
Gui,8: Add, text,x10 y162 w120,Bonus :
Gui,8: Add, text,x10 y192 w120,Nb Joueur payés :
Gui,8: Add, text,x10 y222 w120,`% Joueur payés :
Gui,8: Add, Button,x10 y130 w160 gcalculerPognon, Calculer
Gui,8: Add, Edit,x120 y10 w50 Center vparticpantdepart,%Jouersdepart%
Gui,8: Add, Edit,x120 y40 w50 Center vDroitEntrée,%DroitEntrée%
Gui,8: Add, Edit,x120 y70 w50 Center vPourcentagegains,50
Gui,8: Add, Edit,x120 y100 w50 Center vTotal ReadOnly,
Gui,8: Add, Edit,x120 y160 w50 Center vBonus ReadOnly,
Gui,8: Add, Edit,x120 y190 w50 Center vJoueurpayés ReadOnly,
Gui,8: Add, Edit,x120 y220 w50 Center vPOurcentageJoueurpayés ReadOnly,
GoSub Automatisation8
SetTimer,Automatisation8,100
Gui,8: Show,Autosize,CalculsPognon
Return
;=========//////////////========
;=========//MenuFermer: //=========
;=========//Fenetre 1//=========
;=========/////////////=========
MenuFermer:
Gui,11:Destroy
Gui,11: Color,Red
Gui,11: Add, Radio,x15 y10 vFermer1,Supprimer toutes les données
Gui,11: Add, Radio,x15 y40 vFermer2,Garder toutes les données
Gui,11: Add, Radio,x15 y70 vFermer3,Garder certaines données`n(Participants,Blinds,Classements)
Gui,11: Add, Button,x50 y120 w100 gBoutonFermer11,Fermer
Gui,11: Show,Autosize,Fermeture
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========////////////////////=========
;=========// Automatisation2//=========
;=========//Fenetre 2       //=========
;=========////////////////////=========
Automatisation2:
Gui,2: default
;===Calcul le nbre de participants
NBP:=LV_GetCount()
SB_SetText("Nombre de participants : " NBP)
Return
;=========/////////////////////////=========
;=========//MyListViewParticipant//=========
;=========//      Fenetre 2      //=========
;=========/////////////////////////=========
MyListViewParticipant:
if A_GuiEvent = DoubleClick
{
lignecliquer2:=A_EventInfo
LV_GetText(Nom, A_EventInfo,1)
LV_GetText(Prénom, A_EventInfo,2)
GuiControl, ,Nom, %Nom%
GuiControl, ,Prénom, %Prénom%
}
return
;=========/////////////=========
;=========//Charger2 //=========
;=========//Fenetre2 //=========
;=========/////////////=========
Charger2:
Gui,21: destroy
IfNotExist,Sauvegarde\List_Participants\
{
Msgbox,Il y a aucun fichier à charger !!
}
IfExist,Sauvegarde\List_Participants\
{
Gui,21: Add, GroupBox,x10 y10 w220 h45 center, Choisir le fichier:
ListLigne :=
Loop Sauvegarde\List_Participants\*.txt
{
FichierLu =%A_LoopFileName%
FichierLu%A_Index% = %FichierLu%
StringSplit, Array, FichierLu,`n,.txt
Ligne%A_Index%:= Array1
ListLigne .= Ligne%A_Index% "|"
}
Gui,21: Add, DropDownList, x20 y25 w200 vDDL_Ligne altsubmit, %ListLigne%
Gui,21: Add, Button, x20 y60 w200 h20 gBoutonok21, Charger le fichier
Gui,21: Show,Autosize,Charger une liste
}
return
;=========/////////////=========
;=========//Ajouter2 //=========
;=========//Fenetre 2//=========
;=========/////////////=========
Ajouter2:
Gui,2: submit,nohide
Gui,2: default
;===verifie nom et ajoute au tableau
If Nom =
Msgbox, Vous devez saisir un nom!
Else
{
SoundPlay, %A_WinDir%\Media\chimes.wav
LV_add("",Nom,Prénom)
GuiControl, ,Nom,
GuiControl, ,Prénom,
}
Return
;=========//////////////=========
;=========//Supprimer2//=========
;=========//Fenetre 2 //=========
;=========//////////////=========
Supprimer2:
if lignecliquer2 > 0
{
Gui,2: submit,nohide
Gui,2: default
LV_Delete(lignecliquer2)
GuiControl, ,Nom,
GuiControl, ,Prénom,
lignecliquer2:=
}
else
Msgbox,Cliquer sur le joueur à supprimer
return
;=========/////////////=========
;=========//Save2    //=========
;=========//Fenetre 2//=========
;=========/////////////=========
Save2:
Gui,2: submit,nohide
Gui,2: default
;===enregistre le tableau
FileDelete,FichierTEXT\List_Participants.txt
ControlGet, List, List, , SysListView321,Liste_Participants
FileAppend,%List%,FichierTEXT\List_Participants.txt
Msgbox 48,Sauvegarde, Fichier sauvegardé !, 3
Gui,2: destroy
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========////////////////////=========
;=========// Automatisation3//=========
;=========//Fenetre 3       //=========
;=========////////////////////=========
Automatisation3:
Gui,3: default
;===Calcul le nbre de participants
NBP:=LV_GetCount()
SB_SetParts(150,300)
SB_SetText("Nombre de participants : " NBP,1)
SB_SetText(NBtables " tables de "  JPT  " Joueurs",2)
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========///////////////////=========
;=========//MyListViewBlind//=========
;=========// Fenetre 4     //=========
;=========///////////////////=========
MyListViewBlind:
if A_GuiEvent = DoubleClick
{
lignecliquer4:=A_EventInfo
LV_GetText(BigBlind, A_EventInfo,2)
LV_GetText(Ante, A_EventInfo,3)
LV_GetText(TempsBlind, A_EventInfo,4)
GuiControl, ,BigBlind, %BigBlind%
GuiControl, ,Ante, %Ante%
GuiControl, ,TempsBlind, %TempsBlind%
}
return
;=========/////////////=========
;=========//Charger4 //=========
;=========//Fenetre 4//=========
;=========/////////////=========
Charger4:
Gui,41: destroy
IfNotExist,Sauvegarde\List_Blind\
{
Msgbox,Il y a aucun fichier à charger !!
}
IfExist,Sauvegarde\List_Blind\
{
Gui,41: Add, GroupBox,x10 y10 w220 h45 center, Choisir le fichier:
ListLigne :=
Loop Sauvegarde\List_Blind\*.txt
{
FichierLu =%A_LoopFileName%
FichierLu%A_Index% = %FichierLu%
StringSplit, Array, FichierLu,`n,.txt
Ligne%A_Index%:= Array1
ListLigne .= Ligne%A_Index% "|"
}
Gui,41: Add, DropDownList, x20 y25 w200 vDDL_Ligne altsubmit, %ListLigne%
Gui,41: Add, Button, x20 y60 w200 h20 gBoutonok41, Charger le fichier
Gui,41: Show,Autosize,Charger une liste
}
return
;=========/////////////=========
;=========//Ajouter4 //=========
;=========//Fenetre 4//=========
;=========/////////////=========
Ajouter4:
Gui,4: submit,nohide
Gui,4: default
;===verifie nom et ajoute au tableau
If BigBlind =
Msgbox, Vous devez saisir le montant de la BigBlind!
else If TempsBlind =
Msgbox, Vous devez saisir un temps!(en minutes)
Else
{
;===Calculs
Smallblind:= Round(BigBlind/2,0)
Ante:=Ante ="" ? "0": Ante
SoundPlay, %A_WinDir%\Media\chimes.wav
LV_add("",Smallblind,BigBlind,Ante,TempsBlind)
ProchaineBlind:=Bigblind*2
GuiControl, ,Bigblind,%ProchaineBlind%
}
Return
;=========//////////////=========
;=========//Supprimer4//=========
;=========//Fenetre4  //=========
;=========//////////////=========
Supprimer4:
if lignecliquer4 > 0
{
Gui,4: submit,nohide
Gui,4: default
LV_Delete(lignecliquer4)
GuiControl, ,BigBlind,
GuiControl, ,Ante,
GuiControl, ,TempsBlind,
lignecliquer4:=
}
else
Msgbox,Cliquer sur la ligne à supprimer !
return
;=========/////////////=========
;=========//Save4    //=========
;=========//Fenetre 4//=========
;=========/////////////=========
Save4:
Gui,4: submit,nohide
Gui,4: default
;===enregistre le tableau
FileDelete,FichierTEXT\List_Blind.txt
ControlGet, List, List, , SysListView321,List_Blind
FileAppend,%List%,FichierTEXT\List_Blind.txt
Msgbox 48,Sauvegarde, Fichier sauvegardé !, 3
Gui,4: destroy
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========///////////////////========
;=========//Automatisation5//========
;=========//Fenetre 5     //=========
;=========//////////////////=========
Automatisation5:
Gui,5: default
;===Calcul le nbre de participants
NBP:=LV_GetCount()
SB_SetParts(150,300)
SB_SetText(TableEliminer,1)
SB_SetText("Nombre de Joueurs: " NBP,2)
Return
;=========/////////////////////========
;=========//MyListViewJoueur//=========
;=========//Fenetre 5       //=========
;=========////////////////////=========
MyListViewJoueur:
if A_GuiEvent = DoubleClick
{
lignechoisi:=A_EventInfo
LV_GetText(Nom, A_EventInfo,1)
LV_GetText(Prénom, A_EventInfo,2)
GuiControl, ,Nom, %Nom%
GuiControl, ,Prénom, %Prénom%
}
return
;=========//////////////========
;=========//Eliminer5//=========
;=========//Fenetre 5//=========
;=========/////////////=========
Eliminer5:
Gui,5: submit,nohide
Gui,5: default
;===verifie nom et supprime au tableau
If Nom =
Msgbox, Vous devez saisir un nom!
Else
{
SoundPlay, %A_WinDir%\Media\chimes.wav
MsgBox, 4,, Etes vous sur de vouloir eliminer `n %Nom% %Prénom% ?
IfMsgBox No
{
return
}
else
TextEliminer=%Totaljoueurrestant%%a_tab%%Nom%%a_tab%%Prénom%
IfExist,FichierTEXT\Classement.txt
FileAppend,
(LTrim
`n%TextEliminer%
),FichierTEXT\Classement.txt
IfNotExist,FichierTEXT\Classement.txt
FileAppend,
( Ltrim
%TextEliminer%
),FichierTEXT\Classement.txt

LV_Delete(lignechoisi)
GuiControl, ,Nom,
GuiControl, ,Prénom,
}
Return
;=========//////////////========
;=========//Save5    //=========
;=========//Fenetre 5//=========
;=========/////////////=========
Save5:
Gui,5: submit,nohide
Gui,5: default
;===enregistre le tableau
FileDelete,FichierTEXT\Tirage\%Tablechosi%.txt
ControlGet, List, List, , SysListView321,List_Restant
FileAppend,%List%,FichierTEXT\Tirage\%Tablechosi%.txt
Msgbox 48,Sauvegarde, Fichier sauvegardé !, 3
Gui,5: Destroy
;===Parametres et automatisation Fenetre
GoSub Raffraichirtableau
GoSub CALCULDESCHANGEMENTSDEPLACE
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========///////////////////========
;=========//Automatisation8//========
;=========//Fenetre 8     //=========
;=========//////////////////=========
Automatisation8:
Gui,8: submit,nohide
Gui,8: default
Totalpognon:= particpantdepart * DroitEntrée
GuiControl, ,Total, %Totalpognon%
Return
;=========///////////////////========
;=========//calculerPognon//========
;=========//Fenetre 8     //=========
;=========//////////////////=========
calculerPognon:
Gui,8: default
LV_Delete()
MAXTOTO:=
Maxloop:=particpantdepart
Loop,%Maxloop%
{
If Total >= %DroitEntrée%
{
Somme:= Round((Total*Pourcentagegains/100),-1)
Somme:= Somme >= (Total*Pourcentagegains/100)? Somme  : Somme + 10
Somme:= Somme > DroitEntrée ?  Somme : DroitEntrée
Reste:=Total-Somme
MAXTOTO+=Somme
Joueurpayés:=a_index
PourcentageTotal:=Round(Somme*100/Totalpognon,1)
Gui,8: default
LV_Add("",a_index,Somme,PourcentageTotal)
Total:=Reste
}
}
Bonus:=Totalpognon-MAXTOTO
POurcentageJoueurpayés:= Round(Joueurpayés*100/particpantdepart,1)
Gui,8: default
GuiControl, ,Bonus, %Bonus%
GuiControl, ,Joueurpayés, %Joueurpayés%
GuiControl, ,POurcentageJoueurpayés,%POurcentageJoueurpayés%
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========//////////////////=========
;=========//BoutonFermer11//=========
;=========//Fenetre 11    //=========
;=========//////////////////=========
BoutonFermer11:
Gui,11: submit,nohide
Gui,11: default
If Fermer1 = 1
{
FileRemoveDir, FichierTEXT\, 1
ExitApp
}
else If Fermer2 = 1
{
ExitApp
}
else If Fermer3 = 1
{
FormatTime, date, , yyyyMMdd
FileCreateDir, Sauvegarde\
FileCreateDir,Sauvegarde\List_Participants\
FileMove, FichierTEXT\List_Participants.txt,  Sauvegarde\List_Participants\Participants_Tournois_%date%.txt
FileCreateDir,Sauvegarde\List_Blind\
FileMove, FichierTEXT\List_Blind.txt,  Sauvegarde\List_Blind\Blind_Tournois_%date%.txt
FileCreateDir,Sauvegarde\Classement\
FileMove, FichierTEXT\Classement.txt,  Sauvegarde\Classement\Classement_Tournois_%date%.txt
FileRemoveDir, FichierTEXT\, 1
ExitApp
}
Else
{
msgbox,Faites un choix!!
}
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========/////////////=========
;=========//Boutonok21 //=========
;=========//Fenetre 2//=========
;=========/////////////=========
Boutonok21:
Gui,21: submit,nohide
Lignechoisi:=DDL_Ligne
fichierParticipantsacharger:=FichierLu%Lignechoisi%
FileDelete,FichierTEXT\List_Participants.txt
FileCopy,Sauvegarde\List_Participants\%fichierParticipantsacharger%,FichierTEXT\List_Participants.txt
Gui,21: destroy
GoSub Menuparticipant
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========//////////////=========
;=========//Boutonok41//=========
;=========// Fenetre 4//=========
;=========//////////////=========
Boutonok41:
Gui,41: submit,nohide
Lignechoisi:=DDL_Ligne
fichierBlindsacharger:=FichierLu%Lignechoisi%
FileDelete,FichierTEXT\List_Blind.txt
FileCopy,Sauvegarde\List_Blind\%fichierBlindsacharger%,FichierTEXT\List_Blind.txt
Gui,41: destroy
GoSub MenuBlinds
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========//////////////=========
;=========//Save99    //=========
;=========//Fenetre99 //=========
;=========//////////////=========
Save99:
Gui,99: submit
Msgbox 48,Sauvegarde,Parametre Fichier sauvegardé !, 3
NbMaxiJoueurParTable:=Parametre1
Tapisdepart:=Parametre2
DroitEntrée:=Parametre3
Gui,99: Destroy
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========////////////////////////////////========
;=========//CALCULDESCHANGEMENTSDEPLACE//=========
;=========//      Multi-Fenetre        //=========
;=========///////////////////////////////=========
CALCULDESCHANGEMENTSDEPLACE:
loop ,%NbMaxiJoueurParTable%
{
Gui, Font, cRed,
GuiControl, Font, Consignes2
GuiControl, ,Consignes2,!!Patientez SVP!!
N22Btables:=Totaljoueurrestant/NbMaxiJoueurParTable
ARONDISUP:= (N22Btables-Round(N22Btables,0)) <= 0 ? 0 : 1
N22Btables:=Round(Round(N22Btables,0)+ARONDISUP,0)
JMAX:=0
Jmini:=1000
FileRead, List_table , FichierTEXT\List_table.txt
;==table maxi et mini
Loop, parse, List_table , `n, `r
{
StringSplit, Array, A_LoopField, %a_tab%
nbtablerestant:= A_index
Table:= array1
nbJoueur:= array2
Jmini:= Jmini > nbJoueur  ? nbJoueur : Jmini
Tmini:= Jmini >= nbJoueur ? Table : Tmini
JMax:= JMax < nbJoueur  ? nbJoueur : JMax
TMax:= JMax <= nbJoueur ? Table : TMax
}
diference:=Jmax-Jmini
;==dernier joueur de table max
StringSplit, Array, Tmax, %A_Space%,%A_Space%
FichierTMAX:=Array1 ".txt"
FileRead, Listtest, FichierTEXT\tirage\%FichierTMAX%
Loop, parse, Listtest , `n, `r
{
DernierJoueurTmax:=A_LoopField
dernierlignetmax:=a_index
}
;==dernier joueur de table min
StringSplit, Array, Tmini, %A_Space%,%A_Space%
FichierTMini:=Array1 ".txt"
FileRead, Listtest, FichierTEXT\tirage\%FichierTMini%
Loop, parse, Listtest , `n, `r
{
DernierJoueurTmini:=A_LoopField
dernierlignetmini:=a_index
}
FileRead, listmillieu, FichierTEXT\List_table.txt
Loop, parse, listmillieu , `n, `r
{
StringSplit, Array, A_LoopField, %a_tab%
Table:= array1
nbJoueur:= array2
text=%A_LoopField%
if Table <> %Tmini%
{
If nbJoueur < %NbMaxiJoueurParTable%
{
Tablemillieu:=Table
}
}
}
;==dernier joueur de table milieu
StringSplit, Array, Tablemillieu, %A_Space%,%A_Space%
FichierTablemillieu:=Array1 ".txt"
Sleep,100
;==verifie et bouge de place
if nbtablerestant = %N22Btables%
{
if diference > 1
GoSub MaxVersMini
}
else if nbtablerestant <> %N22Btables%
{
if diference <> ""
GoSub MiniVersMilieu
}
}
Gui, Font, cGreen
GuiControl, Font, Consignes2
GuiControl, ,Consignes2,Prêt
Return
;=========////////////////////////////////========
;=========//     MaxVersMini           //=========
;=========//CALCULDESCHANGEMENTSDEPLACE//=========
;=========///////////////////////////////=========
MaxVersMini:
FichierOtesJoueurs:=FichierTMAX
derniereLigneFOJ:=dernierlignetmax
DernierJoueurFOJ:=DernierJoueurTmax
Tabledepart:=TMAX
FichierAjouteJoueurs:=FichierTMini
Tablearrivé:=Tmini
GoSub degageunjoueur
Return
;=========////////////////////////////////========
;=========//    MiniVersMilieu          //========
;=========//CALCULDESCHANGEMENTSDEPLACE//=========
;=========///////////////////////////////=========
MiniVersMilieu:
FichierOtesJoueurs:=FichierTMini
derniereLigneFOJ:=dernierlignetmini
DernierJoueurFOJ:=DernierJoueurTmini
Tabledepart:=Tmini
FichierAjouteJoueurs:=FichierTablemillieu
Tablearrivé:=Tablemillieu
GoSub degageunjoueur
Return
;=========////////////////////////////////========
;=========//    degageunjoueur          //========
;=========//CALCULDESCHANGEMENTSDEPLACE//=========
;=========////////////////////////////////========
;==bouge le dernier joueur de table vers nouvelle table
degageunjoueur:
FileRead, Listtest, FichierTEXT\tirage\%FichierOtesJoueurs%
Loop, parse, Listtest , `n, `r
{
text=%A_LoopField%
ligne=%a_index%
if ligne <> %derniereLigneFOJ%
{
IfExist,nouvelletable.txt
FileAppend,
(LTrim
`n%text%
),nouvelletable.txt
IfNotExist,nouvelletable.txt
FileAppend,
( Ltrim
%text%
),nouvelletable.txt
}
}
FileDelete,FichierTEXT\tirage\%FichierOtesJoueurs%
FileMove,nouvelletable.txt,FichierTEXT\tirage\%FichierOtesJoueurs%
FileAppend,`n%DernierJoueurFOJ%,FichierTEXT\tirage\%FichierAjouteJoueurs%
textdeplacement= %DernierJoueurFOJ%%a_tab%%Tabledepart%%a_tab%%Tablearrivé%
msgbox,48, Changement de place, le joueur de la %Tabledepart% `n `n %DernierJoueurFOJ% `n `n va à la %Tablearrivé%
IfExist,FichierTEXT\Mouvementstable.txt
FileAppend,
(LTrim
`n%textdeplacement%
),FichierTEXT\Mouvementstable.txt
IfNotExist,FichierTEXT\Mouvementstable.txt
FileAppend,
( Ltrim
%textdeplacement%
),FichierTEXT\Mouvementstable.txt
GoSub Raffraichirtableau
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;=========///////////////////////========
;=========//Raffraichirtableau//=========
;=========// Multi-Fenetre    //=========
;=========//////////////////////=========
Raffraichirtableau:
;::::::::::raffraichir le fichier et tableau::::::
FileDelete,FichierTEXT\List_table.txt
Loop FichierTEXT\Tirage\*.txt
{
FichierLu = %A_LoopFileName%
FileRead,Table, FichierTEXT\Tirage\%FichierLu%
Loop, parse, Table, `n, `r
NbJoueurAssis=%A_Index%
ROw=%A_Index%
StringSplit, Array, FichierLu,.
Table:=Array1
TextEnrgistré = %Table% %a_tab% %NbJoueurAssis%
IfExist,FichierTEXT\List_table.txt
FileAppend,
( Ltrim
`n%TextEnrgistré%
),FichierTEXT\List_table.txt
IfNotExist,FichierTEXT\List_table.txt
FileAppend,
( Ltrim
%TextEnrgistré%
),FichierTEXT\List_table.txt
}
Gui,1:default
LV_Delete()
FileRead, List_table , FichierTEXT\List_table.txt
Loop, parse, List_table , `n, `r
{
StringSplit, Array, A_LoopField, %a_tab%
Table%A_Index%:= Array1
Joueur%A_Index%:= Array2
Gui,1: default
LV_Add("",Table%A_Index%,Joueur%A_Index%)
}
sleep,200
Return



To have an Picture of the table, please copy this Picture and paste it next to the script with this name : table.jpg

Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CROUCHEL



Joined: 24 Mar 2009
Posts: 79
Location: www.rouchel-cyril.fr

PostPosted: Sun Mar 21, 2010 4:15 pm    Post subject: Re: organizing poker tournaments Reply with quote

You can dowload the file.Exe on my website :
www.rouchel-cyril.fr
Je mets en téléchargement gratuit le fichier exécutable sur mon site :
www.rouchel-cyril.fr
_________________
www.rouchel-cyril.fr
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group