SRL Archive - Help

Failsafe when banking?


The Divided

2012-12-17 10:32:51

Hey, this might be a stupid question, but hey im new! Is there a way to implement a failsafe when banking… i mean incase an item doesnt exist(a DTM?)
it will use TerminateScript.

Ive tried the following:
procedure bank;
var
x, y, grass: Integer;
begin
DTM = LONG LINE OF CODE(the actual DTM) //I didn't include the actual DTM in this post, thought it was irrelevant
if OpenBankChest(SRL_BANK_CW) then //opens bank
if FindDTM(DTM, x, y, MBX1, MBY1, MBX2, MBY2)then //attempts to find DTM
begin
Withdraw(0, 0, 13);
wait(500+Random(20));
Withdraw(1, 0, 13);
wait(300+Random(50));
CloseBank;
AntiBan;
end else
begin
TerminateScript;
end;





end;

But when using this it just terminates the script, even if it finds the DTM.
Any suggestions?

DannyRS

2012-12-17 10:38:31

sounds like your DTM is not correct

edit - you may also need to add begin and end after the bank function

The Divided

2012-12-17 10:39:41

From: DannyRS
sounds like your DTM is not correct


The Dtm is correct, when im in DTM editor i open the DTM and search for matching DTMS, and it always finds it… Strange.

DannyRS

2012-12-17 10:41:51

From: The Divided
The Dtm is correct, when im in DTM editor i open the DTM and search for matching DTMS, and it always finds it… Strange.


your "then" statement after the bank include may be causing the issue

procedure bank;
var
x, y, grass: Integer;
begin
DTM := dtmfromstringblahblah;
if OpenBankChest(SRL_BANK_CW) then
begin
if FindDTM(DTM, x, y, MBX1, MBY1, MBX2, MBY2)then
begin
Withdraw(0, 0, 13);
wait(500+Random(20));
Withdraw(1, 0, 13);
wait(300+Random(50));
CloseBank;
AntiBan;
end else
begin
TerminateScript;
end;
end;
end;

xtrapsp

2012-12-17 10:59:35

procedure findbank;
var
x, y, grass: Integer;
begin
DTM := dtmfromstringblahblah;
begin
for i := 0 to i:= 10 do // repeat until i is equal to 10
begin
if FindDTM(DTM, x, y, MBX1, MBY1, MBX2, MBY2)then
mouse( x, y, 2, 2, true);
inc(i*10); //increases i by ten
end else
inc(i); //increases i by 1
end;

Procedure bank;
begin
Withdraw(0, 0, 13);
wait(500+Random(20));
Withdraw(1, 0, 13);
wait(300+Random(50));
CloseBank;
AntiBan;
TerminateScript;
end;
end;
end;

Threw this together, will have errors. Try it

Sin

2012-12-17 12:33:41

Well ALL of you might want to actually call the Bank procedure……….

DannyRS

2012-12-17 13:56:03

From: Shay
Well ALL of you might want to actually call the Bank procedure……….


Think we assumed the fact he cut out his single procedure that he would understand that ;)

The Divided

2012-12-17 16:47:54

Figured it out, i just made a counter which increased by one each lap. And then i just calculate the total number of inventories my supplies are sufficient for and input that in the counter :) problem solved

Thanks though! it was actually Xtrapsp who gave me the idea with the counter

xtrapsp

2012-12-17 19:37:57

From: The Divided
Figured it out, i just made a counter which increased by one each lap. And then i just calculate the total number of inventories my supplies are sufficient for and input that in the counter :) problem solved

Thanks though! it was actually Xtrapsp who gave me the idea with the counter


No problem :)