Results 1 to 10 of 10

Thread: Reflect.Tiles.TiletoMS help.

  1. #1
    Join Date
    Apr 2017
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Reflect.Tiles.TiletoMS help.

    Hi there,
    first off, WOW am I shocked at how easy it is to use reflection..I left simba mainly because I couldn't even get it to load ( ATM i'm still quite confused about how to load the smart drawing / debugging of everything but that's for another time )

    Just a quick question in regards to the findNPC..

    Here is my snippet
    Simba Code:
    procedure talkToBanker;
    var
      banker:TReflectNPC;
      point:TPoint;
    begin
      repeat
        begin
          banker.Find('Banker');
          Point := Reflect.Tiles.TileToMs(banker.GetTile);
          HumanMMouse(Point, 0, 0);
          wait(random(50,100));
          FastClick(MOUSE_RIGHT);
          wait(random(300,400));
          chooseOption('bank Banker');
          wait(random(300,500));
        end;
      until isBankOpen;
    end;

    My question is, what this does is it finds the banker, but always moves the mouse a few pixels down before right clicking, is there anyway to stop that? I was sure that setting the ranX,ranY to 0 would stop it from moving..

  2. #2
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    Quote Originally Posted by theholyone1 View Post
    Hi there,
    first off, WOW am I shocked at how easy it is to use reflection..I left simba mainly because I couldn't even get it to load ( ATM i'm still quite confused about how to load the smart drawing / debugging of everything but that's for another time )

    Just a quick question in regards to the findNPC..

    Here is my snippet
    Simba Code:
    procedure talkToBanker;
    var
      banker:TReflectNPC;
      point:TPoint;
    begin
      repeat
        begin
          banker.Find('Banker');
          Point := Reflect.Tiles.TileToMs(banker.GetTile);
          HumanMMouse(Point, 0, 0);
          wait(random(50,100));
          FastClick(MOUSE_RIGHT);
          wait(random(300,400));
          chooseOption('bank Banker');
          wait(random(300,500));
        end;
      until isBankOpen;
    end;

    My question is, what this does is it finds the banker, but always moves the mouse a few pixels down before right clicking, is there anyway to stop that? I was sure that setting the ranX,ranY to 0 would stop it from moving..
    I think it's the FastClick function.
    Try using
    Reflect.Mouse.Click(Mouse_Right);
    Because you're using reflection anyways.

  3. #3
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    Quote Originally Posted by Aspect View Post
    I think it's the FastClick function.
    Try using
    Reflect.Mouse.Click(Mouse_Right);
    Because you're using reflection anyways.
    Reflect.Mouse.Move(Point, 0, 0) is what I meant.
    Last edited by Aspect; 05-16-2017 at 09:01 PM.

  4. #4
    Join Date
    Apr 2017
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    I think I've sort of found the problem,
    the banker NPC doesn't move.

    I'm using the same procedure for other NPCs that move and it works perfectly fine... for now i'm back to using colour for the banker, would still appreciate it if someone knowledgeable about this could clear this up..

    Thanks!

    edit: hmm.. seems it's doing the same thing with other npcs as well.. guess that wasn't the problem
    Last edited by theholyone1; 05-16-2017 at 09:38 PM.

  5. #5
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    Quote Originally Posted by theholyone1 View Post
    I think I've sort of found the problem,
    the banker NPC doesn't move.

    I'm using the same procedure for other NPCs that move and it works perfectly fine... for now i'm back to using colour for the banker, would still appreciate it if someone knowledgeable about this could clear this up..

    Thanks!
    Did my solution not work for you?

  6. #6
    Join Date
    Apr 2017
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Aspect View Post
    Did my solution not work for you?
    Sorry stepped out for a bit, gave it a go, the same thing is happening, it'll move to NPC, then move down a few pixels before right clicking

  7. #7
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    Quote Originally Posted by theholyone1 View Post
    Sorry stepped out for a bit, gave it a go, the same thing is happening, it'll move to NPC, then move down a few pixels before right clicking
    If you are storing the point in a TPoint, then moving the mouse to that point with humanMMouse, it shouldn't matter if you are using "color" considering you are just moving your mouse to an x y cord and right clicking it. The only thing that would cause the mouse to move down a few pixels would be your mouse movement function, or (maybe) the click and shouldn't have anything to do with color. Perhaps there's an offset between the move mouse and click mouse function for some reason.
    Last edited by Aspect; 05-16-2017 at 09:55 PM.

  8. #8
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    If it doesn't stop before moving downward, it could be returning a value below the banker. You could add/subtract a bit to the y value of the returned point. But this could be your client zoom settings as well. Tiles to MS can be a little wonky sometimes.

    Example
    Point.y := Point.y - 5:
    Last edited by Aspect; 05-16-2017 at 10:12 PM.

  9. #9
    Join Date
    Apr 2017
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    so far this is what I have
    Simba Code:
    program scriptTemplate;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}
    {$I RSWalker/Walker.simba}
    {$i Reflection/Reflection.simba}

    var
      ReflectPlayer : TReflectLocalPlayer;
    procedure startCooksAssist;
    var
      cook:TreflectNPC;
      Point: TPoint;
    begin
      repeat
        begin
          cook.Find('Cook');
          Point := Reflect.Tiles.TileToMs(cook.GetTile);
          Reflect.Mouse.Move(Point, 0, 0);
          wait(random(50,100));
          Reflect.Mouse.Click(Mouse_right);
          wait(random(400,600));
          chooseOption('alk-to Cook');
        end;
      until  TReflectionChat.NpcChatOpen;
    end;

    begin
      initAL;
      Reflect.Setup;
      ClearDebug;
      reflectPlayer.Create;

      StartCooksAssist;

    end.

    it has stopped doing the weird down movement, just need to adjust it so it clicks the cook prooperly, ATM it clicks a little to the right so it misses,

    will report back in an hour or so, heading out
    (using colour for bank atm)

  10. #10
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    Most of my scripts use reflection is the reason I'm so about it. But I will mention that reflection has a built in walking and positioning system. If you just like RSWalker better that's fine though. But it would eliminate the need for another include or map.
    Last edited by Aspect; 05-16-2017 at 10:51 PM.

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
  •