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.

Items in bank

Featured Replies

I'm making a task based script which includes buying gear from grand exchange. I have one task for banking and one for buying.

The buytask should execute when the required arrmor is not in my Inventory, bank or equiped. When the bank is open it works fine and it goes to GE. However when the bank isn't open and I already have the required items in the bank it still thinks it should buy things. I assume this is due to it not knowing what's in the bank when the bank isn't open.

 

It basically boils down to this: Is it possible to store the items in the bank in an arraylist and update it every time i withdraw or deposit something or are there better ways of implementing buying?

 

 

 

4 minutes ago, Jammer said:

I'm making a task based script which includes buying gear from grand exchange. I have one task for banking and one for buying.

The buytask should execute when the required arrmor is not in my Inventory, bank or equiped. When the bank is open it works fine and it goes to GE. However when the bank isn't open and I already have the required items in the bank it still thinks it should buy things. I assume this is due to it not knowing what's in the bank when the bank isn't open.

 

It basically boils down to this: Is it possible to store the items in the bank in an arraylist and update it every time i withdraw or deposit something or are there better ways of implementing buying?

 

 

 

 

Why don't you just check if the player already has the items in their inventory / equipment?

If they don't then check the bank

If they still don't then go to GE.

 

Sounds like the structure of your code is borked ("Task" pattern sucks)

  • Author
2 minutes ago, Explv said:

 

Why don't you just check if the player already has the items in their inventory / equipment?

If they don't then check the bank

If they still don't then go to GE.

 

Sounds like the structure of your code is borked ("Task" pattern sucks)

Wow, I can't believe I didn't think of that.

Yeah, task based was actually messier than I anticipated but it might just have to do with my lack of skills. 

After I finish this script I'm gonna have a look at your tutorial island script and try to use that kind of framework.

24 minutes ago, Jammer said:

It basically boils down to this: Is it possible to store the items in the bank in an arraylist and update it every time i withdraw or deposit something or are there better ways of implementing buying

 

12 minutes ago, HeyImJamie said:

Bank Caches :boge: 

Yea pretty much anytime you close the bank, update arraylist of items in the bank before you close (or finished with bank).

That way you don't need to go and check every time.

Make sure the items are updated before you check them tho, so like depending on where you start your script, the bank cache might not be initialized.  

I'd personally use a HashMap or something similar rather than an arraylist so you can store the string/item and the amount rather than just one or the other. I'd put an initialisation check in regards to size and save it if it's not been saved, eg if size is 0 - load the cache, else set the cache everytime you open bank or w/e

Edited by HeyImJamie

11 minutes ago, HeyImJamie said:

I'd personally use a HashMap or something similar rather than an arraylist so you can store the string/item and the amount rather than just one or the other. I'd put an initialisation check in regards to size and save it if it's not been saved, eg if size is 0 - load the cache, else set the cache everytime you open bank or w/e

Well, he's looking for equipment. So in this case, the list contains it or not, the quantity is implied. 

21 minutes ago, dreameo said:

 

Yea pretty much anytime you close the bank, update arraylist of items in the bank before you close (or finished with bank).

That way you don't need to go and check every time.

Make sure the items are updated before you check them tho, so like depending on where you start your script, the bank cache might not be initialized.  

 

16 minutes ago, HeyImJamie said:

I'd personally use a HashMap or something similar rather than an arraylist so you can store the string/item and the amount rather than just one or the other. I'd put an initialisation check in regards to size and save it if it's not been saved, eg if size is 0 - load the cache, else set the cache everytime you open bank or w/e

 

Except he doesn't need to cache anything..

The structure of his code is the problem.

2 minutes ago, Explv said:

Except he doesn't need to cache anything..

The structure of his code is the problem.

Your suggesting to just check in this order: equipment --> bank --> go buy from ge

Caching it would just eliminate the step of having to check the bank since you'd already know what you don't have. 

Just now, dreameo said:

Your suggesting to just check in this order: equipment --> bank --> go buy from ge

Caching it would just eliminate the step of having to check the bank since you'd already know what you don't have. 

That depends on whether he plans on losing his equipment during the script.

If he only needs to check once, why cache?

2 minutes ago, Explv said:

That depends on whether he plans on losing his equipment during the script.

If he only needs to check once, why cache?

So he finishes one task, goes to a second but needs certain gear. If he cached his bank, he will know whether to buy or go to bank. 

9 minutes ago, dreameo said:

So he finishes one task, goes to a second but needs certain gear. If he cached his bank, he will know whether to buy or go to bank. 

Really depends on what script he is making.

  • Author

It's gonna start leveling combat from scratch so I'm gonna have to use GE multiple times. I'll try what explv suggested and if the bank task and the buy task conflict with each other I'll try the cache thing.

Edit: thanks for the help btw.

 

Edited by Jammer

1 hour ago, dreameo said:

Well, he's looking for equipment. So in this case, the list contains it or not, the quantity is implied. 

My fault, didn't fully read. 

 

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.