Jump to content

Auron

Members
  • Posts

    130
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Auron

  1. @GunmanDamn, actually I think I've hit a wall here. I had another Jar I needed to add (mysql-connector-java), but if I try and extract that into my script jar, not only do I get a lot of "Failed to load local script" for all the mysql classes, and when I try and run the script, I get java.lang.ExceptionInInitializerError ... Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "setContextClassLoader") I have a feeling there's no workaround for this - is there a way to connect to a local database? Or is the only solution here to create a proxy whereby you have to communicate with http requests or something?
  2. @Gunman Thanks for the reply. Good shout, I forgot about looking in the jar. The jar certainly existed inside the script jar, but it still didn't work. However, I tried extracting the Jar into the output root and it works! (Although I could have sworn I tried that before...) My solution 10 months ago was not putting the Jar in the artifact, but putting the jar on the classpath when running osbot. This is what seems to no longer work. Thanks.
  3. Hi, I'm trying to use an extenal library to handle json parsing (in this case json-simple-1.1.1.jar) This was all working for me fine about 10 months ago, but upon returning, it no longer works, I simply get java.lang.ClassNotFoundException: org.json.simple.parser.ParseException I am using InetIliJ 2021.2.2 Community, and I have: have added the jar as an External library added the jar into the artifact ("Put into Output Root") tried adding the library to a lib directory, and launching osbot using this directory as a classpath. E.G "C:\Program Files\Java\jre1.8.0_301\bin\java.exe" -cp "lib/*" org.osbot.Boot -debug Does anybody have any ideas as to what I could be doing wrong? Has something changed in the last 10 months as to not allow external jars? Thanks a lot! This is essentially a duplicate of the thread below, but the solution does not work for me.
  4. Aw man, sad to see you've quit. Return soon tho, ye? Haha, lambdas are easy brah - they're just methods without a name you create on the fly Nice script
  5. Auron

    Improvements

    Eh why the hell not, I find a sick pleasure in doing so. Pm me
  6. Auron

    Improvements

    I can't really comment on the functionality of the script because it's hard to tell from just a brief look, if it works it works, good job pal. But from a coding point of view there can be a much better way of laying things out. In no particular order of things I picked up on: 1) All the settings checking at the beginning of the onLoop() are good, but only need to be checked once. The way you have it now, it will check these setting every loop. In the GUI, make the start button call a start method, which then checks all these things once, if everything is okay, then set Settings.started to true. 2) Conditional sleep can be separated into a method for neatness sake 3) You have two states, imo it's simply pointless in creating an enum with a getState() function. And it's almost pointless having a getState function if it's a one liner. Not to mention I don't really understand your getState() function, wouldn't this always return Alching? Just do if(*getState code*) { alch(); } else { splash(); } 4) (java conventions) sound like a dick saying this, but for convention sake you should create getters in the Settings class rather than accessing variables directly. It's a good habit to get into. 5) That GUI gui = new GUI(); at the top. I'm sure you can't even do that outside a method. Put it in the constructor of Main. That said, does this code compile? Anyway, it's a great start dude, best of luck in the future.
  7. As said above, stronghold of security is not supported with webwalking. Navigating the stronghold of security is a bit of a ballache. This is how I did it: (it's a bit of a hack and most definitely not the best way to do it, but you get the idea... )
  8. That guide by Apaec is a very good source (first post). If learn by looking at source is your thing, check out some scripts that are open source. But honestly, I know it kinda sucks, learning the basics of java is the best step. Pm me if you are really stuck and I will get back to you if I see it.
  9. Do some debugging, like does it loop? Does getState() return anything? It could be a problem with your logic when finding the state, so it returns null. And I'm pretty sure you can't just check whether your bank contains a certain thing if it isn't open. TBH you should redo getState completely, split it into logical steps. if (!getBank().isOpen()) { getBank().isOpen(); wat And use conditional sleeps, or at least use regular sleeps. if (!getBank().isOpen()) { getBank().open(); getBank().withdraw("Tomato", 14); getBank().close(); sleeeeeep If ya need any help holla
  10. I've often wondered what the 'best' way is to do this. Certainly an easy way is to pass your 'main' object (from main.java) to the GUI class so it can communicate and perhaps say it's started or something. So in your GUI class, create a constructor like: private Main main; public GUI(Main m){ this.main = m; } and, so in your Main class, when you create the GUI object: Gui gui = new Gui(this); And also a setter method for started in Main public void setStarted(boolean b){ this.started = b; } Then in your button listener in your GUI class you can main.setStarted(true); That's a simple way of doing it. You could perhaps have a custom 'Environment' class which stores data like int antibanLikelihood; or boolean started; And you can pass this to the GUI and read off it when you want the information. Hope you understood this. (also, capitalise your class names :p)
  11. Usually go for the £2.35 Carlsberg, £3.00 San Miguel if I want to treat myself. I have been out in centre London where it was verging on £5 a pint where I almost said 'Nah you're alright mate' after he poured it.
  12. Auron

    Overload AIO

    Fairly sure this was you, but you helped me learn the basics of scripting which I was and am very grateful for. I believe you were working on a runecrafting script at the time. Can't say I went very far at the time. I proceeded to go away, learn java and I'm back for another crack at it. Anyway, thanks for that hahaha.
  13. Auron

    Overload AIO

    Major props for releasing the source! Always a really good learning resource. Tutorial island always is a little annoying isn't it ;D Really like the GUI btw, very user friendly. Goodluck with everything On an unrelated note, were you on an undisclosed runescape botting site around 4 years ago?
  14. Auron

    FrostCaves

    Congratulations on the release man! Really piqued my interest when I first saw it in development, top stuff. Interested to see what you'll come out with next.
  15. Oh nice, cheers for this. Will most likely be using. I would add this to save writing a million empty lambda functions public boolean hop(int world) { return hop(world, () -> false); }
  16. I have a method in my main script called changeStateNodes(), and it assesses the current situation and adds only the necessary nodes. When it's obvious that the current active nodes have done their job, I call changeStateNodes(). I'm not sure what your situation is, but perhaps this could be useful?
  17. Yeah I saw that comment on your tutorial island thread, but by that time I already had the Widget thing, and I thought it was pretty inventive so I stuck with. Basically the same thing so works either way :P the progression bar more than likely works off those configs. Don't take this away from me Explv D:
  18. Haha, yeah man I know all your troubles. Thanks for the offer, but I've finished now lol. But it would be good to hear your opinion on some things. In particular clicking continue on interactions, wow that was fun to get around. Also I noticed the way your of deciding which step you were on is a bit hacky. I used the progression bar widget to see which step I was on. Here's my method: private int getState() { for (int i = 1; i < 21; i++) { if (s.widgets.get(371, i) != null && s.widgets.get(371, i).getTextColor() == 0) { if (debug) s.log("Getting state" + (i - 1)); return i - 1; } } return -1; }
  19. Dude I'm literally developing a VERY similar thing hahaha. At the moment it does exactly this. I'm planning on adding loads of other things though Good job with the tut island, I know how annoying it can be.
  20. Eclipse does tell to import if you hover over the red text. Ctrl+shift+o is a useful shortcut to sort out all imports, super useful. Another useful shortcut in eclipse is ctrl+shift+f which formats your code to make it more readable. As for the code, I'd split it up into logical steps: if (not in combat) NPC chicken = findChicken(); attack(chicken); else Sleep or do anything you would do in combat As for a findChicken method, something like this. private NPC findNPC(NPC... exceptions) { @SuppressWarnings("unchecked") NPC chicken = getNpcs().closest(new Filter<NPC>() { @Override public boolean match(NPC npc) { return npc.getName().equals("Chicken") && !npc.isUnderAttack() && (npc.getHealthPercent() > 0) } }); return chicken; } And for attack, maybe private void attack(NPC chicken) throws InterruptedException { if (chicken != null) { if (map.canReach(chicken)) { if (chicken.isVisible()) { chicken.interact("Attack"); } else { s.camera.toEntity(chicken); } } } } I think it's just a good habit overall to split your steps into methods, leads to cleaner code and makes it so you can reuse it often.
×
×
  • Create New...