No idea what's going on, but I tried to help you out by showing you a more formal format + explaining what the code does (briefly)
Simba Code:
program new;
{$i srl/srl.simba}
procedure CleanHerbs;
var
rIntArr : TIntegerArray;
CleanBox : TBoxArray;
ItemBox : TBox;
begin
{ re - enter the box coordinates here,
you want to make sure you use the correct
x1 , y1 and then x2 , y2 parameters. You
appeared to have this X2 Y2 X1 Y1...
(which doesn't follow SRL standards, and
can be confusing. so stick with x1,y1,x2,y2 format
}
CleanBox[0] := IntToBox(x1, y1, x2, y2);
CleanBox[1] := IntToBox(x1, y1, x2, y2);
CleanBox[2] := IntToBox(x1, y1, x2, y2);
CleanBox[3] := IntToBox(x1, y1, x2, y2);
{
here, you try gameTab'ing to the inventory,
but if not successful, then you'll try FTabs.
You could always make a personal wait function for this too.}
if not GameTab(Tab_Inv) then
FTab(Tab_Inv);
// no idea what this static wait is for?
Wait(RandomRange(300, 600));
// a small array to use for randomizing our itemBox returned.
rIntArr := [3, 4, 5, 7];
// uses the int array above to pick a random number in the array.
GetInvItemBounds(rIntArr[Random(4)], ItemBox);
MouseTbox(ItemBox, Mouse_left);
// again no idea what this static wait is for
Wait(RandomRange(750, 800));
// clicks a random Box, created from the 0..3 (aka 4 index length array)
// box array declared earlier, again randomizing the box to click.
MouseTBox(CleanBox[Random(4)], Mouse_Left);
end;
Cheers,
-Lj