The following will drop Cartillery on USMC artillery, as MEC on the Strike at Karkand map 90% of the time in x1 commander view in 1024x768 view (you don't have to zoom in).
Code:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
;
; Press 7 on the Keypad to drop on the Left USMC artillery
; Press 9 on the Keypad to drop on the Right USMC artillery
;
; Only run this script when bf2.exe is running in the foreground
;
#SingleInstance force
#InstallKeybdHook
SetTimer, KeepRunning
return
KeepRunning:
; Get the process name of the active window (i.e. Notepad.exe)
WinGet, szProcessName, ProcessName, A
if szProcessName = bf2.exe
{
Suspend, off
}
else
{
Suspend, on
}
return
;
; Disable the Window's keys so they don't switch to desktop while in-game
;
$LWin:: ; Left Windows Button
$RWin:: ; Right Windows Button
; Do nothing
return
$^CapsLock::
ExitApp
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Pressing Ctrl+V while BF2 is active
$^v::
Sleep 200
SetKeyDelay, 30, 30
Send, {Space}%clipboard%
SetKeyDelay, 0
return
MouseEvent(a_xpos, a_ypos)
{
DllCall("mouse_event", uint,1, int,a_xpos, int,a_ypos, uint,0, int,0 )
}
DropCartillery(a_xPos,a_yPos,a_yMenuPos = 92, a_xMenuPos = 20)
{
MouseEvent(-2000,-2000)
sleep 100
MouseEvent(a_xPos,a_yPos)
sleep 20
MouseClick, Right, , , , , D
sleep 40
MouseClick, Right, , , , , U
MouseEvent(a_xMenuPos,a_yMenuPos)
sleep 40
MouseClick, Left, , , , , D
sleep 40
MouseClick, Left, , , , , U
sleep 100
}
;
; Cartillery: USMC Left artillery - Karkand
;
$Numpad7::
$NumpadHome:
DropCartillery(332,342,42)
return
;
; Cartillery: USMC Right artillery - Karkand
;
$Numpad9::
$NumpadPgUp:
DropCartillery(379,328,58)
return
I tried dropping cartillery on MEC artillery with a HUMVEE, but literially the direction the artillery is facing will determine where to drop it (artillery is slanted towards its last target). Therefore its not reliable.
If curious, the x1 zoom for the MEC artillery is: (535, 175) and (568, 117). I tried creating a script that zooms in and then drops artillery to get better accuracy, but it doesn't matter because of the angle of the artillery. Vodiks just have a larger area...
EDIT: Added the
DropCartillery and
MouseEvent functions to make it easier to read and modify
EDIT: I updated the coordinates for the Right USMC artillery from 378x328 to 379x329
EDIT: I tested this script using 1280x1024 and I didn't have to change the coordinates