Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug Needs a bit of help with a combobox.

Joined
Aug 23, 2016
Messages
20
Hey all, hope someone will be able to help a bit..

I use a task bot method in my bot script..

upload_2019-2-27_1-27-22.png


i need help with a little something.. my bot does all the task but when at exemple: Luminite rock..
it does not click.. seems like my combo box isnt right setuped..

there's my code:

Code:
@FXML
    private ComboBox<String> RockToMine;
    ObservableList<String> RockToMinelist = FXCollections.observableArrayList("Luminite rock", "Runite rock", "Adamantite rock");

    public EventHandler<ActionEvent> handleButtonClicked() {
        return event -> {
            String RockToMineItems = RockToMine.getSelectionModel().getSelectedItem();

            BOT.setRockToMineName(RockToMineItems);

            Okbutton.setDisable(true);

            if (BOT.isPaused()) {
                BOT.resume();
            }

        };
    }

Code:
 @Override
    public void initialize(URL location, ResourceBundle resources) {
        setVisible(true);
        Okbutton.setOnAction(handleButtonClicked());
        RockToMine.getItems().setAll(RockToMinelist);
        RockToMine.getSelectionModel().selectFirst();

    }


Code:
 private String RockToMine;
    public void setRockToMineName(String RockToMine) {
        this.RockToMine = RockToMine;
    }

Code:
final GameObject blueDragon = GameObjects.getLoaded(RockToMine).nearest();
            if (blueDragon == null || blueDragon.distanceTo(Players.getLocal().getPosition()) > 15) {
                return KarssLexMiner.State.walkToMine;
            } else {
                return KarssLexMiner.State.mine;
            }


There's it.. It was working very well when i only put "Runite rock"..
i don't really get why it isnt while using a combo box..
 
for my .fxml :
<ComboBox fx:id="RockToMine" prefWidth="150.0" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
 
When using
("Runite ore") it works.. can someone help?
 
Top