SRL Archive - Help

Can you help me make this script not withdraw the ashes twice?


Lilgrimm

2012-02-20 19:32:28

ALL CREDIT TO EVLIN

i removed summoning but idk how to get it to withdraw once instead of twice.

program Gilded_Altar; //By Evlin
{$i srl/srl/misc/smart.simba}
{$DEFINE CRASHSMART}
{$i SRL\SRL.simba}
{$i SPS\SPS.simba}


var
Clock: TIntegerArray;
ActionText: TStringArray;
Runs,Used:Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Number of Players to use
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; // Player to start with, first one is 0
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True; // just leave it as is.
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
Players[0].Integers[1] := 10000; // Number of loads
end;
///////////////////////////////////////////////////////////////////////////////
///////////////No Further Than Here(Unless Permission Was granted)/////////////
///////////////////////////////////////////////////////////////////////////////
procedure SmallReport(Action: Integer);
begin
ClearDebug;
ActionText := ['BankandTele','Useing','UseBankNPC'];
Clock := [0,0,0];
ConvertTime(GetTimeRunning,Clock[0],Clock[1],Clock[2]);
writeln('(---Evlins Gilded Altar`---)');
Writeln('Time Running ' +tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2]));
writeln('Current Process: '+ActionText[Action]);
Writeln('Runs Done:' +IntToStr(runs));
end;


function UseBankNPC: Boolean;
var
bx, by, Speed, ColFace, ColGrey, ColBlue, ColHair, t: Integer;
begin
If FindNormalRandoms then
Begin
Logout;
TerminateScript;
End else
Result := (LoggedIn) and (BankScreen or PinScreen);
if (Result) then exit;
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
ColFace := 7513036;
ColGrey := 4995649;
ColBlue := 4336690;
ColHair := 2506053;
if (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey, ColHair], [5, 5, 5, 5],
['ounter', 'se Co', 'anke', 'to B', 'Banker', 'nker'], 2, 2)) then
begin
Mouse(bx, by, 0, 0, False);
if (WaitOptionMulti(['kly Co', 'se-qu', 'ank B', 'Bank Banker', 'ank', 'nker'], 750)) then
begin
t := (GetSystemTime + 5000);
repeat
if (BankScreen) or (PinScreen) then
begin
Result := true;
Break;
end;
Wait(50);
until(GetSystemTime > t);
if (Length(Players) > 0) then
if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) or (PinScreen);
end;
end;
ColorToleranceSpeed(Speed);
end;



procedure TeleToBank;
var
x, y, N: Integer;
begin
If FindNormalRandoms then
Begin
Logout;
TerminateScript;
End else
if (N > 3) then
begin
Exit;
end;
ClickNorth(SRL_Angle_High);
begin
repeat
Inc(N);
//if FindObjTPA(x, y, 6982558, 10, 2, 25, 20, w, ['mulet']) then
if FindObjCustom(X, Y, ['mulet','et Gl','lory'], [7114144,6982558], 3) then
GetMousePos(X, Y);
Mouse(x, y, 0, 0, false);
until ChooseOption('Rub') or (N > 5);
end;
if (N > 5) then
begin
Exit;
end;
FFlag(0);
N:=0;
repeat
Inc(N);
Wait(500);
until FindNpcChatText('dgev', ClickLeft);
Wait(8000 + Random(957));
begin
SPS_Setup(RUNESCAPE_SURFACE, ['10_6']);
SPS_Continue := true;
SPS_WalkPath([Point(4214, 2686)]);
FFlag(0);
Wait(2500 + Random(200));
N:=0;
end;
end;


Procedure OpenDoor;
var
x, y : integer;

begin
If FindNormalRandoms then
Begin
Logout;
TerminateScript;
End else
KeyUp(VK_F1);
Wait(5500 + Random(200));
begin
repeat
if FindObjCustom(X, Y, ['oor','Doo'], [4807789,5268855,5137269,5466749], 2) then
GetMousePos(X, Y);
Mouse(x, y, 10, 10, false);
until ChooseOption('Open');
end;
end;



procedure RBurner;
var
Rburn,x,y:integer;
aFound:extended;
begin
If FindNormalRandoms then
Begin
Logout;
TerminateScript;
End else
RBurn := DTMFromString('mggAAAHicY2NgYFBjZGDQAmIVINYDYg0gVgTiHqBcAxBXA3EzEE8F4glA/PTJQ4YnWxUYnI1VGTzMNBi+f//G8O7NMwZ+oBw2zIgDQwAAkjMPzw==');

if FindDTMRotated(RBurn, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
Begin
writeln('Found Right Burner, Lighting it.')
MMouse(x, y, 7, 7);
Mouse(x, y, 0, 0, True);
end else
if not FindDTMRotated(Rburn, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
writeln('Found no burner');
FreeDTM(RBurn);
end;


procedure LBurner;
var
Lburn,x,y:integer;
aFound:extended;
begin
If FindNormalRandoms then
Begin
Logout;
TerminateScript;
End else
LBurn := DTMFromString('mrAAAAHic42BgYOCEYn4gZgdiISBmZYAALiAWBmIZIJYEYnEgFgBiNqg8ExA/f/6MIdzRgOHbl08MX169ZJg0oY3h3gZ5BnsDZTCWhOrFhRkJYBgAAIBxDzE=');

if FindDTMRotated(LBurn, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
Begin
writeln('Found Left Burner, Lighting it.')
MMouse(x, y, 7, 7);
Mouse(x, y, 0, 0, True);
end else
if not FindDTMRotated(Lburn, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
writeln('Found no burner');
FreeDTM(LBurn);
end;


procedure GAltar;
var
Altar,x,y:integer;
aFound:extended;
begin
If FindNormalRandoms then
Begin
Logout;
TerminateScript;
End else
Altar := DTMFromString('mggAAAHicY2NgYHjIyMDwD4hPAPF9IH4MxNeAeAtQbh0QbwLiA0C8AohXAnGkixHDtePyDHdvnWUIsNVlWD9dkiEjRI9BBCiHDTPiwBAAAB4tEgE=');
if FindDTMRotated(Altar, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
Begin
writeln('Found The GAltar Using bones.')
MMouse(x, y, 7, 7);
Wait(250);
ClickMouse2(True);
end else
if not FindDTMRotated(Altar, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
writeln('Found No GAltar');
FreeDTM(Altar);
end;



procedure Useing;
begin
If FindNormalRandoms then
Begin
Logout;
TerminateScript;
End else
InvMouse(9, 3);
ClickMouse2(False);
wait(200);
ChooseOption('Use');
FFlag(0);
Wait(600 + Random(250));
GAltar;
Wait(4000 + random(75));
MouseBox(227, 405, 284, 435, 1);
SmallReport(1);
end;


procedure BankandTele;
begin
//Marrentil := DTMFromString('mggAAAHicY2NgYJjOyMCwGIjnAfEEIG4H4olAnA2USwXiQiAuAOIsIM4AYp5gPiDJhIFFGLADRhwYAgCsawah');
//DragonBones := DTMFromString('mggAAAHicY2NgYOBlgAAQLQPEbEAsBcRMQMwB5XMBMSNU3fIFC6CyqJifATtgxIEhAADMUAJ+');
begin
repeat
UseBankNPC;
until BankScreen;
end;

begin
//if WithdrawItem(Marrentil, 'dtm', 1, 'lean', []) then
//if WithdrawItem(Marrentil, 'dtm', 1, 'lean', []) then
//WithdrawItem(DragonBones, 'dtm', 25, 'ragon', []) then
if Withdraw(8, 0, 1) then
if Withdraw(8, 0, 1) then
if Withdraw(9, 0, 25) then
if BankScreen then
CloseBank;
Wait(1000 + Random(350))
KeyDown(VK_F1);
Wait(300 + Random(100))
KeyUp(VK_F1);
end;
begin
repeat
UseBankNPC;
until BankScreen;
end;

begin
//if WithdrawItem(Marrentil, 'dtm', 1, 'lean', []) then
//if WithdrawItem(Marrentil, 'dtm', 1, 'lean', []) then
//WithdrawItem(DragonBones, 'dtm', 25, 'ragon', []) then
if Withdraw(9, 0, 25) then
if BankScreen then
CloseBank;
Wait(1000 + Random(350))
KeyDown(VK_F1);
Wait(300 + Random(100))
KeyUp(VK_F1);
InvMouse(1, 1);
//FreeDTM(Marrentil);
//FreeDTM(DragonBones);
SmallReport(1);
end;
end;


begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Active:= True;
Smart_Server := 15;
Smart_Signed := True;
Smart_Members := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
Writeln('Gilded Altar By Evlin');
Writeln('Version 1.10');
repeat
BankandTele;
OpenDoor;
Wait(3000 + random(75));
MouseBox(250, 40, 268, 73, 1);
Wait(5500 + random(75));
RBurner;
Wait(5500 + random(75));
LBurner;
Wait(5500 + random(88));
Useing;
Wait(42000 + random (200));
TeleToBank;
Inc(Runs);
IncEx(Used,25);
Until(Not Loggedin)
end.

nickrules

2012-02-20 19:58:06

From: Lilgrimm
ALL CREDIT TO EVLIN

i removed summoning but idk how to get it to withdraw once instead of twice.


Next time look just a bit harder ;)

Change


if Withdraw(8, 0, 1) then
if Withdraw(8, 0, 1) then
if Withdraw(9, 0, 25) then
if BankScreen then
CloseBank;

To



if Withdraw(8, 0, 1) then
//if Withdraw(8, 0, 1) then //Notice how the scripter calls "if withdraw(8,0,1) then" twice! if you simply remove the second one, it should work ;)
if Withdraw(9, 0, 25) then
if BankScreen then
CloseBank;

The SRL Devs try to keep things simple, so that it's not too hard to figure out what a function does. Then it's just a matter of knowing what to do ;) In this case, you're trying to stop it from withdraw, and there are two instances of withdraw with the same parameters, so you just remove the second one.

And make sure you give the scripter a heads up about it, and a proggy :cool:

Lilgrimm

2012-02-20 20:11:21

didnt work

Lilgrimm

2012-02-20 20:27:39

nvm it didn't work

Lilgrimm

2012-02-20 20:30:28

It's this

begin
repeat
UseBankNPC;
until BankScreen;
end;

there are two but when i try and delete one i get…


The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

Lilgrimm

2012-02-20 21:37:23

Fix is done. Thanks all for the help. Close this

nickrules

2012-02-20 21:44:12

    begin
repeat
UseBankNPC;
until BankScreen;
end;

begin
//if WithdrawItem(Marrentil, 'dtm', 1, 'lean', []) then
//if WithdrawItem(Marrentil, 'dtm', 1, 'lean', []) then
//WithdrawItem(DragonBones, 'dtm', 25, 'ragon', []) then
if Withdraw(9, 0, 25) then
if BankScreen then
CloseBank;
Wait(1000 + Random(350))
KeyDown(VK_F1);
Wait(300 + Random(100))
KeyUp(VK_F1);


Appears twice. Delete the second instance of it. Also, don't double/triple post, and use
 tags next time


My original post, for anyone who wants it. (deleted it because I thought something was wrong ;) )