New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars
Hi the new update has stopped the script working, I'm a total noob with this stuff, any1 able to help out?
Was working perfectly for me until I had to move the UK client, anyone know if it's a simple fix? I already changed the .log location but that hasn't seemed to fix it.
I have moved to PS7/UK. I have just tested it on a 2NL table and it works fine for me. I changed two things:
- Used the log custom location: C:\Users\Donkey111\AppData\Local\PokerStars.UK\
- Changed the table theme back to Nova. After the upgrade, PS had changed me to Mercury.
- Used the log custom location: C:\Users\Donkey111\AppData\Local\PokerStars.UK\
- Changed the table theme back to Nova. After the upgrade, PS had changed me to Mercury.
Thanks I thought I had tried this but must have missed 1 folder, thanks. I'm reverted back to PS6 with Black theme and it works perfectly again.
Seems to be great!
Where can I find the lattest script?
Where can I find the lattest script?
Code:
; #### StarsTimebank #### ; AHK version: 1.0.48.05 ; date: August 19,2013 version := "1.02c" ; author: Max1mums (max1mums@overcards.com) #SingleInstance, Force #NoEnv Settitlematchmode, 2 OnExit exitSub StringTrimRight, thisahk, A_ScriptName, 4 SetWorkingDir %A_ScriptDir% StringReplace,AhkVersion,A_AhkVersion,.,,All Menu, Tray, NoStandard Menu, Tray, Add, Gui, menugui Menu, Tray, Add Menu, Tray, Add, Reload, reload Menu, Tray, Default, Gui Menu, Tray, Add Menu, Tray, Add, Edit, Edit Menu, Tray, Add Menu, Tray, Add, Exit, ExitSub OnMessage(0x112,"WM_SYSCOMMAND") WM_SYSCOMMAND(wParam) { if (A_Gui && wParam = 0xF020) ; SC_MINIMIZE { Gui, destroy return 0 } } OnMessage(0x201, "drag") SetBatchLines,1ms SetWinDelay,-1 SysGet, xbord, 32 SysGet, ybord, 33 SysGet, cap, 4 tablequeue= ddlist= ddlist:=ddlist . "Off" . "|" Loop 14 ddlist:=ddlist . A_index . "|" DllCall("dwmapi\DwmIsCompositionEnabled","int*",DwmIsEnabled) gosub,getini CheckTime_file:=800 ; Check every n MilliSeconds CheckTime_pixel:=877 DealinClick_delay:=700 ;;;;;;;;;;;;;;End of init;;;;;;;;;;;;;; settimer,clickwithdelay,133 settimer,dwmcheck,342 if use_file { if !instr(location,"not found")>0 SetTimer, FILE_CHECK, %CheckTime_file% } else { settimer,ClickTimebank,%CheckTime_pixel% if dealin settimer,Clickimback,1563 else settimer,Clickimback,off } return ;----------------------------------------------------------------------------------------------------- dwmcheck: DllCall("dwmapi\DwmIsCompositionEnabled","int*",Dwm) if !(dwm=DwmIsEnabled) gosub,reload 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, %del%%item%%del%,%del%,All StringTrimLeft, list, list, 1 StringTrimRight, list, list, 1 return list } ;----------------------------------------------------------------------------------------------------- removefromlist(byRef list,winid) { Loop, Parse, list, `, { if InStr(A_loopfield,winid) listDelItem(list, A_Loopfield) } return list } ;----------------------------------------------------------------------------------------------------- clickwithdelay: if interval1 is not number interval:=0 else interval:=interval1*1000 Loop, Parse, tablequeue, `, { if !A_loopfield continue stringsplit,tab,A_loopfield,- if (abs(tab2-A_TickCount)>interval) ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI { WinGetPos,,,,h,ahk_id%tab1% if h>100 PostClickStars(tab3, tab4, tab1, 0) listDelItem(tablequeue, A_Loopfield) } } Loop, Parse, tablequeue_dealin, `, { if !A_loopfield continue stringsplit,tab,A_loopfield,- if (abs(tab2-A_TickCount)>DealinClick_delay) ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI { WinGetPos,,,,h,ahk_id%tab1% if h>100 PostClickStars(tab3, tab4, tab1, 0) listDelItem(tablequeue_dealin, A_Loopfield) } } return ;----------------------------------------------------------------------------------------------------- relStarsClientPoint(id, ByRef x, ByRef y, client=1,screen=0) { global xbord,ybord,cap WinGetPos,x1,y1,w,h,ahk_id%id% w-=2*xbord h-=(2*ybord)+cap x:=floor(W*x) y:=floor(H*y) if !client { x+=xbord y+=ybord+cap } if screen { x+=x1 y+=y1 } } return ;----------------------------------------------------------------------------------------------------- PostLeftClick(x, y, table_id, activate=1, control_class="") { ; ### 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% critical,6 PostMessage, 0x201, 0x0001, ((y<<16)^x), %control_class%, ahk_id%table_id% PostMessage, 0x202 , 0, ((y<<16)^x), %control_class%, ahk_id%table_id% critical,off sleep,-1 } return ;----------------------------------------------------------------------------------------------------- PostclickStars(x,y,winid,activate=1,client=1) { relStarsClientPoint(winid, x, y,client) DllCall("SetCapture","Uint",winid) PostLeftClick(x, y, winid, activate) DllCall("ReleaseCapture") } return ;----------------------------------------------------------------------------------------------------- PixelColorA(colx,coly,id,region=0,regiondim=5) { global xbord,ybord,cap,DwmIsEnabled WinGetPos,,,W,H,ahk_id %id% if DwmIsEnabled hdc_buffer := DllCall("GetDCEx", "UInt", id,"UInt",0,"UInt",1) else { hdc_frame := DllCall( "GetDC", "UInt",0) hdc_buffer := DllCall("gdi32.dll\CreateCompatibleDC","UInt",hdc_frame) hbm_buffer := DllCall("gdi32.dll\CreateCompatibleBitmap", "UInt",hdc_frame, "Int",w, "Int",h) DllCall( "gdi32.dll\SelectObject", "UInt",hdc_buffer, "UInt",hbm_buffer) DllCall( "PrintWindow", "UInt" , id , "UInt" , hdc_buffer , "UInt" , 0 ) WinGet,ctrls,ControlList,ahk_id %id% Loop,Parse,ctrls,`n { class:=A_LoopField ControlGet,ctrlid,Hwnd,,%class%,ahk_id %id% ControlGet,visible,Visible,,,ahk_id %ctrlid% If visible=1 DllCall("RedrawWindow","UInt",ctrlid,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) } DllCall("RedrawWindow","UInt",id,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) } x:=floor(((W-2*xbord)*colx)) + xbord y:=floor(((H-(2*ybord)-cap)*coly)) + ybord + cap if region { loop %regiondim% { loop %regiondim% { y++ p := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x , "Int", y) pix.=p . "-" } x++ } } else { pix := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x, "Int", y) SetFormat, IntegerFast, hex pix += 0 pix .= "" SetFormat, IntegerFast, d } ;sleep,1 DllCall( "gdi32.dll\DeleteObject","Uint",hbm_buffer) DllCall( "gdi32.dll\ReleaseDC","Uint",hdc_buffer) DllCall( "gdi32.dll\DeleteDC","Uint",hdc_buffer) DllCall( "gdi32.dll\ReleaseDC","Uint",hdc_frame) DllCall( "gdi32.dll\DeleteDC","Uint",hdc_frame) return pix } ;----------------------------------------------------------------------------------------------------- CompareColors(ByRef bgr1, ByRef bgr2, ByRef variation) { c1 := bgr1 & 0xff c2 := bgr2 & 0xff if (abs(c1 - c2) > variation) return false c1 := (bgr1 >> 8) & 0xff c2 := (bgr2 >> 8) & 0xff if (abs(c1 - c2) > variation) return false c1 := (bgr1 >> 16) & 0xff c2 := (bgr2 >> 16) & 0xff if (abs(c1 - c2) > variation) return false return true } ;----------------------------------------------------------------------------------------------------- ClickTimebank: clicktime() return ;----------------------------------------------------------------------------------------------------- clicktime() { Local list,id,col,check,color,x,y,color winget,list,list,Logged In ahk_class PokerStarsTableFrameClass if defpos_pixel { x:=%Theme%_timebank_x y:=%Theme%_timebank_y color:=%Theme%_timebank_color } else { x:=custompos_pixel_x y:=custompos_pixel_y color:=custom_color } v:=3 loop %list% { id:=list%A_index% col:=PixelColorA(x-0.003,y-0.003,id,1) ;fileappend,%color%-%col%`n, test.txt check:=0 Loop, Parse, col, -, { if !A_loopfield continue color1:=A_loopfield if CompareColors(color1, color, v)=1 { if !InStr(tablequeue,id) listAdd(tablequeue,id . "-" . A_TickCount . "-" . x . "-" . y) check:=1 break } } if !check if InStr(tablequeue,id) ;listDelItem(tablequeue,id) removefromlist(tablequeue,id) } } return ;----------------------------------------------------------------------------------------------------- Clickimback: clickimback() return ;----------------------------------------------------------------------------------------------------- clickimback() { Local list,id,col,color,x,y,color winget,list,list,Logged In ahk_class PokerStarsTableFrameClass if defpos_pixel_dealin { x:=%Theme%_imback_x y:=%Theme%_imback_y color:=%Theme%_imback_color } else { x:=custompos_pixel_dealin_x y:=custompos_pixel_dealin_y color:=custom_color_dealin } v:=3 loop %list% { id:=list%A_index% col:=PixelColorA(x-0.003,y-0.003,id,1) Loop, Parse, col, -, { if !A_loopfield continue color1:=A_loopfield if CompareColors(color1, color, v)=1 { WinGetPos,,,,h,ahk_id%id% if h>100 ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI PostClickStars(x,y,id,0) break } } } } return ;----------------------------------------------------------------------------------------------------- FILE_CHECK: If (_NEWLINES := CheckFile(location)) ;fileread,_NEWLINES,%location% { if defpos_file { timebank_x:=%Theme%_timebank_x timebank_y:=%Theme%_timebank_y } else { timebank_x:=custompos_file_x timebank_y:=custompos_file_y } if dealin if defpos_file_dealin { sitin_x:=%Theme%_imback_x sitin_y:=%Theme%_imback_y } else { sitin_x:=custompos_file_dealin_x sitin_y:=custompos_file_dealin_y } ;msgbox, %_NEWLINES% Loop, Parse, _NEWLINES, `n { if (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{8}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{10}\s(\w{8})", m)) { ;zero(m1) if !InStr(tablequeue,("0x" . m1)) listAdd(tablequeue,("0x" . m1) . "-" . A_TickCount . "-" . timebank_x . "-" . timebank_y) } else if (regExMatch(a_loopfield, "MSG_0x0021-T\s\w{8}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0021-T\s\w{10}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0014-T\s\w{8}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0014-T\s\w{10}\s(\w{8})", m)) { ;zero(m1) if InStr(tablequeue,("0x" . m1)) ;listDelItem(tablequeue,("0x" . m1)) removefromlist(tablequeue,("0x" . m1)) } else if (regExMatch(a_loopfield, "MSG_0x000A-T\s\w{8}\s(\w{8})\s", m)) || (regExMatch(a_loopfield, "MSG_0x000A-T\s\w{10}\s(\w{8})\s", m)) if dealin { ;zero(m1) ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI if !InStr(tablequeue_dealin,("0x" . m1)) listAdd(tablequeue_dealin,("0x" . m1) . "-" . A_TickCount . "-" . sitin_x . "-" . sitin_y) } } } Return zero(byRef var) { loop { stringmid,char,var,1,1 if char=0 StringTrimLeft,var,var,1,1 else break } } return CheckFile(File) { global AhkVersion ; 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) ReplaceByte( &Tail, Length) VarSetCapacity(Tail, -1) FP := nSize if A_IsUnicode tail:=Ansi2Unicode(tail) SetBatchLines, %BatchLines% Return Tail } Ansi2Unicode(sString, CP = 0) { nSize := DllCall("MultiByteToWideChar" , "Uint", CP , "Uint", 0 , "Uint", &sString , "int", -1 , "Uint", 0 , "int", 0) VarSetCapacity(wString, nSize * 2) DllCall("MultiByteToWideChar" , "Uint", CP , "Uint", 0 , "Uint", &sString , "int", -1 , "Uint", &wString , "int", nSize) return wstring } ReplaceByte( hayStackAddr, hayStackSize, ByteFrom=0, ByteTo=1, StartOffset=0, NumReps=-1) { Static fun IfEqual,fun, { h= ( LTrim join 5589E553515256579C8B4D0C8B451831D229C17E25837D1C00741F8B7D0801C70FB6451 00FB65D14FCF2AE750D885FFF42FF4D1C740409C975EF9D89D05F5E5A595BC9C21800 ) VarSetCapacity(fun,StrLen(h)//2) Loop % StrLen(h)//2 NumPut("0x" . SubStr(h,2*A_Index-1,2), fun, A_Index-1, "Char") } Return DllCall(&fun , "uint",haystackAddr, "uint",hayStackSize, "short",ByteFrom, "short",ByteTo , "uint",StartOffset, "int",NumReps) } FlipBlueAndRed(c) ; takes RGB or BGR and swaps the R and B { return (c&255)<<16 | (c&65280) | (c>>16) } DecToHex(dec) { oldfrmt := A_FormatInteger hex := dec SetFormat, IntegerFast, hex hex += 0 hex .= "" SetFormat, IntegerFast, %oldfrmt% return hex } config: config() return save_config_file: save(1) return save_config_file_dealin: save(2) return save_config_pixel: save(3) return save_config_pixel_dealin: save(4) return method: gui,Submit,nohide ctrl=file loop 2 { state:=(use_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%Txt GuiControl, %state%, %ctrl%Txt3 GuiControl, %state%, %ctrl%Txt4 GuiControl, %state%, %ctrl%Txt5 GuiControl, %state%, defpos_%ctrl% GuiControl, %state%, custompos_%ctrl% if (ctrl="file") { state:=(use_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, customlocation GuiControl, %state%, Select } state:=(use_%ctrl%=0) ? "Disable" : (custompos_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%btn1 state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : "Enable" GuiControl, %state%, defpos_%ctrl%_dealin GuiControl, %state%, custompos_%ctrl%_dealin state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : (custompos_%ctrl%_dealin) ? "Enable" : "Disable" GuiControl, %state%, %ctrl%btn1_dealin GuiControl, %state%, %ctrl%Txt6 GuiControl, %state%, %ctrl%Txt1 GuiControl, %state%, %ctrl%Txt2 GuiControl, %state%, %ctrl%Txt7 ctrl=pixel } return submitsettings: gui,Submit,nohide FileDelete, %thisahk%.ini gosub,MakeIni gosub,getini GuiControl, +background%Currentcolor%, Currentcolor GuiControl, +background%Currentcolor_dealin%, Currentcolor_dealin GuiControl, Text, pixelTxt4, %Currentcolorbgr% GuiControl, Text, pixelTxt6, %Currentcolorbgr_dealin% GuiControl, Text, filetxt5, Current location: %currentpos_file_x%/%currentpos_file_y% GuiControl, Text, filetxt1, Current location: %currentpos_file_dealin_x%/%currentpos_file_dealin_y% ctrl=file loop 2 { state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : (custompos_%ctrl%_dealin=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%btn1_dealin GuiControl, %state%, %ctrl%Txt2 state:=(use_%ctrl%=0) ? "Disable" : (custompos_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%Txt7 GuiControl, %state%, %ctrl%btn1 ctrl=pixel } return dealinsettings: gui,Submit,nohide state:=(dealin=0) ? "Disable" : (use_pixel=0) ? "Disable" : "Enable" GuiControl, %state%, Currentcolor_dealin GuiControl, %state%, pixelTxt6 ctrl=file loop 2 { state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%Txt1 GuiControl, %state%, defpos_%ctrl%_dealin GuiControl, %state%, custompos_%ctrl%_dealin state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : (custompos_%ctrl%_dealin) ? "Enable" : "Disable" GuiControl, %state%, %ctrl%btn1_dealin GuiControl, %state%, %ctrl%Txt2 ctrl=pixel } return drag() { ifwinactive,ConfigWindow ahk_class AutoHotkeyGUI PostMessage, 0xA1, 2 } return config() { global xbord,cap winclose,Test ahk_class AutoHotkeyGUI ifwinexist,ConfigWindow ahk_class AutoHotkeyGUI return ctrl=file loop 2 { if instr(A_guicontrol,ctrl) { if instr(A_guicontrol,"dealin") GuiControl, Enable, %ctrl%btn2_dealin else GuiControl, Enable, %ctrl%btn2 } ctrl=pixel } ;CustomColor = EEAA99 CustomColor = 000000 Gui,2: +Alwaysontop -Caption +Resize Gui,2: Color, %CustomColor% Gui,2: show, w100 h60, ConfigWindow ;WinSet, TransColor, %CustomColor%, ConfigWindow WinSet, Transparent ,125,ConfigWindow } return Confirm: confirmed:=1 Gui,3:destroy return Cancel1: 3guiclose: Gui,3:destroy confirmed:=0 return save(mode) { global xbord,ybord,cap,confirmed,thisahk winget,id,id,ahk_class PokerStarsTableFrameClass wingetpos,x,y,w,h,ahk_id %id% wingetpos,x1,y1,w1,h1,ConfigWindow getlength:=w1-2*xbord getheight:=h1-2*ybord ;Gui,3: Show, w%getlength% h%getheight%, Test Gui,3: Show, w300 h300, Test WinGet,TestID, id, Test ahk_class AutoHotkeyGUI hdc_frame := DllCall("GetDC", UInt, TestID) hdc_buffer := DllCall("gdi32.dll\CreateCompatibleDC", UInt, hdc_frame) hbm_buffer := DllCall("gdi32.dll\CreateCompatibleBitmap", UInt,hdc_frame, Int,w, Int,h) DllCall( "gdi32.dll\SelectObject", UInt,hdc_buffer, UInt,hbm_buffer) DllCall( "PrintWindow", UInt , id , UInt , hdc_buffer , UInt , 0 ) startx:=x1-x+xbord starty:=y1-y+ybord targetx:=Round((startx+Round(getlength/4)-xbord)/(w - (2*xbord)),5) targety:=Round((starty+Round(getheight/3)-ybord - cap)/(h - (2*ybord) - cap),5) x:=floor(((W-2*xbord)*targetx)) + xbord y:=floor(((H-(2*ybord)-cap)*targety)) + ybord + cap targetp := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x , "Int", y) SetFormat, IntegerFast, hex targetp += 0 targetp .= "" SetFormat, IntegerFast, d loop 5 { loop 5 DllCall("SetPixel", "uint", hdc_buffer, "int", x+A_index, "int", y, "uint", 0xFFFFFF) y++ } x:=(getlength<200) ? Round((200-getlength)/2) : 10 y:=10 DllCall("gdi32.dll\BitBlt" , UInt,hdc_frame, Int, x, Int, y, Int, getlength, Int, getheight, UInt,hdc_buffer, Int, startx, Int, starty, UInt, 0xCC0020) WinGet,ctrls,ControlList,ahk_id %id% Loop,Parse,ctrls,`n { class:=A_LoopField ControlGet,ctrlid,Hwnd,,%class%,ahk_id %id% ControlGet,visible,Visible,,,ahk_id %ctrlid% If visible=1 DllCall("RedrawWindow","UInt",ctrlid,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) } DllCall("RedrawWindow","UInt",id,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) DllCall( "gdi32.dll\DeleteObject", "uint", hbm_buffer ) DllCall( "gdi32.dll\ReleaseDC" , "uint", hdc_frame ) DllCall( "gdi32.dll\DeleteDC" , "uint", hdc_frame ) DllCall( "gdi32.dll\DeleteDC" , "uint", hdc_buffer ) y:=getheight+20 Gui,3: Add, text, x6 y%y% ,Has the button been captured correctly? y+=20 Gui,3: Add, Button, x26 y%y% w65 h20 gconfirm, Confirm Gui,3: Add, Button, x106 y%y% w65 h20 gCancel1, Cancel h:=y+30 w:=(w1<200) ? 200 : w1+20 Gui,3: Show, w%w% h%h%, Test gui,2:destroy ctrl=file loop 2 { GuiControl, Disable, %ctrl%btn2_dealin GuiControl, Disable, %ctrl%btn2 ctrl=pixel } confirmed= loop { if confirmed=1 { if mode=1 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_file_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_file_y } else if mode=2 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_file_dealin_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_file_dealin_y } else if mode=3 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_pixel_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_pixel_y IniWrite, %targetp%, %thisahk%.ini, Options, custom_color } else if mode=4 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_pixel_dealin_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_pixel_dealin_y IniWrite, %targetp%, %thisahk%.ini, Options, custompos_color_dealin } confirmed= gui,Submit,nohide gosub,getini gosub,submitsettings break } else if confirmed=0 break } } return detect: location= Loop, %A_ProgramFiles%\* , 2 { if instr(A_LoopFileName,"PokerStars")>0 location:=A_LoopFileFullPath . "\PokerStars.log.0" } IfNotExist %location% Loop, %A_AppData%\* , 2 if instr(A_LoopFileName,"PokerStars")>0 location:=A_LoopFileFullPath . "\PokerStars.log.0" IfNotExist %location% { StringReplace,location,A_AppData,Roaming,Local Loop, %location%\* , 2 if instr(A_LoopFileName,"PokerStars")>0 location:=A_LoopFileFullPath . "\PokerStars.log.0" } IfNotExist %location% location:="PokerStars.log.0 file was not found!" return Selectfile: gui,Submit,nohide if !customlocation { FileSelectFolder,folder,,2,Select the folder with the PokerStars.log.0 file, type/paste the path into the edit field alternatively Folder := RegExReplace(Folder, "\\$") } else { StringReplace,Folder,customlocation,\PokerStars.log.0, Folder := RegExReplace(Folder, "\\$") } IfNotExist,%Folder%\PokerStars.log.0 gosub,confirmdialog else { location:=Folder . "\PokerStars.log.0" IniWrite, %location%, %thisahk%.ini, Settings, location customlocation:=Folder . "\PokerStars.log.0" IniWrite, %customlocation%, %thisahk%.ini, Settings, customlocation GuiControl,Text,customlocation,%customlocation% GuiControl,Text,fileTxt3,Pokerstars.log.0 file location:%location% } fontcolor:=(instr(location,"not found")>0) ? "red" : (FileExist(location)) ? "green" : "red" gui,font,c%fontcolor% GuiControl,font,fileTxt3 return confirmdialog: MsgBox, 4,, PokerStars.log.0 was not found in the selected folder, continue anyway? IfMsgBox Yes { if !Folder return location:=Folder . "\PokerStars.log.0" IniWrite, %location%, %thisahk%.ini, Settings, location customlocation:=Folder . "\PokerStars.log.0" IniWrite, %customlocation%, %thisahk%.ini, Settings, customlocation GuiControl,Text,customlocation,%customlocation% GuiControl,Text,fileTxt3,Pokerstars.log.0 file location:%location% gui,font,c%fontcolor% GuiControl,font,fileTxt3 } else { customlocation= GuiControl,Text,customlocation,%customlocation% gosub,Selectfile } return BuildGui: Gui, color, white Gui, add, tab, h730 w506, General Gui, Tab, General Gui, Add, Radio, x26 y50 w280 h20 Checked%use_file% vuse_file gmethod, Use Pokerstars.log.0 file reading method (default) Gui, Add, Radio, x26 y70 w280 h20 Checked%use_pixel% vuse_pixel gmethod, Use pixel reading method Gui, add, Text, w200 y110 x26, Time delay for pressing the Time button Gui, add, DropDownList, w40 y105 x215 vInterval1, %ddlist% Gui, add, Checkbox, y150 x26 Checked%dealin% Vdealin gdealinsettings, Press I'm back button additionally Gui, add, text, x26 y170 ,(excluding intentional Sitout/Sitout nextbb using the file read, including for the pixel read) Gui, add, text, x366 y50 cred ,Select the table theme Gui, Add, Radio, x366 y70 w130 h20 Checked%ClassicTheme% vClassicTheme gsubmitsettings, Classic Theme Gui, Add, Radio, x366 y90 w130 h20 Checked%HyperSimpleTheme% vHyperSimpleTheme gsubmitsettings, HyperSimple Theme Gui, Add, Radio, x366 y110 w130 h20 Checked%BlackTheme% vBlackTheme gsubmitsettings, Black Theme Gui, Add, Radio, x366 y130 w130 h20 Checked%SlickTheme% vSlickTheme gsubmitsettings, Slick Theme Gui, Add, Radio, x366 y150 w130 h20 Checked%NovaTheme% vNovaTheme gsubmitsettings, Nova Theme Gui, add, text, x26 y210 cred Disabled%use_pixel% vfileTxt,File reading method configuration Gui, add, text, x26 y230 w480 c%fontcolor% Disabled%use_pixel% vfileTxt3,Pokerstars.log.0 file location: %location% Gui, add, text, x26 y250 Disabled%use_pixel% vfileTxt4,Custom location Gui, Add, Edit, x126 y250 w300 h20 vcustomlocation Disabled%use_pixel%, %customlocation% Gui, Add, Button, x435 y250 w65 h20 gSelectfile Disabled%use_pixel% vSelect,Select Gui, Add, Radio, x26 y290 w280 h20 Disabled%use_pixel% Checked%defpos_file% vdefpos_file gsubmitsettings, Use Theme default Timebank button location Gui, Add, Radio, x26 y310 w280 h20 Disabled%use_pixel% Checked%custompos_file% vcustompos_file gsubmitsettings, Use custom Timebank button location Gui, add, text, x316 y300 w180 cred Disabled%use_pixel% vfileTxt5,Current location: %currentpos_file_x%/%currentpos_file_y% Gui, Add, Button, x26 y330 w65 h20 %customfilestate% gconfig vfilebtn1,Configure Gui, Add, Button, x106 y330 w65 h20 Disabled gsave_config_file vfilebtn2,Save Gui, add, text, x206 y330 %customfilestate% vfileTxt7,(wrap the window around the Timebank button and press save) Gui, Add, Radio, x26 y370 w280 h20 %filedealinstate% Checked%defpos_file_dealin% vdefpos_file_dealin gsubmitsettings, Use Theme default Imback button location Gui, Add, Radio, x26 y390 w280 h20 %filedealinstate% Checked%custompos_file_dealin% vcustompos_file_dealin gsubmitsettings, Use custom Imback button location Gui, add, text, x316 y380 w180 cred %filedealinstate% vfileTxt1,Current location: %currentpos_file_dealin_x%/%currentpos_file_dealin_y% Gui, Add, Button, x26 y410 w65 h20 %customfilestate_dealin% gconfig vfilebtn1_dealin,Configure Gui, Add, Button, x106 y410 w65 h20 Disabled gsave_config_file_dealin vfilebtn2_dealin,Save Gui, add, text, x206 y410 %customfilestate_dealin% vfileTxt2,(wrap the window around the Imback button and press save) Gui, add, text, x26 y470 cred Disabled%use_file% vpixelTxt,Pixel reading method configuration Gui, Add, Radio, x26 y490 w280 h20 Disabled%use_file% Checked%defpos_pixel% gsubmitsettings vdefpos_pixel, Use Theme default Timebank button color Gui, Add, Radio, x26 y510 w280 h20 Disabled%use_file% Checked%custompos_pixel% gsubmitsettings vcustompos_pixel, Use custom Timebank button color Gui, add, text, x316 y500 cred Disabled%use_file% vpixelTxt3,Current color: Gui, Add, Progress, x406 y500 w20 h20 Disabled%use_file% cGreen background%Currentcolor% vCurrentcolor Gui, add, text, x436 y500 w60 vpixelTxt4 Disabled%use_file%,(%Currentcolorbgr%) Gui, Add, Button, x26 y530 w65 h20 %custompixelstate% gconfig vpixelbtn1,Configure Gui, Add, Button, x106 y530 w65 h20 Disabled gsave_config_pixel vpixelbtn2,Save Gui, add, text, x206 y530 %custompixelstate% vpixelTxt7,(wrap the window around the unpressed Timebank button) Gui, Add, Radio, x26 y570 w280 h20 %pixeldealinstate% Checked%defpos_pixel_dealin% gsubmitsettings vdefpos_pixel_dealin, Use Theme default Imback button color Gui, Add, Radio, x26 y590 w280 h20 %pixeldealinstate% Checked%custompos_pixel_dealin% gsubmitsettings vcustompos_pixel_dealin, Use custom Imback button color Gui, add, text, x316 y580 cred %pixeldealinstate% vpixelTxt1,Current color: Gui, Add, Progress, x406 y580 w20 h20 %pixeldealinstate% cGreen background%Currentcolor_dealin% vCurrentcolor_dealin Gui, add, text, x436 y580 w60 %pixeldealinstate% vpixelTxt6 ,(%Currentcolorbgr_dealin%) Gui, Add, Button, x26 y610 w65 h20 %custompixelstate_dealin% gconfig %dealinstate% vpixelbtn1_dealin,Configure Gui, Add, Button, x106 y610 w65 h20 Disabled gsave_config_pixel_dealin %dealinstate% vpixelbtn2_dealin,Save Gui, add, text, x206 y610 %custompixelstate_dealin% vpixelTxt2,(wrap the window around the Imback button and press save) Gui, add, Checkbox, y655 x26 Checked%guishow% Vguishow, Show GUI at the script start Gui, Add, Button, x205 y690 w55 h20 gSave,Submit Gui, Add, Button, x265 y690 w55 h20 gCancel,Cancel Gui, show, w526, %thisahk% gosub,getini Gui,Submit,nohide Return ;----------------------------------------------------------------------------------------------------- GetIni: IfNotExist, %thisahk%.ini gosub, CreateIni IniRead, ClassicTheme,%thisahk%.ini, Options, ClassicTheme,0 IniRead, HyperSimpleTheme,%thisahk%.ini, Options, HyperSimpleTheme,0 IniRead, SlickTheme,%thisahk%.ini, Options, SlickTheme,0 IniRead, BlackTheme,%thisahk%.ini, Options, BlackTheme,0 IniRead, NovaTheme,%thisahk%.ini, Options, NovaTheme,0 IniRead, Interval1, %thisahk%.ini, Settings, Interval1 IniRead, location, %thisahk%.ini, Settings, location IniRead, customlocation, %thisahk%.ini, Settings, customlocation,%A_space% IniRead, dealin, %thisahk%.ini, Settings, dealin IniRead, use_file, %thisahk%.ini, Settings, use_file,0 IniRead, use_pixel, %thisahk%.ini, Settings, use_pixel,0 IniRead, defpos_pixel,%thisahk%.ini, Options, defpos_pixel,0 IniRead, custompos_pixel,%thisahk%.ini, Options, custompos_pixel,0 IniRead, defpos_pixel_dealin,%thisahk%.ini, Options, defpos_pixel_dealin,0 IniRead, custompos_pixel_dealin,%thisahk%.ini, Options, custompos_pixel_dealin,0 IniRead, defpos_file,%thisahk%.ini, Options, defpos_file,0 IniRead, custompos_file,%thisahk%.ini, Options, custompos_file,0 IniRead, defpos_file_dealin,%thisahk%.ini, Options, defpos_file_dealin,0 IniRead, custompos_file_dealin,%thisahk%.ini, Options, custompos_file_dealin,0 IniRead, custompos_file_x,%thisahk%.ini, Options, custompos_file_x,0 IniRead, custompos_file_y,%thisahk%.ini, Options, custompos_file_y,0 IniRead, custompos_file_dealin_x,%thisahk%.ini, Options, custompos_file_dealin_x,0 IniRead, custompos_file_dealin_y,%thisahk%.ini, Options, custompos_file_dealin_y,0 IniRead, custompos_pixel_x,%thisahk%.ini, Options, custompos_pixel_x,0 IniRead, custompos_pixel_y,%thisahk%.ini, Options, custompos_pixel_y,0 IniRead, custompos_pixel_dealin_x,%thisahk%.ini, Options, custompos_pixel_dealin_x,0 IniRead, custompos_pixel_dealin_y,%thisahk%.ini, Options, custompos_pixel_dealin_y,0 IniRead, custom_color,%thisahk%.ini, Options, custom_color,0 IniRead, custom_color_dealin,%thisahk%.ini, Options, custom_color_dealin,0 IniRead, guishow, %thisahk%.ini, Settings, guishow Theme:=(ClassicTheme=1) ? "ClassicTheme" : (HyperSimpleTheme=1) ? "HyperSimpleTheme" : (BlackTheme=1) ? "BlackTheme" : (SlickTheme=1) ? "SlickTheme" : (NovaTheme=1) ? "NovaTheme" : "" fontcolor:=(instr(location,"not found")>0) ? "red" : (FileExist(location)) ? "green" : "red" if customlocation location:=customlocation StringReplace, ddlist, ddlist, %interval1%, %Interval1%| GuiControl, , Interval1, |%ddlist% StringReplace, ddlist, ddlist, %interval1%|, %Interval1% ;------------------------Init-------------------------- ClassicTheme_timebank_x:=0.64423 ClassicTheme_timebank_y:=0.82791 ClassicTheme_timebank_color:=0x09357e ;0x9357e ClassicTheme_imback_x:=0.67400 ClassicTheme_imback_y:=0.85814 ClassicTheme_imback_color:=0x000000 HyperSimpleTheme_timebank_x:=0.64423 HyperSimpleTheme_timebank_y:=0.82791 HyperSimpleTheme_timebank_color:=0xe9e6e6 HyperSimpleTheme_imback_x:=0.67400 HyperSimpleTheme_imback_y:=0.85814 HyperSimpleTheme_imback_color:=0xdfd9ce BlackTheme_timebank_x:=0.58814 ;BlackTheme_timebank_y:=0.85814 BlackTheme_timebank_y:=0.84414 BlackTheme_timebank_color:=0x01025a ;0x1025a BlackTheme_imback_x:=0.67400 BlackTheme_imback_y:=0.85814 BlackTheme_imback_color:=0x1e1e1e SlickTheme_timebank_x:=0.58814 ;SlickTheme_timebank_y:=0.85814 SlickTheme_timebank_y:=0.84414 SlickTheme_timebank_color:=0x09092b ;0x9092b SlickTheme_imback_x:=0.67400 SlickTheme_imback_y:=0.85814 SlickTheme_imback_color:=0x080828 NovaTheme_timebank_x:=0.94712 NovaTheme_timebank_y:=0.78372 NovaTheme_timebank_color:=0x252525 NovaTheme_imback_x:=0.85417 NovaTheme_imback_y:=0.86512 ;NovaTheme_imback_y:=0.89679 NovaTheme_imback_color:=0x4a4a4a if defpos_file=1 { currentpos_file_x:=%Theme%_timebank_x currentpos_file_y:=%Theme%_timebank_y } else { currentpos_file_x:=custompos_file_x currentpos_file_y:=custompos_file_y } if defpos_file_dealin=1 { currentpos_file_dealin_x:=%Theme%_imback_x currentpos_file_dealin_y:=%Theme%_imback_y } else { currentpos_file_dealin_x:=custompos_file_dealin_x currentpos_file_dealin_y:=custompos_file_dealin_y } if defpos_pixel=1 { currentpos_pixel_x:=%Theme%_timebank_x currentpos_pixel_y:=%Theme%_timebank_y } else { currentpos_pixel_x:=custompos_pixel_x currentpos_pixel_y:=custompos_pixel_y } if defpos_pixel_dealin=1 { currentpos_pixel_dealin_x:=%Theme%_imback_x currentpos_pixel_dealin_y:=%Theme%_imback_y } else { currentpos_pixel_dealin_x:=custompos_pixel_dealin_x currentpos_pixel_dealin_y:=custompos_pixel_dealin_y } if defpos_pixel=1 Currentcolor:=DecToHex(FlipBlueAndRed(%Theme%_timebank_color)) else Currentcolor:=DecToHex(FlipBlueAndRed(custom_color)) if defpos_pixel_dealin=1 Currentcolor_dealin:=DecToHex(FlipBlueAndRed(%Theme%_imback_color)) else Currentcolor_dealin:=DecToHex(FlipBlueAndRed(custom_color_dealin)) Currentcolorbgr:=DecToHex(FlipBlueAndRed(Currentcolor)) Currentcolorbgr_dealin:=DecToHex(FlipBlueAndRed(Currentcolor_dealin)) filedealinstate:=(use_file=0) ? "disabled" : (dealin=1) ? "disabled0" : "disabled" pixeldealinstate:=(use_pixel=0) ? "disabled" : (dealin=1) ? "disabled0" : "disabled" customfilestate:=(use_file=0) ? "disabled" : (custompos_file=1) ? "disabled0" : "disabled" customfilestate_dealin:=(use_file=0) ? "disabled" : (dealin=0) ? "disabled" : (custompos_file_dealin=1) ? "disabled0" : "disabled" custompixelstate:=(use_pixel=0) ? "disabled" : (custompos_pixel=1) ? "disabled0" : "disabled" custompixelstate_dealin:=(use_pixel=0) ? "disabled" : (dealin=0) ? "disabled" : (custompos_pixel_dealin=1) ? "disabled0" : "disabled" if guishow { winget,id,id, %thisahk% ahk_class AutoHotkeyGUI if !DllCall( "IsWindowVisible", "UInt",id) gosub, buildgui } Return ;----------------------------------------------------------------------------------------------------- MakeIni: If ClassicTheme IniWrite, %ClassicTheme%, %thisahk%.ini, Options, ClassicTheme If HyperSimpleTheme IniWrite, %HyperSimpleTheme%, %thisahk%.ini, Options, HyperSimpleTheme If SlickTheme IniWrite, %SlickTheme%, %thisahk%.ini, Options, SlickTheme If BlackTheme IniWrite, %BlackTheme%, %thisahk%.ini, Options, BlackTheme If NovaTheme IniWrite, %NovaTheme%, %thisahk%.ini, Options, NovaTheme If defpos_pixel IniWrite, %defpos_pixel%, %thisahk%.ini, Options, defpos_pixel If custompos_pixel IniWrite, %custompos_pixel%, %thisahk%.ini, Options, custompos_pixel If defpos_pixel_dealin IniWrite, %defpos_pixel_dealin%, %thisahk%.ini, Options, defpos_pixel_dealin If custompos_pixel_dealin IniWrite, %custompos_pixel_dealin%, %thisahk%.ini, Options, custompos_pixel_dealin If defpos_file IniWrite, %defpos_file%, %thisahk%.ini, Options, defpos_file If custompos_file IniWrite, %custompos_file%, %thisahk%.ini, Options, custompos_file If defpos_file_dealin IniWrite, %defpos_file_dealin%, %thisahk%.ini, Options, defpos_file_dealin If custompos_file_dealin IniWrite, %custompos_file_dealin%, %thisahk%.ini, Options, custompos_file_dealin if use_file IniWrite, %use_file%, %thisahk%.ini, Settings, use_file if use_pixel IniWrite, %use_pixel%, %thisahk%.ini, Settings, use_pixel if custompos_file_x IniWrite, %custompos_file_x%, %thisahk%.ini, Options, custompos_file_x if custompos_file_y IniWrite, %custompos_file_y%, %thisahk%.ini, Options, custompos_file_y if custompos_file_dealin_x IniWrite, %custompos_file_dealin_x%, %thisahk%.ini, Options, custompos_file_dealin_x if custompos_file_dealin_y IniWrite, %custompos_file_dealin_y%, %thisahk%.ini, Options, custompos_file_dealin_y if custompos_pixel_x IniWrite, %custompos_pixel_x%, %thisahk%.ini, Options, custompos_pixel_x if custompos_pixel_y IniWrite, %custompos_pixel_y%, %thisahk%.ini, Options, custompos_pixel_y if custompos_pixel_dealin_x IniWrite, %custompos_pixel_dealin_x%, %thisahk%.ini, Options, custompos_pixel_dealin_x if custompos_pixel_dealin_y IniWrite, %custompos_pixel_dealin_y%, %thisahk%.ini, Options, custompos_pixel_dealin_y if custom_color IniWrite, %custom_color%, %thisahk%.ini, Options, custom_color if custom_color_dealin IniWrite, %custom_color_dealin%, %thisahk%.ini, Options, custom_color_dealin IniWrite, %Interval1%, %thisahk%.ini, Settings, Interval1 if location IniWrite, %location%, %thisahk%.ini, Settings, location if customlocation IniWrite, %customlocation%, %thisahk%.ini, Settings, customlocation IniWrite, %dealin%, %thisahk%.ini, Settings, dealin IniWrite, %guishow%, %thisahk%.ini, Settings, guishow Return ;----------------------------------------------------------------------------------------------------- CreateIni: use_pixel:=0 use_file:=1 HyperSimpleTheme:=1 ClassicTheme:=0 SlickTheme:=0 BlackTheme:=0 NovaTheme:=0 Interval1:=5 defpos_pixel:=1 defpos_pixel_dealin:=1 defpos_file:=1 defpos_file_dealin:=1 dealin:=0 guishow:=0 gosub,detect gosub, MakeIni gosub, getIni winget,id,id, %thisahk% ahk_class AutoHotkeyGUI if !DllCall( "IsWindowVisible", "UInt",id) gosub, buildgui return ;----------------------------------------------------------------------------------------------------- GuiClose: gosub, cancel return ;----------------------------------------------------------------------------------------------------- 2GuiClose: return ;----------------------------------------------------------------------------------------------------- menuGui: gosub, getini winget,id,id, %thisahk% ahk_class AutoHotkeyGUI if !DllCall( "IsWindowVisible", "UInt",id) gosub, buildgui Gui, Submit,nohide return ;----------------------------------------------------------------------------------------------------- reload: reload return ;----------------------------------------------------------------------------------------------------- Save: Gui, Submit Gui, destroy FileDelete, %thisahk%.ini gosub, MakeIni ;Reload settimer,clickwithdelay,133 if use_file { if !instr(location,"not found")>0 settimer,FILE_CHECK,%CheckTime_file% settimer,ClickTimebank,off settimer,Clickimback,off sleep,-1 } else { settimer,FILE_CHECK,off settimer,ClickTimebank,%CheckTime_pixel% if dealin settimer,Clickimback,1563 else settimer,Clickimback,off sleep,-1 } return ;----------------------------------------------------------------------------------------------------- Cancel: Gui, Destroy Return ;----------------------------------------------------------------------------------------------------- Edit: edit return ;----------------------------------------------------------------------------------------------------- exitSub: FileDelete, %thisahk%.ini gosub, makeini exitApp return ;-----------------------------------------------------------------------------------------------------
Thanks!
Works well!
Works well!
Hi all,
I'm an italian user. Since the last update the timeout helper didn't work anymore!
Has no-one else the same problem?
Bye,
Gunny005
I'm an italian user. Since the last update the timeout helper didn't work anymore!
Has no-one else the same problem?
Bye,
Gunny005
+1
Stopped woking =(
Stopped woking =(
The latest version posted still works fine for me with the latest PS.com update, you can try configuring custom timebank/imback button position for the file reading method or switching to the pixel reading method (configuring custom colors if default colors don't work).
ty, Max1mums, its ok now after I updated the client.
Stopped working, any update?
Its dead ?? Pokerstars seen like ****ing around in their updates. Maybe poker are going to die!
The latest version posted (on previous page) does work fine for me, run the script as admin, configure custom pokerstars.log.0 file location and Timebank/I'mback button position if needed.
Nice script but could you plz make one for other sites aswell like FPT
Hi, can somebodu point me in a good direction to figure out how to use this?
I know nothing about scripts.....but would really appreciate to get auto timebank......
Thanks for any help!
Frode
I know nothing about scripts.....but would really appreciate to get auto timebank......
Thanks for any help!
Frode
1. U need to download and install the ahk software u can download it from here
2. U need to copy/past the code on this comment into a notepad file and svae it into your hard drive
3. U need to change the extention of that notepad file from .txt to .ahk
4. Run the script (double click on the file)
2. U need to copy/past the code on this comment into a notepad file and svae it into your hard drive
3. U need to change the extention of that notepad file from .txt to .ahk
4. Run the script (double click on the file)
Is the function "sit out at all tables" no longer available on stars?
hello Max1mums
the script is not working any more
do you a working script for 2018
ty
the script is not working any more
do you a working script for 2018
ty
marinerodero50, all the script functions work fine for me in the latest PokerStars client. Try reconfiguring the script using GUI, note that "Pixel reading" method should be able to work for any PS client version.
work fine now ty
Since aurora forced update, this aint working anymore, even with pixel reading method.
PokerStars table reacts on a click sent by the script under mouse cursor only after the last update. I've made a version using (fast) mousemovement before a click, not sure if it is usefull or not this way, it won't be good for the stacked tables for sure.
Code:
; #### StarsTimebank #### ; AHK version: 1.0.48.05 ; date: March 19,2020 version := "1.02d" ; author: Max1mums (max1mums@overcards.com) #SingleInstance, Force #NoEnv Settitlematchmode, 2 OnExit exitSub StringTrimRight, thisahk, A_ScriptName, 4 SetWorkingDir %A_ScriptDir% StringReplace,AhkVersion,A_AhkVersion,.,,All Menu, Tray, NoStandard Menu, Tray, Add, Gui, menugui Menu, Tray, Add Menu, Tray, Add, Reload, reload Menu, Tray, Default, Gui Menu, Tray, Add Menu, Tray, Add, Edit, Edit Menu, Tray, Add Menu, Tray, Add, Exit, ExitSub OnMessage(0x112,"WM_SYSCOMMAND") WM_SYSCOMMAND(wParam) { if (A_Gui && wParam = 0xF020) ; SC_MINIMIZE { Gui, destroy return 0 } } OnMessage(0x201, "drag") SetBatchLines,1ms SetWinDelay,-1 SysGet, xbord, 32 SysGet, ybord, 33 SysGet, cap, 4 tablequeue= ddlist= ddlist:=ddlist . "Off" . "|" Loop 14 ddlist:=ddlist . A_index . "|" DllCall("dwmapi\DwmIsCompositionEnabled","int*",DwmIsEnabled) gosub,getini CheckTime_file:=800 ; Check every n MilliSeconds CheckTime_pixel:=877 DealinClick_delay:=1500 ;;;;;;;;;;;;;;End of init;;;;;;;;;;;;;; settimer,clickwithdelay,133 settimer,dwmcheck,342 if use_file { if !instr(location,"not found")>0 SetTimer, FILE_CHECK, %CheckTime_file% } else { settimer,ClickTimebank,%CheckTime_pixel% if dealin settimer,Clickimback,1563 else settimer,Clickimback,off } return ;----------------------------------------------------------------------------------------------------- dwmcheck: DllCall("dwmapi\DwmIsCompositionEnabled","int*",Dwm) if !(dwm=DwmIsEnabled) gosub,reload 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, %del%%item%%del%,%del%,All StringTrimLeft, list, list, 1 StringTrimRight, list, list, 1 return list } ;----------------------------------------------------------------------------------------------------- removefromlist(byRef list,winid) { Loop, Parse, list, `, { if InStr(A_loopfield,winid) listDelItem(list, A_Loopfield) } return list } ;----------------------------------------------------------------------------------------------------- relStarsClientPoint(id, ByRef x, ByRef y, client=1,screen=0) { global xbord,ybord,cap WinGetPos,x1,y1,w,h,ahk_id%id% w-=2*xbord h-=(2*ybord)+cap x:=Round(W*x) y:=Round(H*y) if !client { x+=xbord y+=ybord+cap } if screen { x+=x1 y+=y1 } } return ;----------------------------------------------------------------------------------------------------- PostLeftClick(x, y, table_id, activate=1, control_class="") { ; ### 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% critical,6 coordmode,mouse,screen mousegetpos,mx,my blockinput,MouseMove DllCall("SetCursorPos", int, x, int, y) WinGetPos,wx,wy,,,ahk_id%table_id% x-=wx y-=wy controlclick,x%wx% y%wy%,ahk_id%table_id% controlclick,x%wx% y%wy%,ahk_id%table_id% DllCall("SetCursorPos", int, mx, int, my) blockinput,MouseMoveoff ;PostMessage, 0x201, 0x0001, ((y<<16)^x), %control_class%, ahk_id%table_id% ;PostMessage, 0x202 , 0, ((y<<16)^x), %control_class%, ahk_id%table_id% critical,off sleep,-1 } return ;----------------------------------------------------------------------------------------------------- PostclickStars(x,y,winid,activate=1,client=1,screen=0) { relStarsClientPoint(winid, x, y,client,screen) DllCall("SetCapture","Uint",winid) PostLeftClick(x, y, winid, activate) DllCall("ReleaseCapture") } return ;----------------------------------------------------------------------------------------------------- PixelColorA(colx,coly,id,region=0,regiondim=5) { global xbord,ybord,cap,DwmIsEnabled WinGetPos,,,W,H,ahk_id %id% if DwmIsEnabled hdc_buffer := DllCall("GetDCEx", "UInt", id,"UInt",0,"UInt",1) else { hdc_frame := DllCall( "GetDC", "UInt",0) hdc_buffer := DllCall("gdi32.dll\CreateCompatibleDC","UInt",hdc_frame) hbm_buffer := DllCall("gdi32.dll\CreateCompatibleBitmap", "UInt",hdc_frame, "Int",w, "Int",h) DllCall( "gdi32.dll\SelectObject", "UInt",hdc_buffer, "UInt",hbm_buffer) DllCall( "PrintWindow", "UInt" , id , "UInt" , hdc_buffer , "UInt" , 0 ) WinGet,ctrls,ControlList,ahk_id %id% Loop,Parse,ctrls,`n { class:=A_LoopField ControlGet,ctrlid,Hwnd,,%class%,ahk_id %id% ControlGet,visible,Visible,,,ahk_id %ctrlid% If visible=1 DllCall("RedrawWindow","UInt",ctrlid,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) } DllCall("RedrawWindow","UInt",id,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) } x:=floor(((W-2*xbord)*colx)) + xbord y:=floor(((H-(2*ybord)-cap)*coly)) + ybord + cap if region { loop %regiondim% { loop %regiondim% { y++ p := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x , "Int", y) pix.=p . "-" } x++ } } else { pix := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x, "Int", y) SetFormat, IntegerFast, hex pix += 0 pix .= "" SetFormat, IntegerFast, d } ;sleep,1 DllCall( "gdi32.dll\DeleteObject","Uint",hbm_buffer) DllCall( "gdi32.dll\ReleaseDC","Uint",hdc_buffer) DllCall( "gdi32.dll\DeleteDC","Uint",hdc_buffer) DllCall( "gdi32.dll\ReleaseDC","Uint",hdc_frame) DllCall( "gdi32.dll\DeleteDC","Uint",hdc_frame) return pix } ;----------------------------------------------------------------------------------------------------- CompareColors(ByRef bgr1, ByRef bgr2, ByRef variation) { c1 := bgr1 & 0xff c2 := bgr2 & 0xff if (abs(c1 - c2) > variation) return false c1 := (bgr1 >> 8) & 0xff c2 := (bgr2 >> 8) & 0xff if (abs(c1 - c2) > variation) return false c1 := (bgr1 >> 16) & 0xff c2 := (bgr2 >> 16) & 0xff if (abs(c1 - c2) > variation) return false return true } ;----------------------------------------------------------------------------------------------------- ClickTimebank: clicktime() return ;----------------------------------------------------------------------------------------------------- clicktime() { Local list,id,col,check,color,x,y,color winget,list,list,Logged In ahk_class GLFW30 if defpos_pixel { x:=%Theme%_timebank_x y:=%Theme%_timebank_y color:=%Theme%_timebank_color } else { x:=custompos_pixel_x y:=custompos_pixel_y color:=custom_color } v:=3 loop %list% { id:=list%A_index% col:=PixelColorA(x-0.003,y-0.003,id,1) ;fileappend,%color%-%col%`n, test.txt check:=0 Loop, Parse, col, -, { if !A_loopfield continue color1:=A_loopfield if CompareColors(color1, color, v)=1 { if !InStr(tablequeue,id) listAdd(tablequeue,id . "-" . A_TickCount . "-" . x . "-" . y) check:=1 break } } if !check if InStr(tablequeue,id) ;listDelItem(tablequeue,id) removefromlist(tablequeue,id) } } return ;----------------------------------------------------------------------------------------------------- Clickimback: clickimback() return ;----------------------------------------------------------------------------------------------------- clickimback() { Local list,id,col,color,x,y,color winget,list,list,Logged In ahk_class GLFW30 if defpos_pixel_dealin { x:=%Theme%_imback_x y:=%Theme%_imback_y color:=%Theme%_imback_color } else { x:=custompos_pixel_dealin_x y:=custompos_pixel_dealin_y color:=custom_color_dealin } v:=3 loop %list% { id:=list%A_index% col:=PixelColorA(x-0.003,y-0.003,id,1) Loop, Parse, col, -, { if !A_loopfield continue color1:=A_loopfield if CompareColors(color1, color, v)=1 { WinGetPos,,,,h,ahk_id%id% if h>100 ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI ;PostClickStars(x,y,id,0) PostClickStars(x,y,id,0,0,1) break } } } } return ;----------------------------------------------------------------------------------------------------- clickwithdelay: if interval1 is not number interval:=0 else interval:=interval1*1000 Loop, Parse, tablequeue, `, { if !A_loopfield continue stringsplit,tab,A_loopfield,- if (abs(tab2-A_TickCount)>interval) ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI { WinGetPos,,,,h,ahk_id%tab1% if h>100 ;PostClickStars(tab3, tab4, tab1, 0) PostClickStars(tab3, tab4, tab1, 0,0,1) listDelItem(tablequeue, A_Loopfield) } } Loop, Parse, tablequeue_dealin, `, { if !A_loopfield continue stringsplit,tab,A_loopfield,- if (abs(tab2-A_TickCount)>DealinClick_delay) ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI { WinGetPos,,,,h,ahk_id%tab1% if h>100 ;PostClickStars(tab3, tab4, tab1, 0) PostClickStars(tab3, tab4, tab1, 0,0,1) listDelItem(tablequeue_dealin, A_Loopfield) } } return ;----------------------------------------------------------------------------------------------------- FILE_CHECK: If (_NEWLINES := CheckFile(location)) ;fileread,_NEWLINES,%location% { if defpos_file { timebank_x:=%Theme%_timebank_x timebank_y:=%Theme%_timebank_y } else { timebank_x:=custompos_file_x timebank_y:=custompos_file_y } if dealin if defpos_file_dealin { sitin_x:=%Theme%_imback_x sitin_y:=%Theme%_imback_y } else { sitin_x:=custompos_file_dealin_x sitin_y:=custompos_file_dealin_y } ;msgbox, %_NEWLINES% Loop, Parse, _NEWLINES, `n { if (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{8}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{10}\s(\w{8})", m)) { ;zero(m1) if !InStr(tablequeue,("0x" . m1)) listAdd(tablequeue,("0x" . m1) . "-" . A_TickCount . "-" . timebank_x . "-" . timebank_y) } else if (regExMatch(a_loopfield, "MSG_0x0021-T\s\w{8}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0021-T\s\w{10}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0014-T\s\w{8}\s(\w{8})", m)) || (regExMatch(a_loopfield, "MSG_0x0014-T\s\w{10}\s(\w{8})", m)) { ;zero(m1) if InStr(tablequeue,("0x" . m1)) ;listDelItem(tablequeue,("0x" . m1)) removefromlist(tablequeue,("0x" . m1)) } else if (regExMatch(a_loopfield, "MSG_0x000A-T\s\w{8}\s(\w{8})\s", m)) || (regExMatch(a_loopfield, "MSG_0x000A-T\s\w{10}\s(\w{8})\s", m)) if dealin { ;zero(m1) ifwinnotexist,ConfigWindow ahk_class AutoHotkeyGUI if !InStr(tablequeue_dealin,("0x" . m1)) listAdd(tablequeue_dealin,("0x" . m1) . "-" . A_TickCount . "-" . sitin_x . "-" . sitin_y) } } } Return zero(byRef var) { loop { stringmid,char,var,1,1 if char=0 StringTrimLeft,var,var,1,1 else break } } return CheckFile(File) { global AhkVersion ; 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) ReplaceByte( &Tail, Length) VarSetCapacity(Tail, -1) FP := nSize if A_IsUnicode tail:=Ansi2Unicode(tail) SetBatchLines, %BatchLines% Return Tail } Ansi2Unicode(sString, CP = 0) { nSize := DllCall("MultiByteToWideChar" , "Uint", CP , "Uint", 0 , "Uint", &sString , "int", -1 , "Uint", 0 , "int", 0) VarSetCapacity(wString, nSize * 2) DllCall("MultiByteToWideChar" , "Uint", CP , "Uint", 0 , "Uint", &sString , "int", -1 , "Uint", &wString , "int", nSize) return wstring } ReplaceByte( hayStackAddr, hayStackSize, ByteFrom=0, ByteTo=1, StartOffset=0, NumReps=-1) { Static fun IfEqual,fun, { h= ( LTrim join 5589E553515256579C8B4D0C8B451831D229C17E25837D1C00741F8B7D0801C70FB6451 00FB65D14FCF2AE750D885FFF42FF4D1C740409C975EF9D89D05F5E5A595BC9C21800 ) VarSetCapacity(fun,StrLen(h)//2) Loop % StrLen(h)//2 NumPut("0x" . SubStr(h,2*A_Index-1,2), fun, A_Index-1, "Char") } Return DllCall(&fun , "uint",haystackAddr, "uint",hayStackSize, "short",ByteFrom, "short",ByteTo , "uint",StartOffset, "int",NumReps) } FlipBlueAndRed(c) ; takes RGB or BGR and swaps the R and B { return (c&255)<<16 | (c&65280) | (c>>16) } DecToHex(dec) { oldfrmt := A_FormatInteger hex := dec SetFormat, IntegerFast, hex hex += 0 hex .= "" SetFormat, IntegerFast, %oldfrmt% return hex } config: config() return save_config_file: save(1) return save_config_file_dealin: save(2) return save_config_pixel: save(3) return save_config_pixel_dealin: save(4) return method: gui,Submit,nohide ctrl=file loop 2 { state:=(use_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%Txt GuiControl, %state%, %ctrl%Txt3 GuiControl, %state%, %ctrl%Txt4 GuiControl, %state%, %ctrl%Txt5 GuiControl, %state%, defpos_%ctrl% GuiControl, %state%, custompos_%ctrl% if (ctrl="file") { state:=(use_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, customlocation GuiControl, %state%, Select } state:=(use_%ctrl%=0) ? "Disable" : (custompos_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%btn1 state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : "Enable" GuiControl, %state%, defpos_%ctrl%_dealin GuiControl, %state%, custompos_%ctrl%_dealin state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : (custompos_%ctrl%_dealin) ? "Enable" : "Disable" GuiControl, %state%, %ctrl%btn1_dealin GuiControl, %state%, %ctrl%Txt6 GuiControl, %state%, %ctrl%Txt1 GuiControl, %state%, %ctrl%Txt2 GuiControl, %state%, %ctrl%Txt7 ctrl=pixel } return submitsettings: gui,Submit,nohide FileDelete, %thisahk%.ini gosub,MakeIni gosub,getini GuiControl, +background%Currentcolor%, Currentcolor GuiControl, +background%Currentcolor_dealin%, Currentcolor_dealin GuiControl, Text, pixelTxt4, %Currentcolorbgr% GuiControl, Text, pixelTxt6, %Currentcolorbgr_dealin% GuiControl, Text, filetxt5, Current location: %currentpos_file_x%/%currentpos_file_y% GuiControl, Text, filetxt1, Current location: %currentpos_file_dealin_x%/%currentpos_file_dealin_y% ctrl=file loop 2 { state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : (custompos_%ctrl%_dealin=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%btn1_dealin GuiControl, %state%, %ctrl%Txt2 state:=(use_%ctrl%=0) ? "Disable" : (custompos_%ctrl%=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%Txt7 GuiControl, %state%, %ctrl%btn1 ctrl=pixel } return dealinsettings: gui,Submit,nohide state:=(dealin=0) ? "Disable" : (use_pixel=0) ? "Disable" : "Enable" GuiControl, %state%, Currentcolor_dealin GuiControl, %state%, pixelTxt6 ctrl=file loop 2 { state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : "Enable" GuiControl, %state%, %ctrl%Txt1 GuiControl, %state%, defpos_%ctrl%_dealin GuiControl, %state%, custompos_%ctrl%_dealin state:=(use_%ctrl%=0) ? "Disable" : (dealin=0) ? "Disable" : (custompos_%ctrl%_dealin) ? "Enable" : "Disable" GuiControl, %state%, %ctrl%btn1_dealin GuiControl, %state%, %ctrl%Txt2 ctrl=pixel } return drag() { ifwinactive,ConfigWindow ahk_class AutoHotkeyGUI PostMessage, 0xA1, 2 } return config() { global xbord,cap winclose,Test ahk_class AutoHotkeyGUI ifwinexist,ConfigWindow ahk_class AutoHotkeyGUI return ctrl=file loop 2 { if instr(A_guicontrol,ctrl) { if instr(A_guicontrol,"dealin") GuiControl, Enable, %ctrl%btn2_dealin else GuiControl, Enable, %ctrl%btn2 } ctrl=pixel } ;CustomColor = EEAA99 CustomColor = 000000 Gui,2: +Alwaysontop -Caption +Resize Gui,2: Color, %CustomColor% Gui,2: show, w100 h60, ConfigWindow ;WinSet, TransColor, %CustomColor%, ConfigWindow WinSet, Transparent ,125,ConfigWindow } return Confirm: confirmed:=1 Gui,3:destroy return Cancel1: 3guiclose: Gui,3:destroy confirmed:=0 return save(mode) { global xbord,ybord,cap,confirmed,thisahk winget,id,id,ahk_class GLFW30 wingetpos,x,y,w,h,ahk_id %id% wingetpos,x1,y1,w1,h1,ConfigWindow getlength:=w1-2*xbord getheight:=h1-2*ybord ;Gui,3: Show, w%getlength% h%getheight%, Test Gui,3: Show, w300 h300, Test WinGet,TestID, id, Test ahk_class AutoHotkeyGUI hdc_frame := DllCall("GetDC", UInt, TestID) hdc_buffer := DllCall("gdi32.dll\CreateCompatibleDC", UInt, hdc_frame) hbm_buffer := DllCall("gdi32.dll\CreateCompatibleBitmap", UInt,hdc_frame, Int,w, Int,h) DllCall( "gdi32.dll\SelectObject", UInt,hdc_buffer, UInt,hbm_buffer) DllCall( "PrintWindow", UInt , id , UInt , hdc_buffer , UInt , 0 ) startx:=x1-x+xbord starty:=y1-y+ybord targetx:=Round((startx+Round(getlength/4)-xbord)/(w - (2*xbord)),5) targety:=Round((starty+Round(getheight/3)-ybord - cap)/(h - (2*ybord) - cap),5) x:=Round(((W-2*xbord)*targetx)) + xbord y:=Round(((H-(2*ybord)-cap)*targety)) + ybord + cap targetp := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x , "Int", y) SetFormat, IntegerFast, hex targetp += 0 targetp .= "" SetFormat, IntegerFast, d loop 5 { loop 5 DllCall("SetPixel", "uint", hdc_buffer, "int", x+A_index, "int", y, "uint", 0xFFFFFF) y++ } x:=(getlength<200) ? Round((200-getlength)/2) : 10 y:=10 DllCall("gdi32.dll\BitBlt" , UInt,hdc_frame, Int, x, Int, y, Int, getlength, Int, getheight, UInt,hdc_buffer, Int, startx, Int, starty, UInt, 0xCC0020) WinGet,ctrls,ControlList,ahk_id %id% Loop,Parse,ctrls,`n { class:=A_LoopField ControlGet,ctrlid,Hwnd,,%class%,ahk_id %id% ControlGet,visible,Visible,,,ahk_id %ctrlid% If visible=1 DllCall("RedrawWindow","UInt",ctrlid,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) } DllCall("RedrawWindow","UInt",id,"UInt",0,"UInt",0,"UInt", 1|4|64|1024) DllCall( "gdi32.dll\DeleteObject", "uint", hbm_buffer ) DllCall( "gdi32.dll\ReleaseDC" , "uint", hdc_frame ) DllCall( "gdi32.dll\DeleteDC" , "uint", hdc_frame ) DllCall( "gdi32.dll\DeleteDC" , "uint", hdc_buffer ) y:=getheight+20 Gui,3: Add, text, x6 y%y% ,Has the button been captured correctly? y+=20 Gui,3: Add, Button, x26 y%y% w65 h20 gconfirm, Confirm Gui,3: Add, Button, x106 y%y% w65 h20 gCancel1, Cancel h:=y+30 w:=(w1<200) ? 200 : w1+20 Gui,3: Show, w%w% h%h%, Test gui,2:destroy ctrl=file loop 2 { GuiControl, Disable, %ctrl%btn2_dealin GuiControl, Disable, %ctrl%btn2 ctrl=pixel } confirmed= loop { if confirmed=1 { if mode=1 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_file_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_file_y } else if mode=2 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_file_dealin_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_file_dealin_y } else if mode=3 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_pixel_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_pixel_y IniWrite, %targetp%, %thisahk%.ini, Options, custom_color } else if mode=4 { IniWrite, %targetx%, %thisahk%.ini, Options, custompos_pixel_dealin_x IniWrite, %targety%, %thisahk%.ini, Options, custompos_pixel_dealin_y IniWrite, %targetp%, %thisahk%.ini, Options, custompos_color_dealin } confirmed= gui,Submit,nohide gosub,getini gosub,submitsettings break } else if confirmed=0 break } } return detect: location= Loop, %A_ProgramFiles%\* , 2 { if instr(A_LoopFileName,"PokerStars")>0 location:=A_LoopFileFullPath . "\PokerStars.log.0" } IfNotExist %location% Loop, %A_AppData%\* , 2 if instr(A_LoopFileName,"PokerStars")>0 location:=A_LoopFileFullPath . "\PokerStars.log.0" IfNotExist %location% { StringReplace,location,A_AppData,Roaming,Local Loop, %location%\* , 2 if instr(A_LoopFileName,"PokerStars")>0 location:=A_LoopFileFullPath . "\PokerStars.log.0" } IfNotExist %location% location:="PokerStars.log.0 file was not found!" return Selectfile: gui,Submit,nohide if !customlocation { FileSelectFolder,folder,,2,Select the folder with the PokerStars.log.0 file, type/paste the path into the edit field alternatively Folder := RegExReplace(Folder, "\\$") } else { StringReplace,Folder,customlocation,\PokerStars.log.0, Folder := RegExReplace(Folder, "\\$") } IfNotExist,%Folder%\PokerStars.log.0 gosub,confirmdialog else { location:=Folder . "\PokerStars.log.0" IniWrite, %location%, %thisahk%.ini, Settings, location customlocation:=Folder . "\PokerStars.log.0" IniWrite, %customlocation%, %thisahk%.ini, Settings, customlocation GuiControl,Text,customlocation,%customlocation% GuiControl,Text,fileTxt3,Pokerstars.log.0 file location:%location% } fontcolor:=(instr(location,"not found")>0) ? "red" : (FileExist(location)) ? "green" : "red" gui,font,c%fontcolor% GuiControl,font,fileTxt3 return confirmdialog: MsgBox, 4,, PokerStars.log.0 was not found in the selected folder, continue anyway? IfMsgBox Yes { if !Folder return location:=Folder . "\PokerStars.log.0" IniWrite, %location%, %thisahk%.ini, Settings, location customlocation:=Folder . "\PokerStars.log.0" IniWrite, %customlocation%, %thisahk%.ini, Settings, customlocation GuiControl,Text,customlocation,%customlocation% GuiControl,Text,fileTxt3,Pokerstars.log.0 file location:%location% gui,font,c%fontcolor% GuiControl,font,fileTxt3 } else { customlocation= GuiControl,Text,customlocation,%customlocation% gosub,Selectfile } return BuildGui: Gui, color, white Gui, add, tab, h730 w506, General Gui, Tab, General Gui, Add, Radio, x26 y50 w280 h20 Checked%use_file% vuse_file gmethod, Use Pokerstars.log.0 file reading method (default) Gui, Add, Radio, x26 y70 w280 h20 Checked%use_pixel% vuse_pixel gmethod, Use pixel reading method Gui, add, Text, w200 y110 x26, Time delay for pressing the Time button Gui, add, DropDownList, w40 y105 x215 vInterval1, %ddlist% Gui, add, Checkbox, y150 x26 Checked%dealin% Vdealin gdealinsettings, Press I'm back button additionally Gui, add, text, x26 y170 ,(excluding intentional Sitout/Sitout nextbb using the file read, including for the pixel read) Gui, add, text, x366 y50 cred ,Select the table theme Gui, Add, Radio, x366 y70 w130 h20 Checked%ClassicTheme% vClassicTheme gsubmitsettings, Classic Theme Gui, Add, Radio, x366 y90 w130 h20 Checked%HyperSimpleTheme% vHyperSimpleTheme gsubmitsettings, HyperSimple Theme Gui, Add, Radio, x366 y110 w130 h20 Checked%BlackTheme% vBlackTheme gsubmitsettings, Black Theme Gui, Add, Radio, x366 y130 w130 h20 Checked%SlickTheme% vSlickTheme gsubmitsettings, Slick Theme Gui, Add, Radio, x366 y150 w130 h20 Checked%NovaTheme% vNovaTheme gsubmitsettings, Nova Theme Gui, add, text, x26 y210 cred Disabled%use_pixel% vfileTxt,File reading method configuration Gui, add, text, x26 y230 w480 c%fontcolor% Disabled%use_pixel% vfileTxt3,Pokerstars.log.0 file location: %location% Gui, add, text, x26 y250 Disabled%use_pixel% vfileTxt4,Custom location Gui, Add, Edit, x126 y250 w300 h20 vcustomlocation Disabled%use_pixel%, %customlocation% Gui, Add, Button, x435 y250 w65 h20 gSelectfile Disabled%use_pixel% vSelect,Select Gui, Add, Radio, x26 y290 w280 h20 Disabled%use_pixel% Checked%defpos_file% vdefpos_file gsubmitsettings, Use Theme default Timebank button location Gui, Add, Radio, x26 y310 w280 h20 Disabled%use_pixel% Checked%custompos_file% vcustompos_file gsubmitsettings, Use custom Timebank button location Gui, add, text, x316 y300 w180 cred Disabled%use_pixel% vfileTxt5,Current location: %currentpos_file_x%/%currentpos_file_y% Gui, Add, Button, x26 y330 w65 h20 %customfilestate% gconfig vfilebtn1,Configure Gui, Add, Button, x106 y330 w65 h20 Disabled gsave_config_file vfilebtn2,Save Gui, add, text, x206 y330 %customfilestate% vfileTxt7,(wrap the window around the Timebank button and press save) Gui, Add, Radio, x26 y370 w280 h20 %filedealinstate% Checked%defpos_file_dealin% vdefpos_file_dealin gsubmitsettings, Use Theme default Imback button location Gui, Add, Radio, x26 y390 w280 h20 %filedealinstate% Checked%custompos_file_dealin% vcustompos_file_dealin gsubmitsettings, Use custom Imback button location Gui, add, text, x316 y380 w180 cred %filedealinstate% vfileTxt1,Current location: %currentpos_file_dealin_x%/%currentpos_file_dealin_y% Gui, Add, Button, x26 y410 w65 h20 %customfilestate_dealin% gconfig vfilebtn1_dealin,Configure Gui, Add, Button, x106 y410 w65 h20 Disabled gsave_config_file_dealin vfilebtn2_dealin,Save Gui, add, text, x206 y410 %customfilestate_dealin% vfileTxt2,(wrap the window around the Imback button and press save) Gui, add, text, x26 y470 cred Disabled%use_file% vpixelTxt,Pixel reading method configuration Gui, Add, Radio, x26 y490 w280 h20 Disabled%use_file% Checked%defpos_pixel% gsubmitsettings vdefpos_pixel, Use Theme default Timebank button color Gui, Add, Radio, x26 y510 w280 h20 Disabled%use_file% Checked%custompos_pixel% gsubmitsettings vcustompos_pixel, Use custom Timebank button color Gui, add, text, x316 y500 cred Disabled%use_file% vpixelTxt3,Current color: Gui, Add, Progress, x406 y500 w20 h20 Disabled%use_file% cGreen background%Currentcolor% vCurrentcolor Gui, add, text, x436 y500 w60 vpixelTxt4 Disabled%use_file%,(%Currentcolorbgr%) Gui, Add, Button, x26 y530 w65 h20 %custompixelstate% gconfig vpixelbtn1,Configure Gui, Add, Button, x106 y530 w65 h20 Disabled gsave_config_pixel vpixelbtn2,Save Gui, add, text, x206 y530 %custompixelstate% vpixelTxt7,(wrap the window around the unpressed Timebank button) Gui, Add, Radio, x26 y570 w280 h20 %pixeldealinstate% Checked%defpos_pixel_dealin% gsubmitsettings vdefpos_pixel_dealin, Use Theme default Imback button color Gui, Add, Radio, x26 y590 w280 h20 %pixeldealinstate% Checked%custompos_pixel_dealin% gsubmitsettings vcustompos_pixel_dealin, Use custom Imback button color Gui, add, text, x316 y580 cred %pixeldealinstate% vpixelTxt1,Current color: Gui, Add, Progress, x406 y580 w20 h20 %pixeldealinstate% cGreen background%Currentcolor_dealin% vCurrentcolor_dealin Gui, add, text, x436 y580 w60 %pixeldealinstate% vpixelTxt6 ,(%Currentcolorbgr_dealin%) Gui, Add, Button, x26 y610 w65 h20 %custompixelstate_dealin% gconfig %dealinstate% vpixelbtn1_dealin,Configure Gui, Add, Button, x106 y610 w65 h20 Disabled gsave_config_pixel_dealin %dealinstate% vpixelbtn2_dealin,Save Gui, add, text, x206 y610 %custompixelstate_dealin% vpixelTxt2,(wrap the window around the Imback button and press save) Gui, add, Checkbox, y655 x26 Checked%guishow% Vguishow, Show GUI at the script start Gui, Add, Button, x205 y690 w55 h20 gSave,Submit Gui, Add, Button, x265 y690 w55 h20 gCancel,Cancel Gui, show, w526, %thisahk% gosub,getini Gui,Submit,nohide Return ;----------------------------------------------------------------------------------------------------- GetIni: IfNotExist, %thisahk%.ini gosub, CreateIni IniRead, ClassicTheme,%thisahk%.ini, Options, ClassicTheme,0 IniRead, HyperSimpleTheme,%thisahk%.ini, Options, HyperSimpleTheme,0 IniRead, SlickTheme,%thisahk%.ini, Options, SlickTheme,0 IniRead, BlackTheme,%thisahk%.ini, Options, BlackTheme,0 IniRead, NovaTheme,%thisahk%.ini, Options, NovaTheme,0 IniRead, Interval1, %thisahk%.ini, Settings, Interval1 IniRead, location, %thisahk%.ini, Settings, location IniRead, customlocation, %thisahk%.ini, Settings, customlocation,%A_space% IniRead, dealin, %thisahk%.ini, Settings, dealin IniRead, use_file, %thisahk%.ini, Settings, use_file,0 IniRead, use_pixel, %thisahk%.ini, Settings, use_pixel,0 IniRead, defpos_pixel,%thisahk%.ini, Options, defpos_pixel,0 IniRead, custompos_pixel,%thisahk%.ini, Options, custompos_pixel,0 IniRead, defpos_pixel_dealin,%thisahk%.ini, Options, defpos_pixel_dealin,0 IniRead, custompos_pixel_dealin,%thisahk%.ini, Options, custompos_pixel_dealin,0 IniRead, defpos_file,%thisahk%.ini, Options, defpos_file,0 IniRead, custompos_file,%thisahk%.ini, Options, custompos_file,0 IniRead, defpos_file_dealin,%thisahk%.ini, Options, defpos_file_dealin,0 IniRead, custompos_file_dealin,%thisahk%.ini, Options, custompos_file_dealin,0 IniRead, custompos_file_x,%thisahk%.ini, Options, custompos_file_x,0 IniRead, custompos_file_y,%thisahk%.ini, Options, custompos_file_y,0 IniRead, custompos_file_dealin_x,%thisahk%.ini, Options, custompos_file_dealin_x,0 IniRead, custompos_file_dealin_y,%thisahk%.ini, Options, custompos_file_dealin_y,0 IniRead, custompos_pixel_x,%thisahk%.ini, Options, custompos_pixel_x,0 IniRead, custompos_pixel_y,%thisahk%.ini, Options, custompos_pixel_y,0 IniRead, custompos_pixel_dealin_x,%thisahk%.ini, Options, custompos_pixel_dealin_x,0 IniRead, custompos_pixel_dealin_y,%thisahk%.ini, Options, custompos_pixel_dealin_y,0 IniRead, custom_color,%thisahk%.ini, Options, custom_color,0 IniRead, custom_color_dealin,%thisahk%.ini, Options, custom_color_dealin,0 IniRead, guishow, %thisahk%.ini, Settings, guishow Theme:=(ClassicTheme=1) ? "ClassicTheme" : (HyperSimpleTheme=1) ? "HyperSimpleTheme" : (BlackTheme=1) ? "BlackTheme" : (SlickTheme=1) ? "SlickTheme" : (NovaTheme=1) ? "NovaTheme" : "" fontcolor:=(instr(location,"not found")>0) ? "red" : (FileExist(location)) ? "green" : "red" if customlocation location:=customlocation StringReplace, ddlist, ddlist, %interval1%, %Interval1%| GuiControl, , Interval1, |%ddlist% StringReplace, ddlist, ddlist, %interval1%|, %Interval1% ;------------------------Init-------------------------- ClassicTheme_timebank_x:=0.64423 ClassicTheme_timebank_y:=0.82791 ClassicTheme_timebank_color:=0x09357e ;0x9357e ClassicTheme_imback_x:=0.67400 ClassicTheme_imback_y:=0.85814 ClassicTheme_imback_color:=0x000000 HyperSimpleTheme_timebank_x:=0.64423 HyperSimpleTheme_timebank_y:=0.82791 HyperSimpleTheme_timebank_color:=0xe9e6e6 HyperSimpleTheme_imback_x:=0.67400 HyperSimpleTheme_imback_y:=0.85814 HyperSimpleTheme_imback_color:=0xdfd9ce BlackTheme_timebank_x:=0.58814 ;BlackTheme_timebank_y:=0.85814 BlackTheme_timebank_y:=0.84414 BlackTheme_timebank_color:=0x01025a ;0x1025a BlackTheme_imback_x:=0.67400 BlackTheme_imback_y:=0.85814 BlackTheme_imback_color:=0x1e1e1e SlickTheme_timebank_x:=0.58814 ;SlickTheme_timebank_y:=0.85814 SlickTheme_timebank_y:=0.84414 SlickTheme_timebank_color:=0x09092b ;0x9092b SlickTheme_imback_x:=0.67400 SlickTheme_imback_y:=0.85814 SlickTheme_imback_color:=0x080828 NovaTheme_timebank_x:=0.94712 NovaTheme_timebank_y:=0.78372 NovaTheme_timebank_color:=0x252525 NovaTheme_imback_x:=0.85417 NovaTheme_imback_y:=0.86512 ;NovaTheme_imback_y:=0.89679 NovaTheme_imback_color:=0x4a4a4a if defpos_file=1 { currentpos_file_x:=%Theme%_timebank_x currentpos_file_y:=%Theme%_timebank_y } else { currentpos_file_x:=custompos_file_x currentpos_file_y:=custompos_file_y } if defpos_file_dealin=1 { currentpos_file_dealin_x:=%Theme%_imback_x currentpos_file_dealin_y:=%Theme%_imback_y } else { currentpos_file_dealin_x:=custompos_file_dealin_x currentpos_file_dealin_y:=custompos_file_dealin_y } if defpos_pixel=1 { currentpos_pixel_x:=%Theme%_timebank_x currentpos_pixel_y:=%Theme%_timebank_y } else { currentpos_pixel_x:=custompos_pixel_x currentpos_pixel_y:=custompos_pixel_y } if defpos_pixel_dealin=1 { currentpos_pixel_dealin_x:=%Theme%_imback_x currentpos_pixel_dealin_y:=%Theme%_imback_y } else { currentpos_pixel_dealin_x:=custompos_pixel_dealin_x currentpos_pixel_dealin_y:=custompos_pixel_dealin_y } if defpos_pixel=1 Currentcolor:=DecToHex(FlipBlueAndRed(%Theme%_timebank_color)) else Currentcolor:=DecToHex(FlipBlueAndRed(custom_color)) if defpos_pixel_dealin=1 Currentcolor_dealin:=DecToHex(FlipBlueAndRed(%Theme%_imback_color)) else Currentcolor_dealin:=DecToHex(FlipBlueAndRed(custom_color_dealin)) Currentcolorbgr:=DecToHex(FlipBlueAndRed(Currentcolor)) Currentcolorbgr_dealin:=DecToHex(FlipBlueAndRed(Currentcolor_dealin)) filedealinstate:=(use_file=0) ? "disabled" : (dealin=1) ? "disabled0" : "disabled" pixeldealinstate:=(use_pixel=0) ? "disabled" : (dealin=1) ? "disabled0" : "disabled" customfilestate:=(use_file=0) ? "disabled" : (custompos_file=1) ? "disabled0" : "disabled" customfilestate_dealin:=(use_file=0) ? "disabled" : (dealin=0) ? "disabled" : (custompos_file_dealin=1) ? "disabled0" : "disabled" custompixelstate:=(use_pixel=0) ? "disabled" : (custompos_pixel=1) ? "disabled0" : "disabled" custompixelstate_dealin:=(use_pixel=0) ? "disabled" : (dealin=0) ? "disabled" : (custompos_pixel_dealin=1) ? "disabled0" : "disabled" if guishow { winget,id,id, %thisahk% ahk_class AutoHotkeyGUI if !DllCall( "IsWindowVisible", "UInt",id) gosub, buildgui } Return ;----------------------------------------------------------------------------------------------------- MakeIni: If ClassicTheme IniWrite, %ClassicTheme%, %thisahk%.ini, Options, ClassicTheme If HyperSimpleTheme IniWrite, %HyperSimpleTheme%, %thisahk%.ini, Options, HyperSimpleTheme If SlickTheme IniWrite, %SlickTheme%, %thisahk%.ini, Options, SlickTheme If BlackTheme IniWrite, %BlackTheme%, %thisahk%.ini, Options, BlackTheme If NovaTheme IniWrite, %NovaTheme%, %thisahk%.ini, Options, NovaTheme If defpos_pixel IniWrite, %defpos_pixel%, %thisahk%.ini, Options, defpos_pixel If custompos_pixel IniWrite, %custompos_pixel%, %thisahk%.ini, Options, custompos_pixel If defpos_pixel_dealin IniWrite, %defpos_pixel_dealin%, %thisahk%.ini, Options, defpos_pixel_dealin If custompos_pixel_dealin IniWrite, %custompos_pixel_dealin%, %thisahk%.ini, Options, custompos_pixel_dealin If defpos_file IniWrite, %defpos_file%, %thisahk%.ini, Options, defpos_file If custompos_file IniWrite, %custompos_file%, %thisahk%.ini, Options, custompos_file If defpos_file_dealin IniWrite, %defpos_file_dealin%, %thisahk%.ini, Options, defpos_file_dealin If custompos_file_dealin IniWrite, %custompos_file_dealin%, %thisahk%.ini, Options, custompos_file_dealin if use_file IniWrite, %use_file%, %thisahk%.ini, Settings, use_file if use_pixel IniWrite, %use_pixel%, %thisahk%.ini, Settings, use_pixel if custompos_file_x IniWrite, %custompos_file_x%, %thisahk%.ini, Options, custompos_file_x if custompos_file_y IniWrite, %custompos_file_y%, %thisahk%.ini, Options, custompos_file_y if custompos_file_dealin_x IniWrite, %custompos_file_dealin_x%, %thisahk%.ini, Options, custompos_file_dealin_x if custompos_file_dealin_y IniWrite, %custompos_file_dealin_y%, %thisahk%.ini, Options, custompos_file_dealin_y if custompos_pixel_x IniWrite, %custompos_pixel_x%, %thisahk%.ini, Options, custompos_pixel_x if custompos_pixel_y IniWrite, %custompos_pixel_y%, %thisahk%.ini, Options, custompos_pixel_y if custompos_pixel_dealin_x IniWrite, %custompos_pixel_dealin_x%, %thisahk%.ini, Options, custompos_pixel_dealin_x if custompos_pixel_dealin_y IniWrite, %custompos_pixel_dealin_y%, %thisahk%.ini, Options, custompos_pixel_dealin_y if custom_color IniWrite, %custom_color%, %thisahk%.ini, Options, custom_color if custom_color_dealin IniWrite, %custom_color_dealin%, %thisahk%.ini, Options, custom_color_dealin IniWrite, %Interval1%, %thisahk%.ini, Settings, Interval1 if location IniWrite, %location%, %thisahk%.ini, Settings, location if customlocation IniWrite, %customlocation%, %thisahk%.ini, Settings, customlocation IniWrite, %dealin%, %thisahk%.ini, Settings, dealin IniWrite, %guishow%, %thisahk%.ini, Settings, guishow Return ;----------------------------------------------------------------------------------------------------- CreateIni: use_pixel:=0 use_file:=1 HyperSimpleTheme:=1 ClassicTheme:=0 SlickTheme:=0 BlackTheme:=0 NovaTheme:=0 Interval1:=5 defpos_pixel:=1 defpos_pixel_dealin:=1 defpos_file:=1 defpos_file_dealin:=1 dealin:=0 guishow:=0 gosub,detect gosub, MakeIni gosub, getIni winget,id,id, %thisahk% ahk_class AutoHotkeyGUI if !DllCall( "IsWindowVisible", "UInt",id) gosub, buildgui return ;----------------------------------------------------------------------------------------------------- GuiClose: gosub, cancel return ;----------------------------------------------------------------------------------------------------- 2GuiClose: return ;----------------------------------------------------------------------------------------------------- menuGui: gosub, getini winget,id,id, %thisahk% ahk_class AutoHotkeyGUI if !DllCall( "IsWindowVisible", "UInt",id) gosub, buildgui Gui, Submit,nohide return ;----------------------------------------------------------------------------------------------------- reload: reload return ;----------------------------------------------------------------------------------------------------- Save: Gui, Submit Gui, destroy FileDelete, %thisahk%.ini gosub, MakeIni ;Reload settimer,clickwithdelay,133 if use_file { if !instr(location,"not found")>0 settimer,FILE_CHECK,%CheckTime_file% settimer,ClickTimebank,off settimer,Clickimback,off sleep,-1 } else { settimer,FILE_CHECK,off settimer,ClickTimebank,%CheckTime_pixel% if dealin settimer,Clickimback,1563 else settimer,Clickimback,off sleep,-1 } return ;----------------------------------------------------------------------------------------------------- Cancel: Gui, Destroy Return ;----------------------------------------------------------------------------------------------------- Edit: edit return ;----------------------------------------------------------------------------------------------------- exitSub: FileDelete, %thisahk%.ini gosub, makeini exitApp return ;-----------------------------------------------------------------------------------------------------
thanks for helping out, but like you said, its not useful for stacked and i think the neversitout script is mostly useful for those who play stacked.
Is there no way around to have this work with aurora as many players already can't turn it off anymore.
Is there no way around to have this work with aurora as many players already can't turn it off anymore.
I don't see any easy way to make it work, different soft like tableninja may be able to do it.
Feedback is used for internal purposes. LEARN MORE