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.

Make GUI open on start.

Featured Replies

I've built a GUI with jformdesigner in eclipse. I have imported the gui to my script.

I don't know how to do the following:

A: Make the GUI open on script start.

 

B: After the user presses Start on the GUI, the script starts. (not before.)

A. In the first loop that runs in your script, open the GUI. This includes creating the dimensions and the .setVisible() method.

 

B. Set a boolean called "start" equal to false and when the user presses the Start button on your GUI to set the boolean to true. Have this boolean as a condition that runs the main loop of your script. After the user presses the start button on the GUI, you should also dispose of the GUI to save some resources

Edited by oTroll

Some more info:

 

A) I'd just like to add that usually JFormDesigner usually comes with an initComponents() method, which will initialize all the components. Make sure that this is called in the constructor of you GUI object. Then all you need to do in onStart() is myGui.setVisible(true)

 

B ) To check when the player click a button you'll need to register a new ActionListener to your start button:

8bySF.png

 

then in the actionPerformed method you can set the "Start" boolean to true.

Edited by Deffiliate

Create a Boolean within your GUI class. Add an event handler on your start button

, within the event handler invert the Boolean, also dispose the GUI. In your main class within your onloop set the GUI visible. Then you will sleep while your GUI is still running

Some more info:

 

A) I'd just like to add that usually JFormDesigner usually comes with an initComponents() method, which will initialize all the components. Make sure that this is called in the constructor of you GUI object. Then all you need to do in onStart() is myGui.setVisible(true)

 

B ) To check when the player click a button you'll need to register a new ActionListener to your start button:

8bySF.png

 

then in the actionPerformed method you can set the "Start" boolean to true.

 

 

This is the best code response i have ever gotten. Very clear, thank you. :)

Some more info:

 

A) I'd just like to add that usually JFormDesigner usually comes with an initComponents() method, which will initialize all the components. Make sure that this is called in the constructor of you GUI object. Then all you need to do in onStart() is myGui.setVisible(true)

 

B ) To check when the player click a button you'll need to register a new ActionListener to your start button:

8bySF.png

 

then in the actionPerformed method you can set the "Start" boolean to true.

 

 

http://gyazo.com/e2f421581d27c474bcb0746498a89900

 

Having an issue however. Everything you said made complete sense, but why would i need a bool for this?

This is the best code response i have ever gotten. Very clear, thank you. smile.png

 

 

http://gyazo.com/e2f421581d27c474bcb0746498a89900

 

Having an issue however. Everything you said made complete sense, but why would i need a bool for this?

You might not have the GUI class setup right. It should extend JFrame, that way it will inherit the isVisible boolean from the JFrame.

Edited by Deffiliate

http://gyazo.com/bb1713c2afde5398e89de63ab5b9d0d3

 

I extended it. I'm now getting this:

 

http://gyazo.com/663823a1869812936d6fb0d3c33dddd4

 

 

I also tried isVisible(). Neither seem to be working :c

 

 

Well the problem is that you're declaring that in a static way, if you don't know what static/non-static means add me on Sykpe and i'll help you get it sorted.

You need to either call the method from within the minergui class or by creating an instance of minergui. Please learn Java before making scripts mate :/

 

I have to learn hands on. Not by reading, not by un-important doo-dats in java.

I'm trying to learn the best i can the way that i know how. If i'm a bother, don't read the threads i make or just ask me to stop making them.

Otherwise, i intend to fully learn this my way.

I'm sorry if i come off as rude, but this is the only way i learn.

Thanks for all of your help in the past.

learn Java before making scripts

LOL ya right... majority of people on here have no idea of what a class is, much less why variables should be static/ non-static....

 

 

But Swizzie makes a good point. go take a class or read a book (Head first into Java), then come back and you'll be amazed at what you can do.

Edited by Deffiliate

Well the problem is that you're declaring that in a static way, if you don't know what static/non-static means add me on Sykpe and i'll help you get it sorted.

 

Adding you, dementedfury.

Adding you, dementedfury.

didn't get it, make sure u dint add my impostor. My display name is jsut "Deffiliate" not deffilaite the scripter or w/e that other guys name is.

Guest
This topic is now closed to further replies.

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.