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.

JFormDesigner ComboBox1

Featured Replies

I've recently implemented a GUI into the script i'm working on. I've built the GUI to my liking, however actually coding in the different parts of the GUI is difficult for me. I've spent hours playing with it.

My question is:

How can i make a selection in comboBox1 affect what happens in-game?

Example(which i know is wrong.): if comboBox1 = Bury bones {
                                                           client.burybones(lol)

                                                    } else {

                                                           client.dropbones

                                                    }

 

Given, that code is completely fake. It is just an example to help you understand what i want to do through code.

I'd really appreciate if somebody could show me example code, or explain how to do what i need to do.

Thanks!

 

 

 

 

 

PS: I looked all through google and the OSBot forums for this. I couldn't find it anywhere.

dont use jformdesigner, the code is sloppy and you wont learn anything.  Now for the combobox, try 

String string = combobox.getSelectedItem().toString();

if(string.equals("Bury bones") {

do shit

}

Edited by novak80

 

dont use jformdesigner, the code is sloppy and you wont learn anything.  Now for the combobox, try 

String string = combobox.getSelectedItem().toString();

if(string.equals("Bury bones") {

do shit

}

 

 

What should i use then? :p

Edited by Bitter

What should i use then? tongue.png

Use a radiobutton

 

and then 

Boolean BuryBones = false;

so

private void radioButton1ActionPerformed(ActionEvent e) {
		if(BuryBones = false){
                  BuryBones = true;
                   }else{
                    BuryBones = false;
            }

	}

so when its false the first time it gets ticked and becomes true, than if they click it again its unticked again and false again :D

so

if(Inventory.contains("Bones"){
if(BuryBones){
   /*Bury Bones*/
}else{
   /*Drop Bones*/
}
}

(code might not be exact from this API but logic should work

What should i use then? tongue.png

you should be writing it yourself, as swing is not that hard to learn at all.  Using programs to do it for you is bad and you don't really learn anything, not to mention they usually use bad conventions/sloppy code

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.