SCAR Code:
program AIOFmer;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl\srl/reflection/reflection.scar}
{
This script FMs at the following locations:
'ge' = Grand Exchange
'vwbn' = Varrock West Bank (North)
'vwbs' = Varrock West Bank (South)
'veb' = Varrock East Bank
'feb' = Fally East Bank
To Be Added
'fog' = Fist Of Guthix
Post suggestions!
}
var
SpotTileX, SpotTileY, BankTileX, BankTileY, holder: longint;
loads: LongInt;
const
DebugIt = True; //True/False - Have the script update you on where its at in the debug box constantly?
SmartWorld = 111;
Procedure DeclarePlayers;
begin
HowManyPlayers:= 1; // How many players are there arrays for?
CurrentPlayer:= 0; // Which player should we start with?
NumberOfPlayers(HowManyPlayers); // Do Not Change.
Players[0].Name := ''; // Username.
Players[0].Pass := ''; // Password.
Players[0].Nick := ''; // 2-4 letters of your Username (that are not capital letters or spaces).
Players[0].Active := True;
Players[0].Loc := 'start'; // Do not change.
Players[0].Strings[0] := ''; // Bank Pin. If none, leave as '' (blank).
Players[0].Strings[1] := 'vwbs'; // Read top of script to find out the arguments for this.
Players[0].Integers[0] := 312; //Loads to do
end;
Procedure SwitchPlayer(active: boolean);
begin
if (active = false) then
begin
holder := 0;
wait(9999999999999999999999999999999);
Players[CurrentPlayer].Active := false;
Logout;
wait(3000+random(500));
if (AllPlayersInactive) then
begin
writeln('All Players are inactive, terminating script.');
TerminateScript;
end;
end else
begin
holder := 0;
writeln('Switching Players (Current Player:'+Players[CurrentPlayer].Name+' is still active.');
NextPlayer(true);
end;
end;
Procedure Debug(text: string);
begin
if (DebugIt) then
writeln('DEBUG: '+text);
end;
Function GetTBox: boolean;
begin
if not(loggedin) then
loginplayer;
GameTab(4);
MMouseItem(1);
wait(250+random(200));
if (IsUpText('erbox')) then
begin
result := true;
exit;
end else
begin
writeln('You do not have a tinderbox. Next Player.');
SwitchPlayer(false);
exit;
end;
end;
Function SetUpPlayer: boolean;
begin
if not(LoggedIn) then
LoginPlayer;
GameTab(4);
if not(GetTBox) then
begin
Writeln('You do not have a Tinderbox in your inventory. Next Player.');
SwitchPlayer(false);
exit;
end;
debug('You have a Tinderbox.');
MakeCompass('n');
SetAngle(true);
FindNormalRandoms;
SetRun(true);
result := true;
end;
Function ChooseBank: string;
begin
case (Players[CurrentPlayer].Strings[1]) of
'vwbn': begin result := 'vwb'; exit; end;
'vwbs': begin result := 'vwb'; exit; end;
'veb': begin result := 'veb'; exit; end;
'feb': begin result := 'feb'; exit; end;
//'fog': result := '';
end;
writeln('Please fix the Player''s bank argument.');
end;
{Function OpenGEBank:Boolean; //Made by: The Cnr Sport
Var
TPA : Tpointarray;
P2D : T2DPointarray;
TP : Tpoint;
I,L,U:integer;
begin
if not loggedin then exit;
FindColorsSpiralTolerance(Mscx,mscy,TPA,6712942,190,117,225,177,7);
L := GetArrayLength(TPA);
P2D := TPAToATPAEx(Tpa, 5, 5);
for I := 0 to Length(P2D)-1 do
begin
tp := MiddleTPA(P2D[I]);
MMouse(tp.x,tp.y,2,2);
wait(randomrange(50,90));
If Isuptext('anke') then
begin
Mouse(tp.x,tp.y,0,0,false);
wait(randomrange(50,90));
If Chooseoption('ank Bank') then
begin
result:=true;
writeln('Banked at GE');
If bankscreen or pinscreen then exit;
end;
end;
end;
end; }
Procedure SetTiles;
begin
case (Players[CurrentPlayer].Strings[1]) of
{'ge': begin
SpotTileX := ;
SpotTileY := ;
BankTileX := ;
BankTileY := ;
exit;
end; }
'vwbn': begin
SpotTileX := 0;
SpotTileY := 0;
BankTileX := 0;
BankTileY := 0;
exit;
end;
'vwbs': begin
SpotTileX := 3198;
SpotTileY := 3428;
BankTileX := 3188;
BankTileY := 3435;
exit;
end;
'veb':begin
SpotTileX := 0;
SpotTileY := 0;
BankTileX := 0;
BankTileY := 0;
exit;
end;
'feb':begin
SpotTileX := 0;
SpotTileY := 0;
BankTileX := 0;
BankTileY := 0;
exit;
end;
end;
writeln('Please fix the current Player''s FMing location argument');
SwitchPlayer(false);
end;
Function BankIt: boolean;
begin
if not(LoggedIn) then
begin
SwitchPlayer(true);
Exit;
end;
if not(InvFull) then
begin
Status('Opening Bank...');
{if (Players[CurrentPlayer].Strings[1] = 'ge') then
begin
OpenGEBank;
end else
begin }
OpenBankQuiet(ChooseBank);
// end;
wait(1000+random(200));
Deposit(2,28,true);
wait(250+random(200));
Withdraw(1,1,27);
CloseBank;
end;
result := true;
end;
Function WalkToSpot: boolean;
begin
if not(LoggedIn) then
begin
SwitchPlayer(true);
Exit;
end;
SetTiles;
if (holder/3 = 1) then
holder := 0;
if not(WalkToTile(Point(SpotTilex, SpotTileY+holder),0,1)) then
begin
writeln('Failed while walking to the FMing spot. Next Player.');
SwitchPlayer(false);
result := false;
exit;
end;
Inc(holder);
result := true;
end;
Function MakeFires: boolean;
var i,clicking,burning,strikes: longint;
firstdone: boolean;
begin
strikes := 0;
firstdone := false;
if not(LoggedIn) then
begin
SwitchPlayer(true);
Exit;
end;
Status('Burning logs...');
i := 2;
MarkTime(burning);
repeat
MouseItem(1,true);
wait(randomrange(100,200));
MMouseItem(i);
MarkTime(clicking);
repeat
if not (CharacterAnimating) then break;
if not(Firstdone) then break;
until (TimeFromMark(clicking) > 5500);
MarkTime(clicking);
repeat
if (CharacterMoving) then break;
if not(Firstdone) then break;
until (TimeFromMark(clicking) > 3500);
wait(randomrange(750,1250));
MouseItem(i,true);
Firstdone := true;
status('Burning log #'+inttostr(i-1));
wait(500+random(250));
if (LastChatMessage('black') = 'You can''t light a fire here.') then
begin
Inc(strikes);
if (strikes > 4) then
begin
writeln('Failing to burn logs too often, next player.');
SwitchPlayer(False);
result := false;
exit;
end;
WalkToTileMS(Point(GetMyPos.x,GetMyPos.y+1),0,0);
MouseItem(1,true);
wait(200+Random(150));
MouseItem(i,true);
end;
MarkTime(clicking); //line 300
repeat
wait(randomrange(25,75));
until not(ExistsItem(i)) or (TimeFromMark(clicking) > 4500);
Inc(i);
until(InvCount = 1) or (TimeFromMark(burning) > 60000);
result := true;
end;
Function GoToBank: boolean;
begin
if not(LoggedIn) then
begin
SwitchPlayer(true);
Exit;
end;
SetTiles;
writeln('Distance from: '+inttostr(DistanceFrom(point(3188, 3435))));
writeln('X: '+IntToStr(GetMyPos.x)+' Y: '+IntToStr(GetMyPos.y));
if not (WalkToTile(Point(BankTileX, BankTileY),0,1)) then
begin
writeln('Failed while walking to the Bank. Next Player.');
SwitchPlayer(false);
result := false;
exit;
end;
result := true;
end;
begin
SmartSetupEx(111,false,true,false);
SetTargetDC(smartgetdc);
SetupSRL;
//SetupReflection;
DeclarePlayers;
holder := 0;
repeat
case (Players[CurrentPlayer].Loc) of
'start': begin
if not(LoggedIn) then
LoginPlayer;
if (SetUpPlayer) then
begin
Players[CurrentPlayer].Loc := 'banky';
end else
begin
writeln('Something went wrong during SetUpPlayer. Next Player.');
SwitchPlayer(false);
end;
end;
'banky': begin
if not(LoggedIn) then
LoginPlayer;
if (GoToBank) then
begin
Players[CurrentPlayer].Loc := 'bankit';
end else
begin
writeln('Something went wrong during GoToBank. Next Player.');
SwitchPlayer(false);
end;
end;
'bankit': begin
if not(loggedin) then
loginplayer;
if (BankIt) then
begin
Players[CurrentPlayer].Loc := 'firespot';
end else
begin
writeln('Something went wrong during BankIt. Next Player.');
SwitchPlayer(False);
end;
end;
'firespot': begin
if not(loggedin) then
loginplayer;
if (WalkToSpot) then
begin
Players[CurrentPlayer].Loc := 'firetime';
end else
begin
writeln('Something went wrong during WalkToSpot. Next Player.');
SwitchPlayer(false);
end;
end;
'firetime': begin
if not(loggedin) then
loginplayer;
if (MakeFires) then
begin
Players[CurrentPlayer].Loc := 'banky';
end else
begin
writeln('Something went wrong during MakeFires. Next Player.');
SwitchPlayer(false);
end;
end;
end;
until(false);
end.