Jump to content

How do I know that an NPC is interacting with me?


Recommended Posts

Posted

I have the following code:

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) {
	sleep(random(7000,15000));
	interactCustom(npc, "Dismiss");
	cantNPCFound++;
}

With this code valid that there is an existing NPC and is visible then interact and dismiss it.

But how valid is the NPC for me and not for another user?

Posted (edited)

1) I have no idea what you're asking

2) Why use IDs for NPCs? It looks horrible, is extremely unreadable (highlighted by the fact that you have comments) You can just use the names of the NPCs...

NPC npc = getNpcs().closest("Giles", "Sandwich Lady", "Rick Turpentine");

etc.

3) OSBot already has a random event dismisser, why are you writing your own?

Edited by Explv
Posted (edited)
14 minutes ago, Cloxygen said:

u know there is a built in random event handler right?

I did not know it :(

13 minutes ago, Explv said:

1) I have no idea what you're asking

2) Why use IDs for NPCs? It looks horrible, is extremely unreadable (highlighted by the fact that you have comments) You can just use the names of the NPCs...


NPC npc = getNpcs().closest("Giles", "Sandwich Lady", "Rick Turpentine");

etc.

3) OSBot already has a random event dismisser, why are you writing your own?

1) An NPC appears but you can not identify if you want to interact with me or are interacting with another character.

2) The custom of programming of administrative systems I generate a compulsive obsecion of everything programmed by the identifiers (seriously, I do not joke xD)

3) I did not know it. What is it and how do I use it?

 

NOTE: I do not know if it is completely understood because I speak Spanish and use "Google Translate" to try to communicate my doubts.

Edited by trainux
Posted
9 minutes ago, Antonio Kala said:

Are you asking how to know if random event is for you or for another player?

You can just ignore them and they will go away. Or click on settings then tick "dismiss randoms".

I do not know if I'll ask a stupid question, but ignoring all NPCs is not a bit obvious that it's a bot?
One playing dismisses 2/3 NPC ramdoms.

Posted
11 minutes ago, trainux said:

I do not know if I'll ask a stupid question, but ignoring all NPCs is not a bit obvious that it's a bot?
One playing dismisses 2/3 NPC ramdoms.

by default the client should automatically dismiss random events you don't have to write any code for it to work. If its not doing it, you can enable it in the options

Posted
35 minutes ago, Charlotte said:

Random events were phased out in rs3 as better anti-macro software was developed. Random events have no effect whatsoever and is not used to determine botters. You can either completely ignore it or use the built-in system to dismiss it.

yH6w6T2.png

Thank you very much.


And thank you all for answering.

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...