wilson95816 4 Share Posted October 29, 2020 Hello friends I have been running a script for a very very long time and with the introduction of the new client version I can't get it to work I have tried the usual java, trying different computers and no matter what I get the same result Turns out the issue is: This script's GUI is causing performance issues I have been pointed in the direction of the below However this means nothing to me and I don't even know where to start in applying this fix Help would be greatly appreciated! Troubleshooting This script's GUI is causing performance issues. If the client complains that your script's GUI is causing performance issues, you're either creating Swing components or invoking one of their methods from the wrong thread. Swing is not thread safe, so you'll need to ensure all of your Swing related code is ran on the Event Dispatch Thread (EDT). Danger Make sure any code ran on the EDT is used only for Swing methods. Doing heavy processing on this thread will cause the whole client to freeze and cause other problems. You can use SwingUtilities.invokeLater to run a block of code asynchronously, meaning you don't need the result right away (or ever). This is the preferred method for using Swing, as it's easier to reason about and it doesn't block your script's thread. If for whatever reason you need immediate access to the result, you can use SwingUtilities.invokeAndWait to block and wait until that code is ran. Example: SwingUtilities.invokeLater(() -> { MyGUI gui = new MyGUI() gui.setVisible(true): }); Link to comment Share on other sites More sharing options...
holic 231 Share Posted October 29, 2020 Do you have the source code for the script? If yes, you just need to wrap the part of the code that shows your GUI with the code you posted. Replace MyGUI with whatever yours is called. Link to comment Share on other sites More sharing options...
rune adam43 23 Share Posted October 30, 2020 @wilson95816 likewise, sometimes even with no notable change. The alert still appears. Link to comment Share on other sites More sharing options...
wilson95816 4 Author Share Posted October 31, 2020 On 10/29/2020 at 9:54 PM, holic said: Do you have the source code for the script? If yes, you just need to wrap the part of the code that shows your GUI with the code you posted. Replace MyGUI with whatever yours is called. Hiya mate I'm not entirely sure what a source code is, although the creator did send me a copy of the latest version. Unfortunately for me this is a jar file containing many other files and means very little to me. I must admit I've no experience coding/programming/scripting, but wouldn't rule out the possibility of starting to learn, especially if it helps me get back to running this script that being said, I'm a long way off understanding pretty much most of what you just said. Can you break it down in to extreme laymans? In the meantime I'll do some learning of my own Any help is greatly appreciated Link to comment Share on other sites More sharing options...
bebeli555 8 Share Posted October 31, 2020 . Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.