public class OkadaHerbloreFXController implements Initializable {
private OkadaHerblore bot;
@FXML
private ComboBox Potion_ComboBox;
@FXML
private CheckBox Clean_Herbs_CheckBox;
@FXML
private CheckBox Make_Unfinished_CheckBox;
@FXML
private CheckBox Make_Finished_CheckBox;
@FXML
private Button Start_BT;
public OkadaHerbloreFXController(OkadaHerblore bot) {
this.bot = bot;
}
@Override
public void initialize(URL location, ResourceBundle resources) {
// Add Potions to the combo box
Potion_ComboBox.getItems().addAll(
"Attack Potion",
"Antipoison",
"Relicym's balm",
"Strength potion",
"Serum 207",
"Restore potion",
"Guthix balance",
"Energy potion",
"Defence potion",
"Agility potion",
"Combat Potion",
"Prayer potion",
"Super attack potion",
"Super antipoison",
"Fishing potion",
"Super energy potion",
"Hunter Potion",
"Super Strength potion",
"Magic Essence potion",
"Weapon poison",
"Super restore potion",
"Sanfew serum",
"Super defence potion",
"Anti-fire breath potion",
"Ranging potion",
"Magic potion",
"Zamorak brew",
"Saradomin brew"
);
// If the Start Button is pressed, handle that even in the getStart_BTAction method
Start_BT.setOnAction(getStart_BTAction());
// Set the event for Location_ComboBox
Potion_ComboBox.setOnAction(getPotion_ComboBoxEvent());
}
private EventHandler<ActionEvent> getStart_BTAction() {
return event -> {
try {
// Initialize all variables in your bot
bot.guiWait = false;
// Handle CheckBoxes
if (Clean_Herbs_CheckBox.isSelected()){
bot.cleanHerbs = Boolean.TRUE;
} else {
bot.cleanHerbs = Boolean.FALSE;
}
if (Make_Unfinished_CheckBox.isSelected()){
bot.makeUnfinished = Boolean.TRUE;
} else {
bot.makeUnfinished = Boolean.FALSE;
}
if (Make_Finished_CheckBox.isSelected()){
bot.makeFinished = Boolean.TRUE;
} else {
bot.makeFinished = Boolean.FALSE;
}
// Handle ComboBox
switch(Potion_ComboBox.getSelectionModel().getSelectedItem().toString()){
case "Attack Potion":
bot.potionName = "Attack potion";
bot.unfPotionName = "Guam potion (unf)";
bot.herbName = "Guam leaf";
bot.ingredientName = "Eye of newt";
bot.requiredLvl = 3;
break;
case "Antipoison":
bot.potionName = "Antipoison";
bot.unfPotionName = "Marrentill potion (unf)";
bot.herbName = "Marrentill";
bot.ingredientName = "Unicorn horn dust";
bot.requiredLvl = 5;
break;
case "Relicym's balm":
bot.potionName = "Relicym's balm";
bot.unfPotionName = "Rogue's purse potion (unf)";
bot.herbName = "Rogue's purse";
bot.ingredientName = "Snakeweed";
bot.requiredLvl = 8;
break;
case "Strength potion":
bot.potionName = "Strength potion";
bot.unfPotionName = "Tarromin potion (unf)";
bot.herbName = "Tarromin";
bot.ingredientName = "Limpwurt root";
bot.requiredLvl = 12;
break;
case "Serum 207":
bot.potionName = "Serum 207";
bot.unfPotionName = "Tarromin potion (unf)";
bot.herbName = "Tarromin";
bot.ingredientName = "Ashes";
bot.requiredLvl = 15;
break;
case "Restore potion":
bot.potionName = "Restore potion";
bot.unfPotionName = "Harralander potion (unf)";
bot.herbName = "Harralander";
bot.ingredientName = "Red spider eggs";
bot.requiredLvl = 22;
break;
case "Guthix balance":
bot.potionName = "Guthix balance";
bot.unfPotionName = "Harralander potion (unf)";
bot.herbName = "Harralander";
bot.ingredientName = "Garlic, Red spider eggs, silver dust";
bot.requiredLvl = 22;
break;
case "Energy potion":
bot.potionName = "Energy potion";
bot.unfPotionName = "Harralander potion (unf)";
bot.herbName = "Harralander";
bot.ingredientName = "Chocolate dust";
bot.requiredLvl = 26;
break;
case "Defence potion":
bot.potionName = "Defence potion";
bot.unfPotionName = "Ranarr potion (unf)";
bot.herbName = "Ranarr weed";
bot.ingredientName = "Whiteberries";
bot.requiredLvl = 30;
break;
case "Agility potion":
bot.potionName = "Agility potion";
bot.unfPotionName = "Toadflax potion (unf)";
bot.herbName = "Toadflax";
bot.ingredientName = "Toad's legs";
bot.requiredLvl = 34;
break;
case "Combat Potion":
bot.potionName = "Combat Potion";
bot.unfPotionName = "Harralander potion (unf)";
bot.herbName = "Harralander";
bot.ingredientName = "Ground Goat's Horn";
bot.requiredLvl = 36;
break;
case "Prayer potion":
bot.potionName = "Prayer potion";
bot.unfPotionName = "Ranarr potion (unf)";
bot.herbName = "Ranarr weed";
bot.ingredientName = "Snape grass";
bot.requiredLvl = 38;
break;
case "Super attack potion":
bot.potionName = "Super attack potion";
bot.unfPotionName = "Irit potion (unf)";
bot.herbName = "Irit leaf";
bot.ingredientName = "Eye of newt";
bot.requiredLvl = 45;
break;
case "Super antipoison":
bot.potionName = "Super antipoison";
bot.unfPotionName = "Irit potion (unf)";
bot.herbName = "Irit leaf";
bot.ingredientName = "Unicorn horn dust";
bot.requiredLvl = 48;
break;
case "Fishing potion":
bot.potionName = "Fishing potion";
bot.unfPotionName = "Avantoe potion (unf)";
bot.herbName = "Avantoe";
bot.ingredientName = "Snape grass";
bot.requiredLvl = 50;
break;
case "Super energy potion":
bot.potionName = "Super energy potion";
bot.unfPotionName = "Avantoe potion (unf)";
bot.herbName = "Avantoe";
bot.ingredientName = "Mort Myre fungi";
bot.requiredLvl = 52;
break;
case "Hunter Potion":
bot.potionName = "Hunter Potion";
bot.unfPotionName = "Avantoe potion (unf)";
bot.herbName = "Avantoe";
bot.ingredientName = "Kebbit teeth dust";
bot.requiredLvl = 53;
break;
case "Super Strength potion":
bot.potionName = "Super Strength potion";
bot.unfPotionName = "Kwuarm potion (unf)";
bot.herbName = "Kwuarm";
bot.ingredientName = "Limpwurt root";
bot.requiredLvl = 55;
break;
case "Magic Essence potion":
bot.potionName = "Magic Essence potion";
bot.unfPotionName = "";
bot.herbName = "Starflower";
bot.ingredientName = "Gorak Claw";
bot.requiredLvl = 57;
break;
case "Weapon poison":
bot.potionName = "Weapon poison";
bot.unfPotionName = "Kwuarm potion (unf)";
bot.herbName = "Kwuarm";
bot.ingredientName = "Dragon scale dust";
bot.requiredLvl = 60;
break;
case "Super restore potion":
bot.potionName = "Super restore potion";
bot.unfPotionName = "Snapdragon potion (unf)";
bot.herbName = "Snapdragon";
bot.ingredientName = "Red spider eggs";
bot.requiredLvl = 63;
break;
case "Sanfew serum":
bot.potionName = "Sanfew serum";
bot.unfPotionName = "";
bot.herbName = "Super restore potion";
bot.ingredientName = "Ground unicorn horn, snake weed, nail beast nails";
bot.requiredLvl = 65;
break;
case "Super defence potion":
bot.potionName = "Super defence potion";
bot.unfPotionName = "Cadantine potion (unf)";
bot.herbName = "Cadantine";
bot.ingredientName = "Whiteberries";
bot.requiredLvl = 66;
break;
case "Anti-fire breath potion":
bot.potionName = "Anti-fire breath potion";
bot.unfPotionName = "Lantadyme potion (unf)";
bot.herbName = "Lantadyme";
bot.ingredientName = "Dragon scale dust";
bot.requiredLvl = 69;
break;
case "Ranging potion":
bot.potionName = "Ranging potion";
bot.unfPotionName = "Dwarf weed potion (unf)";
bot.herbName = "Dwarf weed";
bot.ingredientName = "Wine of Zamorak";
bot.requiredLvl = 72;
break;
case "Magic potion":
bot.potionName = "Magic potion";
bot.unfPotionName = "Lantadyme potion (unf)";
bot.herbName = "Lantadyme";
bot.ingredientName = "Potato Cactus";
bot.requiredLvl = 76;
break;
case "Zamorak brew":
bot.potionName = "Zamorak brew";
bot.unfPotionName = "Torstol potion (unf) ";
bot.herbName = "Torstol";
bot.ingredientName = "Jangerberries";
bot.requiredLvl = 78;
break;
case "Saradomin brew":
bot.potionName = "Saradomin brew";
bot.unfPotionName = "Toadflax potion (unf)";
bot.herbName = "Toadflax";
bot.ingredientName = "Crushed Bird's Nest";
bot.requiredLvl = 81;
break;
}
// Set the EmbeddableUI property to reflect your Info GUI
Platform.runLater(() -> bot.setToInfoProperty());
} catch (Exception e) {
e.printStackTrace();
}
};
}