Simba Code:
program RangGuild;
{$DEFINE SRL5}
{$DEFINE SMART}
{$i SRL/srl.simba}
{$i SRL/SRL/misc/paintsmart.simba}
Var
(declare variables here)
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Farming';
Active := True;
end;
end;
function FindArrows(var X, Y: Integer) :Boolean;
var
TPA: TPointArray;
aTPA : T2DPointArray;
MiddlePoint :TPoint;
Hi, I, TempCTS :Integer;
begin
If Not LoggedIn then Exit;
TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.17);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1781567, MIX1, MIY1, MIX2, MIY2, 8);
If Length(TPA) = 0 Then Exit;
aTPA := TPAToATPAEx(TPA, 5, 5);
SortATPAFromFirstPoint(aTPA, Point(0, 0));
MiddlePoint := MiddleTPA(aTPA[0]);
MMouse(MiddlePoint.X, MiddlePoint.Y, 2, 2);
If WaitUpTextMulti(['ronze', 'rrow'], 250) then
begin
GetMousePos(X, Y);
Result := True;
end;
ColorToleranceSpeed(TempCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
procedure SpamMouse(var x, y: Integer; Time: Integer);
begin
If Not LoggedIn then Exit;
HoldMouse(x, y, mouse_left);
Wait(Round(Time / 2));
ReleaseMouse(x, y, mouse_left);
Wait(Time);
end;
procedure Competition;
var
X, Y, C :Integer;
begin
If Not LoggedIn then Exit;
while not FindNPCChatText('orry', Nothing) do
begin
If FindNPCChatText('standard', Nothing) then
If WaitArrow(X, Y, 1500) then Mouse(X, Y, 2, 2, True);
if FireTarget(X, Y) then
SpamMouse(x, y, RandomRange(Players[CurrentPlayer].Integers[1], Players[CurrentPlayer].Integers[2]));
if not DidClick(True, 60) then Inc(C)
else
C := 0;
if (C >= 2) then CloseWindow;
end;
end;
function WaitNPCText(Text :String; Time :Integer) :Boolean;
var
T :Integer;
begin
If Not LoggedIn then Exit;
MarkTime(T);
while (TimeFromMark(T) < Time) do
begin
If Not LoggedIn then Exit;
Wait(RandomRange(10, 25));
if FindNPCChatText(Text, Nothing) then
begin
Result := True;
Break;
end;
end;
end;
function FindJudge :Boolean;
var
TPA: TPointArray;
aTPA : T2DPointArray;
MiddlePoint :TPoint;
X, Y, Hi, I, TempCTS :Integer;
begin
If Not LoggedIn then Exit;
TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.40, 0.06);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 6512479, MSX1, MSY1, MSX2, MSY2, 14);
If Length(TPA) = 0 Then Exit;
aTPA := TPAToATPAEx(TPA, 20, 20);
SortATPAFromFirstPoint(aTPA, Point(260, 32));
DebugATPA(aTPA, '');
Hi := Length(aTPA);
for I := 0 to Hi - 1 do
begin
If Length(aTPA[I]) < 40 then Continue;
MiddlePoint := MiddleTPA(aTPA[I]);
MMouse(MiddlePoint.X, MiddlePoint.Y, 2, 2);
If WaitUpTextMulti(['Competition', 'ompeti', 'Judge', 'udge'], 250) then
begin
ClickMouse2(False);
If WaitOptionEx('alk', 'All', Nothing, 250) then
begin
If WaitOptionMulti(['Compete', 'ompete'], 250) then
begin
Flag;
If WaitNPCText('Yes', 1500) then
begin
TypeSendEx('1', False);
If WaitArrow(X, Y, 3500) then Mouse(X, Y, 2, 2, True);
end;
end;
Result := True;
Break;
end;
end;
end;
ColorToleranceSpeed(TempCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function FireTarget(var X, Y: Integer) :Boolean;
var
TPA: TPointArray;
aTPA : T2DPointArray;
MiddlePoint :TPoint;
Hi, I, TempCTS :Integer;
begin
If Not LoggedIn then Exit;
TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.15, 1.28);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5330874, MSX1, MSY1, MSX2, MSY2, 2);
If Length(TPA) = 0 Then Exit;
aTPA := TPAToATPAEx(TPA, 20, 20);
SortATPAFromFirstPoint(aTPA, Point(0, 0));
DebugATPA(aTPA, '');
MiddlePoint := MiddleTPA(aTPA[0]);
MMouse(MiddlePoint.X, MiddlePoint.Y, 2, 2);
If WaitUpTextMulti(['Fire', 'Target', 'arget'], 250) then
begin
GetMousePos(X, Y);
Result := True;
end;
ColorToleranceSpeed(TempCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function WaitArrow(var X, Y :Integer; Time :Integer) :Boolean;
var
T :Integer;
begin
If Not LoggedIn then Exit;
MarkTime(T);
while (TimeFromMark(T) < Time) do
begin
If Not LoggedIn then Exit;
Wait(RandomRange(10, 25));
if FindArrows(X, Y) then
begin
Result := True;
Break;
end;
end;
end;
begin
SMART_Members := True;
SMART_Signed := True;
SetupSRL();
SetupSRLStats(222, SRLStatsUserName, SRLStatsPassword);
SRLRandomsReport;
ClearDebug();
ActivateClient();
DeclarePlayers();
LoginPlayer();
SetupScript();
(finish the rest)
end.