Results 1 to 3 of 3

Thread: Recording Inv Item Function

  1. #1
    Join Date
    May 2012
    Posts
    102
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Recording Inv Item Function

    Simba Code:
    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
    Edit: Currently gives an empty TPA even when the uptext worked so its definately just the recording of the Co-ords.
    Last edited by Wreck; 06-24-2012 at 01:34 PM.

  2. #2
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    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?
    Last edited by putonajonny; 06-24-2012 at 01:50 PM.

  3. #3
    Join Date
    May 2012
    Posts
    102
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    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 .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •