SRL Archive - SRL Archives

WithdrawByIndex;


Raskolnikov

2008-10-22 17:15:43

Here it is. It withdraws by index instead of column and row:

{By: Cut em2 it
Description: Withdraws by index instead of column and row, same amount idea as
the regular withdraw.
}
function WithdrawByIndex(Index, Amount: integer): boolean;
var
colm, rown: integer;
begin
Result := True;
rown := Index div 10;
if rown := 0 then rown := 1;
colm := Index div 4;
if colm := 0 then colm := 1;
if colm > 10 then Result := False;
if rown > 4 then Result := False;
if not Result then Exit;
Withdraw(colm, rown, Amount);
end;

Hope you like it!

Cut em2 it

Nava2

2008-10-23 06:41:38

function WithdrawByIndex(I, Amount : Integer) : Boolean;
var
P : TPoint;
begin
P := BankIndexToBankPoint(I);
Result := Withdraw(P.x, P.y, Amount);
end;

Sorry, had to. :( Good idea though.

Raskolnikov

2008-10-23 11:07:41

What's lol. I knew about BankIndexToMSBox or MSPoint, but this one :( Okay nvm. I'll do a different one next time lol.

Cut em2 it

ShowerThoughts

2008-10-23 11:16:34

From: Nava2
function WithdrawByIndex(I, Amount : Integer) : Boolean;
var
P : TPoint;
begin
P := BankIndexToBankPoint(I);
Result := Withdraw(P.x, P.y, Amount);
end;

Sorry, had to. :( Good idea though.


You broke the poor guy's heart :(

Narcle

2008-10-23 12:17:18

Is the Index fixed for the new bank? Didn't even look. xD

ZephyrsFury

2008-10-24 05:20:32

From: Narcle
Is the Index fixed for the new bank? Didn't even look. xD


Yea Wizzup fixed everything.

@Cut em2 it, I think this is probably a bit too simple to be added to SRL. If needed, scripters can just convert the bank points to indices using BankIndexToBankPoint. Thanks for the effort though. Its greatly appreciated.