Skip 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.

Banking with names!

Featured Replies

just something i wrote

 

  • This will be able to return the id of the item name inside your bank
  • With this snippet you will need to check if the bank is open
  • With this snippet you must keep the anotation
  • Wrote more around the core so it will return an int
    public int bankItemIdByName(String Item_Name){
        Item items[] = client.getBank().getItems();
        int item_id = 0;
        for (Item single_item : items) {
            if (single_item.getName().equals(Item_Name)) {
             item_id =    single_item.getId();
             return item_id;
            }
        }
        return item_id;
    }
/*
 * This will return the id of the item by name
 * This was written by "TheScrub"
 * John of
 * Adelaide South Australia
 */                      




   /*Example use of the method provided above*/

  client.getBank().withdraw1(bankItemIdByName("Salmon"));

Edited by TheScrub

Might be helpful for me later on. Thanks for this.

  • 2 weeks later...
  • Author

String Item_Name

your naming shouldn't be like that.

 

thats the parameter for people to understand ik what u mean should be item_name no caps

 

i have String s in my parameter's i renamed it for people to understand

 

just something i wrote

 

  • This will be able to return the id of the item name inside your bank
  • With this snippet you will need to check if the bank is open
  • With this snippet you must keep the anotation
  • Wrote more around the core so it will return an int
    public int bankItemIdByName(String Item_Name){
        Item items[] = client.getBank().getItems();
        int item_id = 0;
        for (Item single_item : items) {
            if (single_item.getName().equals(Item_Name)) {
             item_id =    single_item.getId();
             return item_id;
            }
        }
        return item_id;
    }
/*
 * This will return the id of the item by name
 * This was written by "TheScrub"
 * John of
 * Adelaide South Australia
 */                      




   /*Example use of the method provided above*/

  client.getBank().withdraw1(bankItemIdByName("Salmon"));

Looks good but make use of naming conventions. It helps make understanding it easier for the person reading it. 

For example your method name is using correct naming conventions. Use mixed casing for parameter values with a prefix such as a or an. variables use mix casing as well and constants should utilize capitalizing each word with a underscore. 

 

for example:

public int getBankItemByName(aItemName){
        int itemID = 0;
        for (Item singleItem : client.getBank().getItems()) {
            if (single_item.getName().equals(aItemName)) {
             itemID =    singleItem.getId();
             return itemID;
            }
        }
        return -1;
    }

Edited by Exarticus

 

 

just something i wrote

 

  • This will be able to return the id of the item name inside your bank
  • With this snippet you will need to check if the bank is open
  • With this snippet you must keep the anotation
  • Wrote more around the core so it will return an int
    public int bankItemIdByName(String Item_Name){
        Item items[] = client.getBank().getItems();
        int item_id = 0;
        for (Item single_item : items) {
            if (single_item.getName().equals(Item_Name)) {
             item_id =    single_item.getId();
             return item_id;
            }
        }
        return item_id;
    }
/*
 * This will return the id of the item by name
 * This was written by "TheScrub"
 * John of
 * Adelaide South Australia
 */                      




   /*Example use of the method provided above*/

  client.getBank().withdraw1(bankItemIdByName("Salmon"));

Looks good but make use of naming conventions. It helps make understanding it easier for the person reading it. 

For example your method name is using correct naming conventions. Use mixed casing for parameter values with a prefix such as a or an. variables use mix casing as well and constants should utilize capitalizing each word with a underscore. 

 

for example:

public int getBankItemByName(aItemName){
        int itemID = 0;
        for (Item singleItem : client.getBank().getItems()) {
            if (single_item.getName().equals(aItemName)) {
             itemID =    singleItem.getId();
             return itemID;
            }
        }
        return null;
    }

an int cant return null change that to -1

and use #equalsIgnoreCase(); instead of #equals();

 

 

 

just something i wrote

 

  • This will be able to return the id of the item name inside your bank
  • With this snippet you will need to check if the bank is open
  • With this snippet you must keep the anotation
  • Wrote more around the core so it will return an int
    public int bankItemIdByName(String Item_Name){
        Item items[] = client.getBank().getItems();
        int item_id = 0;
        for (Item single_item : items) {
            if (single_item.getName().equals(Item_Name)) {
             item_id =    single_item.getId();
             return item_id;
            }
        }
        return item_id;
    }
/*
 * This will return the id of the item by name
 * This was written by "TheScrub"
 * John of
 * Adelaide South Australia
 */                      




   /*Example use of the method provided above*/

  client.getBank().withdraw1(bankItemIdByName("Salmon"));

Looks good but make use of naming conventions. It helps make understanding it easier for the person reading it. 

For example your method name is using correct naming conventions. Use mixed casing for parameter values with a prefix such as a or an. variables use mix casing as well and constants should utilize capitalizing each word with a underscore. 

 

for example:

public int getBankItemByName(aItemName){
        int itemID = 0;
        for (Item singleItem : client.getBank().getItems()) {
            if (single_item.getName().equals(aItemName)) {
             itemID =    singleItem.getId();
             return itemID;
            }
        }
        return null;
    }

an int cant return null change that to -1

and use #equalsIgnoreCase(); instead of #equals();

 

Opps my bad. Thanks for catching that :P

Very helpful, thank you :)

 

Learning to script is a lot easier with snippets :p

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.