Jump to content

What are the characters that appear randomly and how do you interact with them?


Recommended Posts

Posted

These characters appear randomly, I assume, which are part of the bot detection.
I have captured some IDs as I have developed the code.
Before trying the code that I try to do, first, to "dismiss" said characters, I would like to know:

Sorry if my question is a bit absurd, but I confuse a few types of statements.

The code that I have so far is:

final int[] npcsList = new int[] {
		5427, 6744, //Flippa
		312, 479, 2145, 3290, //Frog
		380, 2122, //Pillory Guard
		375, 376, //Rick Turpentine
		5510, //Sandwich lady
		5438, 5441, //Giles
		322, 2408, 2409, 2429, 4301, 4302, 4303, 4304, 4305, //Drunken Dwarf
};
final NPC npc = npcs.closest(npcsList);
if (npc != null) {
	if(npc.isVisible()) {
		npc.interact("Dismiss");
	}
}


I assume that the error in what I have code is if the NPC or objecto nose digire to me.


First of all, Thanks.

 

osbot npc.jpg

Posted

Looks like the lads above answered your question, but just for future reference: As a general rule of thumb, if you have to use an id for something, there's probably a better solution. Try and filter objects based on static features which are unlikely to change, for example name or interaction options. This is better practice and will mean your script is unlikely to break following game updates. It's also mandatory to avoid the use of ids if you wish to submit a script to the SDN.

If you have any further questions, don't hesitate to let me know / drop me a PM. I'm always happy to help :)

Best

Apa

  • Like 1

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...