Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Explv

Scripter II
  • Joined

  • Last visited

Everything posted by Explv

  1. https://www.cs.utexas.edu/~scottm/cs307/handouts/Eclipse%20Help/jarInEclipse.htm Ignore the .zip part at the end
  2. See my post here for a working solution: http://osbot.org/forum/topic/85684-finished-my-new-script-but-how-do-i-type-faster/?p=952925 I would paste the code but I'm on my phone Edit (pasted code here): private void typeStringInstant(String output){ for(int i = 0; i < output.length(); i ++){ char c = output.charAt(i); int code = KeyEvent.getExtendedKeyCodeForChar(c); // Type the character getBot().getKeyEventHandler().generateBotKeyEvent(400, System.currentTimeMillis(), 0, code, c); } // Press enter getBot().getKeyEventHandler().generateBotKeyEvent(401, System.currentTimeMillis(), 0, 10, '\u0000', 1); // Release enter getBot().getKeyEventHandler().generateBotKeyEvent(402, System.currentTimeMillis(), 0, 10, '\u0000', 1); }
  3. String values are compared using .equals() not == Also the message will not contain / It should be: if(messageReceived.equals("!Test")){ log("Test received.."); getKeyboard().typeString("/Success!", true); }
  4. I think it might be ID 9 for clan chat: @Override public void onMessage(Message message){ if(message.getTypeId() == 9){ // do something } }
  5. The only MessageTypes available are: GAME PLAYER RECEIVE_TRADE So GAME will include clan chat messages.
  6. @Override public void onMessage(Message message){ if(message.getType() == Message.MessageType.PLAYER){ String text = message.getMessage(); } } That should get you started
  7. The real problem with those variables is that most of them are obsolete. Start xp doesn't need to be stored because all xp gain calculations can be accessed through ExperienceTracker. NPCs and Widgets shouldn't be stored globally because they are most likely going to need to be refreshed every time the method that uses them is called, same with run time. Let us all bow our heads and pray that he at least uses OOP. /roast
  8. Code looks clean but pretty awful
  9. Explv replied to Aeonx's topic in Resolved
    Did you use any scripts from the Local section? They are not checked by OSBot staff.
  10. Shoot him! But seriously you do it in your scripts too
  11. Your states should be based on some boolean condition, not set when you think they should be. Otherwise when an action fails your script will be rekt. Also you should use the getBank().open() method. enum State{ OPEN_BANK, BANK } private State getState(){ return getBank() != null && getBank().isOpen() ? State.BANK : State.OPEN_BANK; } @Override public int onLoop() throws InterruptedException{ switch (getState()) { case OPEN_BANK: getBank().open(); break; case BANK: //Dostuff break; } return random(200, 250); }
  12. This is not correct though, as the distance between two positions is not the same as walking distance. Therefore it can easily return a bank that is further away, as it is closer, but the route is longer. Also if you are in a dungeon it will return an incorrect bank due to the way the map is laid out.
  13. This has been fixed
  14. Well it has no impact on performance. If imgur fucks up your script will still work. onPaint runs on a separate thread so I think there could also be a point at the start where img is null
  15. Not relevant to your problem but in your onPaint you should also do a null check for your image. if(img != null) g.drawImage(img, null, 0, 335);
  16. If you want to make a list like that it would be a lot cleaner to do: private final List<Position> TO_BANK = Arrays.asList(new Position[]{ new Position(random(3323, 3320), random(3137,3141), 0)); new Position(random(3318, 3321), random(3144,3147), 0); new Position(random(3307,3313), random(3146, 3152), 0); new Position(random(3301,3305), random(3149,3152), 0); new Position(random(3288,3297), random(3147, 3150), 0); new Position(random(3280, 3289), random(3150, 3153), 0); new Position(random(3276, 3279), random(3155, 3158), 0); new Position(random(3273, 3278), random(3160, 3163), 0); new Position(random(3269, 3272), random(3162,3170), 0); }); But yeah, use the web walker instead: getWalking().webWalk(new Position(0, 0, 0));
  17. No code after a return statement will be executed.
  18. Explv replied to Explv's topic in Others
    Yeah the script is broken rn, haven't had the time to fix it.
  19. Explv replied to RONTAG's topic in Archive
    Update Java to the latest version. You should really update your OS too.
  20. 1) For your runeCheck method you should use a switch not if else statements. 2) When comparing Strings, like in your runeCheck method you should use .equals() not == For Strings, == compares references, where as .equals() compares the values. 3) Your runeCheck method can be replaced with, getMagic().canCast(teleport); 4) Formatting. 5) Stop using this. where you don't need to. This. is a reference to the current object. It is not needed to refer to fields in the current object, unless you have a parameter with the same name. 6) Use my time formatting method, it looks nicer public String formatTime(long ms){ long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24; s %= 60; m %= 60; h %= 24; return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) : h > 0 ? String.format("%02d:%02d:%02d", h, m, s) : String.format("%02d:%02d", m, s); } 7) You don't need to store currentXp, or timeRan, or any variables like that. This information can be calculated when needed, or obtained using the ExperienceTracker and are not used in any other methods. For example there is the gainedLevels and gainedXp methods in ExperienceTracker. 8) Seriously, formatting.
  21. Just do a really long ConditionalSleep. For example if you are smelting Gold bars you could do something like: private final ConditionalSleep SMELTING_SLEEP = new ConditionalSleep(100_000) { @Override public boolean condition() throws InterruptedException { return !getInventory().contains("Gold ore"); } }; When you start smelting, you can call: SMELTING_SLEEP.sleep(); And it will then sleep for up to 100 seconds, or until the inventory no longer contains Gold Ore
  22. Use configs
  23. getWalking().walk(position); or getWalking().webWalk(position);
  24. Or just go to http://www.javadecompilers.com/

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.