Question Quicker Interaction with Moving NPCs

Discussion in 'Developer Support' started by Toksik, Jul 15, 2016.

  1. Toksik

    Joined:
    Feb 13, 2016
    Messages:
    93
    Likes Received:
    19
    Who knows how I should deal with NPCs which are moving, a lot? I am working on a Thieving bot but it appears that the default interactions are really slow as the cursor cannot keep up with the NPC. Is there an approach to deal with this issue?
     
  2. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,521
    Likes Received:
    893
    Mouse.setMouseMultiplier(1.2D)
     
    Toksik likes this.
  3. Toksik

    Joined:
    Feb 13, 2016
    Messages:
    93
    Likes Received:
    19
    Thanks for the suggestion. However, I have noticed that it is still very difficult to get realistic 'Pickpocket' actions in my bot.

    EDIT:
    Issues arise when an NPC starts to move while it is attempting to perform an interaction. It will try to keep up, but it doesn't click so this process iterates until the NPC stands still.
     
  4. Twinki

    Joined:
    Sep 30, 2015
    Messages:
    86
    Likes Received:
    9
    Could try removing mouse movement from the equation completely, but this only works in SDK mode as it isn't allowed on SVN.

    Code (Text):
    1.             if (Environment.isSDK()) {
    2.                 Mouse.setPathGenerator(new Mouse.PathGenerator() {
    3.                     @Override
    4.                     public boolean move(Interactable interactable, double v) {
    5.                         return interactable != null && interactable.getInteractionPoint() != null && hop(interactable.getInteractionPoint());
    6.                     }
    7.                 });
    8.             }
     
  5. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,521
    Likes Received:
    893
    This also wouldn't be allowed on the bot store but you could do new InteractablePoint(interactable.getInteractionPoint()).interact("action", "target");
    but it's also not recommended.
     
  6. Toksik

    Joined:
    Feb 13, 2016
    Messages:
    93
    Likes Received:
    19
    Thank you for all the answers.

    I'm just curious though. But why is this not recommended?
     

Share This Page

Loading...