Jump to content

ChrisJ

Members
  • Posts

    19
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

1131 profile views

ChrisJ's Achievements

Newbie

Newbie (1/10)

2

Reputation

  1. Use getNpcs().closest( or the lowercase npcs.closest( Same for the other ones. You are referencing the class instead of the instance
  2. Yo, I tried to make a basic proof of concept: int x = 12; @Override public int onLoop() { log("loop"); x++; int y = 172; getBot().sendAppletEvent(new MouseEvent(getBot().getCanvas(), MouseEvent.MOUSE_MOVED, System.currentTimeMillis(), MouseEvent.NOBUTTON, x, y, 0, false)); return 500; But when I run this, nothing happens. Im debugging mouse position and mouse trail, but it stays at -1, -1. Logging just keeps saying "loop" without exceptions. What am I doing wrong? Edit: This did work: getBot().getMouseEventHandler().generateBotMouseEvent(MouseEvent.MOUSE_MOVED, System.currentTimeMillis(), 0, x, y, 0, false, MouseEvent.NOBUTTON, true); Might be inefficient for entire paths though, not sure if this is the right way to do it.
  3. Buy RuneScape membership
  4. Learnt most from starting a project and looking up everything i came across untill i'd fully understand. Learnt some more from my study computer science. Then learnt from the book "OCA Java SE 7 Programmer 1 study guide" and got the certificate. After that, the SE 8 programmer 1 and SE 8 programmer 2 study guides & certificates. Now from whatever i run into at my job. I think OSBot is a nice place to start learning as you can set a goal you really want to achieve. "I want to make a script that does X and Y.". Having a goal like that is a nice reason to stay persistent. There is some basic Java knowledge needed though, that could be acquired through basic tutorials, but it could be hard to grasp when jumping into a script skeleton and trying to make things work.. Best way to learn depends on the person, some people learn very well through reading books, others have to really do it in order to remember it. Books often have exercises to make you get used to the concepts though. That's why my advice would be to find a book and set goals for yourself depending on how much time you have etc. Then when you've finished a book, start some kind of project. If you want to make an OSBot script, then read some tutorials on OSBot too because you'll be working with the OSBot library, so you have to understand what the library does exactly when you call a method. Also get to understand what the Java API is and how you can lookup classes and methods, and get to understand the OSBot API. Good luck!
  5. Had to use BlueJ during first year of study computer science aswell. It's good for people that don't understand the concept of classes and objects but as you said you already know those, it kinda sucks. Just had a look and i still have the book "Programming in Java with BlueJ (fourth edition)" here lol.. anyways it could still teach you some useful things i guess, maybe make you more familiar with class diagrams?
  6. air runes = 9gp each cast bond duration = 14 days splashes per hour = 1200 splashes in 14 days = 1200 * 24 * 14 = 403.200 403200 * 9 = 3.628.800 gp current bond price = 4.419.324 gp = why i splash in f2p
  7. Thanks for the suggestions although Im pretty sure that it just doesnt exit the interact() method. If this is true then an OSBot dev should look at it, so Ill try to reproduce it consistently in a seperate script.
  8. @IDontEB Yea that's equivalent to what i did to test. It usually runs fine but sometimes gets stuck in the .execute(interactionEvent) part and won't log the message.
  9. Hello everyone. This is a bug report / call for help to make my script work. In the abyss, i run RS2Object.interact() on one of the obstacles in the outer ring to go through. Sometimes this method is called on an unlucky moment and the player is already in the inner ring. When this happens the bot keeps clicking on the minimap every ~5 seconds to go towards the object, which obviously wont work because it cannot reach it. The log after the interact() method is never called untill i stop the script. I had a look at the source for the interact() method, and took that + added setMaximumAttempts() on the interactionEvent. final InteractionEvent interactionEvent = new InteractionEvent(closest, outerRingObject.getObjectOption()); interactionEvent.setMaximumAttempts(3); this.getBot().getEventExecutor().execute(interactionEvent); failed = !interactionEvent.hasFinished(); It still entered an endless loop on the execute()... I tried starting a seperate thread to set the interactionEvent as finished when the player ended up in the inner ring.. Also didnt help: new Thread(() -> { long start = System.currentTimeMillis(); while (!interactionEvent.hasFinished() && (System.currentTimeMillis() - start < 25000)) { if (getState() == State.INNER_RING) { interactionEvent.interrupt(); interactionEvent.setFinished(); } else { w8(2500 + random(500)); } } }).start(); Made the script override onMessage() to set a waitingForObstacle boolean when the message pops up that we try to mine/distract/go through, and set it to false again when the succes or fail message pops up. To make sure we dont call interact() while mining/distracting or w/e. Checked that boolean just before starting the interactionEvent if (waitingForObstacle) { return 450 + random(450); } And added another check that we're in the outer ring and not the inner ring if (getState().equals(State.OUTER_RING)) { ... Still it ended up trying to interact with the object in the outer ring while being in the inner ring... Any help is appreciated!
×
×
  • Create New...