Results 1 to 10 of 10

Thread: Help with finding doors

  1. #1
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default Help with finding doors

    It seems with Reflection, relying on the Door ID or Name--sometimes when my scripts are detecting the door using FindObj, apssing in an ID, these functions, they tend to fail.

    I noticed while using the ID Display debugger tool, that door IDs would strobe, infrequently so. What's up with that?


    Perhaps I am not implementing my functions effectively using Reflection and this is why they are failing.


    Any ideas?

  2. #2
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Code:
    Function OpenDoor :boolean;
    var Door: TReflectObject;
    begin
      if Door.Find(objGame, 'Open Door', 15)  then begin
        Reflect.Mouse.Move(Door.GetMSPoint, 2, 2);
        fastClick(Mouse_Left);
    end;
    end;
    Something like this doesn't work? it doesn't.

    I will see if i can get something to function, can you explain what circumstance this is in? or just a general fail safe?

    In the mean time you could use

    Code:
    R_InteractTile(Point(X, Y), 'Open Door', 3, 3, 3)
    This is not desirable; But it moves the mouse over the coords if the uptext is correct it will interact; so you will need to make and end else statement. (but as stated this isn't the most desirable way)

    You will also need some extra functions for that function.

    Code:
     function R_TileOnMS(Tile : TPoint; var OutputPoint : TPoint; x : integer = 0; y : integer = 0; z : integer = 0):boolean;
    var tempB : TBox;
    begin
      OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
      tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
      result := PointInBox(OutputPoint, tempB);
    end;
    
    procedure randomMouseInput(pnt:Tpoint; ranx, rany:integer);
    begin
      case random(3) of
        0:humanMMouse(pnt, ranx, rany);
        1:missMouse(pnt, ranx, rany);
        2:mouse(pnt, ranx, rany, mouse_move);
      end;
    end;
    
     function R_InteractTile(tile:Tpoint; action:string; x:integer = 0; y:integer = 0; z:integer = 0):boolean;
    var RSTile : TPoint;
    begin
      if R_TileOnMS(Tile, RSTile, x, y, z) then begin
        randomMouseInput(rsTile, 3, 3);
        if(Reflect.Text.IsUpText(action)) then begin
          FastClick(mouse_left);
          result := didClick(true, 1000);
        end else begin
          if TReflectionText.OptionExists(action) then begin
            FastClick(mouse_right);
            result := Reflect.Text.ChooseOption(action);
          end;
          if not result then
            randomMouseInput(Point(MSCX, MSCY), 500, 500);
        end;
      end;
    end;

    <------------------>



  3. #3
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    can you explain what circumstance this is in?
    [/CODE]
    Spinning wheel in Lumbridge Castle, the door to room of money making machine.

  4. #4
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    what is wrong with spinning in falador? it slower but more reliable...

    <------------------>



  5. #5
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    @NKN; you have the same problem right?

  6. #6
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    @NKN; you have the same problem right?
    Sure do.

    will post an answer for OP if I find one

  7. #7
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    @NKN; @Keelijh;

    Doors tend to be Boundary Objects, so this will work:
    Simba Code:
    if Obj.Find(ObjBoundary, 'Door', 10) then
        Reflect.Mouse.Move(Obj.GetMSPoint, 2, 2);
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  8. #8
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by Kyle View Post
    @NKN; @Keelijh;

    Doors tend to be Boundary Objects, so this will work:
    Simba Code:
    if Obj.Find(ObjBoundary, 'Door', 10) then
        Reflect.Mouse.Move(Obj.GetMSPoint, 2, 2);
    Does there exist a master list of the Name/IDs of objGame, objWallDecoration, objFloorDecoration, objBoundary, which I could use for reference?

    If such a list exists, could we upload it as a sticky to one of the parent threads (Help or Snippets, for example)?

    This would save me a lot of time, currently I use a function to writeln all of the name/ids within 25.





    If a master list has yet to be compiled, I shall begin..

  9. #9
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Keelijh View Post
    Does there exist a master list of the Name/IDs of objGame, objWallDecoration, objFloorDecoration, objBoundary, which I could use for reference?

    If such a list exists, could we upload it as a sticky to one of the parent threads (Help or Snippets, for example)?

    This would save me a lot of time, currently I use a function to writeln all of the name/ids within 25.





    If a master list has yet to be compiled, I shall begin..
    https://github.com/Elfyyy/OSR-Reflec...al/definitions

    That is where the names and other data is pulled from. Do be careful with what you open it with, as it is a massive list and will crash most text readers including notepad.. I use Notepad++ and it works fine.
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  10. #10
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default

    Notepad++ ftw. Thanks.

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
  •