I made a function that can loot items that monsters drop if anyone is interested.
It uses the RedBar on kill to locate the loot piles (On kill, stolen from old chaosmosskiller script, credits to Shatterhand)
At the moment, I've programmed this for my own needs to loot charms from waterfiends, but I'm sure it could be tweaked (by adjusting how relative the Y coordinate is from the bar) for any monster.
You'll also need to add X and Y to Integer vars at the top.
REDBAR FUNCTION (TAKEN FROM SHATTERHAND'S CHAOSMOSSKILLER)
Simba Code:
function FindRedBar : Boolean; //returns True if a full red hp bar is found
var
RedBarDTM1, RedBarDTM2 : Integer;
begin
Result := False;
RedBarDTM1 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w='); //two DTMs just in case
RedBarDTM2 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=');
if FindDTM(RedBarDTM1,X,Y,MSX1,MSY1,MSX2,MSY2) or
FindDTM(RedBarDTM2,X,Y,MSX1,MSY1,MSX2,MSY2) then
begin
{if DebugLines then
Writeln('Found redbar, we killed it.');
if PaintDebug then
begin}
SMART_DrawBoxEx(false,false,IntToBox(X-30,Y-10,X+30,Y+10),ClYellow); //drawing box around the redbar
Wait(50);
SMART_ClearCanvasArea(IntToBox(0,MSY1+49,520,MSY2+50));
//end;
Result := True;
end;
FreeDTM(RedBarDTM1);
FreeDTM(RedBarDTM2);
end;
Looting (Clicks where loot pile should be relative to kill bar)
Simba Code:
if (FindRedBar) then
begin
wait(1000); //Waiting to see if we can detect it twice to make sure that it didn't detect it early (messes up coords)
if (FindRedBar) then
wait(200);
MMouse(X+random(3),Y+20,0,0);
wait(1000+random(200));
ClickMouse2(False);
WaitOptionMulti(['ake Crims','ake Gold c', 'ake Green', 'ake Blue'], 1000);
repeat until not IsMoving
wait(300+random(100));
end;