Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Error Using GUI [Client Crashing]

Featured Replies

        // Create a select box for tree options
        JComboBox<String> treeSelector = new JComboBox<>(new String[]{"Tree", "Oak"});

        // Add an action listener, to listen for user's selections, assign to a variable called selectedTree on selection.
        treeSelector.addActionListener(e -> selectedTree = treeSelector.getSelectedItem().toString());

I was using this code, but if I choose 'Tree' the client crashes, well, the CPU goes to 100% and I have to force quit, but if I choose 'Oak' then it works perfectly fine. I added another option in front of 'Tree' and now 'Tree' works in second position but the 'Oak' options is now causing the problem.

  • Author

Open your logger when running the script and read the error it prints VSuShjF.gif

 

 

YEQpG0w.png

So line 56 in MainHandler.java is treeSelector.addActionListener(e -> selectedTree = treeSelector.getSelectedItem().toString()); ?

 

        // Create a select box for tree options
        JComboBox<String> treeSelector = new JComboBox<>(new String[]{"Tree", "Oak"});

        // Add an action listener, to listen for user's selections, assign to a variable called selectedTree on selection.
        treeSelector.addActionListener(e -> selectedTree = treeSelector.getSelectedItem().toString());

I was using this code, but if I choose 'Tree' the client crashes, well, the CPU goes to 100% and I have to force quit, but if I choose 'Oak' then it works perfectly fine. I added another option in front of 'Tree' and now 'Tree' works in second position but the 'Oak' options is now causing the problem.

 

 

Probably something else in your code. You should really learn what a NullPointerException is though...

Edited by Explv

  • Author

So line 56 in MainHandler.java is treeSelector.addActionListener(e -> selectedTree = treeSelector.getSelectedItem().toString()); ?

 

Line 56: 

status = state.toString();

That other is on line 163.

Line 56: 

status = state.toString();

That other is on line 163.

 

Well that is where your error is then.. Not the GUI. 

 

Pls learn how 2 debug pls pls

Line 56: 

status = state.toString();

That other is on line 163.

You might want to post the whole code as what you posted does not raise any exception :ditto:

Your state variable is definately null though.

Line 56: 

status = state.toString();

That other is on line 163.

 

You probably haven't initialised 'state'

 

Programming 101 pls pls

 

Edited from original comment.

 

Pls learn Java. Why are you doing this in onLoop ?:

switch (state) {
            case CHOP:
                new Chop(this);
                break;
            case DROP:
                new Drop(this);
                break;
            case IN_COMBAT:
                new InCombat(this);
            default:
                break;
        }

Edited by Explv

 

Edited from original comment.

 

Pls learn Java. Why are you doing this in onLoop ?:

switch (state) {
            case CHOP:
                new Chop(this);
                break;
            case DROP:
                new Drop(this);
                break;
            case IN_COMBAT:
                new InCombat(this);
            default:
                break;
        }

 

 

Thank I managed to get it working now.

 

It might work but you are still doing a lot of things incorrectly

  • Author

It might work but you are still doing a lot of things incorrectly

 

Isn't it suppose to be in OnLoop()?

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.