SRL Archive - Outdated / Broken

Anti Dragon Shield Collector


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.

BraK

2010-12-15 12:58:45

Nice Capitalizing on the new thing RS released. That good Initiative. I might try it out later just to test it out for some proggies.

~BraK

Rich

2010-12-15 13:00:01

From: BraK
Nice Capitalizing on the new thing RS released. That good Initiative. I might try it out later just to test it out for some proggies.

~BraK
Thanks. Like I said, it's not amazing…yet!. I'm running it, and watching for areas to improve on. No proggies at the moment, since I haven't added that yet :p I plan to add all that sort of stuff when I've got it functioning to a decent standard, when it can be left alone.

Gu3st...

2010-12-15 13:24:21

Update your reflection :)
SRL/SRL/Reflection is not the correct place to have reflection anymore

Also, Good job on the script :) Going to run it today

Rich

2010-12-15 13:26:18

From: Zyt3x
Up date your reflection :)
SRL/SRL/Reflection is not the correct place to have reflection anymore

Also, Good job on the script :) Going to run it today
Moving the folder now. Thanks for the heads up. Keep an eye on the script when running it until I get it properly sorted out.

Thanks,
Richard.

Gu3st...

2010-12-15 13:35:23

If the door is locked when the script tries to walk back to the stairs after collecting, it will fail and just stand inside the duke's room looking for the stair

E: I added "while IsMoving do Wait(100);" to each procedure and now it's working much better

Rich

2010-12-15 14:21:25

From: Zyt3x
If the door is locked when the script tries to walk back to the stairs after collecting, it will fail and just stand inside the duke's room looking for the stair

E: I added "while IsMoving do Wait(100);" to each procedure and now it's working much better
I've added the IsMoving part like you have. Thanks for that.

Just found R_OpenDoor in Objects.simba. I love reflection…

weequ

2010-12-15 15:42:38

I think anti dragon shield prices will crash due to the new update.
Anyway good release ;)

Rich

2010-12-15 18:07:47

Thanks. I'll update more tomorrow after school.

Bonfield

2010-12-15 19:15:29

te way you hnde chat needs to be fixed, 3/4 of the time it starts talking to the duke then halfway throuh getting the sheild it wil try to talk to him again

Rich

2010-12-16 03:06:46

From: Bonfield
te way you hnde chat needs to be fixed, 3/4 of the time it starts talking to the duke then halfway throuh getting the sheild it wil try to talk to him again
I know about that, but thanks for reminding me. It should be an easy fix when I get in tonight.

Bad Boy JH

2010-12-16 03:20:46

Good call on making this SRL Members only

The Claw

2010-12-16 03:21:21

Cool :) How many per hour?
I used to collect about 5 or 6 an hour from green dragon autoers a few years ago, got a stock of 50 or so :p

Rich

2010-12-16 14:16:53

From: The Claw
Cool :) How many per hour?
I used to collect about 5 or 6 an hour from green dragon autoers a few years ago, got a stock of 50 or so :p
I'll do a test that when I've got it working. I'm running it now to see if I've fixed the door finding problem.

EDIT: Edited the first post with a script which has slightly better door finding, and it will empty your inventory into the bank if you start with something in it. I still need to sort out the issue of starting talking to the Duke again even though you're in mid conversation, but I'll do that later; Forza 3 time.

EDIT 2: Still haven't fixed talking to the Duke, but added a report, and made the script a bit faster in general. Will try to fix that later.

Dervish

2010-12-16 15:01:53

The price of ADShields are crashing.

Rich

2010-12-16 16:03:05

^ Yep, and I doubt that they'll rise again after this update. Get some shields, and then sell ASAP. Once the price has crashed massively, I'll get this moved to Public Scripts.

kitchenrange

2011-01-19 17:29:27

It's about that time. Check the prices now…

Rich

2011-01-19 17:33:26

Yup. I'll buck the script up a bit then have it moved to public.

kitchenrange

2011-01-19 18:52:30

I probably wouldnt worry about buffing it up. Prices are so low now it may be pointless.

Nose Smasher

2011-01-27 00:15:56

From: kitchenrange
I probably wouldnt worry about buffing it up. Prices are so low now it may be pointless.


Never know what might happen when free trade comes back..

Rich

2011-01-27 02:59:07

^ If the prices rise again, I'll probably sort it out, but like kitchenrange said, at the moment it's not worth it.