SCAR Code:
program FallyEastToFurnaceWalker;
{.Include SRL\SRL.SCAR}
{.Include srl/srl/skill/smithing.scar}
Var
BankDTM, SteelBar: Integer;
x,y: 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 FindMyLocation: String;
var
sx, sy: Integer;
Begin
If Not LoggedIn then Exit;
SymbolAccuracy := 0.5;
If FindSymbol(sx,sy,'Furnace') then
Begin
Result:='AtFurnace'
Writeln('At furnace :)')
end else
If FindSymbol(sx,sy,'Bank') then
Begin
Result:='AtBank'
Writeln('We are at Bank');
end else
begin
Writeln('Lost... Could not find location, Logging out.');
Logout;
Exit;
end;
end;
Procedure OpenBank2;
begin
FFlag(0);
OpenBankFast('Feb');
end;
Procedure WalkToFurnace;
Begin
If Not LoggedIn then Exit;
MakeCompass('N');
GameTab(4);
SetRun(True);
RadialRoadWalk(FindFallyRoadColor, 277, 346, 64, 2, 0);
FFlag(0);
RadialRoadWalk(FindFallyRoadColor, 277, 346, 64, 2, 0);
FFlag(0);
SymbolAccuracy := 0.5;
If FindSymbol(x, y, 'Furnace') then
Begin
Writeln('Found the Furnace Symbol');
Mouse(x,y,5,5,True);
FFlag(0)
SymbolAccuracy := 0.8;
Writeln('Entering Furnace');
end else
begin
Writeln('Could not find the Furnace ');
Logout;
end;
end;
Procedure LoadDTMs(DTM: String);
Begin
Case LowerCase(DTM) of
'BankDTM':
Begin
BankDTM:= DTMFromString('78DA636C64626088604001FFFEFD636060042' +
'386FF40C0D805549300916385AAF9F387094C3342F98C2073E209' +
'A82925424D2D6135001FB8135B');
end;
'Steelbar':
Begin
Steelbar := DTMFromString('78DA6314646060E063400101DEDE609A11CA6' +
'7140612120C688011550D37901023A0861548F012502300249808' +
'A89104122C04D4C8116117C81C61FC6A0099450201');
end;
end;
end;
Function FindFurnace2: Boolean;
Begin
If Findfurnace(x, y) then
begin
writeln('furnace found trying to open');
Mouse(x, y, 5, 5, true);
if openfurnace then
begin
writeln('furnace opened');
Result:= True;
end else
writeln('found furnace but could not open');
end else
Writeln('Couldn''t find furnace');
end;
Procedure WalkToBank;
Begin
If Not LoggedIn then Exit;
Begin
MakeCompass('N');
SetRun(True);
RadialWalk(FindFallyRoadColor, 45, 105, 70, 2, 1);
FFlag(0);
RadialWalk(FindFallyRoadColor, 95, 158, 66, 2, 0);
FFlag(0);
SymbolAccuracy := 0.5;
If FindSymbol(x, y, 'Bank') then
Begin
Writeln('Found the Bank Symbol');
Mouse(x,y,5,5,True);
FFlag(3);
Writeln('Entering Bank');
end else
begin
Writeln('Could not find the Bank ');
Logout;
end;
end;
end;
Procedure WalkTobank2;
var
BankDTM : Integer;
begin
LoadDTMs('BankDTM');
If DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 5, 5, true);
WriteLn('Found The BankBooth');
FreeDTM(BankDTM);
end else
Begin
Writeln('Not Found Bank...')
End;
end;
Procedure WithdrawSteelBars;
var
SteelBar: Integer;
begin
LoadDTMs('SteelBar');
if FindDTM(SteelBar, x, y, MSx1, MSy1, MSx2, MSy2) then
begin
Wait(500+random(150));
Mouse(x, y, 3, 3, False);
Wait(100 +random(100));
ChooseOption('All');
end else
begin
MouseBox(302, 300, 326, 316, 1);
repeat
Wait(100 +random(500));
until FindTextTPA(clBlack, 30, MCX1, MCY1, MCX2, MCY2, 'name of', UpChars, Nothing);
TypeSend('steel bars');
Wait(100 +random(500));
If FindDTM(SteelBar, x, y, MSx1, MSy1, MSx2, MSy2) then
begin
Mouse(x, y, 5, 5, false);
Wait(25 +random(100));
ChooseOption('All');
end;
end;
FreeDTM(SteelBar);
end;
begin
SetupSRL;
ClearDebug;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Wait(100 +random(500));
If (FindMyLocation = 'AtBank') then
Begin
OpenBank2;
WithdrawSteelBars;
WalkToFurnace;
FindFurnace2;
end else
Begin
If (FindMyLocation = 'AtFurnace') then
Begin
WalkToBank;
WalkToBank2
OpenBank2;
WithdrawSteelBars;
end;
end;
end.