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.

Need some help with my deposit code

Featured Replies

this is my deposit code when @bank, it deposit's my dragon axe too

worked like 2 days ago but now i dont fkn know.

getBank().depositAllExcept(item -> item.getName().contains("axe"));

Edited by atoo

  if (this.bank.isOpen()) {
                    this.bank.depositAllExcept("Bronze axe", "Iron axe", "Steel axe", "Black axe", "Mithril axe", "Adamant axe", "Rune axe", "Dragon axe");
                    

Havent tested it so not sure if it woks, but it should :) 

  • Author
  if (this.bank.isOpen()) {
                    this.bank.depositAllExcept("Bronze axe", "Iron axe", "Steel axe", "Black axe", "Mithril axe", "Adamant axe", "Rune axe", "Dragon axe");
                    

Havent tested it so not sure if it woks, but it should :) 

 

I wrote that too, but i just thought if we include "axe" it wouldnt deposit it.

Thanks though :)

I wrote that too, but i just thought if we include "axe" it wouldnt deposit it.

Thanks though :)

think it looks for a item "axe" instead of looking for a item containing the word i always type it out and that work so may aswell

Strange if it worked before and suddenly stops working. Also not too important in this situation but I think using .contains() could be bad practice if you were dealing with strings that used other words with the sequence "axe" but were not axes. Again there's no case in this situation but if you were dealing with axel logs, .endsWith() would be better in this case since we know our axes  always ends with "axe"

 

 

Edited by Hayase

best thing to do is make a constant that lists your axe names.

public static final String AXES = ("Bronze axe", "Iron axe", "Steel axe", "Black axe", "Mithril axe", "Adamant axe", "Rune axe", "Dragon axe");

if (this.bank.isOpen()) {
                    this.bank.depositAllExcept(AXES);

This will always call the list of axes (which i doubt will ever change) this is a helpful technique and makes the code much more readable and modular.

Edited by DocMatson

  • Author

best thing to do is make a constant that lists your axe names.

public static final String AXES = ("Bronze axe", "Iron axe", "Steel axe", "Black axe", "Mithril axe", "Adamant axe", "Rune axe", "Dragon axe");

if (this.bank.isOpen()) {
                    this.bank.depositAllExcept(AXES);

This will always call the list of axes (which i doubt will ever change) this is a helpful technique and makes the code much more readable and modular.

Thanks mate :)

I always code messy lol, this will help a bit.

 

this is my deposit code when @bank, it deposit's my dragon axe too

worked like 2 days ago but now i dont fkn know.

getBank().depositAllExcept(item -> item.getName().contains("axe"));
getBank().depositAllExcept(item -> item.getName().endsWith(" axe"));

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

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.