Open Side Menu Go to the Top
Register
Script: Mark Current Hand Script: Mark Current Hand

09-28-2010 , 02:02 PM
Quote:
Originally Posted by Max1mums
clickys, either you don't use the latest version posted (previous post) or run it from Program Files folder (should be run from drive root eg C:\), additionally you can try removing trailing backslashes in the ini file if present.
where i have to paste the above source code and where which location ?
Script: Mark Current Hand Quote
09-28-2010 , 02:06 PM
As i said, try running it from drive root: go to c:\ folder, create new txt file, copy code there, rename file to .ahk, run it. Make sure you have gamenumbers.txt file created or you will get the same error.
Script: Mark Current Hand Quote
09-28-2010 , 02:21 PM
where i find gamenumbers.txt
Script: Mark Current Hand Quote
09-28-2010 , 02:26 PM
Did you read script description from the first page at all? Marked hands will be stored in ganenumbers.txt file, it will be created automatically if you mark a hand.
Script: Mark Current Hand Quote
09-28-2010 , 02:37 PM
C:\Markhands>"C:\Program Files\PostgreSQL\8.4\bin\psql.exe" holdemmanager postgr
es 0<"C:\Markhands\temp.txt"
The system cannot find the file specified.

C:\Markhands>pause
Press any key to continue . . .
Script: Mark Current Hand Quote
09-28-2010 , 02:43 PM
Wasn't bin postgres folder placed in Program files (x86) folder in your first post (it is supposed to be in Program files folder now)? Or is it just a mistype? Does gamenumbers.txt file exist in Markhands directory?
Script: Mark Current Hand Quote
09-28-2010 , 02:46 PM
i think iam ****** or something , wanna teamview to my pc mate u will help me so much...
Script: Mark Current Hand Quote
09-28-2010 , 02:52 PM
Well you are not the first person with this problem so it may be script issue, teamviewer session should clarify this. You can PM me your teamviewer id and session pass or you can contact me directly with any contact on my profile page.
Script: Mark Current Hand Quote
09-28-2010 , 03:06 PM
i pretty much have the same problem as clickys
should this gamenumbers.txt be created at the start of the script?
cause that doesnt happen so i thought i make one of my own and the script prompts me to delete it with the same result obv
Script: Mark Current Hand Quote
09-28-2010 , 03:19 PM
schrups, clickys case is solved, it wasn't the script fault. Note that gamenumbers.txt shouldn't be empty (you can add 123 line for the testing purpose), it will be created automatically when you mark a hand, did you try marking hands at least? I can try helping you through teamviewer if nothing helps, look at my previous post about the ways of contacting me.
Script: Mark Current Hand Quote
09-28-2010 , 03:23 PM
yep i tried marking hands didnt work
will contact u via pm
Script: Mark Current Hand Quote
09-28-2010 , 04:14 PM
Solved for schrups.
Script: Mark Current Hand Quote
09-28-2010 , 07:08 PM
is this the same issue that is being fixed or is each different? if it is the same can you post a possible fix?
Script: Mark Current Hand Quote
09-28-2010 , 08:42 PM
Furio, it wasn't script issue in both cases. Here is version with few minor fixes:
Code:
#noenv
#SingleInstance, Force
SetWinDelay,-1
settitlematchmode,2

StringTrimRight, thisahk, A_ScriptName, 4
SetWorkingDir %A_ScriptDir%

IniRead, StarsHHLogFolderPath, %thisahk%.ini, LogFolder, StarsHHPath, %A_Space%
IniRead, FullTiltHHLogFolderPath, %thisahk%.ini, LogFolder, FullTiltHHPath, %A_Space%
IniRead, PostgresLogPath, %thisahk%.ini, LogFolder, postgrespath, %A_Space%
IniRead, postgresuser, %thisahk%.ini, LogFolder, postgresuser, %A_Space%
IniRead, postgresdb, %thisahk%.ini, LogFolder, postgresdb, %A_Space%

If (!StarsHHLogFolderPath or !FullTiltHHLogFolderPath or !PostgresLogPath or !postgresuser or !postgresdb)
{
   Gui, Add, Text, x10  y5 w120 h20 Center, Select Folder Location
   Gui, Add, Text, x140 y5 w150 h20 Center, Folder Location
   Gui, Add, Button, x5 y20 w150 h20 gPostgresBinFolderSelect center, Postgres Binary Folder
   Gui, Add, Edit, x160 y20 w520 h20 vPostgresLogpath, %PostgresLogpath%
   Gui, Add, Button, x5 y40 w150 h20 gStarsHHFolderSelect  center, Poker Stars HH Folder
   Gui, Add, Edit, x160 y40 w520 h20 vStarsHHLogFolderPath, %StarsHHLogFolderPath%
   Gui, Add, Button, x5 y60 w150 h20 gFullTiltHHFolderSelect   center, Full Tilt HH Folder
   Gui, Add, Edit, x160 y60 w520 h20 vFullTiltHHLogFolderPath, %FullTiltHHLogFolderPath%
   
   Gui, Add, Text, x5  y120 w150 h20 right, Postgres User Name:
   Gui, Add, Edit, x160 y120 w100 h20 vpostgresuser, %postgresuser%
   Gui, Add, Text, x5  y140 w150 h20 right,  Postgres Database:
   Gui, Add, Edit, x160 y140 w100 h20 vpostgresdb, %postgresdb%
   Gui, Add, Button, w40 h30, OK  ; The label ButtonOK (if it exists) will be run when the button is pressed.
Gui, Show,, Markhand 
return
ButtonOK:
GuiClose:
GuiEscape:
Gui, Submit
IniWrite, %postgresdb%, %thisahk%.ini, LogFolder, postgresdb
IniWrite, %postgresuser%, %thisahk%.ini, LogFolder, postgresuser
IniWrite, %PostgresLogPath%, %thisahk%.ini, LogFolder, postgrespath
IniWrite, %FullTiltHHLogFolderPath%, %thisahk%.ini, LogFolder, FullTiltHHPath
IniWrite, %StarsHHLogFolderPath%, %thisahk%.ini, LogFolder, StarsHHPath
return
}


IfExist, gamenumbers.txt
{
MsgBox, 4,, Delete existing file gamenumbers.txt? (press Yes or No)
IfMsgBox Yes
    FileDelete, gamenumbers.txt
}
settimer,checksize,100
return


^2::
Suspend
Return

F1::
winget,id,id,A
wingetclass,class,ahk_id%id%
if class=PokerStarsTableFrameClass
{
site=Stars
dir:=StarsHHLogFolderPath
}
else
if class=QWidget
{
site=FullTilt
dir:=FullTiltHHLogFolderPath
}
else
site=
if site
{
 filename:=HHFile(id, dir ,site) 
 FileGetSize, FileSize, % filename
 if !FileSize
 FileSize:=0
 listadd(filelist, id . "-" . FileSize)
}
return

^F1::
IfExist, temp.txt
FileDelete, temp.txt
IfExist, temp.bat
FileDelete, temp.bat
loop gamenumbers.*
FileRead, numbers, %A_LoopFileName%
if numbers
{
sql1=Update pokerhands
sql2=Set mark_id = 1
sql3=Where gamenumber = 
sql4=AND handtimestamp > localtimestamp - interval '1 days';
sql5=Update pokerhands_hero
Loop, Parse, numbers, `n,
{
if A_loopField
{
FileAppend, %sql1% %sql2% %sql3% %A_loopField% %sql4%`n, temp.txt
FileAppend, %sql5% %sql2% %sql3% %A_loopField% %sql4%`n, temp.txt
}
}
FileAppend, "%PostgresLogPath%\psql.exe"%A_space%"%postgresdb%"%A_space%"%postgresuser%"%A_space%0<"%A_ScriptDir%\temp.txt"`r`npause`n, temp.bat
run temp.bat
}
else
msgbox, gamenumbers.txt file doesn't exist or file is empty.
return
;-----------------------------------------------------------------------------------------------------
checksize:
Loop, Parse, filelist, `,
{
 stringsplit,tab,A_loopField,-
 wingetclass,class,ahk_id%tab1%
 if class=PokerStarsTableFrameClass
 {
 site=Stars
 dir:=StarsHHLogFolderPath
 }
 else
 if class=QWidget
 {
 site=FullTilt
 dir:=FullTiltHHLogFolderPath
 }
 filename:=HHFile(tab1, dir ,site) 
 FileGetSize, FileSize, % filename
 if FileSize
 if FileSize!=%tab2%
 {
  num:=gethhnumber(tab1,site)
  FileAppend, %num%`n, gamenumbers.txt
  listDelItem(filelist, A_loopField)  
 }
}
return
;-----------------------------------------------------------------------------------------------------
gethhnumber(winid,site)
{
global StarsHHLogFolderPath,FullTiltHHLogFolderPath
if site=Stars
path=%StarsHHLogFolderPath%
else
path=%FullTiltHHLogFolderPath%
hh:=LastHH(winid,path,site)
Loop, Parse, hh, `n
{
 if instr(A_loopfield,"Game #")
 {
  stringtrimleft,num,A_loopfield,instr(A_loopfield,"#")
  stringleft,num,num,instr(num,":")-1
  break
 }
}
return num
}
;-----------------------------------------------------------------------------------------------------
HHFile(win, dir, site) {
if site=Stars
ext=HH
else
ext=FT
title := WinGetTitle(win)
if !(instr(title,"Tournament")>0 OR instr(title,"Sit & Go")>0 OR instr(title,"Sit&Go")>0 OR instr(title,"table")>0 OR instr(title,"Satellite")>0) 
{
stringleft,file,title, InStr(title, "-","",0)-2
file := ext . SubStr(a_now, 1, 8) . A_space . file
StringReplace, file, file, /,-,
if site=Stars
{
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
}
else
if site=Stars
{
 stringtrimleft,file,title,instr(title,"Tournament")+10
 stringleft,file,file,InStr(file, A_space)-1
}
else
{
 stringtrimleft,file,title,instr(title,"(")-1
 stringleft,file,file,InStr(file, "-")-2
}
loop %dir%\*.txt
{
if instr(A_LoopFileName,file)>0 & !instr(A_LoopFileName,"Summary")>0
return dir "\" A_LoopFileName
}
EnvAdd, date, -1, d
stringleft,file,title, InStr(title, "-","",0)-2
file := ext . SubStr(date, 1, 8) . A_space . file
StringReplace, file, file, /,-,
if site=Stars
{
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
loop %dir%\*.txt
{
if instr(A_LoopFileName,file)
return dir "\" A_LoopFileName
}
EnvAdd, date, +1, d
stringleft,file,title, InStr(title, "-","",0)-2
file := ext . SubStr(date, 1, 8) . A_space . file
StringReplace, file, file, /,-,
if site=Stars
{
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
loop %dir%\*.txt
{
if instr(A_LoopFileName,file)
return dir "\" A_LoopFileName
}
}
return
;-----------------------------------------------------------------------------------------------------
LastHH(win, dir, site) {
if site=Stars
game=PokerStars Game #
else
game=Full Tilt Poker Game #
file@name:=HHFile(win, dir ,site) 
FileRead, hh, %file@name%
if !instr(hh,"seat")
{
FileGetSize file@size, %file@name%
FileRead file?buffer, %file@name%
VarSetCapacity(hh, file@size / 2 + 1, 0)
r := DllCall("WideCharToMultiByte"
      , "UInt", 0      ; CodePage: CP_ACP=0 (current Ansi), CP_UTF7=65000, CP_UTF8=65001
      , "UInt", 0      ; dwFlags
      , "Str", file?buffer      ; LPCWSTR lpWideCharStr
      , "Int", file@size / 2      ; cchWideChar: -1=null terminated
      , "Str", hh      ; LPSTR lpMultiByteStr
      , "Int", file@size / 2 + 1      ; cbMultiByte: 0 to get required size
      , "UInt",0      ; LPCSTR lpDefaultChar
      , "UInt", 0)      ; LPBOOL lpUsedDefaultChar
}
StringTrimLeft, hh, hh, InStr(hh, game, "", 0)-1
if instr(hh,"SUMMARY")
Stringleft, hh, hh, InStr(hh, "*** SUMMARY", "", 0)-1
return hh
}
;-----------------------------------------------------------------------------------------------------
WinGetTitle(win) {
WinGetTitle, title, ahk_id%win%
return title
}
;-----------------------------------------------------------------------------------------------------
StrRep(str,char,rep_char="",all=1) {
StringReplace,str,str,%char%,%rep_char%,% all ? "useErrorLevel" : 0
return str
}
;-----------------------------------------------------------------------------------------------------
StarsHHFolderSelect:	
FileSelectFolder, SelectedFolder, *%ProgramFiles%\PokerStars\,, Select the folder with the PokerStars handhistory files
SelectedFolder := RegExReplace(SelectedFolder, "\\$")  ; Removes the trailing backslash, if present.	
SelectedFolder := RegExReplace(SelectedFolder, "\$")
If SelectedFolder <>	;the user selected a folder
{
GuiControl,, StarsHHLogFolderPath, %SelectedFolder%
StarsHHLogFolderPath := SelectedFolder
IniWrite, %StarsHHLogFolderPath%, %thisahk%.ini, LogFolder, StarsHHPath
Gui, Submit, NoHide
}	
return
;-----------------------------------------------------------------------------------------------------
FullTiltHHFolderSelect:	
FileSelectFolder, SelectedFolder, *%ProgramFiles%\Full Tilt Poker\,, Select the folder with the FullTilt handhistory files
SelectedFolder := RegExReplace(SelectedFolder, "\\$")  ; Removes the trailing backslash, if present.	
SelectedFolder := RegExReplace(SelectedFolder, "\$")
If SelectedFolder <>	;the user selected a folder
{
GuiControl,, FullTiltHHLogFolderPath, %SelectedFolder%
FullTiltHHLogFolderPath := SelectedFolder
IniWrite, %FullTiltHHLogFolderPath%, %thisahk%.ini, LogFolder, FullTiltHHPath
Gui, Submit, NoHide
}	
return
;-----------------------------------------------------------------------------------------------------
PostgresBinFolderSelect:	
FileSelectFolder, SelectedFolder, *%ProgramFiles%\PostgreSQL\,, Select the folder with the Postgres binary files
SelectedFolder := RegExReplace(SelectedFolder, "\\$")  ; Removes the trailing backslash, if present.	
SelectedFolder := RegExReplace(SelectedFolder, "\$")
If SelectedFolder <>	;the user selected a folder
{
GuiControl,, PostgresLogPath, %SelectedFolder%
PostgresLogPath := SelectedFolder
IniWrite, %PostgresLogPath%, %thisahk%.ini, LogFolder, postgrespath
Gui, Submit, NoHide
}	
return
;-----------------------------------------------------------------------------------------------------
postgresuserselect:

InputBox, postgresuser,, enter Postgres Username
IniWrite, %postgresuser%, %thisahk%.ini, LogFolder, postgresuser
return
;-----------------------------------------------------------------------------------------------------
postgresdbselect:

InputBox, postgresdb,, enter Postgres Datbase Name
IniWrite, %postgresdb%, %thisahk%.ini, LogFolder, postgresdb
return
;-----------------------------------------------------------------------------------------------------
listAdd( byRef list, item, del="," ) {
  list:=( list!="" ? ( list . del . item ) : item )
  return list
}
;-----------------------------------------------------------------------------------------------------
listDelItem( byRef list, item, del=",") {
  ifEqual, item,, return list
  list:=del . list . del
  StringReplace, list, list, %item%%del%
  StringTrimLeft, list, list, 1
  StringTrimRight, list, list, 1
  return list
}
;-----------------------------------------------------------------------------------------------------
reload:
reload
return
;-----------------------------------------------------------------------------------------------------
Exit:
exitapp
return
;-----------------------------------------------------------------------------------------------------
Script: Mark Current Hand Quote
10-03-2010 , 08:28 PM
emmm. Now when I try it i do not get a black screen with next. I just get a window pop up saying "gamenumbers.txt doesn't exist or the file is empty". However if i create a file it then asks me to delete it. I have tried both yes and no and each one has brought the same error box. I have tried placing the files in a separate drive, the main drive root and the bin file. I have compiled to exe and given admin rights and still no luck. Do you have any other suggestions? I know you offered team-viewer but i do not feel comfortable doing this. (esp with all the BDSM porn i have )
Script: Mark Current Hand Quote
10-03-2010 , 09:41 PM
Furio, this was the case for both previous posters: they were trying to mark hands in database without any handnumbers saved, i guess this is your case too. Delete gamenumbers file, mark few hands then press ctrl+f1 hotkey.
Script: Mark Current Hand Quote
10-07-2010 , 09:39 AM


Thank you very much for your effort. I don't understand why HM don't add such feature, but thanks to you...now i don't care.

nice job.
Script: Mark Current Hand Quote
10-21-2010 , 06:07 PM
I will give $50 to anyone that can implement the following features:

1. Support for Absolute Poker/UB.
2. Support for iPoker.

Thanks.
Script: Mark Current Hand Quote
10-29-2010 , 12:36 PM
Quote:
Originally Posted by Max1mums
Furio, this was the case for both previous posters: they were trying to mark hands in database without any handnumbers saved, i guess this is your case too. Delete gamenumbers file, mark few hands then press ctrl+f1 hotkey.
I randonly tried this again today and without changing anything, it worked

I tested it while 4 tabling SNGs to see how well it worked and out of 10 marked hands it correctly marked 9 and only got 1 wrong.

The script is great but so I use it correctly, why did it get one wrong? Was it just bad luck? If I have 4 hands that need attention at any one time, how will it know what hand to mark? Will it mark the current hand with window focus or the hand that goes first into HM?

I am scared to restart my PC incase it stops working
Script: Mark Current Hand Quote
11-02-2010 , 08:33 PM
is it possible to change the key for marking the hand? rather than F1, Id like to move it to Mbutton.
Script: Mark Current Hand Quote
11-02-2010 , 08:55 PM
Here is script version with Gui from RealRauch, few additional filereads added before taking last hand from HH file since FullTilt client doesn't always update HH file if there wasn't file read request for some time.

Code:
#noenv
#SingleInstance, Force
SetWinDelay,-1
settitlematchmode,2

Menu, Tray, NoStandard
;Menu, Tray, Icon, Markhands.ico,1,1
Menu, Tray, Add, Reload, Reload
Menu, Tray, Add, Change Settings,  GetMHSettings()
Menu, Tray, Add, Suspend Hotkeys, SuspendHotkey
Menu, Tray, Add
Menu, Tray, Add, Submit to Database, l_processsql
Menu, Tray, Add, Exit, Exit
Gui, Submit

StringTrimRight, thisahk, A_ScriptName, 4
SetWorkingDir %A_ScriptDir%

IniRead, StarsHHLogFolderPath, %thisahk%.ini, LogFolder, StarsHHPath, %A_Space%
IniRead, FullTiltHHLogFolderPath, %thisahk%.ini, LogFolder, FullTiltHHPath, %A_Space%
IniRead, PostgresLogPath, %thisahk%.ini, LogFolder, postgrespath, %A_Space%
IniRead, postgresuser, %thisahk%.ini, LogFolder, postgresuser, %A_Space%
IniRead, postgresdb, %thisahk%.ini, LogFolder, postgresdb, %A_Space%
IniRead, HK_mark, %thisahk%.ini, LogFolder, HK_mark, %A_Space%
IniRead, HK_sql , %thisahk%.ini, LogFolder, HK_sql , %A_Space%


If (!StarsHHLogFolderPath or !FullTiltHHLogFolderPath or !PostgresLogPath or !postgresuser or !postgresdb)
{
   gosub GetMHSettings()
}

if HK_mark
HotKey, %HK_mark%, l_markhand
if HK_sql
HotKey, %HK_sql%, l_processsql

IfExist, gamenumbers.txt
  gosub deletetext


settimer,checksize,55
return


^2::
Suspend
Return

l_markhand:
winget,id,id,A
wingetclass,class,ahk_id%id%
if class=PokerStarsTableFrameClass
{
site=Stars
dir:=StarsHHLogFolderPath
}
else
if class=QWidget
{
site=FullTilt
dir:=FullTiltHHLogFolderPath
}
else
site=
if site
{
 filename:=HHFile(id, dir ,site) 
 fileread,tempstr,%filename%
 tempstr=
 sleep,50
 FileGetSize, FileSize, % filename
 if !FileSize
 FileSize:=0
 listadd(filelist, id . "-" . FileSize)
}
return

l_processsql:
IfExist, temp.txt
FileDelete, temp.txt
IfExist, temp.bat
FileDelete, temp.bat
loop gamenumbers.*
FileRead, numbers, %A_LoopFileName%
if numbers
{
sql1=Update pokerhands
sql2=Set mark_id = 1
sql3=Where gamenumber = 
sql4=AND handtimestamp > localtimestamp - interval '1 days';
sql5=Update pokerhands_hero
Loop, Parse, numbers, `n,
{
if A_loopField
{
FileAppend, %sql1% %sql2% %sql3% %A_loopField% %sql4%`n, temp.txt
FileAppend, %sql5% %sql2% %sql3% %A_loopField% %sql4%`n, temp.txt
}
}
FileAppend, "%PostgresLogPath%\psql.exe"%A_space%"%postgresdb%"%A_space%"%postgresuser%"%A_space%0<"%A_ScriptDir%\temp.txt"`r`npause`n, temp.bat
run temp.bat
}
else
msgbox, gamenumbers.txt file doesn't exist or file is empty.
numbers=
return
;-----------------------------------------------------------------------------------------------------
checksize:
Loop, Parse, filelist, `,
{
 stringsplit,tab,A_loopField,-
 wingetclass,class,ahk_id%tab1%
 if class=PokerStarsTableFrameClass
 {
 site=Stars
 dir:=StarsHHLogFolderPath
 }
 else
 if class=QWidget
 {
 site=FullTilt
 dir:=FullTiltHHLogFolderPath
 }
 filename:=HHFile(tab1, dir ,site) 
 fileread,tempstr,%filename%
 tempstr=
 sleep,50
 FileGetSize, FileSize, % filename
 if FileSize
 if FileSize!=%tab2%
 {
  num:=gethhnumber(tab1,site)
  FileAppend, %num%`n, gamenumbers.txt
  listDelItem(filelist, A_loopField)  
 }
}
return
;-----------------------------------------------------------------------------------------------------
gethhnumber(winid,site)
{
global StarsHHLogFolderPath,FullTiltHHLogFolderPath
if site=Stars
path=%StarsHHLogFolderPath%
else
path=%FullTiltHHLogFolderPath%
hh:=LastHH(winid,path,site)
Loop, Parse, hh, `n
{
 if instr(A_loopfield,"Game #")
 {
  stringtrimleft,num,A_loopfield,instr(A_loopfield,"#")
  stringleft,num,num,instr(num,":")-1
  break
 }
}
return num
}
;-----------------------------------------------------------------------------------------------------
HHFile(win, dir, site) {
if site=Stars
ext=HH
else
ext=FT
title := WinGetTitle(win)
if !(instr(title,"Tournament")>0 OR instr(title,"Sit & Go")>0 OR instr(title,"Sit&Go")>0 OR instr(title,"table")>0 OR instr(title,"Satellite")>0) 
{
stringleft,file,title, InStr(title, "-","",0)-2
file := ext . SubStr(a_now, 1, 8) . A_space . file
StringReplace, file, file, /,-,
if site=Stars
{
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
}
else
if site=Stars
{
 stringtrimleft,file,title,instr(title,"Tournament")+10
 stringleft,file,file,InStr(file, A_space)-1
}
else
{
 stringleft,file,title,InStr(title, "-","",instr(title,"Table"))-2
}
loop %dir%\*.txt
{
if instr(A_LoopFileName,file)>0 & !instr(A_LoopFileName,"Summary")>0
return dir "\" A_LoopFileName
}
if instr(title,"Table")
return 0
EnvAdd, date, -1, d
stringleft,file,title, InStr(title, "-","",0)-2
file := ext . SubStr(date, 1, 8) . A_space . file
StringReplace, file, file, /,-,
if site=Stars
{
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
loop %dir%\*.txt
{
if instr(A_LoopFileName,file)
return dir "\" A_LoopFileName
}
EnvAdd, date, +1, d
stringleft,file,title, InStr(title, "-","",0)-2
file := ext . SubStr(date, 1, 8) . A_space . file
StringReplace, file, file, /,-,
if site=Stars
{
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
loop %dir%\*.txt
{
if instr(A_LoopFileName,file)
return dir "\" A_LoopFileName
}
}
return
;-----------------------------------------------------------------------------------------------------
LastHH(win, dir, site) {
wingettitle,title,ahk_id%win%
stringtrimleft,hero,title,instr(title,A_space,"",0)
heroaction1:=hero . A_space . "calls"
heroaction2:=hero . A_space . "bets"
heroaction3:=hero . A_space . "raises"
if site=Stars
game=PokerStars Game #
else
game=Full Tilt Poker Game #
file@name:=HHFile(win, dir ,site) 
fileread,tempstr,%file@name%
tempstr=
sleep,50
FileRead, hh, %file@name%
if !instr(hh,"seat")
{
FileGetSize,file@size, %file@name%
FileRead,file@buffer, %file@name%
VarSetCapacity(hh, file@size / 2 + 1, 0)
r := DllCall("WideCharToMultiByte"
      , "UInt", 0      ; CodePage: CP_ACP=0 (current Ansi), CP_UTF7=65000, CP_UTF8=65001
      , "UInt", 0      ; dwFlags
      , "Str", file@buffer      ; LPCWSTR lpWideCharStr
      , "Int", file@size / 2      ; cchWideChar: -1=null terminated
      , "Str", hh      ; LPSTR lpMultiByteStr
      , "Int", file@size / 2 + 1      ; cbMultiByte: 0 to get required size
      , "UInt",0      ; LPCSTR lpDefaultChar
      , "UInt", 0)      ; LPBOOL lpUsedDefaultChar
}
StringTrimLeft, hh, hh, InStr(hh, game, "", 0)-1
if instr(hh,"SUMMARY")
Stringleft, hh, hh, InStr(hh, "*** SUMMARY", "", 0)-1
return hh
}
;-----------------------------------------------------------------------------------------------------
WinGetTitle(win) {
WinGetTitle, title, ahk_id%win%
return title
}
;-----------------------------------------------------------------------------------------------------
StrRep(str,char,rep_char="",all=1) {
StringReplace,str,str,%char%,%rep_char%,% all ? "useErrorLevel" : 0
return str
}
;-----------------------------------------------------------------------------------------------------
StarsHHFolderSelect:	
FileSelectFolder, SelectedFolder, *%ProgramFiles%\PokerStars\,, Select the folder with the PokerStars handhistory files
SelectedFolder := RegExReplace(SelectedFolder, "\\$")  ; Removes the trailing backslash, if present.	
SelectedFolder := RegExReplace(SelectedFolder, "\$")
If SelectedFolder <>	;the user selected a folder
{
GuiControl,, StarsHHLogFolderPath, %SelectedFolder%
StarsHHLogFolderPath := SelectedFolder
IniWrite, %StarsHHLogFolderPath%, %thisahk%.ini, LogFolder, StarsHHPath
Gui, Submit, NoHide
}	
return
;-----------------------------------------------------------------------------------------------------
FullTiltHHFolderSelect:	
FileSelectFolder, SelectedFolder, *%ProgramFiles%\Full Tilt Poker\,, Select the folder with the FullTilt handhistory files
SelectedFolder := RegExReplace(SelectedFolder, "\\$")  ; Removes the trailing backslash, if present.	
SelectedFolder := RegExReplace(SelectedFolder, "\$")
If SelectedFolder <>	;the user selected a folder
{
GuiControl,, FullTiltHHLogFolderPath, %SelectedFolder%
FullTiltHHLogFolderPath := SelectedFolder
IniWrite, %FullTiltHHLogFolderPath%, %thisahk%.ini, LogFolder, FullTiltHHPath
Gui, Submit, NoHide
}	
return
;-----------------------------------------------------------------------------------------------------
PostgresBinFolderSelect:	
FileSelectFolder, SelectedFolder, *%ProgramFiles%\PostgreSQL\,, Select the folder with the Postgres binary files
SelectedFolder := RegExReplace(SelectedFolder, "\\$")  ; Removes the trailing backslash, if present.	
SelectedFolder := RegExReplace(SelectedFolder, "\$")
If SelectedFolder <>	;the user selected a folder
{
GuiControl,, PostgresLogPath, %SelectedFolder%
PostgresLogPath := SelectedFolder
IniWrite, %PostgresLogPath%, %thisahk%.ini, LogFolder, postgrespath
Gui, Submit, NoHide
}	
return
;-----------------------------------------------------------------------------------------------------
postgresuserselect:

InputBox, postgresuser,, enter Postgres Username
IniWrite, %postgresuser%, %thisahk%.ini, LogFolder, postgresuser
return
;-----------------------------------------------------------------------------------------------------
postgresdbselect:

InputBox, postgresdb,, enter Postgres Datbase Name
IniWrite, %postgresdb%, %thisahk%.ini, LogFolder, postgresdb
return
;-----------------------------------------------------------------------------------------------------
listAdd( byRef list, item, del="," ) {
  list:=( list!="" ? ( list . del . item ) : item )
  return list
}
;-----------------------------------------------------------------------------------------------------
listDelItem( byRef list, item, del=",") {
  ifEqual, item,, return list
  list:=del . list . del
  StringReplace, list, list, %item%%del%
  StringTrimLeft, list, list, 1
  StringTrimRight, list, list, 1
  return list
}
;-----------------------------------------------------------------------------------------------------
reload:
reload
return
;-----------------------------------------------------------------------------------------------------
Exit:
exitapp
return
;-----------------------------------------------------------------------------------------------------
SuspendHotkey:
suspend,toggle
return
;-----------------------------------------------------------------------------------------------------
GetMHSettings():
{  
   Gui, Add, Text, x10  y5 w120 h20 Center, Select Folder Location
   Gui, Add, Text, x140 y5 w150 h20 Center, Folder Location
   Gui, Add, Button, x5 y20 w150 h20 gPostgresBinFolderSelect center, Postgres Binary Folder
   Gui, Add, Edit, x160 y20 w520 h20 vPostgresLogpath, %PostgresLogpath%
   Gui, Add, Button, x5 y40 w150 h20 gStarsHHFolderSelect  center, Poker Stars HH Folder
   Gui, Add, Edit, x160 y40 w520 h20 vStarsHHLogFolderPath, %StarsHHLogFolderPath%
   Gui, Add, Button, x5 y60 w150 h20 gFullTiltHHFolderSelect   center, Full Tilt HH Folder
   Gui, Add, Edit, x160 y60 w520 h20 vFullTiltHHLogFolderPath, %FullTiltHHLogFolderPath%
   
   Gui, Add, Text, x5  y120 w150 h20 right, Postgres User Name:
   Gui, Add, Edit, x160 y120 w100 h20 vpostgresuser, %postgresuser%
   Gui, Add, Text, x5  y140 w150 h20 right,  Postgres Database:
   Gui, Add, Edit, x160 y140 w100 h20 vpostgresdb, %postgresdb%

   Gui, Add, Text, x5 y160 w150 h20 right, Hotkey "mark current Hand" :
   Gui, Add, HotKey, x160 y160 w100 h20 vHK_mark, %HK_mark%
   Gui, Add, Text, x5 y180 w150 h20 right, Hotkey "process sql":
   Gui, Add, HotKey, x160 y180 w100 h20 vHK_sql, %HK_sql%  

   Gui, Add, Button, w40 h30, OK  ; The label ButtonOK (if it exists) will be run when the button is pressed.
Gui, Show,, Markhand 
return
ButtonOK:
GuiClose:
GuiEscape:
Gui, Submit
IniWrite, %postgresdb%, %thisahk%.ini, LogFolder, postgresdb
IniWrite, %postgresuser%, %thisahk%.ini, LogFolder, postgresuser
IniWrite, %PostgresLogPath%, %thisahk%.ini, LogFolder, postgrespath
IniWrite, %FullTiltHHLogFolderPath%, %thisahk%.ini, LogFolder, FullTiltHHPath
IniWrite, %StarsHHLogFolderPath%, %thisahk%.ini, LogFolder, StarsHHPath
IniWrite, %HK_sql%, %thisahk%.ini, LogFolder, HK_sql
IniWrite, %HK_mark%, %thisahk%.ini, LogFolder, HK_mark
return
}
;---------------------------------------------------------------------------------------------------
deletetext:
MsgBox, 4,, Delete existing file gamenumbers.txt? (press Yes or No)
IfMsgBox Yes
    FileDelete, gamenumbers.txt
return
;---------------------------------------------------------------------------------------------------
Script: Mark Current Hand Quote
11-08-2010 , 06:39 PM
this is just what iv been looking for..
wish i knew more about computers tho!

i downloaded from link on pg 1.

markhand with 4 folders inside.
AHK file
config settings
jpeg image
doc file

iv tried extracting, opening,saving..
cant get the actual program to open..
just the image of what i should see?

thanks for the help.. and what i hope is an amazing poker tool!
Script: Mark Current Hand Quote
11-10-2010 , 09:17 PM
I am also getting the "gamenumbers.txt" does not exist error.

Can someone confirm if this should be run from C:\Root\ or the postgresq bin folder, as reading the thread there is conflicting advice.
I've tried both.

Sounds like the same issue as furio.

Any help would be appreciated.
Script: Mark Current Hand Quote
11-10-2010 , 10:40 PM
MUFC LUHG, run the latest version posted from C:\
And does gamenumbers.txt exist, did you save any handnumbers first? I can always try helping through teamviewer, my contacts are on the profile page, PM is good enough too.
Script: Mark Current Hand Quote
11-11-2010 , 03:45 PM
Quote:
Originally Posted by Max1mums
MUFC LUHG, run the latest version posted from C:\
And does gamenumbers.txt exist, did you save any handnumbers first? I can always try helping through teamviewer, my contacts are on the profile page, PM is good enough too.
I've created the gamenumbers.txt manually, now when I press ctr-F1 (the command to start marking hands right?) a cmd prompt appears asking for the postgres password: -

Code:
C:\>"C:\Program Files\PostgreSQL\8.4\bin\psql.exe" "holdemmanager" "postgres"  0
<"C:\temp.txt"
Password for user postgres:
Script: Mark Current Hand Quote

      
m