My question is, why foldedcardscheck is activated only once?
Specifically, if the new window is activated, the subroutine is triggered, but if the active window doesn't change, the gosub isn't triggered anymore. Why? I don't get it
Code: Select all
loop {
sathwnd := WinExist("StackAndTile ahk_class AutoHotkeyGUI")
winwaitnotactive, % "ahk_id " winExist("A")
mousegetpos,,,id
WinGetClass, windowClass, ahk_id %id%
if (windowClass = "PokerStarsTableFrameClass" OR windowClass = "Antares Game Client Window Class")
{
if (lastID)
{
IPC_Send(sathwnd, "ignoretable=" . Lastid)
WinGetTitle, prevIgnoredTitle, ahk_id %lastId%
winmove, ahk_id %lastID%,, x,y,w,h
}
wingetpos, x,y,w,h, ahk_id %id%
IPC_Send(sathwnd, "ignoretable=" . id)
WinGetTitle, actIgnoredTitle, ahk_id %Id%
winmove, ahk_id %id%,, 421, 156, 1016, 727
WinActivate, ahk_id %id%
gosub, foldedcardscheck
if (windowClass = "PokerStarsTableFrameClass" OR windowClass = "Antares Game Client Window Class")
lastID := id
}
ToolTip, %prevIgnoredTitle% actual: %actIgnoredTitle%
}
Return
foldedcardscheck:
WinGetClass, zoomedClass, ahk_id %id%
;MsgBox, %zoomedClass%
;MsgBox, %zoomedTitle% %zoomedClass%, Debug
WinGetPos, zoomedX, zoomedY,,, ahk_id %id%
;msgbox, %zoomedX% , %zoomedY% , %zoomedClass%
If (zoomedX = 421 AND zoomedY = 156 AND zoomedClass = "PokerStarsTableFrameClass")
{
PixelGetColor, foldedCards, 473, 485
;tooltip, %foldedcards%
msgbox, %foldedcards%
/*
if (foldedCards = "0x1B1B1B") ; allora ho foldato
{
mousegetpos,,,zoomedId
IPC_Send(sathwnd, "stacktable=" . zoomedId)
IPC_Send(sathwnd, "ignoretable=" . zoomedId)
}
*/
}
Return