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.

lare96

Members
  • Joined

  • Last visited

Everything posted by lare96

  1. are you getting a ConcurrentModificationException? if so what Swizzbeat suggested will work although I wouldn't recommend using concurrent collections as they can be slower you're probably getting that error because you're trying to do something like this for(Element e : list) { if(e == null) { continue; } e.function(); list.remove(e); // <- will throw a ConcurrentModificationException!! } you cant modify a list that isnt concurrent while doing this type of loop. use a raw iterator instead like so for(Iterator<Element> iterator = list.iterator(); iterator.hasNext();) { Element e = iterator.next(); if(e == null) { continue; } e.function(); iterator.remove(); // <- does the same thing but no exception will be thrown! } or like I stated before, you can use a CopyOnWriteArrayList or what the dude above suggested
  2. lare96 replied to lare96's topic in Archive
    sorry, I'm new to script development :P but yeah you guys were right the script I made works great! Thanks
  3. lare96 replied to lare96's topic in Archive
    i dont see how that was funny at all but okay thanks
  4. lare96 posted a topic in Archive
    I'm writing my first script which is for fishing and I'm wondering if there are any classes/methods in the api that can provide blocking events? If you have no clue what I'm talking about take for example this code @Override public void forceState(Script script) throws Exception { /** Move toward wherever the bank is. */ script.setRunning(true); FishingScript.getBankLocation().getPosition().walkMinimap(script.myPlayer().getBot()); /** Get the nearest bank and open it. */ RS2Object object = script.closestObject(FishingScript.getBankLocation().getObjectId()); object.interact("Bank"); /** Deposit all items except for the fishing tools. */ script.myPlayer().getClient().getBank().depositAllExcept(FishingScript.getFishingType().getBankException()); } if I tried to execute that all at once the script would try and click the bank before I was even at the position, deposit the items before the bank was even opened, etc. etc. so I was wondering if there are any functions that serve a purpose like this, where the thread would block until the operation was completed? @Override public void forceState(Script script) throws Exception { /** Move toward wherever the bank is. */ new BlockingEvent() { @Override public boolean blockUntil() { return !script.myPlayer().isMoving(); } @Override public void run() { script.setRunning(true); FishingScript.getBankLocation().getPosition().walkMinimap(script.myPlayer().getBot()); } }.start(); /** Get the nearest bank and open it. */ new BlockingEvent() { @Override public boolean blockUntil() { return !script.myPlayer().getClient().getBank().isOpen(); } @Override public void run() { script.setRunning(true); FishingScript.getBankLocation().getPosition().walkMinimap(script.myPlayer().getBot()); } }.start(); /** Deposit all items except for the fishing tools. */ new BlockingEvent() { @Override public boolean blockUntil() { return !script.myPlayer().getClient().getInventory().isFull(); } @Override public void run() { script.myPlayer().getClient().getBank().depositAllExcept(FishingScript.getFishingType().getBankException()); } }.start(); } I have no problem designing something myself if needed, this is my first script so I have no clue if that's even how its supossed to be done. If anyone more experienced can point me in the right direction that would be cool. thanks
  5. really good explanation, will definitely help out the java newbies
  6. lare96 replied to Reid's topic in Snippets
    this actually helped me out a bit with the paint stuff, so thanks
  7. lare96 replied to Reid's topic in Snippets
    I see you're going for an abstract state model, I took a similar approach when writing my first script yesterday Declaring fields to hold the states is bad design, you should try something like this: public enum State { MINING_ORE(new AbstractState() { ... }), DROPPING_ORE(new AbstractState() { ... }); private State(AbstractState abstractState) { ... } ... } then you can just loop through all of the states for(State s : State.values()) { if(s.getAbstractState().force(...)) { s.getAbstractState().run(); } } a lot more maintainable and it looks nicer too. also your naming is a bit off

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.