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.

How do I check how many stacks of an Item I have?

Featured Replies

Hi everyone! hope all is well. I am currently developing a paid script that I will be releasing to the community hopefully VERY soon and I had a couple of questions regarding scripting.

 

1. How do I go about checking how many stacks of an item I have? Like if I had 1 million Salmon, how would I  get the bot to read this information - Is it possible to extract this info without righclicking the item?

 

 


long salmonCount = getInventory().getAmount("Salmon");

long salmonCount = getBank().getAmount("Salmon");

Edited by LoudPacks

  • Author

Awesome, thanks loudpacks! I have another question: 

 

I want to find the color of something in a specific area on the screen and click it, how would I go about doing that?

 

I know Scar use to be FindColorTolerance(x, y, COLOR, x1, y1, x2, y2, tolerance); but I can't seem to find the mirror code here in OSBot.

 

 

edit: while I'm here I'll just ask all the questions I have:

 

I want to log data for the script to use later, how would I go about doing that?

Basically like creating a counter : so that everytime an action occurs it will add +1 to the counter, so that when I read the counters value later, it will have adjusted. 

 

So for example:

Counter = 0.

Action 1 performed, add + 1 to Counter.

Counter = 1. 

How much does Counter =?

Counter = 1. 

Action 1 performed, add + 1 to Counter.

How much does Counter =?

Counter = 2. 

 

Edited by creationx

Awesome, thanks loudpacks! I have another question: 

 

I want to find the color of something in a specific area on the screen and click it, how would I go about doing that?

 

I know Scar use to be FindColorTolerance(x, y, COLOR, x1, y1, x2, y2, tolerance); but I can't seem to find the mirror code here in OSBot.

 

 

edit: while I'm here I'll just ask all the questions I have:

 

I want to log data for the script to use later, how would I go about doing that?

Basically like creating a counter : so that everytime an action occurs it will add +1 to the counter, so that when I read the counters value later, it will have adjusted. 

 

So for example:

Counter = 0.

Action 1 performed, add + 1 to Counter.

Counter = 1. 

How much does Counter =?

Counter = 1. 

Action 1 performed, add + 1 to Counter.

How much does Counter =?

Counter = 2. 

 

LOL have you read the API? Use interactions.

 

Then you can do:

int count = 0;

if(getItems().closest("Dildo") != null && getItems().closest("Dildo").interact("Take"){
count++;
log(count);
//sleep
}

Edited by LoudPacks

  • Author

I have read the API, but I have troubles understanding how to implement what it says. Please understand I'm new to Java and still learning. Thank you for your help guys.

I have read the API, but I have troubles understanding how to implement what it says. Please understand I'm new to Java and still learning. Thank you for your help guys.

is allg, was just linking it incase u didnt see it :)

I have read the API, but I have troubles understanding how to implement what it says. Please understand I'm new to Java and still learning. Thank you for your help guys.

 

I would suggest following the Tea Stall guide by Apaec in the scripting tutorial section.

You can make your own class with an internal Timer to check on conditions to increase your values. Add a getter for you to retrieve the values.

 

Idk why you would need color detection, but try looking at the ColorPicker, that's all we have.

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.