SRL Archive - First Scripts

Yvw Master's VEB Vial Filler!


yvw master

2008-10-13 04:01:49

Fills vials from the fountain by Varrock East Bank! Might still be a little buggy. Somewhat rarely it fails to find the empty vial DTM in the bank although i redid the DTM a good 4 times. If anyone else gets a similar bug and knows a solution please post it!

Also, DO NOT RUN SCRIPT WITHOUT WATCHING IT. As I said before it sometimes doesn't find the DTM and for some reason when it detects there are no empty vials left in the bank I can't get it to log out or exit, any help with this would also be greatly appreciated.

Shouldn't have to pick fountain color.

Start in the bank with full inventory of empty vials. I've only had the chance to watch it do a load of around 300 and it did so successfully.
.
Has AntiBan and AntiRandom(which I haven't seen in action yet)

My standards might be a little messed up too. Anyway, here it is.


(thank you to BlumbleBee, Andyz55, TheVoiceInYourHead, Cazax, and noidea for replying/helping in my 'script help' thread)

program VialFiller;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\reflection\Reflection.Scar}

//////////////////////////
Procedure SetupSmart;
Begin
SmartSetup('world44', True, True, False);//////set world for smart
Wait(1000);
SetTargetDC(SmartGetDC);
end;
//////////////////////////
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'username';// Your UserName
Players[0].Pass := 'password';// Your PassWord
Players[0].Nick := 'nickname';// Your Nick (3-4 letters from your username)
Players[0].Active := True;// Use this player ??}

end;
//////////////////////////
Procedure AntiRandom;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
if FindFight then
RunAway('N', True, 1, 5000);
end;
//////////////////////////
Procedure AntiBan;
begin
case random(70) of
0: RandomRClick;
1: BoredHuman;
2: BoredHuman;
3: PickUpMouse;
4: PickUpMouse;
5: PickUpMouse;
6: PickUpMouse;
7: PickUpMouse;
8: Wait(15000 + Random(15000));
9: Wait(30000+ Random(20000));
end;
end;
//////////////////////////
function LoadToPath: TPointArray;
begin
SetLength(Result, 2);

Result[0] := Point(3246, 3431);
Result[1] := Point(3239, 3435);
end;
//////////////////////////
Procedure WalkToFountain;
Var
I: Integer;
Path: TPointArray;

Begin
Path := LoadToPath;
for i := 0 to High(Path) do
Begin
WalkToTile(Path[i], 2, 0);
end;
Wait(2000 + Random(2000));
end;
//////////////////////////
function LoadFromPath: TPointArray;
begin
SetLength(Result, 2);

Result[0] := Point(3252, 3428);
Result[1] := Point(3252, 3419);
end;
//////////////////////////
Procedure WalkFromFountain;
Var
I: Integer;
Path: TPointArray;

Begin
Path := LoadFromPath;
for i := 0 to High(Path) do
Begin
WalkToTile(Path[i], 2, 0);
end;
Wait(900 + Random(300));
end;
//////////////////////////


//////////////////////////
Function FindFountain : boolean;
Var
Bx, By : Integer;
Full : Integer;
Empty : Integer;
WaitTime : Integer;
x1, y2 : Integer;
SearchCount : Integer;
label
Search;
Begin
Flag;
Flag;
SearchCount := 0;
Search: //////////////INSERT FOUNTAIN COLOR////////////////
if(FindColorTolerance(Bx,By,14066312,MSX1,MSY1,MSX2,MSY2,20)) then
Begin
Full := DTMFromString('78DA63DCCEC4C0B09F9101192C5B7998811F4' +
'88344FF0301E361A09A7DA86A20B2301248EF03AAD94A40CD4EA0' +
'9A5504D46C05AAD94940CD36A09A6304D4EC27AC060007921083');
Empty := DTMFromString('78DA637CC4C4C0B09791011994959533F0036' +
'990E87F20607C0354B307550D44164602E91740359B09A8790254' +
'B38A809A7B4035BB09A8B903547384809AA74035C7F1AB0100081' +
'410ED');
if(FindDTM(Empty, x1, y2, MIX1, MIY1, MIX2, MIY2))then
begin
Mouse(x1, y2, 5, 5, true);
Mouse(Bx, By, 5, 5, true);
WaitTime := 0;
repeat
WaitTime := (WaitTime + 1);
if(WaitTime = 30) then
begin
WriteLn('Search got wrong coords or lost? Breaking Loop...')
break
end;
Wait(1000);
AntiBan;
AntiRandom;
until not(FindDTM(Empty, x1, y2, MIX1, MIY1, MIX2, MIY2))
end;
end else
begin
if(SearchCount = 3) then
begin
WriteLn('Lost, logging out...')
LogOut;
Exit;
end;
Result := False;
WriteLn('Couldnt Find Fountain')
Exit;
FreeDTM(Full);
FreeDTM(Empty);
end;
FreeDTM(Full);
FreeDTM(Empty);
end;

//////////////////////////
procedure Reload;
var
Full : integer;
Empty : integer;
x1, y1 : integer;
x2, y2 : integer;
begin
Flag;
Full := DTMFromString('78DA63DCCEC4C0B09F9101192C5B7998811F4' +
'88344FF0301E361A09A7DA86A20B2301248EF03AAD94A40CD4EA0' +
'9A5504D46C05AAD94940CD36A09A6304D4EC27AC060007921083');
Empty := DTMFromString('78DA63BCC1C0C060C1C8800CCACA2B18F8813' +
'448F43F10303E0032CC51D540646124907E0C241C08A8B948849A' +
'EB40C285809A2B40C214BF1A0026970C07');
OpenBankQuiet('veb');
Wait (300 + random(300));
if (PinScreen) then
InPin('yourpin');///////////////////////////////////////INSERT BANK PIN
if(FindDTM(Full, x1, y1, MIX1, MIY1, MIX2, MIY2))then
begin
wait(300+random(300));
Mouse(x1, y1, 4, 3, false);
ChooseOption('All');
end;
if(FindDTM(Empty, x2, y2, MSX1, MSY1, MSX2, MSY2))then
begin
wait(300+random(300));
Mouse(x2, y2, 3, 3, false);
ChooseOption('All');
MakeCompass('N');
end else
begin
WriteLn('Out of Vials? Logging out')
logout;
Exit;
end;
FreeDTM(Full);
FreeDTM(Empty);
end;


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////////MAIN LOOP////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
begin
SetupSRL;
SetupSmart;
DeclarePlayers;
LoginPlayer;
wait(1000+random(1000));
MakeCompass('N');
SetAngle(true);
repeat
if not(LoggedIn) then
exit;
WalkToFountain;
AntiRandom;
AntiBan;
FindFountain;
AntiRandom;
WalkFromFountain;
AntiRandom;
Reload;
AntiRandom;
until(false)
end.

in2it

2008-10-13 04:06:13

not to bad but reflection and smart needed to run :( thats annoying
But anyways nice script and looks good script :f:

joelster134

2008-10-13 06:04:09

Try to make Non SMart as well…cause sum ppl prefer. anyways looks GREAT for those who bitch about SMART you can delete it from a script? lolz….anyways will test tonight sometime :) GREAT TRY!


Saved for EDIT: Dont forget to add them to ur creds in script also where to start etc. and maybe put in a SCAR file

desg

2008-10-13 12:03:18

i will be testing this out

jakeyboy29

2008-10-13 12:06:55

cant u use a items ID with reflection?

yvw master

2008-10-13 12:08:39

Sorry about the reflection and whatnot, I didn't know it was so unpopular!

And Jake I didn't even know you could do that but it sounds pretty cool, any tips?

sirlaughsalot

2008-10-13 12:14:03

From: jakeyboy29
cant u use a items ID with reflection?


thats for the ground, not inventory ;)

Also

wherever you have a loop do a simple failsafe like this


var
i : integer;
begin
//whatever
repeat
inc(i);
//whatever
until (finddtm) or (I>=5)
if i>5 then
begin
logout;
writeln('couldnt find any more vials');
end;

something like that

yvw master

2008-10-13 12:23:10

Thanks, any idea why this end else writes the line but doesn't log me out?

end else
begin
if(SearchCount = 3) then
begin
WriteLn('Lost, logging out...')
LogOut;
Exit;
end;
Result := False;
WriteLn('Couldnt Find Fountain')
Exit;
FreeDTM(Full);
FreeDTM(Empty);
end;

yvw master

2008-10-13 17:15:33

did a quick update. I found the solution to why sometimes the empty vial dtm wouldn't be detected in the bank so now it should run smoothly. I've had the chance to see it do 2 loads of ~400 vials flawlessly.

Will update later tonight hopefully with more failsafes, and more human fountain finding, moving paths, etc.

whieldon

2008-12-10 15:03:20

Include file C:\Program Files\SCAR 3.15\includes\SRL\SRL\reflection\Reflection.Scar does not exist.
Failed when compiling

i get tht error

P1nky

2008-12-10 15:55:39

From: whieldon
Include file C:\Program Files\SCAR 3.15\includes\SRL\SRL\reflection\Reflection.Scar does not exist.
Failed when compiling

i get tht error


you got to dl reflection, go to SMART forum and theres reflection tuts :) and youll get it.

Joe12387

2008-12-10 17:47:34

Pretty nice for a first script.

Smarter Child

2009-09-01 05:31:18

From: danishkahn
nice script works well


Big gravedigging dude, i doubt this script even compiles, do not spam to get junior member, please.

Edit:
Failed when compiling
Line 9: [Error] (28014:41): Invalid number of parameters in script

Yep, your just a leecher, trying to get the good scripts…

Markus

2009-09-01 16:15:44

Gravedig closed.