Results 1 to 6 of 6

Thread: [R] Door opening

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

    Default [R] Door opening

    Reflection subject.

    Im trying to open a door in lumby castle.
    Code:
    ClickDoor(36844,'e','pen');
    36844 is the ID for the open door. But i cant get it to detect its there.

    Ive also tried
    Code:
    if(FindObjectEx(Door,36844,12))then
    And still no luck.

    Got ID from Reflection Debugger + Another source.

    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
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

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

    Default

    Everything else is fine. Stairs etc are all ok.

    Seems to be working now lol.

    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
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

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

    Default

    Ty anyways.

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

  6. #6
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use the closed door ID for ClickDoor. Though, I warn you, ClickDoor = really slow, because FindObj is really slow. I personally made a custom function that has an extra parameter, the tile of the door. I haven't tried converting FindObj to FindObjEx though, it's a worth a try too.

    Here's my function using the tile parameter

    SCAR Code:
    {*******************************************************************************
    function ClickDoor2(DoorObj: integer; Dir, Action: string; ObjTile : TPoint): Boolean;
    By: lordsaturn heavily modified by Tad
    Description: Clicks a door. (or almost any object inbetween tiles) Returns true
    when Door is open
    *******************************************************************************}

    function ClickDoor2(DoorObj: integer; Dir, Action: string; ObjTile : TPoint): Boolean;
    var
      Loc, MS: TPoint;
      temp : UID;
      i,x,y : integer;
    begin
        result := true;
        while CharacterMoving do
          if temp.objtype <> DoorObj then Exit;
        temp := GetObjectAt(objTile.x, objTile.y);
        Loc := ObjTile;
        if temp.objtype <> DoorObj then
        begin
          R_Flag;
          if temp.objtype <> DoorObj then Exit;
        end;
        case Lowercase(Dir) of
          'n': MS := TileToMSEx(Tile(Loc.x + 0.5, Loc.y + 0.9), random(5));
          's': MS := TileToMSEx(Tile(Loc.x + 0.5, Loc.y + 0.1), random(5));
          'w': MS := TileToMSEx(Tile(Loc.x + 0.1, Loc.y + 0.5), random(5)); //try x-.5, y-.1
          'e': MS := TileToMSEx(Tile(Loc.x + 0.9, Loc.y + 0.5), random(5));
          'c': MS := TileToMSEx(Tile(Loc.x + 0.5, Loc.y + 0.5), 10);    //(Center)
        end;
        result := false;
        if MS.x = 0 then Exit;
        MMouse(MS.x, MS.y, 3, 3);
        if R_WaitUpText(Action, 150) then
        begin
          GetMousePos(x,y);
          Mouse(x,y,0,0,true);
          result := DidClick(true, 500);
        end else if not Result then
        begin
          Mouse(MS.x, MS.y, 3, 3, False);
          Result := R_ChooseOption(Action);
        end;
    end;

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
  •