ItPoke Posted January 29, 2019 Share Posted January 29, 2019 (edited) @Imthabawse Read up on the api, it's super usefull! https://osbot.org/api/ You will find that it has an inventory method. getInventory(); This method actually has a build in drop all function. dropAll() Drops all the items. getInventory().dropAll(); This also returns a boolean (true or falese) So you can check if it succsfully dropped all items. More so you can add a filter to this function so that for example it only drops items containing the word log. (This is a bit more advanced) dropAll(Filter<Item>... filters) Drops all the items in the filters. getInventory().dropAll(item -> item.nameContains("log")); Again this returns a boolean so you can check if you dropped the items correctly! These drop functions uses shift dropping if it's enabled. Edited January 29, 2019 by ItPoke 1 Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted January 29, 2019 Share Posted January 29, 2019 @Malcolm @ItPoke Thank you guys for the feedback i'll have to tinker around with this when I get the time. Quote Link to comment Share on other sites More sharing options...
LooneyToons Posted February 3, 2019 Share Posted February 3, 2019 I've followed your guide, but after I compile the code to the tar file, how do I run it myself to test? Quote Link to comment Share on other sites More sharing options...
Apaec Posted February 3, 2019 Author Share Posted February 3, 2019 3 hours ago, LooneyToons said: I've followed your guide, but after I compile the code to the tar file, how do I run it myself to test? You put it in the OSBot data folder and then run it with OSBot Quote Link to comment Share on other sites More sharing options...
LooneyToons Posted February 3, 2019 Share Posted February 3, 2019 (edited) 17 hours ago, Apaec said: You put it in the OSBot data folder and then run it with OSBot Nevermind programerz helped me out and walked me thru the bug! Edited February 4, 2019 by LooneyToons 1 Quote Link to comment Share on other sites More sharing options...
mitsuki Posted February 16, 2019 Share Posted February 16, 2019 (edited) So, say i wanted to use an item with a fire, how would i do this? Like this? if (getInventory().isFull()) { getInventory().contains("Trout"); { getInventory().use("Trout") RS2Object Fire = getObjects().closest("Fire");; } I've been trying to find how to use fires to cook in the api, but can't find an object, or interactable for fire Edited February 17, 2019 by mitsuki Quote Link to comment Share on other sites More sharing options...
Apaec Posted February 17, 2019 Author Share Posted February 17, 2019 11 hours ago, mitsuki said: So, say i wanted to use an item with a fire, how would i do this? Like this? if (getInventory().isFull()) { getInventory().contains("Trout"); { getInventory().use("Trout") RS2Object Fire = getObjects().closest("Fire");; } I've been trying to find how to use fires to cook in the api, but can't find an object, or interactable for fire Well, it looks like you've correctly defined the fire: RS2Object fire = getObjects().closest("Fire"); Then all you have to do is select the item in your inventory: getInventory().interact("Trout", "Use"); .. and once that is selected (you will have to add checks for this), you can interact with the fire: fire.interact("Use"); -Apa Quote Link to comment Share on other sites More sharing options...
mitsuki Posted February 17, 2019 Share Posted February 17, 2019 if (getInventory().isFull()) { getInventory().contains("Trout"); { RS2Object Fire = getObjects().closest("Fire"); { getInventory().interact("Trout", "Use"); { fire.interact("Use); } } } So it would be like that? I'm just confused because i didn't find anything about using a fire or anything in the api. Cheers for the help Quote Link to comment Share on other sites More sharing options...
extatus Posted February 17, 2019 Share Posted February 17, 2019 (edited) 1 hour ago, mitsuki said: if (getInventory().isFull()) { getInventory().contains("Trout"); { RS2Object Fire = getObjects().closest("Fire"); { getInventory().interact("Trout", "Use"); { fire.interact("Use); } } } So it would be like that? I'm just confused because i didn't find anything about using a fire or anything in the api. Cheers for the help kinda inefficient-> its going to resupply with 27 or 26 raw trout. try to use: for loops, or events Edited February 17, 2019 by extatus 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted February 17, 2019 Author Share Posted February 17, 2019 3 hours ago, mitsuki said: if (getInventory().isFull()) { getInventory().contains("Trout"); { RS2Object Fire = getObjects().closest("Fire"); { getInventory().interact("Trout", "Use"); { fire.interact("Use); } } } So it would be like that? I'm just confused because i didn't find anything about using a fire or anything in the api. Cheers for the help There's no specific reference to 'fire' in the API - we're working with Java objects here. It seems you've got the brackets and semi colons a little confused as well, it might be worth looking up some basic java tutorials to get the basics down before trying to do this Apa 1 Quote Link to comment Share on other sites More sharing options...
mitsuki Posted February 17, 2019 Share Posted February 17, 2019 1 hour ago, extatus said: kinda inefficient-> its going to resupply with 27 or 26 raw trout. try to use: for loops, or events Ohh, i thought that everything within the curly brackets would be handled first, so if you nest another line of code within another set of them, i thought that would happen first 9 minutes ago, Apaec said: There's no specific reference to 'fire' in the API - we're working with Java objects here. It seems you've got the brackets and semi colons a little confused as well, it might be worth looking up some basic java tutorials to get the basics down before trying to do this Apa okay, thanks guys Quote Link to comment Share on other sites More sharing options...
laxdude815 Posted June 6, 2019 Share Posted June 6, 2019 @Apaec - This is a fantastic guide. We all very much appreciate you taking the time to create this. Thanks I'm familiar with basic Java programming concepts but don't know anything about the osbot API, so will have to get used to that and the nomenclature for finding objects around me once i start making scripts. I do have a particular question about the mouse movements, patterns, speeds, etc. How do we control this within our script? My initial thought is that when i pickup something, attack something, etc. using a bot then my mouse will fly across the screen with super precision or just appear elsewhere (as if using a touchpad?) and this would lead me to be banned immediately by the detection software. Does this happen? How do we control these mouse elements which would give away "bot-like behavior" ? And for this very simple tea thieving script that you've written via tutorial - is this actually functional? Or would the script click on the same identical spot of the tea stall and we'd be banned in 10 minutes? I'm trying to understand the level of randomization (mouse speed, pattern, delays, click positions) that is necessary in the scripts so we don't get banned in <10 minutes. (obviously at the beginning levels). Thoughts? And if this has already been discussed in another thread, please direct me to it! thanks! Quote Link to comment Share on other sites More sharing options...
Apaec Posted June 6, 2019 Author Share Posted June 6, 2019 9 hours ago, laxdude815 said: @Apaec - This is a fantastic guide. We all very much appreciate you taking the time to create this. Thanks I'm familiar with basic Java programming concepts but don't know anything about the osbot API, so will have to get used to that and the nomenclature for finding objects around me once i start making scripts. I do have a particular question about the mouse movements, patterns, speeds, etc. How do we control this within our script? My initial thought is that when i pickup something, attack something, etc. using a bot then my mouse will fly across the screen with super precision or just appear elsewhere (as if using a touchpad?) and this would lead me to be banned immediately by the detection software. Does this happen? How do we control these mouse elements which would give away "bot-like behavior" ? And for this very simple tea thieving script that you've written via tutorial - is this actually functional? Or would the script click on the same identical spot of the tea stall and we'd be banned in 10 minutes? I'm trying to understand the level of randomization (mouse speed, pattern, delays, click positions) that is necessary in the scripts so we don't get banned in <10 minutes. (obviously at the beginning levels). Thoughts? And if this has already been discussed in another thread, please direct me to it! thanks! Hey, The API does take a bit of getting used to, but if you've used other APIs in the past, it shouldn't be too bad. As for mouse movements, most of this is abstracted away. OSbot handles all of the low level mouse interactions, and exposes a high level API for you to work with. As a result, the mouse doesn't 'teleport' as you alluded to, rather the movement is smooth and nonlinear. You can visualise this by adding a pixel trail to the mouse pointer in the paint method (or there might be a debug option to enable moues trail? not sure). The tea thieving script is functional, but very basic. For example, it will spam-click the stall when tea is available. Rather than me writing a paragraph about bans, i'd suggest having a read of this: https://osbot.org/forum/topic/124429-preventing-rs-botting-bans-v3/ Best Apa Quote Link to comment Share on other sites More sharing options...
Thclove Posted July 27, 2019 Share Posted July 27, 2019 Love all the info apac, keep on going Quote Link to comment Share on other sites More sharing options...
RSAccountsFarm Posted September 21, 2019 Share Posted September 21, 2019 Thx for all the info i trying to get back into scripting again.I used to develop on other botting websites years ago now I can use your guide to learn thank you. Quote Link to comment Share on other sites More sharing options...