Jump to content

Misclicking objects


saurav2008

Recommended Posts

I have an object I an clicking by doing 

obstacle = objects.closest(27985);

obstacle.interact("Climb");

 

However, this object is directly next to another object and it often misclicks the wrong obstacle. How can I stop from misclicking the wrong object? I have tried to have the code stop and stand still before trying to interact with the object, but it still can misclick. Any snippets to help?

Link to comment
Share on other sites

20 hours ago, Sphiinx said:

Did you attempt to use a String rather than an ID? If you have, did this seem to fix your issue?

I did, and no that did not fix the issue. If it helps to mention, its the climbing rocks shortcut on zeah between mining spot and dark altar.

Edited by saurav2008
Link to comment
Share on other sites

On 2/22/2017 at 1:12 AM, saurav2008 said:

I have an object I an clicking by doing 

obstacle = objects.closest(27985);

obstacle.interact("Climb");

 

However, this object is directly next to another object and it often misclicks the wrong obstacle. How can I stop from misclicking the wrong object? I have tried to have the code stop and stand still before trying to interact with the object, but it still can misclick. Any snippets to help?

Try to get your object by position. Write a filter something like 

	RS2Object ladder = s.objects.closest(new Filter<RS2Object>() {
		@Override
		public boolean match(RS2Object obj) {
			return obj.getName().equals("Ladder") && obj.hasAction("Climb-Up") && obj.getPosition().getX() >= X_COORDINATE; 
		}
	});

And also you can add a fail-safe if he accidentally still misclicks. Something like if you're in an area that you don't want to be in - climb back up and try again

On 2/22/2017 at 1:30 AM, Prozen said:

The two objects next to each other don't have the same id right? Also note you shouldn't use ids for objects as ids change every update, causing your script to break.

Lol they don't change id's each update :D But yeah, you're right, bad practice.

Edited by nosepicker
Link to comment
Share on other sites

11 hours ago, nosepicker said:

Try to get your object by position. Write a filter something like 


	RS2Object ladder = s.objects.closest(new Filter<RS2Object>() {
		@Override
		public boolean match(RS2Object obj) {
			return obj.getName().equals("Ladder") && obj.hasAction("Climb-Up") && obj.getPosition().getX() >= X_COORDINATE; 
		}
	});

And also you can add a fail-safe if he accidentally still misclicks. Something like if you're in an area that you don't want to be in - climb back up and try again

Lol they don't change id's each update :D But yeah, you're right, bad practice.

A lot of objects ids get changed nearly every update.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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