First off, G15 setup, spam cast spell and loop.
Autohotkey setup
Code:
#Persistent
Loop
{
PixelSearch, OutputVarX, OutputVarY, 0, 0, 1680, 1200, 0xBDF9FF, 0, Fast
'find npc with pixel 0xBDF9FF
Sleep, 50
'wait one sec to send server clickpacket and retrieve it, see if we targetted something
MouseClick, left, OutputVarX, OutputVarY
'click that location to target it
Sleep, 1000
'1 sec break, who cares why
PixelSearch, OutputVarX, OutputVarY, 0, 0, 1680, 1200, 0x565AFF, 0, Fast
'check if we actually targetted an npc, by checking for the target frame. In robin's game, a red frame appears around targets, so check that code
if ErrorLevel = 0
Sleep 5000
'if we got a target, give it 5 secs to kill it
PixelSearch, OutputVarX, OutputVarY, 0, 0, 1680, 1200, 0x565AFF, 0, Fast
'check if the red target box is still there, an indication the target is still alive, if so, wait 5 more secs
if ErrorLevel = 0
Sleep 5000
}
Quite easy, should work on any MS-game.