SCAR Code:
program New;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
var
t:integer;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
function LoadPath: TPointArray;
begin
SetLength(Result, 15);
Result[0] := Point(3184, 3435);
Result[1] := Point(3177, 3429);
Result[2] := Point(3168, 3427);
Result[3] := Point(3163, 3421);
Result[4] := Point(3157, 3418);
Result[5] := Point(3149, 3416);
Result[6] := Point(3141, 3416);
Result[7] := Point(3131, 3415);
Result[8] := Point(3123, 3415);
Result[9] := Point(3118, 3419);
Result[10] := Point(3111, 3420);
Result[11] := Point(3101, 3420);
Result[12] := Point(3095, 3419);
Result[13] := Point(3087, 3420);
Result[14] := Point(3081, 3421);
end;
Procedure WalkThePath(Tobank:boolean);
Var
I: Integer;
Path: TPointArray;
Begin
Path := LoadPath;
if Tobank then
begin
for i := ((High(Path))-1) Downto 0 do
WalkToTile(Path[i], 3, 0);
Wait(500+Random(300));
end else
begin
for i := 1 to (High(Path)) do
WalkToTile(Path[i], 3, 0);
Wait(500+Random(300));
end;
end;
function FindObjectPvH(ID,decreasey:integer): boolean;
var
xx : TPoint;
begin
if FindObject(xX,ID) then
begin
Result:= True;
XX:= TileToMS(XX, 0);
Mouse(xX.x,(xX.y-decreasey),4,4,true);
FindNormalRandoms;
fflag(0);
end else writeln('Failed to find the object...');
end;
procedure SetupSmart;
begin
SmartSetup('world55', True, True, false);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
function InDungeon:boolean;
begin
Result := CountColor(65536,mmx1,mmy1,mmx2,mmy2) > 3000;
end;
function Enterdungeon:boolean;
begin
if not FindObjectPvH(16154,0) then exit; //Enters the dungeon...
repeat
wait(700+random(1000));
Marktime(t);
if InDungeon then Result:=true;
until (result) or (timefrommark(t) > (3000+random(2000)))
if not result then
begin
writeln('Failed to enter the dungeon...');
logout;
exit;
end;
end;
function LoadPath2: TPointArray;
begin
SetLength(Result, 1);
Result[0]:= Point(1863, 5239);
end;
function TeleportToRoom1:boolean;
var
Path: TPointArray;
I : integer;
begin
Path := LoadPath2;
for i := 0 to (High(Path)) do
WalkToTile(Path[i], 3, 0);
Wait(200+Random(300));
if not FindObjectPvH(16150,0) then //Enters the dungeon...
begin
writeln('Failed to teleport to room 1');
logout;
exit;
end;
wait(500+random(1000));
Result:=true;
end;
function LoadMinotaurPath:TPointArray;
begin
SetLength(Result, 2);
Result[0]:= Point(1912, 5212);
Result[1]:= Point(1907, 5203);
end;
Function SolveDoor: Boolean;
var
I, Doortime: Integer;
QuestionAnswer: TStringArray;
begin
if not loggedin then exit;
wait(2000+random(2000));
if not FindObjectPvH(16123,7) then //Clicks the door...
begin
writeln('Failed to get trough the door...');
logout;
exit;
end;
wait(2000+random(1000));
Marktime(Doortime);
QuestionAnswer := ['No','nly on the','ost Password','amous','obody','Report','utton','emorable','ouple',
'owhere','tolen','nform','Virus scan','teal', 'anker' , 'nbox', 'y password'];
repeat
while ClickContinue(True,True) do
Wait(100+random(300));
if not ClickContinue(True,True) then
begin
Result:=True;
exit;
end;
wait(1000+random(1200));
for i := 0 to (high(QuestionAnswer)) do
begin
if FindNPCChatText(QuestionAnswer[i],ClickLeft) then
begin
repeat
Wait(100+random(300));
until(ClickContinue(True,True));
ClickContinue(True,True);
Writeln('Getting trough the door took ' + IntToStr((Timefrommark(Doortime))/1000) + ' seconds!');
wait(500+random(1000));
Result := True;
end else
begin
writeln('trying to solve the door again...');
SolveDoor;
end;
end;
until not(ClickContinue(True,True)) or not(FindNPCChatText(QuestionAnswer[i],ClickLeft))
end;
function WalktoMinotaurs:boolean;
var
Path: TPointArray;
I , T: integer;
begin
Path := LoadMinotaurPath;
for i := 0 to ((High(Path))-1) do
WalkToTile(Path[i], 2, 0);
repeat
if not Solvedoor then
begin
writeln('Failed to get trough the door...');
logout;
exit;
end;
inc(T);
until (T >= 2)
Wait(500+Random(1000));
for i := 1 to (High(Path)) do
WalkToTile(Path[i], 2, 0);
makecompass('e');
repeat
if not Solvedoor then
begin
writeln('Failed to get trough the door...');
logout;
exit;
end;
inc(T);
until (T >= 2)
Result:=true;
end;
begin
SetupSRL;
Declareplayers;
SetupSmart;
loginplayer;
Makecompass('n');
setangle(true);
{if not FindObjectPvH(16154,0) then terminatescript; //Enters the dungeon...
if random(4) <= 1 then ClickContinue(True,True);
if not TeleportToRoom1 then terminatescript; }
if not WalktoMinotaurs then terminatescript;
end.