-
Posts
364 -
Joined
-
Last visited
-
Days Won
2 -
Feedback
0%
Everything posted by fixthissite
-
So your Swing code looks fine. But after taking a second look at your singleton design, you never lazily initialize your singleton in the getInstance() method. This makes me assume you already have an instance created: class Single { private static Single SINGLE = new Single(); public Single() { instance = this; } public static Single getInstance() { return SINGLE; } } The problem with this design is that you instantiate the object in the field variable, then replace that object immediately after. Check this out: public Single() { System.out.println(this == SINGLE); //prints false SINGLE = this; } This could have been avoided by ensuring the field was final. Try removing instance = this
-
Please show your initComponents() method; I was hoping to see your actual Swing code, make sure everything is fine. Also, Im no fan of singletons. But if you're gonna have one, use an enum for it. As for the lambdas, they work for functional interfaces (interfaces with only 1 method). Instead of creating an anonymous class, specify an identifier for each parameter of the method (or use () if there is no parameters), then point to a statement block using ->: EventQueue.invokeAndWait(() -> { }); If your lambda only has 1 statement, you can omit the { }. If you had an enum, you would only need 1 statement: enum FrameSingleton { FRAME; //define your frame's behavior and state } It'll instantiate as soon as you refer to the enum. You would be able to do EventQueue.invokeAndWait(() -> FRAME.setVisible(true));
-
invokeLater posts your code to the Event Queue to be executed on the Event Dispatch Thread. When it will be executed is unknown. To ensure the calling thread waits until the Event Dispatch Thread has finished executing your Swing code, use invokeAndWait. Although, I can't promise this will fix it, seeing how you only show a small portion of your code.. Also, I heard OSBot now has support for Java 8. I suggest using a lambda to pass in the run() method
-
Al-Kharid MoltenGlassMaker & IronSmelter
fixthissite replied to Acinate's topic in Resource Crafting
Feel free to message me for programming advice at any time -
Al-Kharid MoltenGlassMaker & IronSmelter
fixthissite replied to Acinate's topic in Resource Crafting
Curious as to why you didn't use an else statement rather than if(smeltSelect != null) { } if(smeltSelect == null) { } Something you could do is encapsulate each state behavior within the actual state: class MoltenGlasser extends Script { private State state; public int onLoop() throws InterruptedException { getState().process(this); return 500; } private State getState() { //... } } enum State { SMELT { @Override public void performTask(MoltenGlasser script) { script.log("Smelting"); script.cameraFix(); Entity furnace = script.objects.closest(...); //... } }, BANK { //... }; public void performTask(MoltenGlasser script) {} } This will keep your onLoop method nice and clean, and separate the logic of each state into it's own method. Also, no need to switch between cases anymore! Thanks for posting this! Every script snippit helps familiarize me with the API; much appreciated man! -
Title says it all! Please use the poll
-
You want getLocationOnScreen(). getBounds() returns the locatiom of the component relative to it's container, not your screen
-
Please show your code so it can be identified easier, more preferrably, a MCVE
-
Hey! I've been working on some independent projects recently, so I haven't been able to be part of the community. I finally have some free time, so expect more guides and info For those wanting to contact with me during these "independent" stages, feel free to add me on skype! sincerely.vince I've mentioned before, I'm not a botter (or even a bot scripter), but I'm very experience in terms of computer science, so let me know if you wanna expand you programming knowledge!
-
Because they're bots who should do things for you; I find that to be a good reason to assume
-
That's the problem; I'm not familiar, which is why I asked for this. It would help out new people quite a bit as well, since they can quickly view the API and get an idea of what they're going to do. I'll keep that assumpsion for now on; thanks for the heads up
-
Well it's convention (similar to good identifier names). APIs should never force the client to assume things about it. Any well written documentation states these specifications. "returns null otherwise" or SOMETHING would be useful. It could return an empty array (which is actually recommended) for all I know
-
It should mention that in the document's return clause /: And thanks for the information, especially about the bank booths! But I have a lot of questions.. Asking them all in a single thread would be overwhelming, and creating a bunch of new threads would clutter up the question area. I was just hoping someone, on their free time, might be able to polish up the documentation a bit
-
I've seen waaaay worse when it comes to documentation, so I'm not saying it could be better based on comparisons. Since I can't run scripts and test functions (no old school RuneScape account), I'm attempting to write scripts using what I can scrape from the documentations. I have quite a few questions about some functions that can really only be answered through testing or documentation, for example: Bank#open() - "Searches for the best bank, based on type and distance of player" I'm assuming this searches for a bank within view. Of course, this is just an educated guess; I would have to test it to make sure. Maybe have something like "Searches for the best bank within sight, based on type and distance of player. Does nothing if no banks are in sight." Bank#getItems() - "Gets the array of items stored in this container" What's the container? The bank or a tab? If I call this method without the bank being open, what will happen? ______________________________________________________ It'll help out quite a bit, seeing how there's no test server. I'm sure it's the last thing you guys are worried about, but it's something that could definitely be improved. Thanks for taking the time to read this
-
If they're looking for more devs, I'd be happy to help; not sure how one would apply
-
Post-hardcore? Mind naming a few bands? I used to listen to quite a few bands that went by that genre, but now I rarely hear about it. Could just be due to most of my friends listening to rap and what not I'm mostly a progressive metal kind of guy now, although I listen to a lot of disco and pop, including Michael Jackson (one of my favorites). My collection of music is very diverse
-
EDIT: Forgot you mentioned there was a problem; my bad. While I look for it, wrap you code in proper code tags to format it, then read what I have below. Does the fill() method get called? As in, is the condition that needs to be true for fill() to execute returning true? Where EXACTLY is the problem? You rarely use String literals. Instead, you create a new StringBuilder for every String you create, even if only appending a single String. Yes, StringBuilders are efficient when needing to concat a ton of Strings, possibly within some kind of loop. But the way you're using them is actually waaaay more costly. You aren't taking advantage of the String pool, which can save you quite a bit of memory, you're creating a bunch of new StringBuilder objects (taking up quite a bit a memory, seeing hoe they contain a String themselves), and performing an un-needed method call (since you could instead just declarw the String you want in StringBuilder's constructor). String literals are your friend. Please do not use a StringBuilder every time you want a String; use a String literal instead. This will first check to see if the String you want already exists in something called a String Pool. If it does, it'll use the pre-existing value, saving you memory. This is a functionality you can only get by using String Literals. If the string doesn't already exist, a new String will be created and added to the pool. This is referred to as "interning", which can be performed manually, although should only be used in special cases. Removing those un-needed StringBuilders will save you some memory. Removing the append and toString methods will save you some processing time
-
Practical questions about R (the programming language)
fixthissite replied to Botre's topic in Software Development
Useful? Yes, in terms of data analyzing Valuable? Could easily be replaced, although I personally find it pretty useful Fun to use? Define "fun". It's more of a "get to your goal" kind of language. It allows you to quickly generate graphs based on statistics and probability Easy to learn? Compared to languages like C++ or Rust, yes. No need to worry about pointers or manually deallocating memory, allowing you to focus more on your real goal. -
Did you configure your project's build path to include the jar containing the library?
-
Then you might be interested in Udemy aswell You can use the filter to search for free courses. You're gonna want to check occasionally to see if they've added any new courses I'll try my best! Will definitely do. Thanks for all the support you've given so far, it means a lot Hey! How's it goin? Thanks a ton man, I really appreciate the hospitality. Let me know if there's anything I could possibly help with!
-
A few people have asked me things like where I went to school and how long have I've been programming, as well as why I'm here seeing how I don't bot nor play RuneScape anymore I'll keep this short: I've been programming for around 7 years, I've never attended school for programming (took a few free courses on a variety of subjects, although I tend to switch to studying independently) and some subjects I find most interesting include machine learning, in-depth decision making (logic and design) and resource monitoring. Here's a little explination of how I got here: A friend of mine requested some help with a script he was (attempting) to write. Helping him out actually sparked some interest. I asked him which site he was using, since I know that cheap mf wouldn't be scripting if he had to pay, so I dropped by. After losing 3 of my commonly used usernames, I was finally able to join, allowing me to check out the forums. I made a few (hopefully helpful) posts before deciding to write some articles on programming, which I'm current in the process of. This is what's keeping me here: My main interest right now, in relation to botting, would be decreasing the exhaust rate of certain clicking and path finding situations. Being an ex-RuneScape player myself, I've notice the duration of time a few humans may spend on the game is unbelievable. Seeing how reptuable people claim accounts don't get banned for just being logged in using a bot client, possibilities are most likely being exhausted too quickly, leading to a small cluster of possible choices within time. To me, this fits in perfectly with the "botting is alright, as long as you take breaks" theory. Variety is another important concept, although not as important as exhausting randomness. What questions me is why there isn't a script that allows you to choose multiple skills (or even quests and minigames), then set some conditions (or have some generated) to give the illusion that the bot has a schedule; the realistic nature may depend on how detailed the developer specifies the conditions. Those are the subjects I'm currently looking into, as well as a side-project that will hopefully contribute to finding techniques Jagex uses to scout bots. This is what's keeping me here. I can't make any promises as to how much I can contribute, but if you're interested in helping the cause, feel free to let me know. I'm also always willing to answer any questions you might have about a subject (assuming I understand it). Hoping to achieve API Designer rank to help improve and diversitise the tools scripters use to create scripts, so wish me luck! Thanks for the warm welcoming I've gotten so far, and sorry for the long post, considering I said I'd keep it short. Feel free to spark up a conversation with me about anything
-
A few AI tactics that I think might evolve bots to be more human-like, such as increasing the amount of possible paths taken, multi-tasking and an artificial conscience that lets the bot decide (with guidance from the user) when it should switch to a new skill, quest or market event. I also wanted to attempt a pretty crazy task, which would be logging bot information, sending it to a database to be analyzed by an artificial neural network that I've been thinking of the past week. Within time, I was hoping it would contribute to finding out how Jagex scouts for bots. I just want to make sure the foundation I'm building this on is as optimized as possible (I'm talking micro-optimization), since I know how these subjects can be pretty resource greedy at times, not to mention overhead from the synchronization required to bring all this together together. I'm not even sure if I could fit this all into your client, seeing how I haven't had the chance to profile an average bot, but it's worth a shot. I'm pretty keen when it comes to optimization, so hopefully I could make something of this Although I'm not building on the actual API (rather than a mock I've slowly been attempting to write; not planning on releasing it once it's finished or anything, the implementation is probably far from true anyways), I want to account for certain aspects one would need to using the real API And just a heads up, I might have quite a few more questions in the future that I'm not sure the community will be able to properly answer. Would you rather me post a topic or message you?
-
I had a feeling it was to lazily initialize something (not completely sure the purpose of a wrapper, but I have no doubts that it's essential), but is there at any point the adapter won't have a wrapper after setting it? Or is it just to prevent creating the wrapper before the user is called for? I understand it's not a HUGE difference, but I actually plan on using quite a bit of resources (CPU time wise in this case), and seeing how myPlayer isn't subject for inlining (on some JVMs), I was wondering if I could safely reference the object using my own variable. Thanks for the confirmation, by the way! EDIT: I understand HotSpot may inline the method if it hasn't been overriden yet, but I'm asking for a general case