1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resource NPC Interact Script for easy use

Discussion in 'Tutorials & Resources' started by youramazingames, Jul 6, 2017.

  1. youramazingames

    Joined:
    Oct 24, 2015
    Messages:
    79
    Likes Received:
    13
    Hello,

    So while i was making my new Questing bot i realized i needed an easy way to interact/talk with NPCs and navigate the menu and select the correct responses to forward the quest. So i created this class to do just that.

    It is very easy to use and has not failed me yet. (If there are bugs you see or find please tell me and ill update).

    To use the API do something along the lines of:

    Code (Text):
    1. Actor a = Npcs.newQuery().names("NPC_NAME").results().first();
    2. Object[] list = {1, "Test!", 4}
    3. talk(a, list)
    1. This will then talk to the NPC, select the first choice option.
    2. Then on the second one it will look for the one with the exact name of "Test!" and select that.
    3. Then finally it will choose the 4th option on the 3 Choice section.

    This is designed for RS3 but may work in OSRS not tested.

    To initiate it i recommend doing something in the Main bot file so you can easily re-use it.

    Code (Text):
    1. public npcInteract npc = new npcInteract();
    Then you just need to do:
    Code (Text):
    1. bot.npc.talk(NPC, list);
    To make it run.

    Please tell me your thoughts.
    I Have done some more comments in the file so enjoy.

    Here is the file: npcInteract ยท GitHub

    Cheers
     
    slappygoose likes this.
  2. Aaron Priest

    Joined:
    Jan 31, 2017
    Messages:
    121
    Likes Received:
    30
    I can't really comment on your work as I've not read the source, and not to disappoint you, but I think interacting with an npc is a very trivial thing that most people would handle in a few lines. This resource is only applicable in few cases, such as your questing bot, but I think whenever someone would need such a thing, most authors aspirations would be high enough to write their tools themselves, to make it fit perfectly into their framework. Of course all that is just my humble opinion and I can't talk for anyone else :)

    One last suggestion tho, you should work on your conventions. For example, classes in java always start with a capital letter (npcInteract -> NpcInteract).


    EDIT: Just had a quick glance at your code and wanted to give you another hint. Bots should follow the guideline of one action per loop :)
     
    #2 Aaron Priest, Jul 6, 2017
    Last edited: Jul 6, 2017
    Chief Jaeger likes this.

Share This Page

Loading...