Results 1 to 8 of 8

Thread: Finding/Opening gate

  1. #1
    Join Date
    Aug 2007
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Finding/Opening gate

    Well actually, I guess its not a gate but rather a hole in a fence.

    This is what I am trying to find/go through:



    As you can see, that part of the fence has an ID of 19171.

    I made a procedure to go through this:

    SCAR Code:
    procedure OpenGate;
    var
      P : TPoint;
    begin
      if FindObjectEx(P, 19171, 8) then
      begin
        P := TileToMSEx(Tile(2522.0,3375.5), 15);
        MMouse(P.x, P.y, 2, 2);
        wait(100);
        if IsUpText('queeze') then
        begin
          GetMousePos(P.x, P.y);
          Mouse(P.x, P.y, 0, 0, True);
          Wait(RandomRange(300, 500));
        end;
      end;
      Wait(750+Random(250));
    end;

    I wasn't sure if the tile part was right, so I also tried chaning that line to just:

    SCAR Code:
    P := TileToMS(P, 0);

    Neither one worked, so I tried just finding the object id and the object id of the surrounding fence to make sure I had the right IDs:

    SCAR Code:
    procedure OpenGate;
    var
      P : TPoint;
    begin
      if FindObjectEx(P, 19171, 10) then
      begin
        writeln('found gate');
      end;
      if FindObjectEx(P, 997, 10) then
      begin
        writeln('found fence');
      end;
    end;

    To my dismay, only found fence is appearing in the debug box. Any ideas?

  2. #2
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Just try tile clicking.

    SCAR Code:
    procedure OpenGate;
    var
      P : TPoint;
    begin  
      P := TileToMS(Point(2522,3375), 0);
      MMouse(P.x, P.y, 0, 0);
      if IsUpText('queeze') then    
      begin      
        GetMousePos(P.x, P.y);      
        Mouse(P.x, P.y, 0, 0, True);      
        Wait(RandomRange(300, 500));    
      end;
    end;

    Youll have to experiment with offsets.

  3. #3
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'd do repeat (isUpText/Mouse stuff from TRiLeZ's post) until(whatever or Tries > 20); or something.

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

    Default

    Dont see why it dont work.

    If your using FindObject then get the tile from that.

    SCAR Code:
    Procedure HandleFence;
     Var
      Fence: TPoint;
    Begin
      If (FindObjectEx(Fence, 19171, 5)) Then
      Begin
        Fence:= TileToMS(Fence, 1);
        Mouse(Fence.x, Fence.y, 1, 1, False);
        wait(50 + Random(130));
        ChooseOption('queeze');
        wait(200 + Random(300));
      End;
    End;

    Or use your
    SCAR Code:
    if IsUpText('queeze') then

    I know it shouldnt make a difference, but try rotating the camera the opposite way. (Face East).

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

  5. #5
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    The fence is always in the same tile, i suggest not to use FindObject at all.
    See Trilezs post.

  6. #6
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    You could get the MS points of the tiles that are on both sides of the "door" and then move the mouse to the mid of the two, you should then find in the door (in theory)

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

    Default

    As per that image. Just move the mouse to the MainScreen center point and wolla ?

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

  8. #8
    Join Date
    Aug 2007
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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
  •