I'm not sure which part you fixed, but I found several things I thought I should point out...
This part:
Simba Code:
if((x = x) and (y = y))then
Will always be true since something is always going to be equal to itself, you need to use more variables:
Simba Code:
function PickBerries: Boolean;
var
x1, y1, x2, y2: Integer;
begin
x1 := MSCX;
y1 := MSCY;
if FindObjCustom(x1, y1, ['hite'], [14146272], 15) then
begin
GetMousePos(x2, y2);
if ((x1 = x2) and (y1 = y2)) then
ClickMouse2(mouse_Left)
else
Mouse(x1, y1, 5, 5, mouse_Left);
wait(2500 + random(200));
end;
end;
For this part:
Simba Code:
repeat
if (WaitUpText('ake', 200 + Random(500))) then
PickBerries; //This is calling your function you are already in
until (InvCount = 28);//what if it runs out of berries on the bush, this will cause an infinite loop
You would be better with this:
Simba Code:
if (WaitUpText('ake', 200 + Random(500))) then
begin
ClickMous2(mouse_Left);
Wait(200+Random(2000));
end;