Code:
CrosshairAdjust = 11
Process, wait, iw5mp.exe, 0.1
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID != 1
{
Process, wait, iw5mp.dat, 0.1
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID != 1
{
MsgBox Could not find Modern Warfare 3!
ExitApp
}
}
WinActivate, ahk_pid %NewPID%
WinGetPos,,,ModW, ModH, ahk_pid %NewPID%
NewX := (A_ScreenWidth / 2) - (ModW / 2)
NewY := (A_ScreenHeight / 2 - 11) - (ModH / 2)
WinMove, ahk_pid %NewPID%,, %NewX%, %NewY%
WinGetPos,,,ModW, ModH, ahk_pid %NewPID%
#SingleInstance force
#Persistent
OnExit, ExitRoutine
xpos := A_ScreenWidth/2
ypos := A_ScreenHeight/2
hDrwArea := DllCall("GetDC", "uint", Null)
SetTimer, SetPixel, 1
SetPixel:
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 1, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 1, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 1, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 1, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 2, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 2, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 3, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 3, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 2, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 2, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 3, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 3, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 4, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 4, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 4, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 4, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 5, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 5, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 5, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 5, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 6, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 6, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 6, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 6, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 7, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 7, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 7, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 7, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 8, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 8, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 8, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 8, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 9, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 9, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 9, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 9, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 10, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 10, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 10, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 10, "int", ypos, "uint", 255, "uint", 0, "uint", 0)
ExitApp
Return
ExitRoutine:
DllCall("ReleaseDC", UInt, 0, UInt, hDrwArea)
DllCall("FreeLibrary", "UInt", hDrwArea)
ExitApp
; Please do not edit this! ----------------------------------
^+a::
Gui, Add, Button, x32 y20 w130 h50, &Move &Crosshair &Up
Gui, Add, Button, x32 y140 w130 h50, &Move &Crosshair &Down
; Generated using SmartGUI Creator 4.0
Gui, Show, x127 y87 h221 w198, Settings
Return
ButtonMoveCrosshairUp:
NewT := (A_ScreenWidth / 2) - (ModW / 2)
NewU := (A_ScreenHeight / 2 - CrosshairAdjust--) - (ModH / 2)
WinMove, ahk_pid %NewPID%,, %NewT%, %NewU%
Return
ButtonMoveCrosshairDown:
NewT := (A_ScreenWidth / 2) - (ModW / 2)
NewU := (A_ScreenHeight / 2 - CrosshairAdjust++) - (ModH / 2)
WinMove, ahk_pid %NewPID%,, %NewT%, %NewU%
Return
; -------------------------------------------------------------
~NumLock::Suspend, toggle
$Mbutton::
{
GetKeyState, state, Mbutton, T
if state = D
{
send {RButton Down}
sleep 260
MouseClick,left
send {RButton Up}
send {RButton Down}
send {RButton Up}
}
else
{
MouseClick,middle
}
}
Dont know if that will work. If it dont tell me.