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.

How to JFrame?

Featured Replies

Hi guys, I was trying to make a menu where users select what scenarios to include from my script and was told to use JFrame. I've watched some tutorials on it but I can't figure out how to include it in my script. Any help to get out there? :-)

 

This is what I have so far, btw, and it clearly doesn't work xD

 

public class SlayerBot extends (Script && JFrame) {

     private Frame() {

        //Code

     }

}

Nope only a class can extend only one class.

You'll have a script class and a sepreate jframe class

Can only extend one class.

If you want multiple inheritance you need to extend a class that extends a class that extends... you get it.

 

Make another class

 

Class Gui extends JFrame

Gui class:

public class Gui extends JFrame { 
    public Gui() { //constructor
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 
        //stick your Gui code in here for the jframe. You can use windowbuilder plugin for eclipse to design it a bit simpler. 
    } 
}

Main class:

private Gui GUI;

@Override
public void onStart() {
    GUI = new Gui();
    GUI.setVisible(true);
}

merry christmas

apa

Edited by Apaec

Gui class:

public class Gui extends JFrame { 
    public Gui() { //constructor
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 
        //stick your Gui code in here for the jframe. You can use windowbuilder plugin for eclipse to design it a bit simpler. 
    } 
}

Main class:

private Gui GUI;

@Override
public void onStart() {
    GUI = new Gui();
    GUI.setVisible(true);
}

merry christmas

apa

 

It's Christmas in August!

Hi guys, I was trying to make a menu where users select what scenarios to include from my script and was told to use JFrame. I've watched some tutorials on it but I can't figure out how to include it in my script. Any help to get out there? :-)

 

This is what I have so far, btw, and it clearly doesn't work xD

 

public class SlayerBot extends (Script && JFrame) {

     private Frame() {

        //Code

     }

}

 

code your gui in a seperate class (so that the gui class itself extends JFrame)

 

then you declare a new instance in your slayerbot class

 

the way Apaec had it written

Edited by RickyD

  • Author

Alright, so I've figured out that making this using Window Builder is actually pretty simple. I just still can't figure out how to get the two classes to work together. I get the onStart-code calling the GUI but how do I make the GUI change variables in my main script? Or should I declare the variables in the GUI and then pass them to my SlayerBot-class? There are no "classes" in C so this concept is not familiar to me :-P

:-P

Alright, so I've figured out that making this using Window Builder is actually pretty simple. I just still can't figure out how to get the two classes to work together. I get the onStart-code calling the GUI but how do I make the GUI change variables in my main script? Or should I declare the variables in the GUI and then pass them to my SlayerBot-class? There are no "classes" in C so this concept is not familiar to me :-P

:-P

struct GUI
{
    int valueA;
    int valueB;
};  

int main() // Your script
{
struct GUI MyGUI;
// > Load GUI and set values here <

int valueA = MyGUI.valueA;
int valueB = MyGUI.valueB;

return 0;
}

Think of a class as a struct with more functionality (crude definition but might help you).

Edited by Botre

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.