Last active
August 29, 2015 14:02
-
-
Save jarfil/42901ee8a05aa0ecf0ff to your computer and use it in GitHub Desktop.
Guns of Icarus: Multi-monitor center window, Auto-fire with OSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance force | |
;//////////// | |
;// Hotkeys | |
^!F8:: | |
WinGetActiveTitle, WActiveTitle | |
CenterWindow(WActiveTitle) | |
return | |
^!F10::AutoClick("left") | |
#F11::AutoClick("right") | |
XButton1::AutoClick("left") | |
LButton up::Click left up | |
LButton:: | |
AutoClick("off") | |
Click left down | |
return | |
RButton up::Click right up | |
RButton:: | |
AutoClick("off") | |
Click right down | |
return | |
; debug | |
;#F5::Gosub, ShowOSD | |
;#F4::Gosub, HideOSD | |
;////////////// | |
;// Functions | |
CenterWindow(WinTitle) | |
{ | |
WinGetPos,,, Width, Height, %WinTitle% | |
XOffset := 0 | |
YOffset := 0 | |
if ( WinTitle == "GunsOfIcarusOnline" ) | |
{ | |
YOffset := -12 | |
} | |
WinMove, %WinTitle%,, (A_ScreenWidth/2)-(Width/2)+XOffset, (A_ScreenHeight/2)-(Height/2)+YOffset | |
} | |
AutoClick(vButton="left", vInterval=100) | |
{ | |
global clickButton | |
static isEnabled := false | |
if (vButton == "off") { | |
if (isEnabled) { | |
doEnable := false | |
} else { | |
return | |
} | |
} else { | |
if (!isEnabled) { | |
doEnable := true | |
} else { | |
if (clickButton != vButton) { | |
clickButton := vButton | |
return | |
} else { | |
doEnable := false | |
} | |
} | |
} | |
isEnabled := doEnable | |
if (doEnable) | |
{ | |
clickButton := vButton | |
Gosub, ShowOSD | |
Gosub, ClickRepeat | |
SetTimer, ClickRepeat, %vInterval% | |
return | |
} | |
else | |
{ | |
clickButton := "" | |
Gosub, HideOSD | |
SetTimer, ClickRepeat, off | |
return | |
} | |
ClickRepeat: | |
Click %clickButton% | |
return | |
} | |
ShowOSD: | |
if (!isOsdCreated) { | |
isOsdCreated = true | |
CustomColor = EE4400 ; Can be any RGB color (it will be made transparent below). | |
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow ; +ToolWindow avoids a taskbar button and an alt-tab menu item. | |
Gui, Color, %CustomColor% | |
Gui, Font, s32 | |
Gui, Add, Text, vMyText cWhite, Auto-Click: ENABLED | |
; WinSet, TransColor, %CustomColor% 255 | |
} | |
Gui, Show, x400 y-100 NoActivate ; change to desired x,y | |
return | |
HideOSD: | |
if (isOsdCreated) { | |
Gui, Cancel | |
} | |
return | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment