Kave
2008-05-08 06:03:24
I know that in Bank.scar there is a function called MSTPointToBankIndex, and mine does what it does, but it didn't work for me so I made my own.
I use this with a modified version of munks countInvStack to get amounts in the bank.
function PointToBankIndex(P: TPoint): Integer;
var
sx,ex,sy,ey,i,z: Integer;
begin
if not(LoggedIn) then exit;
sx := 80;
sy := 60;
ex := 115;
ey := 95;
for i := 0 to 8 do
begin
if (P.x > sx) and (P.x < ex) then
Break
else
begin
IncEx(sx,45);
IncEx(ex,45);
end;
end;
if i > 8 then Exit;
for z := 1 to 6 do
begin
if (P.y > sy) and (P.y < ey) then
Break
else
begin
IncEx(sy,40);
IncEx(ey,40);
end;
end;
if z > 6 then Exit;
Result := BankPointToIndex(Point);
end;I use this with a modified version of munks countInvStack to get amounts in the bank.