Resolved Clicking Players instead of NPCS

Discussion in 'Developer Support' started by torque0, Oct 31, 2015.

  1. torque0

    Joined:
    Oct 18, 2015
    Messages:
    25
    Likes Received:
    3
    It's definitely NOT just a missclick because the bot will continue to target the player multiple times before moving on to the actual target npc

    Code (Text):
    1.  
    2. Npc npcm = Npcs.newQuery().names("Minotaur").results().nearestTo(Players.getLocal());
    Code (Text):
    1. if (npcm.getLevel() < 30) {
    2. if (npcm.interact("Attack")) {
    3. Execution.delayUntil(() -> npcm.getTarget() != null, 400, 1300);
    4. }
    5. }
    Anyone have a suggestion on how i can stop it doing this, even tried checking that the level was below 30 but its trying to attack any player, even those over 30
     
  2. Best Answer:
    Post #2 by Arbiter, Oct 31, 2015
  3. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,556
    Likes Received:
    1,079
    npcm.interact("Attack", npcm.getDefinition().getName())
     
    torque0 likes this.
  4. torque0

    Joined:
    Oct 18, 2015
    Messages:
    25
    Likes Received:
    3
    Thankyou!
     
  5. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,556
    Likes Received:
    1,079
    No problem. Are you in Dev Chat yet? Anyone in there could have answered that instantly. P.S. Make sure you null check definition.
     
  6. torque0

    Joined:
    Oct 18, 2015
    Messages:
    25
    Likes Received:
    3
    Didn't know such a thing existed but I have joined it :) , and i will thanks for the tip
     

Share This Page

Loading...