
Originally Posted by
The Mayor
You didn't do what I said?
Wow I feel stupid now. I thought you meant I had to replace the bush colours with those from the redberries, so when you get the redberries and they disappear from the bush, the script goes for the other bush because there are redberries left. I probably was a little bit distracted when I was reading your message.
I edited it and now I have this:
Simba Code:
procedure getRedberries();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
berryTPA: TPointArray;
redberriesTimer: TTimeMarker;
begin
if not isLoggedIn() then
exit;
redberriesTimer.start();
minimap.setAngle(320);
mainscreen.setZoom(true);
minimap.toggleRun(true);
repeat
findColorsSpiralTolerance(x, y, TPA, 1473055, mainScreen.getBounds(), 10, colorSetting(2, 0.14, 1.53)); //bush colour
ATPA:= TPA.toATPA(30, 30);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i:= 0 to high(ATPA) do
if findColorsSpiralTolerance(x, y, berryTPA, 1714858, ATPA.getBounds(), 5, colorSetting(2, 0.11, 0.31)) then //redberry colour
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['Redberry bush'], 2000) then
repeat
fastClick(MOUSE_LEFT);
wait(randomRange(650, 950));
until tabBackpack.waitForShift(5000);
smartImage.clear;
break;
end;
until tabBackpack.isFull() or (redberriesTimer.getTime() > 900000);
end;
I changed this line (yours):
Simba Code:
if findColorsSpiralTolerance(x, y, berryTPA(i), 1714858, ATPA.getBounds(), 5, colorSetting(2, 0.11, 0.31)) then //redberry colour
Into this:
Simba Code:
if findColorsSpiralTolerance(x, y, berryTPA, 1714858, ATPA.getBounds(), 5, colorSetting(2, 0.11, 0.31)) then //redberry colour
Because when I tried to use your line it said:
Code:
Exception in Script: Don't know which overloaded method to call with params (Int32, Int32, *unknown*, Int32, record [0]Int32; [4]Int32; [8]Int32; [12]Int32; end, Int32, record [0]Int32; [4]record [0]Extended; [10]Extended; [20]Extended; end; end) at line 144, column 12
Why is this happening?
I'm wondering about something though. When I test the procedure it goes to the first TPA, clicks to get the first redberries. Then it clicks to get the second redberries, now the bush is out of redberries and it's time to go to the other bush. But why does it just keeps clicking the same bush? Maybe the answer to that question is pretty obvious, but not to me.