-
Posts
11146 -
Joined
-
Last visited
-
Days Won
91 -
Feedback
100%
Everything posted by Apaec
-
Looks good, but you don't need any lists! A method would just take in the parameters and perform the checks on them. You know the amount of an item by getInventory().getAmount() - make sure you have some though, otherwise this will throw an error. This should get you started, wrote it in reply box so apologies if there are any errors! private boolean withdrawItem(String itemName, int amount, boolean noted, boolean stackable) { if (!stackable && amount>28) return false; // illegal argument if (getBank().isOpen()) { // make sure bank is open int currentAmount = getInventory().contains(itemName) ? getInventory().getAmoumt(itemName) : 0; int amountNeeded = amount - currentAmount; if (amountNeeded > 0) { // Withdraw some! } else if (amountNeeded < 0) { // Deposit some! } else return true; // We already have the right amount! } else return false; }
-
Perhaps try writing your own withdrawing method, which takes a string item and int amount, and maybe some other parameters such as booleans for noted, stackable etc. Then this method would do different things based on the bank status, e.g if you already have a certain number and more, it would deposit instead of withdraw, if you don't have any it would stop, etc. Might be a good project for you to work on!
-
Having a look at your code, you appear to be making a very common mistake with beginners - not considering that OSRS is a live game. Issues such as latency fluctuations can mean any given line isn't guaranteed to execute, even though it might seem like most of the time it is successful. To account for this, you have to make all of your code conditional. This means nesting your code with checks to make sure it does one interaction at a time per loop, and at no point in your code should any line rely on another to successfully execute. I know you have got the opening correct, however the following example is just to illustrate a point: For example, consider the code: getBank().open(); getBank().depositAll(); What if the first line fails to successfully open the bank? Then the second line will cause a horrible error to be thrown in the logger, and your script will fail. The key too a good script is reliability - here's a better way of structuring the above code (and you will need to do this for all of your withdrawing): if (getBank().isOpen() { if (!getInventory().isEmpty() { getBank().depositAll(); } } else { getBank().open(); } Of course you would probably need to add conditional sleeps in there, where appropriate, to avoid spam-clicking. Secondly, you're using a huge amount of static sleeps. BAD!! Make them conditional (to prevent spam-clicking) or remove them altogether - they would not be allowed on the SDN anyway! Good luck!
-
- 12 replies
-
Reliable, well written, and around for a long time!
- 12 replies
-
Congratulations!!! (: 99 str on an obby in just under 15 days is awesome Also, if you've got a spare minute, I would greatly appreciate it if you could drop a quick review on the store here https://osbot.org/forum/store/product/643-apa-sand-crabs/ (: Cheers, Apa
-
Sure, done! Have you considered Sand Crabs?
-
Why shouldn't the conditional sleep be inside the if? ConditionalSleep#sleep returns a boolean (relating to the success), and as such can be used for conditional/ternary expressions. @Lychees You need to find some other way to check this! Perhaps implement some kind of inventory listener of your own design, or have a concurrent timer counting the time since a pizza base was last made? -Apa
-
If you're unsure about what's going on, i'd suggest switching over to a slightly simpler structure: the 'if' statement! Work straight in the onLoop. For example: if (getBank().isOpen() { if (!getInventory().isEmpty() { getBank().depositAll(); } } else { getBank().open(); } At some point, I will update my guide as I think it's a little too abstracted for a beginner to programming altogether. Apa
-
Not sure have a look at the log file, see what it says, and maybe try googling ?
-
On request - I wouldn't consider it an issue; i'd just consider this update a feature!: Version 3.05 Prevented the script from depositing runes. The script will still deposit everything else that it does not need! Added checks for inventory over-configuration while banking If you have runes in your inventory, please account for this yourself by ensuring you leave free slots in the gui inventory set up! Please set up the auto-casting for your spell manually before starting the script. Please allow time for the developers to verify the update and push it live; this normally takes less than 24 hours. Please the latest version is running before reporting any issues. Apa
-
Good luck with this project (:
-
I'm sorry to hear that ): It happens though... 80 cooking is a good achievement, but hopefully the next account you bot will last longer!!! Apa
-
Sure, done! Woo, awesome once again!! (: Thanks for sharing this one as well!!!!! 2.3M exp... wow! Edit: You've almost got a skillcape worth of exp! Sure thing, done!!
-
Hey, Unfortunately probably not with the script at this price, since if I were to add one pie, I would have to add them all along side all pizzas and other special food items. Perhaps in another script though down the road some time! Sure thing, done!( : Apa
-
I aim to get this done today or tomorrow! Not sure where this error is coming from; seems to be a stack trace from client code. Are you sure this is at the bottom of the logger when the script is stopping?
-
Sure, no problem. I've just started a trial for the sand crabs script for you; enjoy!(:
-
It's up to you with the times, there's no 'optimum' set up. Just think of it this way - the less you bot, the less likely you are to get banned. 2 hour botting sessions are quite long, that's longer that I personally would bot in one day. It's up to you though, it's a compromise between xp gains and chances of a ban! Apa
-
Just set breaks up as you would for any other script through the options menu; the script will make sure that you break safely. Apa
-
Apologies; I thought when you said you were combining items, you meant for example putting toppings on pizza; and I concluded you were attempting to sleep until, for example, there are no tomatoes left in your inventory, with a time out of 1 minute say. Guthix teas is a bit different; not entirely sure how they work but i'm sure you will find a neat solution - good luck!