- Thread Author
- #1
I don't know why but I keep getting this error...
Here is my main class: (iChop.java)
Here is my controller: (GUIController.java)
Can anyone help me?
Fixed it nevermind
Code:
javafx.fxml.LoadException:
unknown path
at javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at com.Ipwnu2day.bots.tutorial_bot.iChop.botInterfaceProperty(iChop.java:49)
at nul.iiiiiIiiiIii.initialize(wob:53)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at nul.iIIiIiiIIiIi.enum(ce:103)
at nul.iIIiIiiIIiIi.enum(ce:197)
at nul.iiiiiIiiiIii.<init>(wob:195)
at nul.IIIIiIiiIIII.enum(mic:32)
at nul.iIiIiIiiIiiI.enum(vob:138)
at nul.IiIIIIiiIiIi.enum(atb:4479)
at nul.IiIIIIiiIiIi.call(atb:23188)
at javafx.concurrent.Task$TaskCallable.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: Calling methods that must query the session for information is no longer allowed within non-bot threads.
at nul.IiiiiIiiIiiI.enum(vgc:8)
at com.runemate.game.api.hybrid.Environment.getGameType(nyb:194)
at com.runemate.game.api.hybrid.Environment.isOSRS(nyb:103)
at com.Ipwnu2day.bots.tutorial_bot.GUIController.initialize(GUIController.java:61)
... 17 more
Here is my main class: (iChop.java)
JavaScript:
package com.Ipwnu2day.bots.tutorial_bot;
import com.runemate.game.api.client.embeddable.EmbeddableUI;
import com.runemate.game.api.hybrid.input.Mouse;
import com.runemate.game.api.hybrid.util.Resources;
import com.runemate.game.api.script.framework.LoopingScript;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.image.Image;
import javax.imageio.ImageIO;
import java.awt.*;
import java.io.IOException;
import java.net.URL;
import java.util.concurrent.ExecutionException;
/**
* Created by XXEX0RCISMXX on 5/24/2016.
*/
public class iChop extends LoopingScript implements EmbeddableUI {
private ObjectProperty<Node> botInterfaceProperty;
public iChop(){
setEmbeddableUI(this);
}
@Override
public void onLoop() {
setLoopDelay(300, 600);
}
/*public void onStart(){
}*/
@Override
public ObjectProperty<Node> botInterfaceProperty() {
if (botInterfaceProperty == null) {
FXMLLoader loader = new FXMLLoader();
loader.setController(new GUIController(this));
try {
Node node = loader.load(getPlatform().invokeAndWait(() -> Resources.getAsStream("com/Ipwnu2day/bots/tutorial_bot/GUI.fxml")));
botInterfaceProperty = new SimpleObjectProperty<>(node);
} catch (IOException | InterruptedException | ExecutionException e) {
e.printStackTrace();
}
}
return botInterfaceProperty;
}
//public long getToLevel(){
// return Skill.WOODCUTTING.getExperienceToNextLevelAsPercent();
// }
//public int getStartLevel(){
// return startLevel;
// }
}
Here is my controller: (GUIController.java)
JavaScript:
package com.Ipwnu2day.bots.tutorial_bot;
import com.runemate.game.api.hybrid.Environment;
import com.runemate.game.api.hybrid.input.Mouse;
import com.runemate.game.api.hybrid.util.Resources;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TitledPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javax.imageio.ImageIO;
import java.awt.*;
import java.io.IOError;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.concurrent.ExecutionException;
/**
* Created by XXEX0RCISMXX on 5/25/2016.
*/
public class GUIController implements Initializable {
@FXML
private ImageView imageLogo;
@FXML
private Button btnStart;
@FXML
public ComboBox<String> selectTree;
@FXML
public ComboBox<String> selectLocation;
@FXML
private TitledPane groupBoxOptions;
@FXML
public RadioButton radioBank;
@FXML
public RadioButton radioPowerChop;
@FXML
public RadioButton radioChopBurn;
@FXML
public void initialize(URL location, ResourceBundle resources) {
try {
imageLogo.setImage(new Image(bot.getPlatform().invokeAndWait(() -> Resources.getAsStream("com/Ipwnu2day/bots/tutorial_bot/iChopLogo.png"))));
if (Environment.isOSRS()) {
//selectTree.getItems().clear();
selectTree.getItems().addAll("Normal Tree", "Oak Tree", "Willow Tree", "Maple Tree", "Ivy", "Magic Tree");
//selectTree.getSelectionModel().selectFirst();
//selectLocation.getItems().addAll("Anywhere");
//selectLocation.getSelectionModel().selectFirst();
selectTree.setOnAction(treeChanged());
selectLocation.setOnAction(locationChanged());
}
if (Environment.isRS3()) {
//selectTree.getItems().clear();
selectTree.getItems().addAll("Normal Tree", "Oak Tree", "Willow Tree", "Maple Tree", "Ivy", "Magic Tree", "Elder Tree", "Crystal Tree");
//selectTree.getSelectionModel().selectFirst();
//selectLocation.getItems().addAll("Anywhere");
///selectLocation.getSelectionModel().selectFirst();
selectTree.setOnAction(treeChanged());
selectLocation.setOnAction(locationChanged());
}
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
}
private iChop bot;
public GUIController(iChop bot) {
this.bot = bot;
}
private EventHandler<ActionEvent> treeChanged() {
return eventTree -> {
selectLocation.getItems().clear();
switch (selectTree.getValue()) {
case "Normal Tree":
selectLocation.getItems().addAll("Anywhere");
break;
case "Oak Tree":
selectLocation.getItems().addAll("Draynor Village", "Falador", "Lumbridge", "Seers Village", "Tree Gnome Village", "Varrock West");
break;
case "Willow Tree":
selectLocation.getItems().addAll("Ardounge", "Catherby", "Crafting Guild", "Draynor Village", "Edgeville", "Falador", "Lumbridge", "Rimmington", "Seers Village", "Taverly");
break;
case "Maple Tree":
selectLocation.getItems().addAll("Seers Village");
break;
case "Ivy":
selectLocation.getItems().addAll("Varrock Palace (North)", "");
break;
case "Magic Tree":
break;
case "Elder Tree":
break;
case "Crystal Tree":
break;
default:
break;
}
};
}
private EventHandler<ActionEvent> locationChanged() {
return eventLocation -> {
if (selectLocation.getValue() == null) {
groupBoxOptions.setDisable(true);
}
else {
if (selectTree.getValue() == "Ivy" || selectTree.getValue() == "Crystal Tree") {
radioBank.setDisable(true);
radioChopBurn.setDisable(true);
}
else {
radioBank.setDisable(false);
radioChopBurn.setDisable(false);
}
switch (selectLocation.getValue()) {
case "Anywhere":
groupBoxOptions.setDisable(false);
break;
default:
break;
}
}
};
}
public void saveSettings(){
bot.getPlatform().invokeLater(() -> {
bot.getSettings().setProperty("selectTree", selectTree.getValue());
bot.getSettings().setProperty("selectLocation", selectLocation.getValue());
});
}
public void loadBot(){
saveSettings();
if (Environment.isOSRS()) {
}
}
}
Can anyone help me?
Fixed it nevermind