function ClimbBranchUp: Boolean;
var
area: Tbox;
i, CTS, oldxp, H: integer;
TPA, Branch: TPointArray;
ATPA: T2DPointArray;
Hue, Sat: TExtendedArray;
Col, Tol: TIntegerArray;
p: tpoint;
begin
if not LoggedIn then
Exit;
Smart_ClearScreen;
CurrObstacle := 'Branch Up';
UpdateStatus;
NextAction := 'balance rope';
OldXP := GetXpBarTotal;
Result := False;
Area := ProjectPlatform;
CTS := GetColorToleranceSpeed;
Hue := [0.21, 0.08, 0.11, 0.04, 0.13, 0.04, 0.05];
Sat := [2.36, 0.19, 2.31, 0.33, 0.42, 0.13, 0.76];
Col := [3227984, 4215136, 3228241, 3227209, 3293002, 3556690, 3886944];
Tol := [2, 4, 2, 2, 3, 7, 6];
for i := 0 to High(Hue) do
begin
with Area do
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue[i], Sat[i]);
FindColorsTolerance(TPA, Col[i], X1, Y1, X2, Y2, Tol[i]);
CombineTPAWrap(TPA, Branch, Branch);
end;
end;
if SMART_Debug Then
SMART_DrawDotsEx(False, Branch, clAqua);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
SplitTPAWrap(Branch, 5, ATPA);
SetMinTPALength(ATPA, 15);
SortATPAFromFirstPoint(ATPA, MidPlat);
if GetArrayLength(ATPA) < 1 then
begin
O_Debug(CurrObstacle, 'Found no colours');
Exit;
end;
H := High(ATPA);
for i := 0 to H do
begin
If SMART_Debug Then
SMART_DrawBoxEx(False, False, GetTPABounds(ATPA[i]), clRed);
P := ATPA[i][Random(Length(ATPA[i]))];
HumanMMouse(P.X, P.Y, 0, 0);
if WaitUpTextMulti(ObstacleText, RandomRange(400, 500)) then
begin
O_Debug(CurrObstacle, '"' + BeforeStr(' / ', getuptext) + '" Intracting with obstacle');
Click;
if not (O_DidYellowClick) then
begin
O_Debug(CurrObstacle, 'Did click (red) on the obstacle.... ');
PredictObstacle;
Smart_ClearScreen;
if (WaitXpGain(OldXP)) then
begin
Result := True;
Exit;
end else
Exit;
end else
Exit;
end;
end;
end;