Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resource NPC Interact Script for easy use

Joined
Oct 24, 2015
Messages
82
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:
Actor a = Npcs.newQuery().names("NPC_NAME").results().first();
Object[] list = {1, "Test!", 4}
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:
public npcInteract npc = new npcInteract();
Then you just need to do:
Code:
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
 
Joined
Jan 31, 2017
Messages
121
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 :)
 
Last edited:
Top