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

06-18-2012 , 05:33 PM
Quote:
Originally Posted by MachtiSonni
Any chance of having a full package re-released somewhere with all the new code? I think the download-link for the original .zip in the first post has gone cold. I'm having trouble getting the script to work and I think I might be missing something from the original package.
I haven't tried the new script, but I've compiled the .ahk file and the .exe in a .zip.

Just run the executable in admin mode and it should work

Link: Script(@dropbox)
Script: Mark Current Hand Quote
06-18-2012 , 10:49 PM
Is this script only compatible with HEM database?
Script: Mark Current Hand Quote
06-20-2012 , 04:34 PM
Hey,

I've got the newest script and it's on HEM2-mode. I've compiled an .exe of it and it's running on Admin mode on Vista. However, when I try to write the hands to database, I get an error stating:

Error: Failed attempt to launch program or doument:
Action: <temp.bat>
Params: <>

The current thread will exit.

Specifically: The system cannot find the file specified.


Line#
---> 165: Return


So, the script cannot find temp.bat. What could be wrong?

-Machti
Script: Mark Current Hand Quote
06-28-2012 , 10:45 AM
hey guys

i have the correct folders of bin and HH's of stars and i'm running it as admin, but stiil appear the message saying the the gamenumbers.txt file doesn't exist :S

AAnyone knows what can the problem be?
Script: Mark Current Hand Quote
08-10-2012 , 07:15 AM
Same problem for me, all folders set correctly with the newest script running as admin, but same error message. Searched the thread for any solutions, it doesn't work =/
Script: Mark Current Hand Quote
08-10-2012 , 10:36 AM
Quote:
Originally Posted by YNC
Same problem for me, all folders set correctly with the newest script running as admin, but same error message. Searched the thread for any solutions, it doesn't work =/
Which version of postgres are you using?
Script: Mark Current Hand Quote
08-11-2012 , 11:05 AM
8.3 as I wrote you in the PM
Does it just work with 8.4?
Script: Mark Current Hand Quote
08-11-2012 , 02:03 PM
"File cannot be found" is not a postgres problem at all, it is usually running the script as admin/placing the script into a folder with write permission/specifying correct paths in the script options issue, it failed for handhistories placed in the AppData folder for someone, using different mark hand hotkey may help too.
Script: Mark Current Hand Quote
09-03-2012 , 07:00 AM
I installed everything confirm guideline. But I still getting the popup gamenumbers.txt file doesnt exist or file is empty. Got anyone a solution for this?
Same problem as Perucao and YNC.
Script: Mark Current Hand Quote
09-06-2012 , 10:48 AM
Bump: if someone can help me out I would really appreciate it.
Script: Mark Current Hand Quote
09-30-2012 , 12:51 PM
Quote:
Originally Posted by chaserr
I installed everything confirm guideline. But I still getting the popup gamenumbers.txt file doesnt exist or file is empty. Got anyone a solution for this?
Same problem as Perucao and YNC.
I have the same problem as chaser, 50$ reward for anyone who can fix this!
Script: Mark Current Hand Quote
09-30-2012 , 01:20 PM
haagel, use the latest version from the previous page, read post №208.
Script: Mark Current Hand Quote
10-18-2012 , 02:45 PM


??????????

Just started using this and dont know how to fix this error????
Script: Mark Current Hand Quote
10-20-2012 , 08:02 AM
Thread dead?
Script: Mark Current Hand Quote
12-21-2012 , 01:42 PM
heeeeeeeeeeeeeeeeelp someone has a working script?
Script: Mark Current Hand Quote
12-21-2012 , 05:49 PM
Any updates on this script?
Script: Mark Current Hand Quote
12-21-2012 , 06:48 PM
The latest version seems to work fine still guys, it was posted on the previous page.
Script: Mark Current Hand Quote
12-26-2012 , 03:41 PM
Got it working! TY
Script: Mark Current Hand Quote
01-08-2013 , 08:12 AM
Has anyone got this working for HM2?

I've tried all the scripts on this page and the previous one, I always get some kind of error the same as the ones that have already been mentioned.

Any help much appreciated.
Script: Mark Current Hand Quote
01-09-2013 , 09:21 AM
Anyone know how to fix the error message I posted above?
Script: Mark Current Hand Quote
01-09-2013 , 10:00 AM
SCOOOOP23, read the thread?
Script: Mark Current Hand Quote
01-09-2013 , 10:31 AM
ok I tryed all that was said before maybe I was doing something wrong, ill try again when I got time

Last edited by SCOOOOP23; 01-09-2013 at 10:38 AM.
Script: Mark Current Hand Quote
01-09-2013 , 10:51 AM
Quote:
Originally Posted by Max1mums
You can select if you want to use the script for HM1 or HM2 in this version
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,  showgui
Menu, Tray, Default, Change Settings
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, Hotkeys, HK_mark, %A_Space%
IniRead, HK_sql , %thisahk%.ini, Hotkeys, HK_sql , %A_Space%
IniRead, HM1, %thisahk%.ini, Settings, HM1, 0
IniRead, HM2, %thisahk%.ini, Settings, HM2, 0

gosub,buildgui
If (!HK_mark || !HK_sql)
{
  ; gosub GetMHSettings
 Gui, Show,, Markhand 
}

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%
class=PokerStarsTableFrameClass
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
 if !instr(filelist,id) 
 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
{
if HM1
{
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
}
else
if HM2
{
sql1=insert into hand_markings (marking_id, gamenumber, site_id)
sql2= select 1, gamenumber, pokersite_id from pokerhands 
sql3= Where gamenumber = 
sql4=and (1, gamenumber) not in (select marking_id, gamenumber from hand_markings);
sql5=update hand_markings set marking_id = 1 where gamenumber = 
sq16=;
Loop, Parse, numbers, `n,
{
if A_loopField
FileAppend, %sql1% %sql2% %sql3% %A_loopField% %sql4% %sql5% %A_loopField% %sq16% `n, temp.txt
}
}
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)
  fileread,tempnum,gamenumbers.txt
  if !instr(tempnum,num)
  FileAppend, %num%`n, gamenumbers.txt
  tempnum=
  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,"Hand #")
 {
  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 || instr(title,"Sit & Go")>0 || instr(title,"Sit&Go")>0 || instr(title,"table")>0 || 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
{
 if instr(file,"Cap")
 {
  stringmid,cap,file,instr(file,"-","",instr(file,"/")),instr(file,"-","",instr(file,"Cap","",0))-instr(file,"-","",instr(file,"/"))+2
  stringreplace,file,file,%cap%,
 }
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
}
else
{
if site=Stars
{
 stringtrimleft,file,title,instr(title,A_space,"",instr(title,"Tournament"))
 stringleft,file,file,instr(file,"Table","",0)-2
}
else
{
 stringleft,file,title,InStr(title, "-","",instr(title,"Table"))-2
 stringleft,file1,title,InStr(title, ")","",0)
}
}
loop %dir%\*.*
{
if (instr(A_LoopFileName,file)>0) && !(instr(A_LoopFileName,"Summary")>0)
return dir "\" A_LoopFileName
}
if instr(title,"Table")
{
if file1
{
 loop %dir%\*.txt
 {
  if instr(A_LoopFileName,file1)>0 & !instr(A_LoopFileName,"Summary")>0
  return dir "\" A_LoopFileName
 }
}
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
{
 if instr(file,"Cap")
 {
  stringmid,cap,file,instr(file,"-","",instr(file,"/")),instr(file,"-","",instr(file,"Cap","",0))-instr(file,"-","",instr(file,"/"))+2
  stringreplace,file,file,%cap%,
 }
 StringReplace, file, file, USD -,- USD,
 StringReplace, file, file, EUR -,- EUR,
}
loop %dir%\*.txt
{
if instr(A_LoopFileName,file)
return dir "\" A_LoopFileName
}
EnvAdd, date, +2, d
stringleft,file,title, InStr(title, "-","",0)-2
file := ext . SubStr(date, 1, 8) . A_space . file
StringReplace, file, file, /,-,
if site=Stars
{
 if instr(file,"Cap")
 {
  stringmid,cap,file,instr(file,"-","",instr(file,"/")),instr(file,"-","",instr(file,"Cap","",0))-instr(file,"-","",instr(file,"/"))+2
  stringreplace,file,file,%cap%,
 }
 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)
if site=Stars
game=PokerStars Hand #
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
;-----------------------------------------------------------------------------------------------------
buildgui:
   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, Radio, x60 y90 w50 h20 Checked%HM1% vHM1, HM1
   Gui, Add, Radio, x115 y90 w50 h20 Checked%HM2% vHM2, HM2

   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.
return

showgui:
Gui, Show,, Markhand 
return

ButtonOK:
GuiClose:
GuiEscape:
Gui, Submit,nohide
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, Hotkeys, HK_sql
IniWrite, %HK_mark%, %thisahk%.ini, Hotkeys, HK_mark
if HK_mark
HotKey, %HK_mark%, l_markhand
if HK_sql
HotKey, %HK_sql%, l_processsql
if HM1
IniWrite, %HM1%, %thisahk%.ini, Settings, HM1
if HM2
IniWrite, %HM2%, %thisahk%.ini, Settings, HM2
Gui,Cancel
return
;---------------------------------------------------------------------------------------------------
deletetext:
MsgBox, 4,, Delete existing file gamenumbers.txt? (press Yes or No)
IfMsgBox Yes
    FileDelete, gamenumbers.txt
return
;---------------------------------------------------------------------------------------------------
Where do you select/ change it to HM2 option in this script??

Thanks
Script: Mark Current Hand Quote
01-09-2013 , 10:57 AM
Nevermind figured it
Script: Mark Current Hand Quote
01-10-2013 , 07:03 AM
Ok so I right click on desktop and select create new text file - paste the script into it and save it as Mark-Hands.ahk, then I convert it into a Mark-Hands.exe file - I right click the .exe and select properties>> compatibility tab>> tick run as admin, I select the security tab and see that it has full permission's, then I create a folder on the desktop and put the .exe file in the folder - right click the folder and see that it has full permission's, launch the program and fill in all the options...

Postgres Binary Folder: C:\postgreSQL\bin

Pokerstars HH Folder: C:\Stars-HH\SCOOOOP23

HM1 or HM2: HM2

Postgres User Name: postgres

Postgres Database: postgres

Hotkey "mark current hand" F1

Hotkey "process .sql" SHIFT + F1

I click OK and it creates a .ini file which I put in the folder also, I start a session and start marking hands then when I finish I hit the hotkey to process the .sql and I get the same error pop up saying it cannot run temp.bat

Can you see where I am going wrong here ?

Thanks for your help
Script: Mark Current Hand Quote

      
m