Jump to content

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


Recommended Posts

Posted

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?

 

 

Posted (edited)

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
Posted (edited)

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
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...