SCAR Code:
program RuneMysteriesQuester;
{.include SRL/SRL.scar}
var
x, y: Integer;
function TellyToLumby: Boolean;
begin
if(Players[CurrentPlayer].Booleans[0])then Exit;
if(not(LoggedIn))then Exit;
GameTab(7);
Mouse(571, 239, 6, 6, true);
wait(11000 + random(3000));
SymbolAccuracy := 0.6;
if(FindSymbol(x, y, 'Quest'))then Result := True;
if(FindSymbol(x, y, 'Water'))then Result := True;
SymbolAccuracy := 0.8;
end;
{------------------------------------------------------------------------------]
[ function ClickAnswer(Answer: string): Boolean; ]
[ by: ZephyrsFury ]
[ Description: Clicks the answer in an NPC chat. ]
{------------------------------------------------------------------------------}
function ClickAnswer(Answer: string; Times: Integer): Boolean;
var
j, i: Integer;
begin
if (not(LoggedIn)) then Exit;
//if (TimeExceeded) then Exit;
j := 0;
i := 0;
repeat
if (FindNPCChatText(Answer, ClickLeft)) then
begin
FTWait(4);
Inc(i);
end;
j := j + 1;
until(j = Times);
if (j = i) then Result := True;
end;
function AutoColorIt: Integer;
var
X, Y, Z: Extended;
Points: TPointArray;
Colors, UniqueColors: TIntegerArray;
i, a: Integer;
NewColor: Boolean;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(0);
FindColorsSpiralTolerance(MMCX, MMCY, Points, 6985, MMX1, MMY1, MMX2, MMY2, 5);
if Length(Points) < 1 then
begin
ColorToleranceSpeed(1)
Exit;
end;
Colors := GetColors(Points);
for i := 0 to Length(Colors) -1 do
begin
NewColor := True;
for a := 0 to GetArrayLength(UniqueColors) - 1 do
begin
if(UniqueColors[a] = Colors[i])then
begin
NewColor := False;
Break;
end;
end;
if(NewColor)then
begin
SetArrayLength(UniqueColors, GetArrayLength(UniqueColors) + 1);
UniqueColors[GetArrayLength(UniqueColors) - 1] := Colors[i];
end;
end;
for i := 0 to Length(UniqueColors) -1 do
if UniqueColors[i] <> 0 then
begin
ColorToXYZ(UniqueColors[i], X, Y, Z);
if (X < 5) and (X > 1) then
if (Y < 4) and (Y > 0) then
if (Z < 2) and (Z > -2) then
if CountColor(UniqueColors[i], MMX1, MMY1, MMX2, MMY2) > 50 then
begin
WriteLn('AutoColor: '+IntTostr(UniqueColors[i]))
Result := UniqueColors[i];
Break;
end;
end;
ColorToleranceSpeed(1);
end;
procedure TalkToDuke;
var
TPA: TPointArray;
Found: Boolean;
i, cx, cy, LadderColor: Integer;
begin
cx := MMCX;
cy := MMCY;
LadderColor := AutoColorIt;
SymbolAccuracy := 0.6;
if(FindSymbol(x, y, 'Quest'))then
begin
Mouse(x, y, 6, 6, true);
FFlag(5);
if(FindColorSpiral(cx, cy - 25, LadderColor, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(x + 3, y + 3, 2, 2, true);
FFlag(0);
if(FindColorTolerance(x, y, 803167, MSX1, MSY1, MSX2, MSY2, 10))or
(FindColorTolerance(x, y, 603212, MSX1, MSY1, MSX2, MSY2, 10))then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('-up');
end;
if(FindSymbol(x, y, 'Quest'))then
begin
Mouse(x, y, 6, 6, true);
//CheckDoor;
SymbolAccuracy := 0.8;
end;
FindColorsTolerance(TPA, 4983817, MSX1, MSY1, MSX2, MSY2, 10);
for i := 0 to High(TPA)do
begin
MMouse(TPA[i].x, TPA[i].y, 3, 3);
if(IsUpText('alk'))then
begin
Found := True;
GetMousePos(TPA[i].x, TPA[i].y);
Break;
end;
if(Found)then Mouse(Tpa[i].x, TPA[i].y, 0, 0, true);
ClickAnswer('continue', 1);
ClickAnswer('quests', 1);
ClickAnswer('continue', 4);
ClickAnswer('probl', 1);
ClickAnswer('continue', 3);
end;
end;
begin
SetupSRL;
TalkToDuke;
end.