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

03-12-2011 , 03:42 AM
Quote:
Originally Posted by matt57225
ty I tested it out and it did not mark any hands that I didn't want, but it did not mark about 1/4 of the hands I wanted to mark.
re: rush cash game version

After further testing, I would say it doesn't mark about 1/2 of the hands I try to mark.

Last edited by matt57225; 03-12-2011 at 03:53 AM.
Script: Mark Current Hand Quote
03-12-2011 , 10:05 AM
Quote:
Originally Posted by mckrogh
Does this work for cereus network?
So does this work with Cereus?
Script: Mark Current Hand Quote
03-14-2011 , 12:45 AM
Or rather,.. can you add functionality for Cereus please?

Quote:
Originally Posted by abcp0ker
So does this work with Cereus?
Script: Mark Current Hand Quote
03-15-2011 , 06:42 AM
Quote:
Originally Posted by michty6
Hi

I just tried this and got the following errors (after i had marked my hands) when I tried the 2nd hotkey to process the marked hands:

Any ideas?
Quote:
Originally Posted by Max1mums
michty6, Postgres wasn't running or you have it blocked with firewall i guess.
Thanks for the response. I still cant get this to work. I have HEM running, have it importing, have the AHK script in the postgres folder and keep getting the same error message. I only have windows firewall and checked and postgres is unblocked. Would it matter that Im using postgres v9.0? Or that my database is run through port 5433 (not 5432 like the error message keeps trying to connect to)?
Script: Mark Current Hand Quote
03-18-2011 , 01:33 AM
Bumpity bump
Script: Mark Current Hand Quote
03-18-2011 , 07:32 AM
michty6, can't you try using port 5432 for postgres?
Script: Mark Current Hand Quote
03-20-2011 , 06:43 AM
Yeh how do I do that? I tried just changing the port on HEM Database Management and tried changing it in PG Admin and neither of those worked...?
Script: Mark Current Hand Quote
03-27-2011 , 04:12 AM
I'm a newbie to these AHK scripts, so I just wanted to ask, how is this script any different from the HEM feature of marking hands?

Also, if I use this script to mark hands, do I need to keep HEM open that time?
Script: Mark Current Hand Quote
03-29-2011 , 02:45 AM
Quote:
Originally Posted by fizzypants
I'm a newbie to these AHK scripts, so I just wanted to ask, how is this script any different from the HEM feature of marking hands?

Also, if I use this script to mark hands, do I need to keep HEM open that time?
This script is different from the marking feature built into HEM in that HEM will only mark the PREVIOUS hand. This script marks the CURRENT hand you are involved in.

This is much more useful while multitabling because most people will never be able to remember which table they wanted to mark a hand on while they wait for it to get imported, and in that time they might have missed a hand and thus they will never actually get to mark the proper hand.
Script: Mark Current Hand Quote
04-01-2011 , 11:30 AM
Im a software newb so sorry. How exactly do you install this program. I downloaded the rapidshare file from the OP and unzipped it but I dont know what to do now.
Script: Mark Current Hand Quote
04-03-2011 , 11:02 AM
download and install autohotkey
http://www.autohotkey.com/
and run markhand.ahk
Script: Mark Current Hand Quote
04-12-2011 , 06:57 AM
Installation process seemed to all go well for me. But ive just tried to use it and nothing seems to be happening.

I press the save current hand hotkey i assigned, then press the other to put it in HM after the hand has been played and i get no hands marked in HM.

Where is the text file with the hand numbers saved to? the same place i put the script of in the postgres bin folder? I cant find it.

Would appreciate any help i can get
Script: Mark Current Hand Quote
04-12-2011 , 07:18 AM
Ignore my last post. Seems to be working fine now.

Absolutely brilliant script. Who i send donations to on PS?
Script: Mark Current Hand Quote
04-14-2011 , 08:00 PM
how is this script different than the "mark hand" feature of HEM? which is better and why?
Script: Mark Current Hand Quote
05-26-2011 , 12:43 AM
For some reason the script isn't working for me. I'll list the things I have tried.

used the script on page 5.
marked a few hands then tried to process it but get the gamenumbers.txt doesn't exist error.
changed the postgres folder so that I can't create files in there.

C:\Program Files (x86)\PostgreSQL\8.3\bin
C:\Users\User\AppData\Local\PokerStars\HandHistory


I use ctrl+x for marking ctrl+c for processing

the scripts are located in the bin folder of postgres
Script: Mark Current Hand Quote
05-31-2011 , 06:02 PM
For those who still can't get this wonderful script to work.... just make sure that you use the default password for your postgres user , i had changed mine to something else and the script just wouldn't work. As soon as i set the default password it worked like a charm. Thank you once again Max1mus.
Script: Mark Current Hand Quote
08-13-2011 , 11:22 PM
This script going to work with HM2?
Script: Mark Current Hand Quote
08-23-2011 , 08:55 AM
higuys!
gamenumbers.txt doesnt exist or empty.
i made it manually so its exist but its empty. what i need to copy to it? thanks so much!
Script: Mark Current Hand Quote
09-06-2011 , 08:44 AM
Quote:
Originally Posted by wayneking7
This script going to work with HM2?
I'm wondering this too...
Script: Mark Current Hand Quote
10-30-2011 , 11:56 AM
Does this still work? Any updated version or the one in the OP good?
Script: Mark Current Hand Quote
10-30-2011 , 02:42 PM
Code:
#noenv
#SingleInstance, Force
SetWinDelay,-1
settitlematchmode,2

StringTrimRight, thisahk, A_ScriptName, 4
SetWorkingDir %A_ScriptDir%

Menu, Tray, NoStandard
Menu, Tray, Add, Reload, Reload
Menu, Tray, Add, Change Settings,  GetMHSettings()
Menu, Tray, Add, Suspend Hotkeys, SuspendHotkey
Menu, Tray, Add, Exit, Exit
Gui, Submit

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 or !HK_mark or !HK_sql)
   gosub GetMHSettings()
   
   
HotKey, %HK_mark%, l_markhand
HotKey, %HK_sql%, l_processsql

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

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) 
 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
IfExist, %PostgresLogPath%\temp.txt
FileDelete, %PostgresLogPath%\temp.txt
IfExist, %PostgresLogPath%\temp.bat
FileDelete, %PostgresLogPath%\temp.bat
FileRead, numbers, gamenumbers.txt
sql1=Update pokerhands
sql2= Set mark_id = 1
sql3= Where gamenumber = 
sql4=AND handtimestamp > localtimestamp - interval '5 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, cd %PostgresLogPath%`npsql.exe %postgresdb% %postgresuser% <temp.txt`npause`n, temp.bat
Filemove, temp.txt, %PostgresLogPath%
Filemove, temp.bat, %PostgresLogPath%
run %PostgresLogPath%\temp.bat
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) 
{
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
Folder := RegExReplace(Folder, "\\$")  ; Removes the trailing backslash, if present.	
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
Folder := RegExReplace(Folder, "\\$")  ; Removes the trailing backslash, if present.	
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
Folder := RegExReplace(Folder, "\\$")  ; Removes the trailing backslash, if present.	
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
;-----------------------------------------------------------------------------------------------------
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, x360 y180 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
Gui, Destroy
return
}

;-----------------------------------------------------------------------------------------------------
SuspendHotkey:
SendInPut, {CTRLDOWN}2{CTRLUP}
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-30-2011 , 02:43 PM
Quote:
Originally Posted by wayneking7
This script going to work with HM2?
though I was alpha testing they seem to be unable to get me a beta-license. Will tell you asap.
Script: Mark Current Hand Quote
10-31-2011 , 05:30 AM
Is there a version for Party Poker? AKA, would it be too difficult to make it work in Party ?
Script: Mark Current Hand Quote
10-31-2011 , 05:57 PM
Quote:
Originally Posted by wayneking7
This script going to work with HM2?
HM2 has new DB-Layout. Trying to look into this next week or so.
Script: Mark Current Hand Quote
11-04-2011 , 02:27 PM
any update on hm2 compatability?
Script: Mark Current Hand Quote

      
m