Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Modify these values
- CrosshairWidth = 2
- CrosshairLength = 23
- CrosshairColor = FF00FF
- GameName = 7 Days To Die
- ;Do not modify below this line
- #NoEnv
- #SingleInstance Force
- SetWinDelay 0
- Coordmode Mouse, Screen
- WS_BORDER:= 0x800000
- WS_CAPTION:=0xC00000
- ID1 := Box(1,CrosshairWidth,CrosshairLength)
- ID2 := Box(2,CrosshairLength,CrosshairWidth)
- IfWinNotActive, %GameName%
- {
- Gui %ID1%: hide
- Gui %ID2%: hide
- }
- RulerX:= A_ScreenWidth/2-Ceil(CrosshairWidth/2)
- RulerY:= A_ScreenHeight/2-Ceil(CrosshairWidth/2)
- WinMove ahk_id %ID1%,, %RulerX%, % RulerY-Floor(CrosshairLength/2)+1
- WinMove ahk_id %ID2%,, % RulerX-Floor(CrosshairLength/2)+1, %RulerY%
- loop
- {
- WinWaitActive, %GameName%
- Winset AlwaysOnTop,ON,ahk_id %ID1% ;needed for some games
- Winset AlwaysOnTop,ON,ahk_id %ID2% ;needed for some games
- Gui %ID1%: Show, NoActivate
- Gui %ID2%: Show, NoActivate
- WinWaitNotActive, %GameName%
- Gui %ID1%: hide
- Gui %ID2%: hide
- }
- return
- Box(n,wide,high)
- {
- global CrosshairColor
- Gui %n%:-Caption +ToolWindow +E0x20 +hwndID ; No title bar, No taskbar button, Transparent for clicks
- Gui %n%:Color, %CrosshairColor%,0 ; Set background color to CrosshairColor
- Gui %n%: Show, Center W%wide% H%high% NoActivate ; Show it
- Winset AlwaysOnTop,ON,ahk_id %ID% ; Keep it always on the top
- WinSet Transparent,255,ahk_id %ID% ; make it transparent
- Return ID
- }
- !F1::
- IfWinExist %GameName%
- {
- WinSet, Style, -%WS_BORDER%, %GameName%
- WinSet, Style, -%WS_CAPTION%, %GameName%
- WinMove, %GameName%,, 0, 0, A_ScreenWidth, A_ScreenHeight
- }
- else
- msgbox, Game window not found.
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement