SRL Archive - SRL Bugs

GetBankItemAmount


Le Jingle

2012-03-22 18:24:26

This,

function GetBankIndexItemAmount(const Index: Integer): Integer;
begin
Result := getAmountBox(BankIndexToMSBox(Index));
end;
I put this into a script, told it to terminate the script if the count is equal to or under 50. I have ~120m of an item and it doesn't recognize the item stack to be greater than 50..(it does work when I remove the size to be under 10m of the item)

I don't know what I would/could do to turn this into a suggestion (to remedy the situation) so I posted this in bugs.

Let me know if I can do anything to assist,
~Jingle

Coh3n

2012-03-22 18:25:19

Can you post the code you're testing with?

Le Jingle

2012-03-22 18:45:03

E:oops lol

Sure, it's essentially this;


program LearningViaMarkUps1;
{$DEFINE SMART}
{$DEFINE SRL5}
{$i srl/srl.simba}

var
CheckBankSlot: Integer;

procedure BankChest;
begin
OpenBankChest(SRL_BANK_SW);
if (BankScreen) then
begin
Exit;
end else
BankChest;
end;


procedure LeItemProcess;
begin
BankChest;
if (BankScreen) then
begin
CheckBankSlot := GetBankIndexItemAmount(BankPointToBankIndex(Point(9, 0)));
if CheckBankSlot <= 50 then
begin
Writeln('Just about out of items, Turning Off.');
Logout;
TerminateScript;
end;
end else

if not (BankScreen) then
begin
Logout;
TerminateScript;
end;
LeItemProcess;
end;

begin
SetupSRL;
ActivateClient;
LogInPlayer;
repeat
BankChest;
LeItemProcess;
until(CheckBankSlot <= 50);
if (CheckBankSlot <= 50) then
Writeln('Ciao, torna presto! / Bye, come again!');
LogOut;
TerminateScript;
CloseWindow;
end.


But the mark-up's I placed are on a script not done by myself, so I don't know if posting my marked up full script of theirs would be legit; so I just posted this snippet. :confused:

Wyn

2012-03-22 18:55:23

Change CheckBankSlot <= 50 to CheckBankSlot < 50

Kyle Undefined

2012-03-22 18:59:39


program new;
{$i srl/srl.simba}

begin
setupsrl;
WriteLn(GetBankIndexItemAmount(3))
end.

That worked perfectly fine for me. I had 161K of an item in the 3rd slot of my bank.


SRL Compiled in 0 msec
161000
Successfully executed.

Le Jingle

2012-03-22 19:04:27

From: wyn10
Change CheckBankSlot <= 50 to CheckBankSlot < 50


Thanks, this worked.

E: &Kyle, I was thinking there was a bug in reading the 'M' at the end of the item amount, but switching the less than or equal to to just less than fixed my problem. But I didn't know you could writeln the amount like that, thanks for teaching me that. :>

Thanks for the help everyone

Wyn

2012-03-22 19:48:41

Glad to help.