SCAR Code:
program AirCrafter;
{.include srl/srl/misc/Smart.scar}
{.include srl/srl.scar}
var
DTM, DTM2 : integer;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Active :=True;
End;
Procedure Randoms;
begin
FindNormalRandoms;
end;
procedure twitch; //ftw... failsafes cant touch this.
begin
KeyDown(VK_Left);
Wait(random(200));
KeyUp(VK_Left);
KeyDown(VK_Right);
Wait(random(200));
KeyUp(VK_Right);
MakeCompass('n');
end;
function FindColorSimilarity(Color1, Color2, basesimilarity: integer) : integer;
begin
for result := BaseSimilarity downto 0 do
begin
if not SimilarColors(Color1, Color2, result) then exit;
end;
result := 999;
end;
function FindSimilarestColor(var dx, dy : integer; cx, cy, cx2, cy2 : integer; Color : integer; BaseTol : integer) : boolean;
var ClosestColor, ix, iy : integer;
ClosestCoords : tpoint;
begin
ClosestColor := BaseTol;
for ix := cx to cx2 do
begin
for iy := cy to cy2 do
begin
if FindColorSimilarity(getColor(ix, iy), Color, ClosestColor) < ClosestColor then
begin
ClosestColor := FindColorSimilarity(getColor(ix, iy), Color, BaseTol)
ClosestCoords.x := ix;
ClosestCoords.y := iy;
end;
end;
end;
if ClosestColor = Basetol then
begin
result := false;
end else
begin
result := true;
dx := ClosestCoords.X;
Dy := ClosestCoords.Y;
end;
end;
function ToDRunes1 : boolean;
begin
if not LoggedIn then Exit;
Randoms;
SetRun(True);
RadialRoadWalk(FindFallyRoadColor, 270, 180, 60, 1, 1);
result := true;
end;
function ToDRunes2 : boolean;
begin
if not LoggedIn then Exit;
Randoms;
RadialRoadWalk(FindFallyRoadColor, 220, 130, 60, 1, 1);
result := true;
end;
function ToDRunes3 : boolean;
var c : TPoint;
begin
if not LoggedIn then Exit;
Randoms;
FindColor(c.x, c.y, FindRoadColor, MMX1, MMY1, MMX2, MMY2);
Mouse(c.x+3, c.y+random(3), 0, 0, true);
fflag(0);
result := true;
end;
function ToDRunes5 : boolean;
begin
if not LoggedIn then Exit;
Randoms;
Mouse(582, 134, 3, 3, true);
fflag(0);
result := true;
end;
function ToDRunes4 : boolean;
var c : TPoint;
begin
if not LoggedIn then Exit;
Randoms;
FindColor(c.x, c.y-10, FindRoadColor, MMX1, 150, MMX2, MMY2);
Mouse(c.x-20, c.y+random(3), 0, 0, true);
fflag(0);
result := true;
end;
function OpenAlter : boolean;
var c : tpoint;
begin
if not LoggedIn then Exit;
Randoms;
FindObj(c.x, c.y, 'ysterious', 7435896, 10);
Mouse(c.x, c.y, 0, 0, true);
fflag(0);
wait(2000+random(30));
result := true;
end;
function CraftRunes : boolean;
var c : tpoint;
begin
if not LoggedIn then Exit;
Randoms;
Mouse(636, 72, 4, 4, true);
fflag(1);
FindObj(c.x, c.y, 'raft', 4145992, 10);
Mouse(c.x, c.y, 0, 0, true);
fflag(0);
wait(3000+random(20)*random(20));
result := true;
end;
function LeaveTemple : boolean;
var c : tpoint;
begin
if not LoggedIn then Exit;
Randoms;
Mouse(582, 131, 5, 5, true);
fflag(1);
FindObj(c.x, c.y, 'ortal', 6918553, 25);
Mouse(c.x, c.y, 0, 0, true);
fflag(0);
wait(2000+random(30));
result := true;
end;
function ToDBank1 : Boolean;
begin
if not LoggedIn then Exit;
Randoms;
Mouse(675, 42, 1, 1, true);
fflag(2);
result := true;
end;
function ToDBank2 : boolean;
var c : TPoint;
begin
if not LoggedIn then Exit;
Randoms;
FindColor(c.x, c.y, FindRoadColor, MMX1, MMY1, MMX2, 150);
Mouse(c.x, c.y+5, 0, 0, true);
fflag(0);
result := true;
end;
function ToDBank3 : boolean;
var c : TPoint;
begin
if not LoggedIn then Exit;
Randoms;
FindColor(c.x, c.y, FindRoadColor, MMX1, MMY1, MMX2, MMY2);
Mouse(c.x+3, c.y+random(3), 0, 0, true);
fflag(2);
result := true;
end;
function ToDBank4 : boolean;
begin
if not LoggedIn then Exit;
Randoms;
RadialRoadWalk(FindFallyRoadColor, 320, 400, 60, 1, 1);
RadialRoadWalk(FindFallyRoadColor, 320, 400, 60, 1, 1);
result := true;
end;
function ToDBank : boolean;
var c : tpoint;
i : integer;
begin
if not LoggedIn then Exit;
Randoms;
i := 0;
repeat
Randoms;
wait(200);
i := i + 1;
if i > 20 then
begin
LogOut;
WriteLn('ERROR: Could not find bank, Logging off.');
result := False;
Exit;
end;
twitch;
if DTMRotated(DTM, c.x, c.y, MMX1, MMY1, MMX2, MMY2) then
begin
i := 21;
end else if FindSymbol(c.x, c.y, 'bank') then
begin
i := 21;
end;
until i > 20
Mouse(c.x, c.y, 0, 0, true);
fflag(0);
if not OpenBank('feb', True, False) then
begin
LogOut;
WriteLn('ERROR: Could not open bank, Logging off.');
result := false;
Exit;
end;
result := true;
end;
Function BankStuff : boolean;
var c : tPoint;
begin
if not LoggedIn then Exit;
if not bankscreen then Exit;
Deposit(1, 1, 2);
FindDTM(DTM2, c.x, c.y, MSX1, MSY1, MSX2, MSY2);
MMouse(c.x, c.y, 0, 0);
wait(50);
If not isuptext('ssence') then
begin
Writeln('Cannot Find d ESS AHH!?!');
Logout;
Exit;
end;
Mouse(c.x, c.y, 0, 0, False);
Chooseoption('ll');
CloseBank;
result := true;
end;
begin
SmartSetup('ny11', false, True);
wait(10000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
SetupSRL;
ActivateClient;
DTM := DTMFromString('78DA639CC0C4C060C88002766D9ACCF01F483' +
'302F17F20606C01AAB14655F3E70F13831C540D0830F602D5D8A0' +
'AA79FB960155CD54A01A5B026A40E65860BA07590D00F26D1314');
DTM2 := DTMFromString('78DA632C676460F0614001B161610CAC401A2' +
'8C3F01F0818B330D5806419A16AC0BC0A202B9A809A36202B8080' +
'9A2620CB85809A1C202B0CBF1A00EDB709D1');
DeclarePlayers;
LoginPlayer;
Randoms;
repeat
MakeCompass('N');
SetAngle(True);
ToDBank;
BankStuff;
ToDRunes1;
ToDRunes2;
ToDRunes3;
ToDRunes4;
ToDRunes5;
OpenAlter;
CraftRunes;
LeaveTemple;
ToDBank1;
ToDBank2;
ToDBank3;
ToDBank4;
until not Loggedin
end.