Well, this is my BarCount:
SCAR Code:
Function BarCount: integer;
var
i: integer;
IBox: TBox;
begin
GameTab(4);
for i := 1 to 28 do
if ExistsItem(i) then
begin
IBox := InvBox(i);
if FindDtm(BarDTM, x, y, IBox.x1, IBox.y1, IBox.x2, IBox.y2) then Inc(Result);
end;
end;
It's supposed to count the bars currently in Inventory.
And this is where I call it:
SCAR Code:
repeat
if FindRandoms then
if not LoggedIn then Exit;
Bars := BarCount;
Smelt(Players[CurrentPlayer].Strings[0], Amount);
Wait(1000+Random(500));
repeat
if FindRandoms then
if not LoggedIn then Exit;
if (BarCount = Bars) then Break;
Bars := BarCount;
Writeln('Bars in Inventory: ' + IntToStr(BarCount));
AntiBan;
Wait(1000+Random(500));
until (Bars = StrToInt(Amount));
until not FindDTM(MOreDTM, x, y, MIX1, MIY1, MIX2, MIY2);
And somehow it adds the integer that BarCount outputs to the var Bars instead of replacing Bars previous value. But I need to replace the previous value not the new value added to the old one