Oh my goodness... thank you for your WAY over the top investment in helping me try to figure this out
I have been using it for like 8 or 9 years and here is an example of probably my MOST complex script that I use for one of the ONLY 2 browsers that "mostly" work on my octogenarian Win XP OS*:
Code: Select all
sleep, 250
FileDelete, %AllUsersProfile%\Start Menu\Programs\Accessories\Scanner and Camera Wizard.lnk ;created whenever iPad is accessed by PC
sleep, 50
Run, C:\Program Files\Firefox\Firefox.exe
sleep, 1000 ;proven to be enough time for corrupted file to be created
{
IfExist, %AppData%\Mozilla\Firefox\Profiles\Evil-e\places.sqlite.corrupt ;script executed if found {1st attempt)
{
BlockInput, On
Menu, Tray, Icon, C:\Program Files\Firefox\Uninstall.exe, , 1 ;replacement System tray icon during corrupted Bookmarks repair
WinWait, ahk_exe Firefox.exe
WinMinimize, ahk_exe Firefox.exe ;minimize screen during corrupted file repair
Process, Close, Firefox.exe
sleep, 4000 ;allow corruption repair (less time fails consistantly)
FileMove, %AppData%\Mozilla\Firefox\Profiles\Evil-e\places.sqlite.corrupt, %AppData%\Mozilla\Firefox\Profiles\Evil-e\places.sqlite, 1
sleep, 500
Run, C:\Program Files\Firefox\Firefox.exe ;restart browser after Bookmarks repair
sleep, 750
CoordMode, Mouse, Screen ;moves cursor to upper LH corner near short-cuts
MouseMove,100,150,0
Menu, Tray, Icon, C:\Program Files\Firefox\Firefox.exe, , 1 ;restore Firefox System tray con after Bookmarks repair
BlockInput, Off
}
}
CoordMode, Mouse, Screen ;moves cursor to upper LH corner near short-cuts
MouseMove,100,150,0
{
IfWinExist, ahk_exe Firefox.exe
{
WinActivate, ahk_exe Firefox.exe
sleep, 250
WinActivate, ahk_exe Firefox.exe
sleep, 250
WinActivate, ahk_exe Firefox.exe
sleep, 250
WinActivate, ahk_exe Firefox.exe
}
}
sleep, 4000
{
IfWinNotExist, ahk_exe Firefox.exe ;ExitApp if browser closed prior to auto-execute complete
{
CoordMode, Mouse, Screen
MouseMove, 700, 980 ;cursor moved lower center of screen
ExitApp
}
}
#SingleInstance Ignore ;disables program already running message
#IfWinActive, ahk_exe Firefox.exe
DetectHiddenWindows, On
WinWait, ahk_exe Firefox.exe
WinWaitClose, ahk_exe Firefox.exe
{
IfWinExist, D3DOverrider ahk_class Afx:400000:20:10011:0:0 ;skip actions if Google Chrome browser in use
{
Process, Close, D3DOverrider.exe ;close vertical Sync program
BlockInput, On
CoordMode, Mouse, Screen
SendMode, Event
MouseMove, 1750,1060,0 ;clear cache from System Tray
SendMode, Event
MouseMove, 1845,1060,5
SendMode, Event
MouseMove, 700, 980 ;cursor moved lower cetner of screen
BlockInput, Off
}
}
{
IfWinNotExist, ahk_class Chrome_WidgetWin_1 ;skip actions if Google Chrome browser in use
{
WinMaximize, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass ;restore Wordpad program to full-screen by default
sleep, 50
WinMaximize, + web site log-in and passwords - WordPad ahk_class WordPadClass ;restore Wordpad program to full-screen by default
sleep, 250
WinClose, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass ;in the event Benjamin Boyce LINKS file is left open
sleep, 50
WinClose, + web site log-in and passwords - WordPad ahk_class WordPadClass ;in the event this log-in and passwords file is left open
CoordMode, Mouse, Screen
MouseMove, 700, 980 ;cursor moved lower cetner of screen
}
}
FileMove, %AppData%\Mozilla\Firefox\Profiles\Evil-e\places.sqlite.corrupt, %AppData%\Mozilla\Firefox\Profiles\Evil-e\places.sqlite, 1
sleep, 250
FileDelete, %AllUsersProfile%\Start Menu\Programs\Accessories\Scanner and Camera Wizard.lnk ;created whenever iPad is accessed by PC
sleep, 50
FileRemoveDir, %AppData%\Mozilla\Firefox\Crash Reports, 1 ;browser crash logs
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\parent.lock, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e, 1
sleep, 50
Run, "C:\Program Files\Firefox\LAUNCHDeleteCacheItems_Firefox.vbs" ;Cleans Documents and Settings of hidden folder attributes and cache
ExitApp
ControlFocus, OK, Mozilla Firefox ahk_class MozillaWindowClass ;forces focus of browser when cursor is active
F1:: ;extracts bookmarks with browser history
{
BlockInput, On
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionstore.js
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\cookies.sqlite
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\logins.json
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\places.sqlite
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionCheckpoints.json
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\SiteSecurityServiceState.txt
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\xulstore.json
sleep, 500
FileCopy, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionstore.js, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\cookies.sqlite, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\logins.json, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\places.sqlite, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\sessionCheckpoints.json, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\SiteSecurityServiceState.txt, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\xulstore.json, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\sessionstore-backups\recovery.js, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionstore.js
BlockInput, Off
}
return
F2::
{
BlockInput, On ;extracts bookmarks without browser history
sleep, 50
send {Ctrl down} ;opens Clear History dialog box
sleep, 50
send {Lshift down}
sleep, 50
send {delete down}
sleep, 50
send {delete up}
sleep, 50
send {Lshift up}
sleep, 50
send {Ctrl up} ;waits for "Clear All History" dialog box to open
{
WinWait, Clear All History ahk_class MozillaDialogClass
{
send {enter down}
sleep, 50
send {enter up}
}
}
sleep, 250
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionstore.js
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\cookies.sqlite
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\logins.json
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\places.sqlite
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionCheckpoints.json
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\SiteSecurityServiceState.txt
sleep, 50
FileDelete, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\xulstore.json
sleep, 500
FileCopy, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionstore.js, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\cookies.sqlite, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\logins.json, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\places.sqlite, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\sessionCheckpoints.json, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\SiteSecurityServiceState.txt, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\xulstore.json, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e
sleep, 50
FileCopy, %AppData%\Mozilla\Firefox\Profiles\Evil-e\sessionstore-backups\recovery.js, G:\Games\+ FireFox browser\+ Profile\Mozilla\Firefox\Profiles\Evil-e\sessionstore.js
BlockInput, Off
}
return
F3:: ;"Tap" opens + web site log-in and passwords "Hold" closes file
keywait,F3,t.2 ;"Hold" 200ms will close file when focus on browser window
if (errorlevel) {
ControlSend, + web site log-in and passwords - WordPad ahk_class WordPadClass ;sends commands "+ web site log-in and passwords.rtf" while out of focus
sleep, 250
WinMaximize, + web site log-in and passwords - WordPad ahk_class WordPadClass ;maximizes "+ web site log-in and passwords.rtf" while remaining out of focus
sleep, 250
WinClose, + web site log-in and passwords - WordPad ahk_class WordPadClass ;closes "+ web site log-in and passwords.rtf" after setting Wordpad to open fullscreen
sleep, 250
CoordMode, Mouse, Screen ;moves cursor near center of the screen
MouseMove,1000,600,0
} else {
ControlSend, ahk_class Chrome_WidgetWin_1
Run, "C:\Program Files\Google Chrome\+ web site log-in and passwords.rtf", ,Min ;launches "+ web site log-in and passwords.rtf" minimized to system tray
sleep, 250
WinActivate, + web site log-in and passwords - WordPad ahk_class WordPadClass ;sets as active window
sleep, 50
WinActivate, + web site log-in and passwords - WordPad ahk_class WordPadClass
sleep, 50
WinActivate, + web site log-in and passwords - WordPad ahk_class WordPadClass
sleep, 50
WinWaitActive, + web site log-in and passwords - WordPad ahk_class WordPadClass ;sets this window to apply following script
WinGet, window, ID, A
TargetX := (A_ScreenWidth/2)-(Width/2) ;sets horizontal target for window as 1/2 of screen width
TargetY := (A_ScreenHeight/2)-(Height/2) ;sets horizontal target for window as 1/2 of screen hight
WinMove, ahk_id %window%, ,400 ,400 ,1000 ,600 ;window position: from LH side , from top , width , hight
CoordMode, Mouse, Screen ;moves cursor near center "+ web site log-in and passwords.rtf"
MouseMove,1000,600,0
}
return
F4:: ;"Tap" opens + Benjamin Boyce LINKS "Hold" closes file
keywait,F4,t.2 ;"Hold" 200ms will close file when focus on browser window
if (errorlevel) {
ControlSend, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass ;sends commands "+ Benjamin Boyce LINKS.rtf" while out of focus
sleep, 250
WinMaximize, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass ;maximizes "+ Benjamin Boyce LINKS.rtf" while remaining out of focus
sleep, 250
WinClose, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass ;closes "+ Benjamin Boyce LINKS.rtf" after setting Wordpad to open fullscreen
sleep, 250
CoordMode, Mouse, Screen ;moves cursor near center of the screen
MouseMove,1000,600,0
} else {
Run, "C:\Program Files\Google Chrome\+ Benjamin Boyce LINKS.rtf", ,Min ;launches "+ Benjamin Boyce LINKS.rtf" minimized to system tray
sleep, 250
WinActivate, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass ;sets as active window
sleep, 50
WinActivate, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass
sleep, 50
WinActivate, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass
sleep, 50
WinWaitActive, + Benjamin Boyce LINKS - WordPad ahk_class WordPadClass ;sets this window to apply following script
WinGet, window, ID, A
TargetX := (A_ScreenWidth/2)-(Width/2) ;sets horizontal target for window as 1/2 of screen width
TargetY := (A_ScreenHeight/2)-(Height/2) ;sets horizontal target for window as 1/2 of screen hight
WinMove, ahk_id %window%, ,400 ,400 ,1000 ,600 ;window position: from LH side , from top , width , hight
CoordMode, Mouse, Screen ;moves cursor near center "+ web site log-in and passwords.rtf"
MouseMove,1000,600,0
}
return
F5:: ;"Tap" launches D3DOverrider
keywait,F5,t.2 ;"Hold" closes D3DOverrider and clears icon cache
if (errorlevel) {
Process, Close, D3DOverrider.exe ;close vertical Sync program
BlockInput, On
CoordMode, Mouse, Screen
SendMode, Event
MouseMove, 1750,1060,0 ;clear cache from System Tray
SendMode, Event
MouseMove, 1845,1060,5
SendMode, Event
MouseMove, 700, 980 ;cursor moved lower cetner of screen
BlockInput, Off
} else {
Run, C:\Program Files\Firefox\D3DOverrider\D3DOverrider.exe ;launches D3DOverrider Vsync program
}
return
F12::Run, "C:\Program Files\Firefox\Keymapping_Kill_Firefox_and_Chrome_1.exe" ;Complete restoration of Google Chrome / Firefox browsers
return
MButton:: ;"Tap" cycles Dark Mode
keywait,MButton,t.2 ;"Hold" 200ms saves bookmark to toolbar
if (errorlevel) {
BlockInput, On ;create Toolbar bookmark of current webpage
CoordMode, Mouse, Screen
MouseMove, 1788,48,2 ;add Bookmark
sleep, 500
send {LButton down}
sleep, 50
send {LButton up}
sleep, 250
CoordMode, Mouse, Screen
MouseMove, 1824,80,2 ;save Bookmark (long script to overcome loading lag)
sleep, 50
send {LButton down}
sleep, 5
send {LButton up}
sleep, 150
send {LButton down}
sleep, 5
send {LButton up}
sleep, 150
send {LButton down}
sleep, 5
send {LButton up}
sleep, 150
send {LButton down}
sleep, 5
send {LButton up}
sleep, 150
send {LButton down}
sleep, 5
send {LButton up}
sleep, 150
send {LButton down}
sleep, 5
send {LButton up}
CoordMode, Mouse, Screen
MouseMove, 1824,354,0 ;cursor upper RH side of webpage
BlockInput, Off
} else {
CoordMode, Mouse, Screen ;moves cursor over "Dark Mode" on / off switch
MouseMove,1857,51,0
send {LButton down} ;cycles "Dark Mode" on / off
sleep, 50
send {LButton up}
CoordMode, Mouse, Screen ;moves cursor 1"x 6" down RH top of screen
MouseMove,1860,350,0
}
return ;these block keys from various actions (^=Ctrl / +=LShift / !=ALt / #=Windows)
^+::
tooltip,blocked ;Disables "Ctrl+LShift"
sleep,50
tooltip
return
^!:: ;Disables "Ctrl+Alt"
tooltip,blocked
sleep,50
tooltip
return
^#:: ;Disables "Ctrl+Win"
tooltip,blocked
sleep,50
tooltip
Alt:: ;Disables "Options Menu"
tooltip,blocked
sleep,50
tooltip
LWin:: ;Disables "Left Windows"
tooltip,blocked
sleep,50
tooltip
RWin:: ;Disables "Right Windows"
tooltip,blocked
sleep,50
tooltip
PgUp:: ;Disables "Scrolling up"
tooltip,blocked
sleep,50
tooltip
PgDn:: ;Disables "Scrolling down"
tooltip,blocked
sleep,50
tooltip
return
The above is 100% unrelated to my problem with DiRT 3, but much of what I wrote here is from knowledge of only the last 1 year. Up until this past year, 98% of my 1400+ scripts are WSAD = EDSF and hot keys. In short the language in your script is light years over my head
Do not misunderstand, my appreciation for your help is as over the top as your willingness to write that script for me. However, unless it were to work flawlessly as it stands (short of directory / file name changes), I would have literally ZERO idea of where to begin looking to figure out what went wrong. I can see it is doing a pixel search, but that is all I know. again....
I will do some research on "pixel search", as there is a failing game code issue that is happening in processing launch, but all that I see is either the loading video's begin playing or they don't and I key "F11" to restart. Amazing that you wrote this script to help me, but I don't have the AHK knowledge to work with it... I am sorry
Thank you VERY much for all of your effort, but this is too complicated for me to understand
*I have EXTREMELY customized my Win XP, deep into System32 critical operation files and Bill Gates would DEFINITELY not approve!...