Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Dialogues.getNPCName


    testerino99
     Share

    Recommended Posts

    I'm trying to make some sort of generic condition. Is there a method in the API that does as stated in title in the API. Trying to make sure the Player is in a dialogue (talking) to a specific NPC. 

    Following works initally but after the first Dialogue appears the Player is no longer interacting and thus fails.

    Dialogues.inDialogue() && Players.localPlayer().isInteracting(NPCs.closest(getNPCname()))

    I could manually use the Widgets API and scrape the name of the NPC from the text box but that seems prone to breaking later if different id's are used..

    Link to comment
    Share on other sites

    Hey you can check if youre in a dialouge and use 
     

    Players.localPlayer().getCharacterInteractingWithMe()

    to get the npc youre interacting with  :) 

    Edited by Hosfad
    Link to comment
    Share on other sites

    Definitely checking out this method. Alright I actually just tried this and it seems to do exactly what I want. Thank you very much!

    I assume the players loses the 'interaction' with the NPC but not the other way around somehow?

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.