View Single Post
  #10  
Old 03-07-2006, 10:07 PM
TheNoocH TheNoocH is offline
Senior Member
 
Join Date: Sep 2004
Location: NJ via Philly
Posts: 104
Default Re: Setting Up A Shortcut To Open Multiple Programs

Adde/Sam/anyone who wants to help,

trying this at home...ALMOST got it...couple of quick questions:

1) ControlClick, Button13 --> how do you know what Button # to use? note: this is just an example...i'm more interested how do you find what button in general
eg...i used this in Stars
ControlClick, OK , Login , User ID
ie using OK rather than Button#...just tried it...and seems to work...curious what should be used.

2)WinMinimize --> for Poker Tracker i have it set to minimize to system tray in poker trackers options but this seems to only minimize to task bar. any way to get it to minimize to the system tray?

3) i noticed on the RUN lines that the min and/or max don't seem to work all the time? any reasons why?

4)Is there any way to step through (ie debug) the ahk code? sometimes it just seems to stop processing...

5)can you take a look at this code and see if you see anything that could be better...i had to remark out the part in stars about the network status ...i'm assuming b/c i have to wait till the batch file window closes before i start doing the other menu commands, etc?

thanks for all your help....didn't notice the new code...this is based off your previous code examples...

; CODE BEGINS

pathPokerstars := "C:\Program Files\PokerStars\PS.bat"
pathPokerTracker := "C:\Program Files\Poker Tracker V2\ptrack2.exe"

doMinimizePokerTracker := 1 ; 1=YES 0=NO



; --------------------------------------------------------------------------------------------
;; THUNDERBIRD EMAIL ;;

Process, Exist, Thunderbird.exe
if %ErrorLevel% = 0
{
Run, "C:\Program Files\Mozilla Thunderbird\thunderbird.exe", ,min


SetTitleMatchMode, 2

WinWait, Thunderbird
IfWinNotActive, Thunderbird, , WinActivate, Thunderbird,
WinWaitActive, Thunderbird,

WinMinimize, Thunderbird
}
; --------------------------------------------------------------------------------------------


; --------------------------------------------------------------------------------------------
;; POKERTRACKER ;;
; --------------------------------------------------------------------------------------------

SetTitleMatchMode, 1
Process, Exist, ptrack2.exe
if %ErrorLevel% = 0
{
Run , %pathPokerTracker% , , max
}

openImportWindow := 0
startImportTimer := 0

IfWinNotExist, Poker Tracker (Version, Auto-Import
{
openImportWindow := 1
}
if openImportWindow = 1
{
WinWait, Poker Tracker (Version
WinActivate, Poker Tracker (Version
WinMenuSelectItem, Poker Tracker, , File, Auto-Import PokerStars
startImportTimer := 1
}
if startImportTimer = 1
{
WinWait, Poker Tracker (Version , Start Timer
ControlClick, Button11 , , Start Timer
WinWait, Poker Tracker (Version, Stop Timer
ControlClick, Button12 , , Force Import
}
if doMinimizePokerTracker
{
WinMinimize, Poker Tracker (Version
}
; --------------------------------------------------------------------------------------------


; --------------------------------------------------------------------------------------------
;; POKERACE HUD ;;

Process, Exist, PAHud.exe
if %ErrorLevel% = 0
{
Run, "C:\Program Files\PokerAce Hud\PAHud.exe", ,min
}
; --------------------------------------------------------------------------------------------


; --------------------------------------------------------------------------------------------
;; POKERSTARS ;;
; --------------------------------------------------------------------------------------------

SetTitleMatchMode, 1
Process, Exist, PokerStars.exe
if %ErrorLevel% = 0
{
Run, %pathPokerstars%

WinWait, C:\WINDOWS\system32\cmd.exe
WinWaitClose ; Wait for the exact window found by WinWait to be closed.


;WinWait, , Network Status

;Loop {
;IfWinNotExist , , Network Status
;break
;}

WinWait, PokerStars Lobby
IfWinNotActive, PokerStars Lobby, , WinActivate, PokerStars Lobby,
WinWaitActive, PokerStars Lobby,

;WinMove, PokerStars Lobby, , 0, 0

WinMenuSelectItem, PokerStars Lobby, , Lobby , Login
SetTitleMatchMode, 2
WinWait, Login , User ID
ControlClick, OK , Login , User ID
WinMenuSelectItem,PokerStars Lobby,,Options ,Images
WinMenuSelectItem,PokerStars Lobby,,Options,Images

ControlClick, x422 y146, PokerStars Lobby
ControlClick, x142 y179, PokerStars Lobby
ControlClick, x317 y205, PokerStars Lobby

}
; --------------------------------------------------------------------------------------------





; CODE ENDS
Reply With Quote