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.

Gui Checkbox for Banking or Dropping

Featured Replies

Just getting back into scripting. Trying to learn how to implement a GUI checkbox for which the user can select if they wish to bank or drop items. I have my GUI panel made, I just cannot figure out how to pass data from my GUI class, Main class, and drop/bank class task. If anyone can point me in the right direction! or has tips! please let me know! Thanks greatly in advance!!!

 

 

  • Author
1 minute ago, Gunman said:

@mark jacobs Are you asking how to make a check box? Or are you asking how to determine the logic of banking and dropping based on this checkbox?

The logic behind it. My GUI design is there, the logic part is what I am struggling with. Here is what I have so far that is not quite working:

Gui class variables

private boolean DropToggle;
private JCheckBox DropCheckBox;

Gui class Checkbox

//Dropping Check Box
            DropCheckBox = new JCheckBox("Drop?");
            DropCheckBox.setFont(new Font("Sans Serif", Font.BOLD, 15));
            DropCheckBox.setBounds(53, 285, 150, 20);
            settingsPanel.add(DropCheckBox);
            DropCheckBox.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        DropCheckBox.setSelected(true);
                        DropToggle = true;
                    }
                });

Gui Call method

public boolean isDropBoxChecked(){
        return DropToggle;
    }

Main class OnSstart

 if(gui.isDropBoxChecked()){
            tasks.add(new DropFish(this));
        }

Drop task

 

public class DropFish extends Task{

    private boolean dropItemsEnabled;

    public DropFish(EioFisher script) {
        super(script);
    }


    @Override
    public boolean canProcess() throws InterruptedException {
        return script.inventory.isFull();
    }

    @Override
    public void process() throws InterruptedException {
        script. currentState = Status.DROPPING;

        script.inventory.dropAllExcept("Small fishing net");
    }
}

When I check the box it does nothing.

 

And here is a visual of my GUI design

2acdea7f3abd0a5518a3fe8c3f48221a.png

I still have to work on the other sections, but I was starting with figuring out the dropping and banking first before I even tried the Type, Tool, and Location.

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.