creationx Posted January 31, 2016 Share Posted January 31, 2016 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? Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted January 31, 2016 Share Posted January 31, 2016 (edited) long salmonCount = getInventory().getAmount("Salmon"); long salmonCount = getBank().getAmount("Salmon"); Edited January 31, 2016 by LoudPacks 1 Quote Link to comment Share on other sites More sharing options...
creationx Posted January 31, 2016 Author Share Posted January 31, 2016 (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 January 31, 2016 by creationx Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted January 31, 2016 Share Posted January 31, 2016 (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 January 31, 2016 by LoudPacks 1 Quote Link to comment Share on other sites More sharing options...
BurritoBug Posted January 31, 2016 Share Posted January 31, 2016 http://osbot.org/api/ Quote Link to comment Share on other sites More sharing options...
creationx Posted January 31, 2016 Author Share Posted January 31, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
BurritoBug Posted January 31, 2016 Share Posted January 31, 2016 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 1 Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted January 31, 2016 Share Posted January 31, 2016 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. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted January 31, 2016 Share Posted January 31, 2016 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. Quote Link to comment Share on other sites More sharing options...