program SWHerby;
{.include SRL\SRL.scar}
var
LoadsDone, WaitTimer: Integer;
const
LoadsToDo = 1000;
function sFindObjTPA(var X, Y: Integer; Color, Tol, CTS, ObjWidth, ObjHeight, minCount: Integer; UpText: TStringArray): Boolean;
var
I, tCTS: Integer;
myPoint: TPoint;
Points: TPointArray;
aPoints: T2DPointArray;
begin
Result := False;
if not LoggedIn then exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.44);
FindColorsSpiralTolerance(X, Y, Points, Color, MSX1, MSY1, MSX2, MSY2, Tol);
if Length(Points) = 0 then
begin
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
Exit;
end;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
aPoints := TPAtoATPAEx(Points, ObjWidth, ObjHeight);
SetLength(Points, 0);
for I := 0 to High(aPoints) do
begin
if Length(aPoints[i]) < minCount then
Continue;
myPoint := MiddleTPA(aPoints[i]);
MMouse(myPoint.X, myPoint.Y, 4, 6);
if WaitUpTextMulti(UpText, 300) then
begin
GetMousePos(X, Y);
Result := True;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
Exit;
end;
end;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
end;
function FindBankChest: boolean;
var
x, y: integer;
begin
if BankScreen then
begin
result := true;
Exit;
end;
if IsUpTextMultiCustom(['chest', 'ank']) then
begin
result := true;
wait(100 + random(100));
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
exit;
end;
Wait(100 + Random(100));
if not IsUpTextMultiCustom(['chest', 'ank']) then
begin
x := MSCX;
y := MSCY - 100;
if sFindObjTPA(x, y, 11053497, 21, 2, 32, 35, 3, ['chest', 'ank']) then
begin
Result := true;
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;
end;
end;
procedure WaitRandomAntiban(time: Integer);
begin
MarkTime(WaitTimer);
repeat
case Random(50) of
1: SleepAndMoveMouse(500 + Random(1000));
2: HoverSkill('herblore', false);
3: SleepAndMoveMouse(1000 + Random(1000));
4: GameTab(tab_Friends);
5: GameTab(tab_Stats);
6: SleepAndMoveMouse(1500 + Random(1000));
7: SleepAndMoveMouse(2000 + Random(1000));
8: SleepAndMoveMouse(1000 + Random(1000));
9: SleepAndMoveMouse(1000 + Random(1000));
else
Wait(1000 + Random(1000));
end;
until TimeFromMark(WaitTimer) > time;
end;
procedure UnfToPots;
begin
GameTab(tab_Inv);
Wait(500 + Random(100));
MouseItem(1 + Random(13), true);
Wait(500 + Random(100));
MouseItem(28 - Random(13), true);
Wait(1000 + Random(100));
Mouse(255, 420, 5, 5, false);
Wait(1000 + Random(100));
ChooseOption('Make All');
WaitRandomAntiban(18000 + Random(1000));
ClickContinue(true, true);
Wait(500 + Random(100));
end;
procedure DoBank;
begin
Wait(1000 + Random(100));
if not FindBankChest then begin
Wait(1000 + Random(100));
if not FindBankChest then begin
LogOut;
TerminateScript;
end;
end;
Wait(1000 + Random(100));
if not BankScreen then begin
LogOut;
TerminateScript;
end;
Wait(1000 + Random(100));
DepositAll;
Wait(500 + Random(100));
DepositAll;
Wait(500 + Random(100));
Withdraw(0, 0, 14);
Wait(500 + Random(100));
Withdraw(1, 0, 14);
Wait(500 + Random(100));
CloseBank;
Wait(500 + Random(100));
end;
procedure Initialize;
begin
SetupSRL();
ActivateClient();
LoadsDone := 0;
end;
begin
Initialize;
repeat
DoBank;
UnfToPots;
LoadsDone := LoadsDone + 1;
until LoadsDone >= LoadsToDo;
LogOut;
end.