SRL Archive - OSR Help

[Q]Looting an that is dropped


msemtex

2013-07-22 07:08:42

Hi,

I'm in the process of creating a Goblin Killer for runescape 2007. The goblin scanner and attacker works fine, but I want to add a loot option for picking up.
My problem is, if a goblin drops coins and bones,the bones are above the coins and cover up the coins.
I can detect bones, but nothing else :(


Procedure TakeLoot;

Begin
if FindObjCustom(x,y, ['ake','ones'],[boneColour1,boneColour2], 5) then
begin
mouse(x,y,4,4,false);
ChooseOption('ake');
wait(2000)
end;
end;

All help is appreciated,

msemtex

Flight

2013-07-22 07:47:52

From: msemtex
Hi,

I'm in the process of creating a Goblin Killer for runescape 2007. The goblin scanner and attacker works fine, but I want to add a loot option for picking up.
My problem is, if a goblin drops coins and bones,the bones are above the coins and cover up the coins.
I can detect bones, but nothing else :(


Procedure TakeLoot;

Begin
if FindObjCustom(x,y, ['ake','ones'],[boneColour1,boneColour2], 5) then
begin
mouse(x,y,4,4,false);
ChooseOption('ake');
wait(2000)
end;
end;

All help is appreciated,

msemtex


I assume you're wanting to take coins?

I would make a TPA/ATPA finder for all the bones by grabbing the bone color, getting the TPA of all bones, and splitting that into [TPAs] (an ATPA). Then, get the bounds of each [TPA], this will give you a box. Next, search only inside each of these boxes for the color of coins. If that color is found then get the middle of that box (MiddleBox returns a TPoint), move your mouse to that, right-click, and ChooseOptionMulti['ke Coi','Coins']. Since this function will return True of False just make something that if the function returned True (successfully chose the option to "Take Coins") then wait until the player has stopped moving (Flag or FFlag(0), ect…).

msemtex

2013-07-22 16:34:08

Ok, I will have a look into it. Thanks!