SCAR Code:
{.include SRL\SRL\misc\SMART.SCAR}
{.include SRL\SRL.scar}
{.include reflection\reflection.simba}
{ Valid locations is: 'VPG' Varrock Palace Guards, 'DMF' Draynor Master Farmer
{
{}
var
Level, XP: integer;
NPCTarget: TNPC;
FoodName: string;
TargetHitDamage: integer;
GoldStolen, PrevGold, StartGold: integer;
const
World = 108;
Signed = True;
Members = False; // Duh!
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name :='';
Pass :='';
Nick :='oli';
Level[SKILL_HITPOINTS] := 10; // Your hitpoints level (Not lifepoints!)
Active := True;
Booleans[0] := True; // If wanted EXP is relative to your current EXP.
Integers[0] := 0; // Wanted EXP, 0 is continue 'til stopped.
Integers[1] := 70; // Amount of lifepoints your food heals
Booleans[1] := True; // Wanna take breaks?
Integers[2] := 50; // How many minutes between each break. +- 5 minutes.
Integers[3] := 10; // How many minutes to break for. +- 5 minutes.
Loc := 'VPG'; // Location as to where to pickpock;
end;
{
}
end;
// DO NOT CHANGE THE FOLLOWING CONST ITEMS \\
const
XP_Man = 8;
XP_Farmer = 14.5;
XP_Warrior = 26;
XP_Guard = 46.8;
XP_MasterFarmer = 43;
DMG_Man = 10;
DMG_Farmer = 0;
DMG_Warrior = 0;
DMG_Guard = 30;
DMG_MasterFarmer = 30;
//\\\\\\\\\\\\\\\\\\\////////////////////\\
function LoadPath(Path:String;Bank:Boolean): TTileArray;
begin
if (not Bank) then
begin
case Path of
'DMF':
begin
SetLength(Result, 2);
Result[0] := Point(3856, 2606);
Result[1] := Point(3842, 2614);
end;
'VPG':
begin
SetLength(Result, 8);
Result := [
Tile(3167, 3489), Tile(3177, 3489), Tile(3185, 3489),
Tile(3195, 3487), Tile(3196, 3480), Tile(3197, 3471),
Tile(3200, 3459), Tile(3212, 3462)];
end;
end;
end;
if (Bank) then
begin
case Path of
'DMF':
begin
SetLength(Result, 2);
Result[0] := Point(3842, 2614);
Result[1] := Point(3855, 2606);
end;
'VPG':
begin
SetLength(Result, 9);
Result := [
Tile(3212, 3463), Tile(3212, 3457), Tile(3202, 3457),
Tile(3197, 3465), Tile(3195, 3474), Tile(3191, 3482),
Tile(3188, 3487), Tile(3179, 3487), Tile(3172, 3488)];
end;
end;
end;
writeln('Loaded path');
end;
procedure Terminate;
begin
writeln('Terminating script...');
TerminateScript;
end;
procedure Walk(Bank : boolean);
begin
R_MakeCompass('N');
case Bank of
True: // To bank
WalkPath(LoadPath(Players[CurrentPlayer].Loc,True));
False: // To target
begin
WalkPath(LoadPath(Players[CurrentPlayer].Loc,False));
end;
end;
writeln('Done walking');
end;
function IsFood(Item: TInvItem):boolean;
begin
if (Item.Actions[0] = 'Eat') then
Result := True;
if (Item.Actions[0] <> 'Eat') then
Result := False;
end;
function GetTargetHitDMG: integer;
begin
Result := -1;
case NPCTarget.Name of
'Guard': Result := DMG_Guard;
'Master Farmer': Result := DMG_MasterFarmer;
end;
if Result = -1 then
writeln('Returned -1 as HitDMG, why???');
end;
function GetTargetXP: Extended;
begin
Result := -1;
case NPCTarget.Name of
'Guard': Result := XP_Guard;
'Master Farmer': Result := XP_MasterFarmer;
end;
if Result = -1 then
writeln('Returned -1 as XP...');
end;
function PickFailed: boolean;
begin
Result := True;
if (PrevGold <> GoldStolen) then
begin
Result := False;
PrevGold := GoldStolen;
end;
end;
procedure Eat;
var
i: integer;
begin
for i := 1 to 28 do
begin
if (IsFood(GetInvItemAt(i))) then
begin
R_ClickItem(i,True,'');
while (GetInvItemAt(i).StackSize <> -1) do
begin
wait(50);
end;
end;
end;
end;
procedure CheckEat;
begin
if R_GetMMLevels('hp') <= TargetHitDamage then
begin
Eat;
while (R_GetMMLevels('hp') + Players[CurrentPlayer].Integers[1]) <= (Players[CurrentPlayer].Level[SKILL_HITPOINTS]*10) do
begin
Eat;
end;
end;
end;
function GetGold: integer;
var
G: TInvItem;
begin
Result := 0;
if R_ItemNameExists(G,'Coins') then
begin
Result := G.StackSize;
end;
end;
function GetTarget: boolean;
begin
Result := False;
case Players[CurrentPlayer].Loc of
'VPG':
Result := FindNPC('uard',NPCTarget);
'DMF':
Result := FindNPC('aster Farm',NPCTarget);
end;
if (Result = False) then
GetTarget;
if (Result = False) then
begin
writeln('Couldnt find NPC.');
Terminate;
end;
end;
function IsCloseToTarget: boolean;
begin
Result := False;
if DistanceFrom(NPCTarget.Tile) <= 10 then
begin
Result := True;
end;
end;
function PickTarget: boolean;
var TP: TPoint;
begin
PrevGold := GoldStolen;
TP := TileToMs(NPCTarget.Tile, NPCTarget.Height);
MMouse(TP.x,TP.y,0,0);
if IsUptext('ickpock') then
begin
ClickMouse(Tp.x,tp.y,True);
end;
if not R_IsUpText('ickpock') then
begin
ClickMouse(Tp.x,tp.y,false);
wait(200);
if not R_ChooseOption('ickpock') then
begin
writeln('Failed to find pickpock option.');
Terminate;
end;
end;
wait(1000);
end;
procedure BankOpen;
begin
case Players[CurrentPlayer].Loc of
'VPG': OpenBankNPC;
'DMF': OpenBank('dr',true,true);
end;
end;
procedure DepositStuff;
begin
if (R_BankScreen) then
R_DepositAllButIDEx([617,995]);
end;
procedure PrintStats;
begin
end;
procedure MainLoop;
begin
while (true) do
begin
BankOpen;// Opens bank
DepositStuff; // Deposits anything but coins.
WithdrawFood; // Withdraws item from slot 1
CloseBank; // Closes bank
Walk(False); // Walks to pickpocking place
while (HasFood) do
begin
CheckEat; // Checks if LP is too low to risk a fail, eats if it is
GetTarget; // Looks for the target
PickTarget; // Pickpockets the target
GoldStolen := GetGold - StartGold; // Updates gold stats
end;
Walk(True); // Walks to bank
PrintStats; // Prints stats
end;
end;
begin
Smart_Server := World;
Smart_Members := Members;
Smart_Signed := Signed;
DeclarePlayers;
SetupSRL;
SetupReflectionEx(False);
LogInPlayer;
SetAngle(True);
MainLoop;
StartGold := GetGold;
GoldStolen := GetGold - StartGold;
PrevGold := GoldStolen;
end.