SRL Archive - First Scripts

Vial Filler * not working*


[S]paz

2007-11-02 12:16:27

I made this vial filler but i cant get the radial walk to work so i scrapped it..
it is a bit messy (probably Very) but all the scrip is there apart from the walkin to and from the fountain

if you want t finish the script go for it…jst made it cos i thought i could
i originally designed it to start in Varock West bank and walk to the fountains in the square.. good luck ifu try otherwise could someone help me with the walkin .. thx :D:D

btw it does complie :P
spaz


program VialFiller;
{.include SRL/SRL.scar}

var
Vial, FillVial, TLoads, VialsDone: Integer;
x, y, tx, ty, BTries:Integer;
Const
Water = 12227199;
Loads = 33; //Number Of Loads

Procedure DeclarePlayers;
Begin
NumberOfPlayers(1);
CurrentPlayer := 0;

Players[0].Name :=''; //RS Username
Players[0].Pass :=''; //RS Password
Players[0].Nick :=''; //3-4 Letters from the middle of you username, NO CAPS
Players[0].Active:=True; // Use this char??
end;

Procedure DTMs;
begin
Vial := BitmapFromString(9, 4, 'beNrTM/L08vfxCZzUYrd+ntfyaW' +
'6NpWZFafqmplYWlrb+/iHh4VEQ1NbWExAY6u0dkJVTau/gFhEZE5+' +
'QBEQJYARUWVhU7eLiZWFhGxUVm5GZBUSZmVmr126sqKz38PC1sXXQ' +
'AwAw8ycP');

FillVial := BitmapFromString(10, 4, 'beNoLqsgrXTZ3wZ4ly/YB0' +
'bLl+5s69wFF4tOmRiX0OLmlZxctW7R0L0QWiNp6DwJlE9OnxyZPdP' +
'PKmTRtK1AWjjomQGUT0qd6+BYtWLIXgiCyPZOPAGWTMqcnZ870BQD' +
'92EOO');
end;

Procedure Free;
begin
FreeDTM(Vial);
FreeDTM(FillVial);
end;

function LoadsToDo: Boolean;
begin
If (TLoads = 0) Then
begin
Result := True;
end;
end;

procedure SetTLoads;
begin
TLoads := Players[CurrentPlayer].Integers[0];
end;

procedure Proggie;
begin
WriteLn('[]=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=[]');
Wait(1);
WriteLn('[]=~=~=~= Vial filler by Spaztaz666 =~=~=~=[]');
Wait(1);
WriteLn('[]Time Running: ' + timerunning + ' []');
Wait(1);
WriteLn('[]============================[]');
WriteLn('[]Done ' +IntToStr(Loads) + ' Loads');
WriteLn('[]Done ' +IntToStr(VialsDone) + 'Vials');
WriteLn('[]=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=[]');
end;

Procedure GetVials;
begin
MakeCompass('e');
LowestAngle;
OpenBankQuiet('db');
wait(200 + random(100));
{if FindDTM(Vial, x, y, 550, 210, 730, 462) then
begin
Mouse(x, y, 1, 1, false); // not sure on coords... check otherwise
wait(100 + Random(200)); //have vials in first invent slot
ChooseOption('ll');
wait(500 + Random(400));
end; }
Withdraw(1, 1, 28);
Wait(200 + random(100));
CloseBank;
end;

Procedure WalkToWater;
begin
MakeCompass('N');
HighestAngle;

//Radial walk :S:S

if (FindSymbol(x, y, 'water source')) then
begin
Wait(300 + random(110));
Mouse(x, y, 1, 1, true);
Flag;
end;
if not (FindSymbol(x, y, 'water source')) then
begin
wait(300 + Random(110));
if (FindSymbol(x, y, 'bank')) then
begin
wait(300 + random(110));
Mouse(x, y, 1, 1, true);
Flag;

//MORE RADIAL WALK???

end;
if (FindSymbol(x, y, 'water source')) then
begin
Wait(300 + random(110));
Mouse(x, y, 1, 1, true);
Flag;
end;
end;
end;

Procedure Fillvials;
begin
if FindDTM(Vial, x, y, 554, 205, 743, 465) then
begin
Mouse(x, y, 1, 1, true);
FTwait(1);
VialsDone := VialsDone + 28;
if(findcolor(x, y, Water, 1, 1, 600, 600)) then
MMouse(x, y, 2, 2);
Mouse(x, y, 1, 1, true);
if not(findcolor(x, y, Water, 1, 1, 600, 600))then
if (FindSymbol(x, y, 'water source')) then
begin
Wait(300 + random(110));
Mouse(x, y, 1, 1, true);
Flag;
end;
if(findcolor(x, y, Water, 1, 1, 600, 600)) then
MMouse(x, y, 2, 2);
Mouse(x, y, 1, 1, true);
VialsDone := VialsDone + 28;
end;
if not FindDTM(vial, x, y, 554, 205, 743, 465) then
wait(500);
end;

Procedure WalkToBank;
begin

//RADIAL WALK HERE

if (FindSymbol(x, y, 'bank')) then
begin
Wait(300 + random(110));
Mouse(x, y, 1, 1, true);
Flag;
end;
if not (FindSymbol(x, y, 'bank')) then
RunTo('W', false);
Wait(300 + Random(110));
if (FindSymbol(x, y, 'bank')) then
begin
Wait(300 + random(110));
Mouse(x, y, 1, 1, true);
Flag;
end;
if not (FindSymbol(x, y, 'bank')) then
NextPlayer(False);
Players[CurrentPlayer].Loc := 'Lost'
Logout;
TerminateScript;
end;

Procedure OpenBanker;
begin
if not(LoggedIn) then
begin
LoginPlayer;
Exit;
end;
BTries :=0;
MakeCompass('e');
LowestAngle;
Repeat
begin
BTries := BTries + 1;
WriteLn('Lookin Number: '+ IntToStr(BTries));
OpenBankQuiet('db');
end;
until (BankScreen) or (BTries > 50)
if BankScreen then
ClickAllItemsBmpTolWait(FillVial, 'All', 15, 1500);
if BTries > 50 then
FindSymbol(x, y, 'bank');
begin
Wait(300 + random(110));
Mouse(x, y, 1, 1, true);
Flag;
end;
if IsUpTextMulti('use','ank','ooth') then
begin
wait(100 + random(300));
Mouse(tx, ty, 2, 2, false);
Wait(1000 + Random(400));
end;
if (ChooseOption('quickly')) or (ChooseOption('bank')) then
FindDTM(FillVial, tx, ty, 550, 210, 730, 462);
begin
ClickAllItemsBmpTolWait(FillVial, 'All', 15, 1500);
end;
end;

//MainLoop\\
begin
DeclarePlayers;
repeat
GetVials;
WalkToWater;
FillVials;
WalkToBank;
OpenBanker;
Until(Players[CurrentPlayer].Integers[0] = TLoads);
if Players[CurrentPlayer].Integers[0] = TLoads then
Proggie;
Free;
Logout;
NextPlayer(False);
Writeln('Thats For Using This Script :D:D');
end.