Jump to content

Help with a chest


Recommended Posts

Posted

No i dont want to be spoonfed but i have been trying trial and error on how to make it right click search for traps at the ardounge nature rune chest, not sure if i need to make it entity chest or entity stall = objects.closest("chest"); 

 

also on my state would it be SEARCH_FOR_TRAPS or is their a different way to do that? 

 

This is my first script and I am just trying to learn and this seems like an extremely easy script to start with! Any help or guidance would be appreciated thanks!

post-210432-0-51507600-1456931887_thumb.png

Posted

Just a few bits of advice:

 

1. I would use RS2Object instead of Entity because Objects extends EntityAPI<RS2Object>. 
2. You are searching for the chest twice between your getState() and onLoop() which is a bit inefficient. If your getState() found the object, you should pass that object to your onLoop() without having to find it all over again.

 

But yes, no underscores. You are interacting with the action exactly as you see it in-game (with color tags being stripped).

  • Like 2
Posted (edited)

Is there any tips you could give me on programming bots? I do have some basic java knowledge and I am just trying to make simple scripts until learning how to do it efficiently.

Just write whatever you want. You'll learn from that. Take something a bit harder than you think you can do. This will stimulate you to actually think about solutions to your problem.

Eventually your experience writing scripts and hopefully your Java knowledge will grow.

EDIT: Also, you should get rit of that framework as soon as possible!

Edited by Psvxe
Posted

Just write whatever you want. You'll learn from that. Take something a bit harder than you think you can do. This will stimulate you to actually think about solutions to your problem.

Eventually your experience writing scripts and hopefully your Java knowledge will grow.

EDIT: Also, you should get rit of that framework as soon as possible!

why is that?

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