-
Pick certain amount of items
After this question I promise I'll stop beating a dead horse: What I did was create an object using the RS2Object method and outputted the ID RS2Object redberries = getObjects().closest("Redberry bush"); log(redberries.getId()); I fully comprehend your point about checking the length of the modelID array, but with the code I posted, the log shows "23628" when there are berries, and then "23629" when there are no berries. Knowing this, couldn't I simply redeclare the bush variable to an object with an ID of 23628 instead of 23629? Nvm, the solution by FuryShark truly is far cleaner and more sufficient. BravoTaco, thank you again for the detailed explanation. You're an excellent teacher. For anyone that stumbles on this thread weeks/months/years from now, here is my code and I implemented FuryShark's solution if (!(getInventory().getAmount("Redberries") >= 3)) { walk(redberryArea); RS2Object redberryBush = getObjects().closest(o -> o.getName().endsWith("Redberry bush") && o.getModelIds().length > 1); if (redberryBush.exists()) if (redberryBush.isVisible()) if (redberryBush != null) { int redberryCount = Math.toIntExact(getInventory().getAmount("Redberries")); redberryBush.interact("Pick-from"); Sleep.sleepUntil(() -> getInventory().getAmount("Redberries") > redberryCount, 5000); } }
-
Pick certain amount of items
That all makes perfect. On a different note however, wouldn't it be possible to simply select the nearest bush by the desired ID? For example if the bush's ID changes, couldn't I then just reselect the other bush based on it's ID? So basically if (!(getObjects().closest(modelID)) == desiredID) I know thats not proper syntax but along those lines
-
Pick certain amount of items
Can you expand on this? Will it also target Cadava bushes?
-
Pick certain amount of items
This is why I love this site. Thank you for the detailed answer. The only problem is, with your solution, it still tries picking from the bush even if there's no berries and it still increments the for loop, so I eventually run away. Is there a way to monitor the chat for the error it spits out when there's nothing left on the bush?
-
Pick certain amount of items
I know this is a very simple concept but for some reason I'm struggling. I'm making a script to complete Goblin Diplomacy and I need to pick exactly 3 redberries. I know there's something inherently wrong with it, but here's my for loop thus far if (!(getInventory().getAmount("Redberries") == 3)) { walk(redberriesArea); RS2Object redberries = getObjects().closest("Redberry bush"); for (int i=0; i<4; i++) { int berryCount = i; redberries.interact("Pick-from"); Sleep.sleepUntil(() -> getInventory().getAmount("Redberries") == berryCount + 1, 5000); } } What am I doing wrong? It won't pick exactly 3, it'll pick one and then move on with the script, which makes the character run to a different area. Sometimes it'll pick 1, I think it's picked 2 before too.
-
Bots getting banned during tutorial island
Aah I see. And no, I have not used a proxy or VPN. I did however signup for large amounts of OSRS accounts in such a short period of time that I was prompted for a human-verification. I'll try verifying emails. Thanks all
-
Bots getting banned during tutorial island
You mean after the account has been created?
-
Bots getting banned during tutorial island
I made a bunch of accounts with temp emails and then loaded them into osbot. I was going to complete Tut island with Explv's script one-by-one, but it seems as though Jagex switched something up. I've used Explv's tutorial island probably a hundred times and never once did it cause a ban. It's an excellent script. But it seems as though Jagex may have caught on. Of the 4 accounts I've tried running through Tut island with Explv's script, 3 were suddenly logged out with the message "Account locked as we suspect it has been stolen" I know this is common and I'm not surprised it's happening. I'm not asking for a fix or complaining, just wondering if anyone has noticed this as well
-
[Quest] Rune Mysteries
Will do, if not for this little script then for the other stuff I'm working. I definitely catch nullpointers in the log all the time, something I need to improve on. I just got more acquainted with the dialogue side of the API so I'll make sure to brush up on more. Thanks man
-
[Quest] Rune Mysteries
Been working on an all-in-one trade restriction lifter, which includes getting 10qp. It's just easier to do Romeo & Juliet and Goblin Diplomacy. I doubt anyone will need it but here's a simple script to finish Rune Mysteries public Area dukeHoracioArea = new Area(3208, 3224, 3213, 3218).setPlane(1); public Area wizardTower = new Area(3102, 3164, 3104, 3163); public Area wizardTowerBasement = new Area(3101, 9574, 3107, 9567).setPlane(0); public Area varrockShop = new Area(3251, 3401, 3254, 3400); private void runeMysteries() throws InterruptedException { NPC dukeHoracio = getNpcs().closest("Duke Horacio"); NPC sedridor = getNpcs().closest("Sedridor"); NPC aubury = getNpcs().closest("Aubury"); if (configs.get(63) == 0) { walk(dukeHoracioArea); dukeHoracio.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && dialogues.completeDialogueU("Have you any quests for me?", "Sure, no problem."), 5000); } if (configs.get(63) == 1 || configs.get(63) == 2) { walk(wizardTowerBasement); sedridor.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && dialogues.completeDialogueU("I'm looking for the head wizard.", "Ok, here you are.", "Yes, certainly."), 5000); } if (configs.get(63) == 3) { walk(varrockShop); aubury.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && dialogues.completeDialogueU("I have been sent here with a package for you."), 5000); } if (configs.get(63) == 4) { aubury.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && !getDialogues().inDialogue(), 5000); } if (configs.get(63) == 5) { walk(wizardTowerBasement); sedridor.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && !getDialogues().inDialogue(), 20000); } } public void walk(Area x) throws InterruptedException { if (!x.contains(myPosition())) getWalking().webWalk(x); } I'm sure there's plenty to be improved upon but I figured maybe it'll help someone.
-
Pass Area variable to method
Makes so much more sense. Thank you!
-
Pass Area variable to method
Awesome thanks man, that works. I had it set up like that but I didn't know the x was interchangeable. The x is just a placeholder and can be changed out with anything right? Like I could do private void walk(Area flippityFloppityFloomSham) { if(!flippityFloppityFloomSham.contains(myPositions())){ getWalking().webWalk(flippityFloppityFloomSham); } } And it would work the same, right? Thanks again
-
Pass Area variable to method
I apologize for asking another question so quickly. I want to create a reusable method for webwalking so I don't have to keep typing it out. Basically I want to do this: private void walk() { if (!x.contains(myPosition())) { getWalking().webWalk(x); Sleep.sleepUntil(() -> x.contains(myPosition()), 2000); sleep(random(100, 500)); } And I want to be able to call the method by doing walk(x); Somewhere in the script. So that I could change x to a different area, like "walk(cowArea);" or "walk(giantArea);" whenever I need. I know this is easy but it's kicking my ass.
-
Dialog box with multiple drop menus in one
I saw the GUI section in Explv's tutorial but for some reason didn't give it a chance. I should have read it further, thank you. And thank you for linking the other tutorial. I'll read through them thoroughly and get better acquainted.
-
Dialog box with multiple drop menus in one
I promise when I say, I have been searching endlessly, both on osbot and elsewhere for an answer to my question. Can someone point me in the direction of a tutorial or write-up on how to do a simple dialog box with multiple drop boxes? Basically I'm trying to make a script that, when it starts, it asks the user several questions and carries out the script based on those answers. I'd prefer the drop down boxes to be on the same single dialog pop-up instead of them popping up one after the other. I did read a question that said I have to create two JComboBoxes, place them in a JPanel and then place that JPanel into the JOptionPane's Object parameter". Which is cool and all but idk how to do that. Thanks