Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-16-2006, 09:33 PM
TheIrishThug TheIrishThug is offline
Senior Member
 
Join Date: Jan 2005
Location: Belligerent and numerous
Posts: 1,819
Default 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 &lt; %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 /,\,,:,*,?,&lt;,&gt;,|
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, "&lt;"
StringReplace, Word, Word, "&lt;", , All
IfInString, Word, "&gt;"
StringReplace, Word, Word, "&gt;", , 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 &lt; 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 &amp; mask) &gt;&gt; 8 * (A_Index - 1))
mask := mask &lt;&lt; 8 ; Set it up for isolation of the next byte.
}
}
</pre><hr />
Reply With Quote
  #2  
Old 08-17-2006, 03:10 AM
cph_vice cph_vice is offline
Junior Member
 
Join Date: Aug 2006
Posts: 11
Default 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.
Reply With Quote
  #3  
Old 08-17-2006, 06:46 AM
TheIrishThug TheIrishThug is offline
Senior Member
 
Join Date: Jan 2005
Location: Belligerent and numerous
Posts: 1,819
Default Re: The Absolute Solution - Datamining

After "Code: &lt;horizontal line&gt;" to before "&lt;horizontal line&gt;".
Reply With Quote
  #4  
Old 08-17-2006, 07:11 AM
TheMetetron TheMetetron is offline
Senior Member
 
Join Date: Oct 2004
Location: Blog Updated Dec 1st
Posts: 6,839
Default Re: The Absolute Solution - Datamining

Thanks.
Reply With Quote
  #5  
Old 08-17-2006, 02:40 PM
Roland Roland is offline
Senior Member
 
Join Date: Mar 2005
Location: Norwich, UK
Posts: 2,703
Default Re: The Absolute Solution - Datamining

Nice work with the Gui there.
Reply With Quote
  #6  
Old 08-17-2006, 02:47 PM
cph_vice cph_vice is offline
Junior Member
 
Join Date: Aug 2006
Posts: 11
Default Re: The Absolute Solution - Datamining

sorry too complicated for me, could'nt get it to work. But thanks anyway...
Reply With Quote
  #7  
Old 08-17-2006, 03:13 PM
TheIrishThug TheIrishThug is offline
Senior Member
 
Join Date: Jan 2005
Location: Belligerent and numerous
Posts: 1,819
Default 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 &gt; Save Link As...
Reply With Quote
  #8  
Old 08-17-2006, 03:16 PM
Roland Roland is offline
Senior Member
 
Join Date: Mar 2005
Location: Norwich, UK
Posts: 2,703
Default 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.
Reply With Quote
  #9  
Old 08-17-2006, 03:26 PM
cph_vice cph_vice is offline
Junior Member
 
Join Date: Aug 2006
Posts: 11
Default 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]
Reply With Quote
  #10  
Old 08-17-2006, 04:04 PM
philnewall philnewall is offline
Senior Member
 
Join Date: Apr 2003
Posts: 799
Default 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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.