Jump to content

Auron

Members
  • Posts

    130
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

2263 profile views

Auron's Achievements

Steel Poster

Steel Poster (4/10)

87

Reputation

  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.
×
×
  • Create New...