-
Posts
650 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by Butters
-
Try to get your object by position. Write a filter something like RS2Object ladder = s.objects.closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return obj.getName().equals("Ladder") && obj.hasAction("Climb-Up") && obj.getPosition().getX() >= X_COORDINATE; } }); And also you can add a fail-safe if he accidentally still misclicks. Something like if you're in an area that you don't want to be in - climb back up and try again Lol they don't change id's each update But yeah, you're right, bad practice.
-
How do I get my account name and password set for automatic login?
Butters replied to dmrfc92's topic in General Help
This is accomplished by launching a script via CLI. Open a command line window or terminal if you're on Linux and go to the folder where OSbot is at. then type java -jar "osbot 2.4.107.jar" -login YOUR_LOGIN:YOUR_PASS if you want to launch a script type java -jar "osbot 2.4.107.jar" -login YOUR_LOGIN:YOUR_PASS -bot BOT_LOGIN_NAME:BOT_PASS:0000 -script SCRIPT_ID_OR_NAME:null or script parameters instead of null. Refer to CLI usage thread for more -
Just to let you know, this bug was present in stealth injection mode yesterday (about 30 hours ago). I've coppied the log in this thread http://osbot.org/forum/topic/113362-24107-entity-hover-debug/#entry1275112 . Though everything seems to be fine today, so dunno what happened. By the way thanks for constantly expanding CLI capabilities. Really usefull
-
Had a very similar problem, though using stealth injection [ERROR][Bot #1][01/05 05:23:27 AM]: Error in bot executor! java.lang.AbstractMethodError: client.getTileVisibilityArray()[[Z at org.osbot.rs07.api.map.Position.isVisible(ti:150) at org.osbot.rs07.event.WebWalkEvent.execute(fp:761) at org.osbot.rs07.event.EventExecutor$2.run(xg:188) at org.osbot.rs07.event.EventExecutor.execute(xg:201) at org.osbot.rs07.script.MethodProvider.execute(rh:650)
-
Having exactly the same problem. Any idea how to fix this?
-
/*chckbxAutoGE.addActionListener(e -> { if (chckbxAutoGE.isSelected()) { spinnerHides.setEnabled(true); } else { spinnerHides.setEnabled(false); } });*/ Why is this part commented out? Should work
-
Maybe you're going the right way, but what I did is I used ActionListener instead of a ItemListener and everything worked fine private void muleCheckActionPerformed(java.awt.event.ActionEvent evt) { if (muleCheck.isSelected()) { fisherCheck1.setSelected(false); fisherPanel.setEnabled(false); mulePanel.setEnabled(true); for (java.awt.Component comp : mulePanel.getComponents()) { comp.setEnabled(true); } for (java.awt.Component comp : fisherPanel.getComponents()) { comp.setEnabled(false); } } } This disables/enables one of the two JPanels and all of it's components depending on which checkbox is selected. Code is for one checkBox only
-
I've added a break condition if the bot is in an area that I don't want it to be and then redirect him around that area, so the web walking could resume. I do hope that there is a better solution
-
Any idea how to avoid certain areas while webwalking? To be exact how to avoid going to the Dwarven mines from Falador by using the mining guild ladder? Another question would be how to check if a WebWalkEvent has was breaked?
-
Damn, thanks and sorry. Slipped through my eyes.
-
Thanks. How do to check what the "30" in getLoginStateValue() stands for? And isn't this if(getClient().getLoginState().equals(Client.LoginState.LOGGED_IN)) the same as client.isLoggedIn() ?
-
Problem could be the item not being null but the player not moving. Don't really know the specifics for this but what I usually do is: if (myPlayer().isMoving()) { // Reset the timer if the player is moving idleTime = System.currentTimeMillis(); } newTime = (System.currentTimeMillis() - idleTime); if (newTime >= 30000) { //stuff idleTime = (System.currentTimeMillis()); } If everything is going well, reset the idleTime. If things are not going well then it will do something after 30 seconds and reset the timer
-
Great idea! Will test it
-
What's the best way to definitely know if you are logged in? client.isLoggedIn() ^ This returns true as soon as I get to the welcome screen (or even sooner). Even after pressing "Play" on the welcome screen there's a delay where it loads the maps or something. The problem I get is that I get tons of null pointer exceptions and this skips at least one tick of my loop. Also, when world hopping I believe that you get logged out for a little while (correct me if I'm wrong) and this launches my login event handler, which of course spouts out a ton of errors. By the way, after logging in I use worlds.getCurrentWorld() to check if I'm on the world I need to be, and when I do worlds.hop() the previous method gives me nullPointers. I do understand that when hopping there's some time when you are not in a world, but would like to handle or even evade these errors. Maybe use LoginStages? http://osbot.org/api/org/osbot/rs07/api/Client.LoginStage.html or maybe use LoginStates? http://osbot.org/api/org/osbot/rs07/api/Client.LoginState.html If so, which combination of these two would let me know that I can do script specific stuff (logged in and ready to go), like open a bank booth.
-
Launch a script which's name has spaces from CLI
Butters replied to Butters's topic in Scripting Help
Sadly none of the above options work -
If you use walking.webwalk then basically no. Try to create a WalkingEvent and set some break conditions
-
Launch a script which's name has spaces from CLI
Butters replied to Butters's topic in Scripting Help
Thanks, tried this and it didn't work SCRIPT="My\ Script:null" java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script $SCRIPT $BOT1WORLD Gonna try with two \\ when I get on my other PC. The idea behind this is to launch like 10 bots with the same script, so thought that storing script params to variables would make it cleaner and easier to manage -
Launch a script which's name has spaces from CLI
Butters replied to Butters's topic in Scripting Help
Sorry for misleading you. Yep, both your and Abuses' options work fine. The problem is that I want to store the script params in a variable and then add it to the java -jar line. For example this works fine: java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script My\ Script:null $BOT1WORLD Though this doesn't find the script SCRIPT="-script My\ Script:null" java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 $SCRIPT $BOT1WORLD By the way, a noob question. What does the "\" actually do? And even so, how to understand this syntax that you've provided? "\"My Script\":null" -
Well this will sleep UNTIL you are in dialogue or if you don't have 14 items in inventory. So dunno if this is what you want
-
I can't remember if there's a method something like inventory.interactAll("Item", "Use") and interact with a another item. You can simply always check if (inventory.getAmount("Item1) > 0 || inventory.getAmount("Item2) > 0) { // Do some interacting } If a level up dialog appears it will simply keep on interacting cause the above mentioned condition will still be true. Also you can add (though I don't think you need it) something like if(dialogues.isPendingContinuation()) { dialogues.clickContinue(); } Don't have an IDE running so the method names might be a bit off. This will click continue on the "You have leveled up" screen
-
Launch a script which's name has spaces from CLI
Butters replied to Butters's topic in Scripting Help
It works great on Windows. Failed to launch it on Linux, any ideas? Super easy for my own scripts. Problem when I want to launch a script that someone else made. And I find decompiling it unethical -
Conditional sleep is your friend new ConditionalSleep(2000, 100) { @[member=Override] public boolean condition() throws InterruptedException { return bank.withdraw("Item", 14); } }.sleep(); This will wait until it withdraws 14 "Items" from bank
-
Launch a script which's name has spaces from CLI
Butters replied to Butters's topic in Scripting Help
Kudos Lemons, works great -
Hey, the title says it all. I am familiar with launching OSbot from CLI so this is only about the -script part Let's say I have a local script called "My Script". How to launch it in Windows/Linux? I've tried noob stuff like without commas -script My Script:null with commas -script "My Script:null" name with commas, params nor -script "My Script":nulll Nothing works
-
The idea behind this is that you can configure your farm and start it automatically. If you have good scripts which support CLI and muling you can launch your bots and go on a pub crawl for three days. For a very very simple example imagine you write a bat file which launches 10 bots. You launch it, it launches 10 bots which cur yew logs and trades them to the mule. At the end of the day you log in to the mule, sell the logs - profit.