badjie
-
Posts
12 -
Joined
-
Last visited
-
Feedback
0%
Posts posted by badjie
-
-
23 minutes ago, Apaec said:
Yep, that's more or less what is going on. It looks a bit complicated and is certainly advanced syntax (it's an anonymous instantiation) so don't worry too much if you're not comfortable with it.
Just wondering do most paid scripts use advanced java knowledge (like anonymous instantiation) or can most of them be acomplished through simple use of the api capabilities?
-
alright, i think i get the idea thank you everyone!
-
18 minutes ago, Wisply said:
yeah for mass botting its normally just suicide botting everything, but if youre doing something with higher reqs like zulrah you could buy a zulrah ready account or pay someone to get an account zulrah ready
so it's better to get accounts that are already ready to do high lvl content
-
Do people that massbot do it by suicidebotting? do they just bot right from tut island, bot all the quests basically 100% botted. Curious to know since people that have 1/2 bots usually take better "care" of the accounts since they do not need that much time to manually setup compared to mass botters who can't be bothered to manually do quests and tut island on like 50 accounts. Wondering what's the process like thanks!
-
8 hours ago, Apaec said:
Hmm, this is certainly a niche situation, but can definitely be done. Might be a little trickier though. Typically, when the players inventory is full of junk so a script cannot run, the script should either terminate and let the player know this, or do something loss-less, such as going to a bank and depositing the junk. Arbitrarily dropping items isn't a great idea in general: what is the inventory was full of godswords?
Anyway, to achieve what you're looking for, the default API entries won't seem to provide this functionality. We'll have to create our own filter:
(Note that I haven't tested this code and wrote it here in the reply box so there could be errors, let me know if it doesn't work!)
if (getInventory().isFull()) { getInventory().dropForFilter(new Filter<Item>(){ @Override public boolean match(Item x) { return !x.getName().equals("Cup of Tea"); } }); }
Oh i see what you did there! just to make sure you are basically making a filter for an item, then you create a method with the argument x, and make it return an item thats NOT x and then you pass that to the filter? i currently have no way to test it since i have a main rs account and i dont want to test it on a bot and get my ip flagged. I still need to take care of that later(prob getting a proxy). Anyways, the important thing is that i think i understood how it works. Thanks once again!
- 1
-
1 hour ago, Apaec said:
Sounds like the relevant part of the API to you would be the inventory API: https://osbot.org/api/org/osbot/rs07/api/Inventory.html
Something like inventory#dropAllExcept sounds about right. For example:
if (getInventory().isFull()) { getInventory().dropAllExcept("Cup of Tea"); }
what if i dont want to drop everything, and instead just 1 thing at a time? that's my real problem cuz i can't find anything for that
-
public int onLoop() throws InterruptedException {
RS2Object stall = getObject().closest("Tea Stall");
if (getInventory().contains("Cup of Tea")) {
getInventory().drop("Cup of Tea");
sleep(700);
}
else if (stall != null && !myPlayer().isAnimating) {
stall.interact("Steal-From");
log ("Stall Here!");
sleep(700);
}
return random(200, 300);
}So my inventory can be full and NOT have tea (just full with other items), i was thinking about doing something like
if ( getInventory().isFull() AND getInventory().contains("anything other than tea") ) {
getInventory().drop("a random item in my inventory")
I've been looking on the API but im not sure how to check for "anything other than tea" and how to drop a random item in my inventory.
-
I actually have 1 more question,
getObjects().closest()
what is the "." just before "closest" doing? i also didnt find anything on the api so im assuming its a language thing
- 1
-
13 hours ago, Apaec said:
Exactly
Thank you for the fast answers!
-
On 8/15/2014 at 9:51 AM, Apaec said:
RS2Object stall = getObjects().closest("Tea Stall"); if (stall != null && !myPlayer().isAnimating()) { stall.interact("Steal-from"); } // ...
So here the !myPlayer().isAnimating() part is basically saying if my player is NOT(negating with !) in the middle of an animation?
-
I recently got into scripting and im having some difficulties searching for stuff i need in the api, i know what i need but i have trouble finding what is the right method to use and how to use it. For example the myPlayer method, there's no way i would know that i need to do !myPlayer instead of myPlayer. Also if i find a method, i dont know what do i have to import in order to use it. Sorry for the noob question but essencially if i know how to search the api, i would script much faster since i have some programming knowledge already. Thanks!
A Beginners Guide to Writing OSBot Scripts (where to get started!) by Apaec
in Tutorials
Posted
thank you so much man!