#1
|
|||
|
|||
The Absolute Solution - Datamining
The Absolute Solution
This program will datamining Absolute Poker for you. Hand Histories are saved as [Date]_[Table].txt. The hand histories will default to save into the same folder that the program is saved, this can be changed by using the "Select Save Folder" button. When "Only Observed Hands" is selected, any hand you play in will be skipped over. As a hand is loaded, the vital information will be added to the list on the window. Hands are sorted by hand number, therefore, the last hand loaded may not be the last hand on the list. Double clicking on a hand that is listed on the window will bring up a second window with the text of that hand. Note: Opening and Closing tables. This is not part of the program yet, but I will be working on it. I still need to look into the iWitness code and see what will need to be changed. The following is the AutoHotkey code. You will not need to change any parts of the text. Copy the text and paste it into Notepad. Save the file as [name].ahk (make sure "Save as type:" is All Files so that the .ahk will not be followed by a .txt). <font class="small">Code:</font><hr /><pre> ; _____________________ ; / ; The Absolute Solution ; By TheIrishThug ; Date: 8/16/2006 ; v0.5 ; \_____________________ ; ------ Check AHK version ahk_version = 1.0.44.09 if A_AhkVersion < %ahk_version% { msgbox, 4, , % "This script needs AutoHotkey version " . ahk_version . " or newer (you are using version" . A_AhkVersion . ")." . "`nScript will exit.`n`nGo to web page and download new version now?" IfMsgBox, Yes Run, http://www.autohotkey.com ExitApp } DetectHiddenWindows, On OnMessage(0x24, "WM_GETMINMAXINFO") ; ------ Variables /* [Folder] LastSaved= [Gui] MainX= MainY= MainH=400 MainW=275 */ ; ------ ; ------ Collect Variables IniRead, LastSavedFolder, %A_ScriptFullPath%, Folder, LastSaved, %A_ScriptDir% IniRead, LastGuiX, %A_ScriptFullPath%, Gui, MainX, Center IniRead, LastGuiY, %A_ScriptFullPath%, Gui, MainY, Center IniRead, LastGuiH, %A_ScriptFullPath%, Gui, MainH, 400 IniRead, LastGuiW, %A_ScriptFullPath%, Gui, MainW, 275 IfEqual, LastSavedFolder, LastSavedFolder := A_ScriptDir FormatTime, TimeStamp, , MM-dd-yy BaseFileName := SwitchDirSting(LastSavedFolder . "\" . TimeStamp . "_", "Convert") HandsSaved = 0 MyHandsSkipped = 0 SetTimer, Mine, 180000 SetTimer, Mine, Off ; ------ Gui Gui, +Resize -Maximize ListViewH := LastGuiH - 120 ListViewW := LastGuiW - 30 Gui, Add, ListView, xp+8 yp+10 w%ListViewW% h%ListViewH% -Hdr Sort vTheListView, Hand Number|Winner|Pot|Table LV_ModifyCol(4, 0) GapAfterListView := ListViewH +10 Gui, Add, CheckBox, xp+37 yp+%GapAfterListView% vOnlyObservedHands, Only Observed Hands Gui, Add, Button, xp-35 yp+30 w70 gStartStopMine Hidden, Stop Gui, Add, Button, xp yp w70 gStartStopMine, Start Gui, Add, Button, xp+80 yp-5 gSelectFolder, Select`nSave Folder Gui, Add, Button, xp+85 yp+5 w70 gClose_Gui, Close Gui, Show, x%LastGuiX% y%LastGuiY% w%LastGuiW% h%LastGuiH%, The Absolute Solution Return Close_Gui: GuiClose: MouseGetPos, , , WinID WinGetPos, LastGuiX, LastGuiY, LastGuiW, LastGuiH, ahk_id %WinID% IniWrite, %LastGuiX%, %A_ScriptFullPath%, Gui, MainX IniWrite, %LastGuiY%, %A_ScriptFullPath%, Gui, MainY IniWrite, %LastGuiH%, %A_ScriptFullPath%, Gui, MainH IniWrite, %LastGuiW%, %A_ScriptFullPath%, Gui, MainW IniWrite, %LastSavedFolder%, %A_ScriptFullPath%, Folder, LastSaved ExitApp Return SelectFolder: FileSelectFolder, LastSavedFolder, , 1, The Absolute Solution IniWrite, %LastSavedFolder%, %A_ScriptFullPath%, Folder, LastSaved BaseFileName := SwitchDirSting(LastSavedFolder . "\" . TimeStamp . "_", "Convert") Return ListClick: If A_GuiEvent = DoubleClick { ControlGet, GuiSelected, List, Count Focused, SysListView321, The Absolute Solution ahk_class AutoHotkeyGUI If GuiSelected != 0 { ControlGet, GuiRowText, List, Focused, SysListView321, The Absolute Solution ahk_class AutoHotkeyGUI StringSplit, GuiRowArray, GuiRowText, %A_Tab% GuiHand := GuiRowArray1 GuiTable := GuiRowArray4 RecordHand = 0 TextOfHand := "" fname := SwitchDirSting(BaseFileName . GuiTable . ".txt", "UnConvert") Loop, Read, %fname% { IfInString, A_LoopReadLine, %GuiHand% RecordHand = 1 If RecordHand = 1 { If (InStr(A_LoopReadLine, "Stage #") = 1 AND InStr(A_LoopReadLine, GuiHand) = 0) Break TextOfHand := TextOfHand . A_LoopReadLine . "`n" } } Gui, 2:Font, S9 Bold Gui, 2:+Owner Gui, 2:Add, Text, x6 y6, Hand Viewer Gui, 2:Font, S8 Norm Gui, 2:Add, Edit, xp yp+30 w300 h200 vHandEdit +ReadOnly, %TextOfHand% Gui, 2:Add, Button, xp+15 yp+215 gHandViewerClose, Close Gui, 2:Add, Button, xp+50 yp gHandViewerCopy, Copy Hand GuiControl, 2: Focus, HandViewerCopy Gui, 2:Show, , Absolute Hand Viewer } } Return GuiSize: Anchor("TheListView", "wh") Anchor("OnlyObservedHands", "y") Anchor("Stop", "y") Anchor("Start", "y") Anchor("Select`nSave Folder", "y") Anchor("Close", "y") Return StartStopMine: GuiControlGet, ControlClicked, , %A_GuiControl% If ControlClicked = Stop { SetTimer, Mine, Off GuiControl, Show, Start GuiControl, Hide, Stop } Else { SetTimer, Mine, On GuiControl, Show, Stop GuiControl, Hide, Start If HandsSaved = 0 GoTo Mine } Return Mine: Gui, Submit, NoHide IfWinExist, Instant Hand History ahk_class Instant Hand History { Loop { IfWinNotExist, Instant Hand History ahk_class Instant Hand History break ControlGet, Table, Choice, , ComboBox1 IfNotInString, Table, All Poker Tables { Control, Choose, 1, ComboBox1 Sleep 200 } ControlFocus, SysListView321 ControlGet, RowNumberOfFocusedOfHand, List, Count Focused, SysListView321, Instant Hand History ahk_class Instant Hand History ControlGet, NumberOfHandsOfIHH, List, Count, SysListView321, Instant Hand History ahk_class Instant Hand History If ( HandsSaved + MyHandsSkipped = 0 ) ControlSend, SysListView321, {Home}, Instant Hand History ahk_class Instant Hand History Else If ( RowNumberOfFocusedOfHand != NumberOfHandsOfIHH ) ControlSend, SysListView321, {Down}, Instant Hand History ahk_class Instant Hand History If (NumberOfHandsOfIHH = HandsSaved + MyHandsSkipped) Break HandMyHand := "" ControlGet, RowText, List, Focused, SysListView321, Instant Hand History ahk_class Instant Hand History StringSplit, RowArray, RowText, %A_Tab% HandNumber := RowArray1 HandTable := RowArray2 HandMyHand := RowArray3 HandWinner := RowArray4 HandPot := RowArray5 ControlGet, ColText, List, Col1, SysListView321, The Absolute Solution ahk_class AutoHotkeyGUI IfInString, ColText, %HandNumber% Continue If HandTable Contains /,\,,:,*,?,<,>,| HandTable := SpecialChr(HandTable) Sleep 200 If ((OnlyObservedHands = 1 AND HandMyHand = "") Or OnlyObservedHands = 0) { ControlGetText, HandText, Edit1 FileName := SwitchDirSting(BaseFileName . HandTable . ".txt", "UnConvert") FileAppend, %HandText%`n`n, %Filename% StringReplace, HandPot, HandPot, $, LV_Add(Col1, HandNumber, HandWinner, "$" . HandPot, HandTable) LV_ModifyCol() LV_ModifyCol(4, 0) HandsSaved++ } Else MyHandsSkipped++ } FormatTime, tempTimeStamp, , MM-dd-yy IfNotEqual, TimeStamp, %tempTimeStamp% { TimeStamp := tempTimeStamp BaseFileName := SwitchDirSting(LastSavedFolder . "\" . TimeStamp . "_", "Convert") } } Return ; ------ Gui 2 Controls HandViewerClose: Gui, 2estroy Return HandViewerCopy: ClipBoard := TextOfHand Return ; ------ Functions SpecialChr(Word) { IfInString, Word, "/" StringReplace, Word, Word, "/", , All IfInString, Word, "\" StringReplace, Word, Word, "\", , All IfInString, Word, ":" StringReplace, Word, Word, ":", , All IfInString, Word, "*" StringReplace, Word, Word, "*", , All IfInString, Word, "?" StringReplace, Word, Word, "?", , All IfInString, Word, "<" StringReplace, Word, Word, "<", , All IfInString, Word, ">" StringReplace, Word, Word, ">", , All IfInString, Word, "|" StringReplace, Word, Word, "|", , All Return Word } SwitchDirSting(PathIn, ConvertOrUnConvert) { If ConvertOrUnConvert = Convert StringReplace, PathIn, PathIn, :\, ?? If ConvertOrUnConvert = UnConvert StringReplace, PathIn, PathIn, ??, :\ Return PathIn } Anchor(ctrl, a, draw = false) { ; v3.2 by Titan static pos sig = `n%A_Gui%:%ctrl%= If !InStr(pos, sig) { GuiControlGet, p, Pos, %ctrl% pos := pos . sig . px - A_GuiWidth . "/" . pw - A_GuiWidth . "/" . py - A_GuiHeight . "/" . ph - A_GuiHeight . "/" } StringTrimLeft, p, pos, InStr(pos, sig) - 1 + StrLen(sig) StringSplit, p, p, / c = xwyh Loop, Parse, c If InStr(a, A_LoopField) { If A_Index < 3 e := p%A_Index% + A_GuiWidth Else e := p%A_Index% + A_GuiHeight m = %m%%A_LoopField%%e% } If draw d = Draw GuiControl, Move%d%, %ctrl%, %m% } WM_GETMINMAXINFO(wParam, lParam) { if not A_Gui ; No GUI window number, so it's not for a GUI window: do nothing. return ; Alter the MINMAXINFO structure's ptMinTrackSize X and Y: InsertIntegerAtAddress(275, lParam, 24, 4) ; X InsertIntegerAtAddress(390, lParam, 28, 4) ; Y return 0 ; MSDN: "If an application processes this message, it should return zero." } InsertIntegerAtAddress(pInteger, pAddress, pOffset = 0, pSize = 4) { mask := 0xFF ; This serves to isolate each byte, one by one. Loop %pSize% ; Copy each byte in the integer into the structure as raw binary data. { DllCall("RtlFillMemory", UInt, pAddress + pOffset + A_Index - 1, UInt, 1 , UChar, (pInteger & mask) >> 8 * (A_Index - 1)) mask := mask << 8 ; Set it up for isolation of the next byte. } } </pre><hr /> |
#2
|
|||
|
|||
Re: The Absolute Solution - Datamining
Hi there thanks alot [img]/images/graemlins/smile.gif[/img] But where exactly should I cut'n paste from and to?
I just cp the whole and get the following error: Error at line 1. Line Text: : Error: The first character above is illegal in an expression. The program will exit. |
#3
|
|||
|
|||
Re: The Absolute Solution - Datamining
After "Code: <horizontal line>" to before "<horizontal line>".
|
#4
|
|||
|
|||
Re: The Absolute Solution - Datamining
Thanks.
|
#5
|
|||
|
|||
Re: The Absolute Solution - Datamining
Nice work with the Gui there.
|
#6
|
|||
|
|||
Re: The Absolute Solution - Datamining
sorry too complicated for me, could'nt get it to work. But thanks anyway...
|
#7
|
|||
|
|||
Re: The Absolute Solution - Datamining
Roland:
Thanks. I always get really nitty with them and spend way to much time checking to see if it has a better aesthetic feel if a button is 5 pixels to the left. vice: link right click the link > Save Link As... |
#8
|
|||
|
|||
Re: The Absolute Solution - Datamining
[ QUOTE ]
Thanks. I always get really nitty with them and spend way to much time checking to see if it has a better aesthetic feel if a button is 5 pixels to the left. [/ QUOTE ] Lmao. That's me exactly. |
#9
|
|||
|
|||
Re: The Absolute Solution - Datamining
Thank you very much, now even a programming fish like me can find out [img]/images/graemlins/wink.gif[/img]
|
#10
|
|||
|
|||
Re: The Absolute Solution - Datamining
Thanks a lot for this. I would pay good money for an Absolute auto-miner if you could get that working.
|
Thread Tools | |
Display Modes | |
|
|