Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • This script's GUI is causing performance issues


    wilson95816
     Share

    Recommended Posts

    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

    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

    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

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.