Jump to content

Butters

Lifetime Sponsor
  • Posts

    650
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Butters

  1. Well he started on the right track and knows what he is doing. Best of luck
  2. God damn so much spam on such an awesome thread. @progamerz you clearly have a problem in your getLobbyButton() method. Just catch that pesky nullPointer and wait until everything is loaded for it to execute properly. Here's mine public RS2Widget getLobbyButton() { try { RS2Widget lobbyButton = widgets.getWidgetContainingText("CLICK HERE TO PLAY"); if (lobbyButton != null) { return lobbyButton; } } catch (NullPointerException e) { s.log("Didn't find lobby button"); } return null; }
  3. Great idea. If I understood correctly, just run login event on a separate thread?
  4. On a very similar note, just started using IntelliJ and am having trouble exporting a JavaFX project as a runnable jar with dependencies (external libs) into A SINGLE RUNNABLE JAR FILE. Exports the dependencies into the same folder as the jar, but not inside the jar itself. In Artifacts -> Output layout tab: Dragging the eternal jars into the jar I want them to be in doesn't help. Still exports outside the jar. If I do "Extract into Output root" on the desired library and then drag the extracted folders inside the "jar to be made" then all seems ok, but something messes up and the jar does't launch due to Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes Any ideas how to properly export a JavaFX project with dependencies into a single runnable jar?
  5. Yep, same thoughts here. I'm not using anything fancy really int onLoop() { if (client.isLoggedIn()) doTasks(); else initLoginHandler(); } Each webwalkevent/walkevent has a break condition to stop exuting if logged out new Condition() { @Override public boolean evaluate() { if (!s.client.isLoggedIn()) return true; return false; } }; if any of the tasks do a ton of things during one loop iteration, just check if the client is logged inside there. A horrible example but still: // NO NO NO public void catchFish() { while (!inventory.isFull) catchSomeFishies(); } // YES YES YES public void catchFish() { while(client.isLoggedIn() && !inventory.isFull) catchSomeFishies()' } Can write everything properly, but you get the gist of it
  6. If they work well on your other machine and not on dedi probably means that you didn't authenticate your dedicated server ip
  7. not a 100% one but seems to work. Based on guesses mostly. If you get logged out while doing webwalking or some other activity that's basically a loop and requires being logged in, that activity doesn't really end. I've made sure that all these activities stop executing if the bot is logged out. Saw only 1 bot fail out of 100 so far.
  8. The likelihood of all 3 scripts being broken is close to 0. In any case click Settings -> Logger and see if there are any errors present when you run the script.
  9. Either the scripts are broken or you don't press "Start" on them
  10. Yep you can do whatever you want with this info, as long the script starts
  11. Yep, there are dependencies for http components, all of which are included and tested outside OSBot. As I understood from Alek, OSBot is ok with this, I'm just not doing this properly.
  12. Thank you for the heads up, appreciate it. Regarding this. I have two noobish questions: 1) Apart from SDN, why shouldn't it work if I add all the mentioned jars to the build path in Eclipse? During script export all is well and no errors. Clearly the class in question isn't found at runtime. 2) Actually ashamed to ask this but how do you import the source code for this properly? Put everything by hand to correct packages/folders where the classes expect they would be? Cause tried importing the source in various ways and failed.
  13. Hello, Having troubles when running HttpClient within osbot. Is it even allowed? Doesn't throw any security exceptions. Using same logic and etc outside OSBot. Using: httpclient-osgi-4.3.jar (works outside of OSBot). Tried other versions as well. Added this to classpath of course. Using when in onStart(): HttpClient client = new DefaultHttpClient(); Error: [INFO][09/19 09:46:54 AM]: Started bot #1 Starting script... Loaded 18 local scripts and 63 SDN scripts. [ERROR][09/19 09:46:57 AM]: Uncaught exception! java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.getConstructor(Unknown Source) at org.osbot.Xb.run(um:268) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.http.client.HttpClient at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 8 more
  14. I think you can't access the inbuilt break handler from a script. You can either speculate on the given break time values, but this would be messy and not bulletproof most likely. Best to write your own break handler.
  15. So I'm trying to use path walking instead of webwalking wherever I can. The problem I'm facing is what if a bot enters a location accidentally from which it can't go out without handling obstacles? WalkingEvent walkEvent = new WalkingEvent(); walkEvent.setPath(path); // walkEvent.setBreakCondition(new Condition() { // @Override // public boolean evaluate() { // return (?????????); // } // }); s.execute(walkEvent); if (walkEvent.hasFailed()) s.log("Walk event failed"); Seems like hasFailed() never really fires. Event just clicks on the minimap on the next position. Planning to use webwalking if path walking fails. So the question is: Is it possible to evaluate if a bot can reach the next desired position in WalkingEvents' position list? Would like not to do calculations of which position the bot is currently closest to in the provided list myself, the idea here is to save cpu power. Maybe set the break condition to check if the bot is not moving for more than, say, 5 seconds and then break the event? So basically, what would be the cleanest, most efficient way in doing this?
×
×
  • Create New...