Skip 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.

SRSYL wtf JFormDesigner

Featured Replies

I have never had any issues in the past developing with JformDesigner but now whenever I create a GUI with it, the script will not load.

	@Override
	public void onStart() throws InterruptedException {
		UI gui = new UI();
		gui.setVisible(true);
		while (gui.isVisible()) {
			sleep(100);
		}
		getExperienceTracker().start(Skill.FISHING);
		timeStart = System.currentTimeMillis();
	}

and a pastebin for the GUI code:

http://pastebin.com/CRgidXqW

 

 

 

I had Explv helping me with the same problem on a different script, not even he could figure out why it's doing this. OSBot @Devs pls.

 

 

Edited by Paradox68

Now will you consider my advice?

 

Edit: Are you saying the script as a whole doesn't start or just the GUI doesn't show. And do you notice any CPU spikes?

Edited by GoldenGates

  • Author

Need to see the UI class. Are you using #dispose?

 

 

Dispose is for the button click method. UI class is in the pastebin link in original post.

Now will you consider my advice?

 

Edit: Are you saying the script as a whole doesn't start or just the GUI doesn't show. And do you notice any CPU spikes?

If I remove the GUI the script runs normally so I know the GUI is causing it, but symptom is that the script instantly stops itself when I run it.

What if you move the while loop into the overridden onLoop method?

  • Author

What if you move the while loop into the overridden onLoop method?

 

Nope. By all accounts none of this follows any form of logic.

I have never had any issues in the past developing with JformDesigner but now whenever I create a GUI with it, the script will not load.

	@Override
	public void onStart() throws InterruptedException {
		UI gui = new UI();
		gui.setVisible(true);
		while (gui.isVisible()) {
			sleep(100);
		}
		getExperienceTracker().start(Skill.FISHING);
		timeStart = System.currentTimeMillis();
	}

and a pastebin for the GUI code:

http://pastebin.com/CRgidXqW

 

 

 

I had Explv helping me with the same problem on a different script, not even he could figure out why it's doing this. OSBot @Devs pls.

 

 

Works fine for me when I run it (not on OSBot):

 

f908f7b77a.png

 

 

The only thing I had to remove was:

label1.setIcon(new ImageIcon(getClass().getResource("/title.png"));

because I don't have the image obviously. Perhaps you are getting an NPE because one of the image locations is wrong

  • Author

Works fine for me when I run it (not on OSBot):

 

f908f7b77a.png

 

 

The only thing I had to remove was:

label1.setIcon(new ImageIcon(getClass().getResource("/title.png"));

because I don't have the image obviously. Perhaps you are getting an NPE because one of the image locations is wrong

 

 

How do I make it so an image is kept in the GUI (the .jar) so that other people can load it when they use the script? I thought it was to put it in classpath...? Also it seems to work when I remove the image and change the font of the header.

How do I make it so an image is kept in the GUI (the .jar) so that other people can load it when they use the script? I thought it was to put it in classpath...? Also it seems to work when I remove the image and change the font of the header.

 

You should place the image inside of a folder called "resources". This folder should be placed within src

 

You then load the image using:

private void initComponents() {

    Image image = getImage("title.png");
    if(image != null) label1.setIcon(new ImageIcon(image));
}

private Image getImage(String imageName){

        try{
            return ImageIO.read(TutorialIsland.class.getResourceAsStream("/resources/" + imageName));
        } catch(IOException e){

        }
        return null;
}

Edited by Explv

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.