Results 1 to 4 of 4

Thread: R_ClickItem

  1. #1
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default R_ClickItem

    SCAR Code:
    {*******************************************************************************
    function R_ClickItemID(ID: integer): Boolean;
    Description: Clicks an item with the given ID and chooses the given option.
    *******************************************************************************}

    function R_ClickItemID(ID: integer): Boolean;
    var
      Inv, x, y, itemID, i: integer;
      B: TBox;
    begin
      Inv := GetInterface(149, 0);
      Result := False;
      for i := 0 to 27 do
      begin
        itemID := SmartGetFieldArrayInt(Inv, InventoryItemIDs, i);
        if (itemID > 0) and (itemID = ID) then
        begin
          B := InvBox(i+1);
          MouseBox(B.x1, B.y1, B.x2, B.y2, 1);
          Wait(50+Random(50));
          Break;
        end;
      end;
      SmartFreeObject(Inv);
    end;

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Pretty much the same as the fixed version I fixed from Coh3n's one:
    http://www.villavu.com/forum/showpos...80&postcount=6

    No offence because this can't really be done any different way. Just to inform you .
    And also to make ensure this will be added. As you are not the only one thinking about this.

    EDIT:
    Also, will this ever returns true?
    There is just one line setting it false. Then result is not set any more.
    Either this should be a procedure and let the user check before this for the item is it exists or not or
    Result := True; before B := In ...
    Last edited by Sabzi; 08-30-2009 at 11:20 PM. Reason: grammal fails

  3. #3
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Didnt bother searching. I needed the function for a script so i altered the current MouseItemID.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  4. #4
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    These forums are not for the reflection include....

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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
  •