SRL Archive - OSR Help

Recording Inv Item Function


Wreck

2012-06-24 09:27:59

function RecordInvItem(var Obj: MSObject; TPA: TPointArray): Boolean;
var
i: Integer;
begin
for i := 1 to 28 do
if ExistsItem(i) then
begin
MMouseItem(i);
if WaitUpTextMulti(Obj.Uptext, 150 + random(100)) then
begin
SetLength(TPA, Length(TPA) + 1);
GetMousePos(TPA[High(TPA)].x, TPA[High(TPA)].y);
Result := True;
end;
end;
end;

How can I make this work currently it doesnt assign any values to the TPA :redface:
Edit: Currently gives an empty TPA even when the uptext worked so its definately just the recording of the Co-ords.

putonajonny

2012-06-24 09:45:44

Does putting a second Var in work?
function RecordInvItem(var Obj: MSObject; Var TPA: TPointArray): Boolean;

Edit:
I don't think you need the first one?

Wreck

2012-06-24 09:49:59

From: putonajonny
Does putting a second Var in work?
function RecordInvItem(var Obj: MSObject; Var TPA: TPointArray): Boolean;

Edit:
Do you even need the first one?


It was getting the length of the tpa right but then i tried using MMouse(InvObjects[0].x, InvObjects[0].y, 5, 5); and it would just drag the mouse to the 0,0 top-left.

Edit: Scratch that it works with the var, thank you I knew it was something small I missed :).