Results 1 to 4 of 4

Thread: reflection help

  1. #1
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default reflection help

    I'm new to reflection and I don't understand the parameters that well, so.

    Function FindObject(Var Tile: TPoint; objType: Integer): Boolean;

    Can someone provide me and example of how to make that function.

    For example : FindObject(4342, objType);

    are the options, like Long/UID?

    What are the option for objType and what is a UID?


    HELP ME!
    Last edited by Smarter Child; 07-15-2009 at 08:19 AM.

  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Here's an example of a simple case:

    SCAR Code:
    FindObject(Gate, 1234);

    Where Gate is a TPoint, and 1234 is the items ID, if you don't know how to get the items ID, you can go here.That is a Ref Debugger which is very useful for getting item IDs.

    Just a tip, you should use FindObjectEx instead of FindObject, it's much much faster, and not hard to understand.

    Here's a function I use in one of my scripts:

    SCAR Code:
    function Dray_ClimbStile: Boolean;
    var
      Stile : TPoint;
    begin
      if not LoggedIn then Exit;
      MakeCompass('N');
      if FindObjectEx(Stile, 7527, 10) then
      begin
        Writeln('Found stile, attempting to climb...');
        Stile := TileToMS(Stile, Random(5));
        MMouse(Stile.x, Stile.y - 20, 4, 4);
        Result := R_ClickMouseOption(Stile.x, Stile.y - 20, 0, 0, 'random', ['tile', 'limb-over'], ['limb-over']);
        if not Result then
          Writeln('Couldn''t climb over stile.');
      end else Exit;
    end;

    The "10" is how many tiles you want it to look in, so basically it should be as big as the item you are trying to find.

    I hope I helped, if you have any questions, don't hesitate to ask.

  3. #3
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Rep, +1, Thanks a lot. I'll use FindObjectex

  4. #4
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Smarter Child View Post
    Rep, +1, Thanks a lot. I'll use FindObjectex
    Thanks, and glad I could help you out. I replied to your PM if you haven't seen it already.

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
  •