I tried everything but it still doesn't work. I have black theme and I reset table size to default. Have Windows 7.
My script:
Code:
#NoEnv
#Persistent
SetBatchLines -1
CheckTime := 500 ; Check every n MilliSeconds
sitin_x := 679
sitin_y := 485
timebank_x := 442
timebank_y := 459
_FILE := "C:\Users\MyName\AppData\Local\PokerStars.EU\PokerStars.log.0"
;_FILE := "E:\sitout.txt"
SysGet, border, 32
SysGet, caption, 4
SetTimer, FILE_CHECK, %CheckTime%
return
FILE_CHECK:
If (_NEWLINES := CheckFile(_FILE))
{
;msgbox, %_NEWLINES%
Loop, Parse, _NEWLINES, `n
{
if(regExMatch(a_loopfield, "MSG_0x000A-T\s\w{8}\s(\w{8})\s", m))
{
;msgbox, %m1%
PostStarsClick(sitin_x, sitin_y, ("0x" . m1))
}
else if (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{8}\s(\w{8})", m))
{
;msgbox, %m1%
PostStarsClick(timebank_x, timebank_y, ("0x" . m1))
}
}
;msgbox, %m1%
}
Return
CheckFile(File) {
; THX Sean for File.ahk : http://www.autohotkey.com/forum/post-124759.html
Static CF := "" ; Current File
Static FP := 0 ; File Pointer
Static OPEN_EXISTING := 3
Static GENERIC_READ := 0x80000000
Static FILE_SHARE_READ := 1
Static FILE_SHARE_WRITE := 2
Static FILE_SHARE_DELETE := 4
Static FILE_BEGIN := 0
BatchLines := A_BatchLines
SetBatchLines, -1
If (File != CF) {
CF := File
FP := 0
}
hFile := DllCall("CreateFile"
, "Str", File
, "Uint", GENERIC_READ
, "Uint", FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE
, "Uint", 0
, "Uint", OPEN_EXISTING
, "Uint", 0
, "Uint", 0)
If (!hFile) {
CF := ""
FP := 0
SetBatchLines, %BatchLines%
Return False
}
DllCall("GetFileSizeEx"
, "Uint", hFile
, "Int64P", nSize)
If (FP = 0 Or nSize <= FP) {
FP := nSize
SetBatchLines, %BatchLines%
DllCall("CloseHandle", "Uint", hFile) ; close file
Return False
}
DllCall("SetFilePointerEx"
, "Uint", hFile
, "Int64", FP
, "Uint", 0
, "Uint", FILE_BEGIN)
VarSetCapacity(Tail, Length := nSize - FP, 0)
DllCall("ReadFile"
, "Uint", hFile
, "Str", Tail
, "Uint", Length
, "UintP", Length
, "Uint", 0)
DllCall("CloseHandle", "Uint", hFile)
VarSetCapacity(Tail, -1)
FP := nSize
SetBatchLines, %BatchLines%
Return Tail
}
relStarsClientPoint(id, ByRef x, ByRef y)
{
global border
global caption
rw := 792
rh := 546
WinGetPos, , , w, h, ahk_id%id%
w := w - (2*border)
h := h - (2*border) - caption
x := Floor( (x / rw ) * w )
y := Floor( (y / rh) * h )
}
;Juks rocks
PostLeftClick(x, y, table_id, activate=0) {
; ### JUK: Send the down left click, then the mouse-up messages.
; NOTE: This is relative to the top left of the client area and NOT the top left of the
; window (ie: It *doesn't* include the title-bar like AHK's MouseClick does!!!).
If activate
WinActivate, ahk_id%table_id%
PostMessage, 0x201, 0x0001, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
}
PostStarsClick(x, y, id)
{
relStarsClientPoint(id, x, y)
PostLeftClick(x, y, id)
}
I got coordinates by using windows spy (substracted 8 from x and 30 from y). A picture where mouse cursor was in the middle of the time bank box:
If i uncomment all 4 msgbox lines it starts to pop up windows but script never pushed any button.
Oh, I also tried with Nova theme and got the same coordinates as OditeRussia but it didn't work.
Any suggestions?
Last edited by gaan64; 12-26-2012 at 12:22 AM.