SRL Archive - Reflection Discussion

ClickItemsID(id,text,wait) error


ZaSz

2009-02-08 18:26:18

Well its kind of an error.
ClickItemsID(450,'ll',[400,800]);

450 = iron ore id.

o.k, what i have there is what i use in my banking procedure, but in the loop for the clickitemsid procedure it already recorded all locations of ore, so it will click on empty spots thinking ore is there.

My fix adds 1 line.

function ClickItemsID(ID : Integer; Option : String; WaitNum : TIntegerArray) : Integer;

var
Slots : TIntegerArray;
Left : Boolean;
I : Integer;

begin
Result := 0;
if not InventoryContains(ID, Slots) then Exit;
Left := Option = '';
for I := 0 to High(Slots) do
begin
if not InventoryContains(ID, Slots) then Exit; // line i added!!!
MouseItem(Slots[I], Left);
if not Left then
begin
Wait(RandomRange(90, 150));
R_ChooseOption(Option);
end;
Wait(RandomRange(WaitNum[0], WaitNum[1]));
Inc(Result);
end;
end;

please add this to next revision so i dont have to fix everytime i update my svn?

Narcle

2009-02-08 18:55:29

Yeah I see what your saying… I think Nava needs to rethink that procedure, it should also include multiple IDs to click and deposit in bank as well, instead of just one.