I have not tested these so far, can test later today though. These updates are usefull when looping a banking function with presets untill backpack.isFull or empty, so you don't have to repeat random waits untill you have desired backpack.
Simba Code:
function TRSTabBackpack.isFull(waitTime: integer = 0): boolean;
var
i: integer;
t: UInt64;
begin
result := false;
t := (getTickCount64() + waitTime);
while (not result) and (t >= getTickCount64()) do
begin
if (not self.open()) then
exit(false);
for i := BACKPACK_SLOT_LOW to BACKPACK_SLOT_HIGH do
if (not (self.isItemInSlot(i))) then
exit(false);
result := true;
wait(randomRange(20, 50));
end;
end;
Simba Code:
function TRSTabBackpack.isEmpty(waitTime: integer = 0): boolean;
var
b: tbox;
t: UInt64;
begin
result := false;
t := (getTickCount64() + waitTime);
while (not result) and (t >= getTickCount64()) do
begin
if (not self.open()) then
exit(false);
b := self.getBounds();
b.edit(0, 0, 0, -30);
result := (not b.colorExists(ITEM_OUTLINE_BLACK)) and (not b.colorExists(ITEM_OUTLINE_BLACK_SECONDARY)) and
(not b.colorExists(ITEM_OUTLINE_WHITE));
wait(randomRange(20, 50));
end;
end;
Simba Code:
function TRSTabBackpack.isItemInSlot(slot: integer; waitTime: integer = 0): boolean;
var
t: UInt64;
begin
result := false;
t := (getTickCount64() + waitTime);
while (not result) and (t >= getTickCount64()) do
begin
if (not self.open()) or (not self.isSlotValid(slot))then
exit(false);
result := isItemIn(self.getSlotBox(slot));
wait(randomRange(20, 50));
end;
end;