Jump to content


Scripter II
  • Posts

  • Joined

  • Last visited

  • Days Won

  • Feedback


Xerion last won the day on January 31 2014

Xerion had the most liked content!

About Xerion

Profile Information

  • Gender

Recent Profile Visitors

2952 profile views

Xerion's Achievements

Black Poster

Black Poster (5/10)




Community Answers

  1. You can run it though the command line: java -jar "Path to .jar file"
  2. Use the walking event. This way you can set the minimal distance threshold. I believe the default is 3 so that's why the method returns true when you are not standing on the exact position.
  3. I would suggest using https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html instead of using that interface.
  4. Okay. Gimme a few minutes I don't want to spoon feed everything, but this should be a good basis. Also note that this class extends the API so you wont have to use script.client or script.inventory. The thread will automatically stop after a script has stopped. import org.osbot.rs07.Bot; import org.osbot.rs07.script.API; import java.util.ArrayList; import java.util.List; /** * Created by Xerion on 16-1-2017. */ public class InventoryObserver extends API { private List<InventoryListener> listeners = new ArrayList<>(); /** * * @param bot */ public InventoryObserver(Bot bot){ this.exchangeContext(bot); new Thread(() -> { logger.debug("Started: InventoryWatcher"); while (isRunning()) { try { sleep(loop()); } catch (InterruptedException e) { e.printStackTrace(); } } logger.debug("Stopped: InventoryWatcher"); }).start(); } @[member=Override] public void initializeModule() { } /** * * @[member=Return] */ private int loop(){ /** * Add your code here to check if item is added/removed */ return 100; } /** * * @[member=Return] True if a script is running */ private boolean isRunning(){ return bot.getScriptExecutor().getCurrent() != null; } /** * * @param listener */ public void addListener(InventoryListener listener) { listeners.add(listener); } /** * * @param listener */ public void removeListener(InventoryListener listener) { if(listener != null && listeners.contains(listener)) { listeners.remove(listener); } } }
  5. while (true) { Really?? Just don't do that.
  6. Well it depends on with distro you are using (CentOS, Ubuntu, etc). Secondly there should be a lot of tutorials on the internet.
  7. It had a fashion check. If you had ugly armour it would drop it. It was probably @Krulvis fault
  8. Additionally you also do an API suggestion here: http://osbot.org/forum/forum/102-client-bugs-suggestions/ Could be useful for everybody else if an method is added that supports item names.
  9. Why do you want to know it? Well in most cases there are multiple items that have the same name. The easiest example to mention is noted and unnoted items. You can use the ItemDefinition class, but I believe you have to load the items first.
  10. It just has a different name. I believe it's "rock"
  11. Why don't you just increase the counter every time you buy the item?
  12. A human would not always pick the closest NPC. For example: NPC A is 6 tiles away from the player and is visible on the screen. NPC B is 5 tiles away from the player and not visible If a bot would pick the closest NPC it will turn the screen and interact with NPC B. A human would interact with NPC A because that one is already visible. If you let the bot always chose the closest NPC you will get a pattern that does not happen with normal players. I agree that humans will mostly interact with the closest NPC, but that is not guaranteed.
  13. Technically those things can be detected on Jagex end. I'm not going to say it matters but they will know of you do those things. First of all I want to say to most of the things you mention should be in your script. Hovering the next monster or food to eat will make your script faster so in my opinion it's worth the development time to add those things. In my opinion the most important thing for a combat script is target selection. If you always attack the closest target you will get banned eventually. My advice is to create a method that will select your next target in a more realistic way.
  • Create New...