SRL Archive - SRL Archives

More Bank Tabbing


Heysus

2008-10-20 16:57:57

This is in addition to the ones that Narcle made…


{*******************************************************************************
Function MoveItemToTab(T: integer): Boolean;
by: Heysus
Description: Moves the item at x,y to the specified bank tab.
Creates a new bank tab if T is 0.
*******************************************************************************}
Function MoveToBankTab(x, y, T: integer): Boolean;
var
i: integer;
begin
if not BankScreen then
Exit;

if T = 0 then
begin
for i:=1 to 9 do
if ExistsBankTab(i) then T := i+1;
end;

if (T < 1) or (T > 9) then
begin
srl_Warn('MoveToBankTab', 'Bank Tab '+inttostr(T) +' does not Exist.', warn_AllVersions);
Result := false;
exit;
end;

MMouse(x, y, 4, 4);
if IsUpText('ithdraw') then
begin
GetMousePos(x,y);
Wait(50 + random(50));
HoldMouse(x, y, true);
Wait(200 + random(100));
if FindColor(x, y, 1448221, x-21, y-18, x+21, y+18) then //faded outline
begin
MMouse(48 * T, 64, 4, 4);
Wait(200 + random(100));
GetMousePos(x, y);
ReleaseMouse(x, y, true);
Wait(150);
if CurrentBankTab = T then
Result := true;
end;
end;
end;

Magiic

2008-10-20 17:28:19

thats pretty cool just the standards like here
   begin
srl_Warn('MoveToBankTab', 'Bank Tab '+inttostr(T) +' does not Exist.', warn_AllVersions);
Result := false;
exit;
end;

Narcle

2008-10-20 17:33:19

Some fail safes could be added. For example, when you hold the item and drag it to the new tab, you could have it wait until new tab is selected. However, idk if that would detect it when you are making the new tab.

if T = 10 then
needs to be
if (T < 0) or (T > 9) then


MMouse(x, y, 4, 4);
GetMousePos(x,y);
Wait(50 + random(50));
HoldMouse(x, y, true);
Wait(200 + random(100));
MMouse(48 * T, 64, 4, 4);
Wait(200 + random(100));
GetMousePos(x, y);
ReleaseMouse(x, y, true);

This part overall could have problems. Couple of fail safes need to be added (like the one I already mentioned). Another one you could check to see if there really is an item at or around x,y by looking for the black outline of an item. I'm sure there is more, I just want to get you on the right track and see what you come up with. ;)

Heysus

2008-10-20 19:39:03

I updated it.

Fixed standards here:
From: sandos1234
thats pretty cool just the standards like here
   begin
srl_Warn('MoveToBankTab', 'Bank Tab '+inttostr(T) +' does not Exist.', warn_AllVersions);
Result := false;
exit;
end;


Changed if T = 10 to if (T < 1) or (T > 9)

Added fail safes.