I see a lot of people have problems with collecting loots. I decided to make this tool letting you to pick up from ground whatever you want ,which you can use in your script and edit if you wish.
Basically I ripped off this function from my fighting script and adjusted to be universal.
- easy and quick to SetUp
- it's looking for stacks ,not for particular items
- will grab items ,even if they are covered by another
- code is clear ,you can edit it to your purpose if you wish.
Setup
All you need is to make function ,which will load properties of objects. Like this. I highly recommend to use ACA for finding colors and tolerance. It doesn't matter how you name this function. Remember to put SetLength ( Result , x ) at beginning ,where x is amount of items you declare.
Simba Code:
function SetupLoots : Array of TLoot; // Example
begin
SetLength( Result, 3 ); // Second parameter here should be amount of items you want to find
Result[0].name := ['bone','ones','one'];
Result[0].color := 13948895;
Result[0].tol := 5;
Result[0].CTS := 2;
Result[0].cts2Hue := 0.76;
Result[0].cts2Sat := 1.22;
Result[1].name := ['egg','gg'];
Result[1].color := 65535;
Result[1].tol := 3;
Result[1].CTS := 1;
Result[1].cts2Hue := 0.1; // If you use CTS other then 2 just ignore this
Result[1].cts2Sat := 1.1;
Result[2].name := ['third','item']; // it's example
Result[2].color := 65535;
Result[2].tol := 7;
Result[2].CTS := 1;
Result[2].cts2Hue := 0.1;
Result[2].cts2Sat := 1.1;
end;
Now load this function into LootGrabber ,like this:
Simba Code:
LootGrabber(SetupLoots,TRUE,['hicken','icken','aw','chick']);
as you see there are two additional parameters.
- Debug - TRUE/FALSE - it's obvious
- ['hicken','icken','aw','chick'] - ListOfUndesirable - TStringArray - it needs explanation:
You write here names of objects ,which could cover your potential loot. For example ,you want to collect bones ,but not raw chickens. Nevertheless bones are below chicken ,so if you hover mouse on stack uptext will show 'Raw chicken' - like on a picture. So you add chicken to the list ,and it will be ok - script will click on stack ,and take only bones from it. Obviously it will not find or clicks on a chickens alone.

Example Script
This simple script shows Grabber in action. First download grabber.simba and put it in Simba\Includes. Leave your character in Varock's hen house ,run script and see ,how it's collecting full inventory of bones.
Simba Code:
program HenHouseBones;
{$DEFINE SMART}
{$I SRL/srl.simba}
{$i SRL/SRL/MISC/PAINTSMART.simba}
{$I grabber.simba}
function SetupLoots : Array of TLoot;
begin
SetLength(Result,1);
Result[0].name := ['one','ones'];
Result[0].color := 13948895;
Result[0].tol := 5;
Result[0].CTS := 2;
Result[0].cts2Hue := 0.76;
Result[0].cts2Sat := 1.22;
end;
procedure start;
begin
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
end;
begin
start;
declareplayers;
MakeCompass('E');
repeat
LootGrabber(SetupLoots,TRUE,['cken','fea','ath']);
until not LootGrabber(SetupLoots,TRUE,['cken','fea','ath']);
end.