Rich
2010-12-15 12:09:01
program ReflectionBasic;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
Const
World = 72; // World to load in SMART
Members = False; // RS account Member
Signed = True; // Use signed client
BankPIN = ''; // RS bank PIN
Debug = False; // Does nothing as of yet
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Multiplayer not added yet
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; // RS account username
Players[0].Pass :=''; // RS account password
Players[0].Nick :=''; // 3-4 lowercase letters of your RS username
Players[0].Active := True; // Use this account
end;
// No need to change anything below this line ----------------------------------
var
Randoms, Loads, Money : Integer;
procedure AntiRandoms;
begin
if FindNormalRandoms or R_FindRandoms then
Inc(Randoms);
end;
procedure Proggy;
begin
if not Debug then
ClearDebug;
WriteLn('> <');
WriteLn('>>>>>>>>>>>>>>>>>>>>>> Richard''s <<<<<<<<<<<<<<<<<<<<<<');
WriteLn('>>>>>>>>>>>>>> Anti Dragon Shield Robber <<<<<<<<<<<<<');
WriteLn(PadR('> Ran: ' + TimeRunning, 54) + '<');
WriteLn(PadR('> Player: ' + Players[CurrentPlayer].Name, 54) + '<');
WriteLn(PadR('> Loads: ' + IntToStr(Loads), 54) +'<');
WriteLn(PadR('> Shields: ' + IntToStr(Loads * 28), 54) + '<');
WriteLn(PadR('> Loads/Hour: ' + IntToStr(Round((Loads * 3600) / (GetTimeRunning / 1000))), 54) + '<');
WriteLn(PadR('> Shields/Hour: ' + IntToStr(Round((Loads * 3600 * 28) / (GetTimeRunning / 1000))), 54) + '<');
WriteLn(PadR('> Randoms: ' + IntToStr(Randoms), 54) + '<');
WriteLn('> <');
end;
procedure DoDoor(ToDuke : Boolean);
var
DukeTile, OutTile : TTile;
DTP : TPoint;
X, Y : Integer;
begin
while IsMoving do
Wait(100);
if not ToDuke then
begin
OutTile:= Tile(3209, 3222);
WalkToTile(OutTile, 0, 1);
while IsMoving do
Wait(100);
end;
Wait(250 + Random(500));
if R_OpenDoor(36844, 2) then
Exit;
DukeTile:= Tile(3208, 3222);
DTP := TileToMS (DukeTile, 1);
Wait(500 + Random(500));
MMouse (DTP.x, DTP.y, 0, 0);
AntiRandoms;
if WaitUpTextMulti(['Door', 'oor'], 500) then
begin
if WaitUpTextMulti(['Open', 'pen'], 500) then
begin
GetMousePos(DTP.x, DTP.y);
Wait(Random(250));
Mouse(DTP.x, DTP.y, 0, 0, True);
end;
end else
begin
if (FindObjCustom(X, Y, ['Door', 'oor'], [10876406,5661808,10546927,5993095,5998215,4412772], 4)) then
begin
MMouse(X, Y, 0, 0);
if WaitUpTextMulti(['pen', 'Open'], 500) then
begin
AntiRandoms;
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
end;
end;
end;
end;
procedure UseTheBank(First : Boolean);
begin
while IsMoving do
Wait(100);
AntiRandoms;
if not R_OpenBankBooth('lb') then
if not OpenBank('lb', False, False) then
begin
LogOut;
TerminateScript;
end;
AntiRandoms;
Wait(500 + Random(500));
if ((PinScreen) or (R_PinScreen)) then
InPin(BankPIN);
if ((BankScreen) or (R_BankScreen)) then
R_DepositAll(True);
AntiRandoms;
Wait(500 + Random(250));
CloseBank;
if not First then
Inc(Loads);
Proggy;
end;
procedure GetToBank;
var
BankTile : TTile;
begin
while IsMoving do
Wait(100);
Wait(250 + Random(250));
case Random(4) of
0 : BankTile:= Tile(3208, 3219);
1 : BankTile:= Tile(3208, 3218);
2 : BankTile:= Tile(3209, 3218);
3 : BankTile:= Tile(3209, 3219);
end;
AntiRandoms;
WalkToTile(BankTile, 1, 1);
UseTheBank(False);
end;
procedure ClickOnUpStairs;
var
X, Y, C, D, Q : Integer;
StairTile, DukeTile : TTile;
STP : TPoint;
begin
while IsMoving do
Wait(100);
AntiRandoms;
StairTile:= Tile(3205, 3208);
DukeTile:= Tile(3208, 3222);
STP := TileToMS (StairTile, 1);
MMouse (STP.x, STP.y, 2, 2);
AntiRandoms;
if WaitUpTextMulti(['limb', 'tair', 'ase'], 500) then
begin
GetMousePos(STP.x, STP.y);
Wait(Random(250));
Mouse(STP.x, STP.y, 0, 0, True);
Wait(1500 + Random(750));
Mouse(255, 397, 50, 2, True);
Wait(500 + Random(250));
AntiRandoms;
end else
begin
AntiRandoms;
if ((C = 0) and (D = 0)) then
begin
if (FindObjCustom(X, Y, ['limb', 'tair', 'ase'], [10660010,9475735,10067616,7699067, 10067616], 4)) then
begin
Mouse(X, Y, 0, 0, True);
GetMousePos(C, D);
Wait(1500 + Random(750));
Mouse(255, 397, 50, 2, True);
Wait(250 + Random(250));
AntiRandoms;
end;
end else
begin
MMouse(C, D, 5, 5);
if not IsUpTextMultiCustom(['limb', 'tair', 'ase']) then
begin
AntiRandoms;
C:= 0;
D:= 0;
Inc(Q);
if Q = 25 then
begin
LogOut;
TerminateScript;
end;
ClickOnUpStairs;
end;
end;
end;
Q:= 0;
Wait(500 + Random(500));
AntiRandoms;
GetToBank;
end;
procedure GetToUpStairs;
var
UpTile : TTile;
begin
while IsMoving do
Wait(100);
UpTile:= Tile(3206, 3210);
AntiRandoms;
DoDoor(False);
WalkToTile (UpTile, 1, 1);
FFlag(1);
Wait(500 + Random(250));
ClickOnUpStairs;
end;
procedure TalkToDuke;
var
NPC : TNPC;
TP : TPoint;
B : Boolean;
begin
while IsMoving do
Wait(100);
repeat
AntiRandoms;
if FindNPC('uke Horacio', NPC)then
begin
TP := TileToMs(NPC.Tile, 0);
MMouse(TP.x, TP.y, 0, 0);
if IsUpTextMultiCustom(['uke', 'oracio'])then
begin
Wait(50 + Random(25));
GetMousePos(TP.x, TP.y);
B:= True;
end;
end else
begin
if (FindObjCustom(Tp.x, Tp.y, ['Duke', 'uke', 'Horacio', 'oracio'], [9129259,1518132,7982550,1254699,5792102,8235229], 4)) then
begin
GetMousePos(Tp.x, Tp.y);
B:= True;
end;
end;
if B = True then
begin
if ((R_InvFull) or (InvFull)) then
Break;
Mouse(TP.x, TP.y, 0, 0, True);
Wait(500 + Random(250));
R_ClickToContinue;
Wait(500 + Random(250));
Mouse(262, 399, 150, 2, True);
Wait(500 + Random(250));
R_ClickToContinue;
Wait(500 + Random(250));
R_ClickToContinue;
Wait(500 + Random(250));
R_ClickToContinue;
Wait(500 + Random(250));
R_ClickToContinue;
Wait(500 + Random(250));
if ((R_InvFull) or (InvFull)) then
Break;
end;
until((R_InvFull) or (InvFull));
GetToUpStairs;
end;
procedure GetToDuke;
var
DukeTile : TTile;
begin
while IsMoving do
Wait(100);
Wait(250 + Random(500));
DukeTile:= Tile(3206, 3222);
AntiRandoms;
WalkToTile(DukeTile, 0, 1);
DoDoor(True);
AntiRandoms;
TalkToDuke;
end;
procedure ClickOnStairs;
var
X, Y, C, D, Q : Integer;
StairTile : TTile;
STP : TPoint;
begin
AntiRandoms;
while IsMoving do
Wait(100);
StairTile:= Tile(3205, 3208);
STP := TileToMS (StairTile, 1);
MMouse (STP.x, STP.y, 2, 2);
if WaitUpTextMulti(['limb', 'own', 'tair', 'ase'], 500) then
begin
AntiRandoms;
GetMousePos(STP.x, STP.y);
Wait(Random(250));
Mouse(STP.x, STP.y, 0, 0, True);
Wait(500 + Random(250));
end else
begin
if ((C = 0) and (D = 0)) then
begin
AntiRandoms;
if (FindObjCustom(X, Y, ['limb', 'own', 'tair', 'ase'], [10660010,9475735,10067616,7699067, 10067616], 4)) then
begin
Mouse(X, Y, 0, 0, True);
GetMousePos(C, D);
end;
end else
begin
MMouse(C, D, 5, 5);
if not IsUpTextMultiCustom(['limb', 'own', 'tair', 'ase']) then
begin
AntiRandoms;
C:= 0;
D:= 0;
Inc(Q);
if Q = 25 then
begin
LogOut;
TerminateScript;
end;
ClickOnStairs;
end;
end;
end;
Q:= 0;
Wait(500 + Random(500));
GetToDuke;
end;
procedure GetToStairs;
var
DownTile : TTile;
begin
while IsMoving do
Wait(100);
DownTile:= Tile(3206, 3210);
AntiRandoms;
WalkToTile (DownTile, 1, 1);
ClickOnStairs;
end;
procedure DoItAll;
begin
Wait(2000);
MakeCompass('N');
SetAngle(True);
if not R_InvEmpty then
UseTheBank(True);
repeat
GetToStairs;
until(false);
end;
begin
Smart_Members := Members;
Smart_Signed := Signed;
Smart_Server := World;
Smart_SuperDetail := False;
SetupSRL;
SetupReflection;
DeclarePlayers;
LoginPlayer;
DoItAll;
end.Start at Lumbridge bank. It doesn't matter whether there is stuff in your inventory or not; if there is the script will bank it.The script will run downstairs to the Duke, keep on getting Anti Dragon Shields, run upstairs, bank and repeat.
The script at the moment is mediocre. There are known bugs which are being worked on, and improvements made. If someone applied for Members with this script, I'd probably vote No. The only reason it's in Members is to keep the leachers from selling at minimum, so sell at max!
If anyone notices any bugs or improvements, please feel free to point them out.
Features:
- Anti randoms
- Some failsafes
- Progress report
To come:
- More failsafes
- Anti-ban
- Multiplayer
- Money earned calculation
- Location and object detection
- General bug fixes and improvements
Sit rep: The script is almost OK to leave alone. With a few more tweaks, it should be fine. Sexy progress report added! :D
Sell at mid/max!
GE - Anti Dragon Shield
Progress reports:
> <
>>>>>>>>>>>>>>>>>>>>>> Richard's <<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>> Anti Dragon Shield Robber <<<<<<<<<<<<<
> Ran: 11 Minutes and 57 Seconds <
> Player: <
> Loads: 2 <
> Shields: 56 <
> Loads/Hour: 10 <
> Shields/Hour: 281 <
> Randoms: 0 <
> <Richard.