I've built a very nice script. It uses screen pixels to determine enemy health, so you will have to change those values for your needs. If you don't have the same pixel as me, then you will have to figure out how to change it. I will attach the pixel I am using (HIGHLIGHTED IN BLUE). There is two colors that it changes to while you are killing the creature. And then one more when it is dead. Hence the 231 and 239.

This script started off as facerip's macro. I updated it heavily.

Some changes include:

Automatic detection of enemy death
Automatic detection of potion qty via memory readings =)

This macro is much more streamlined and works much faster.

If you're in a group, change the loot qty to 1 from 10 to save that time.





CODE

Constants
loot = {SPACE} //Hotkey to autoloot.
target = ] //Hotkey to target nearest enemy.
attack = 3 //Hotkey to autoattack.
alive = 0
Const = 0
recall = 8 // Put in Passport for when you run out of potions here.
End

SetActiveWindow Archlord

Call findEnemy

Procedure findEnemy
SetActiveWindow Archlord
Keys $target
Keydown {RIGHT} 0.2 sec
Call checkalive
Delay 0.5 sec
Call killEnemy
End
//GetRed 732, 43 = 222
//GetRed 732, 43 = 214
//GetRed 732, 43 = 228
Procedure checkalive
GetRed 416, 247 = 231
$alive=1
Else
GetRed 416, 247 = 239
$alive=1
else
$alive=0
end
End
end

Procedure killEnemy
while $alive=1
Keys $attack
Delay 1 Sec
call checkalive
end
Delay 2 sec
Call lootEnemy
End

Procedure lootEnemy
Loop 10
Keys $loot
Delay 0.2 Sec
End
ReadMemoryEx $Const = 09054E28, LongWord
If $Const < 5
Keys $recall
Else
End
Call findEnemy
End