1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Interface not loading on RuneMate (fixed)

Discussion in 'Developer Support' started by Ipwnu2day, Jun 7, 2016.

  1. Ipwnu2day

    Joined:
    May 24, 2016
    Messages:
    27
    Likes Received:
    16
    I don't know why but I keep getting this error...
    Code (Text):
    1. javafx.fxml.LoadException:
    2. unknown path
    3.  
    4.     at javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
    5.     at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
    6.     at javafx.fxml.FXMLLoader.load(Unknown Source)
    7.     at com.Ipwnu2day.bots.tutorial_bot.iChop.botInterfaceProperty(iChop.java:49)
    8.     at nul.iiiiiIiiiIii.initialize(wob:53)
    9.     at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
    10.     at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
    11.     at javafx.fxml.FXMLLoader.load(Unknown Source)
    12.     at nul.iIIiIiiIIiIi.enum(ce:103)
    13.     at nul.iIIiIiiIIiIi.enum(ce:197)
    14.     at nul.iiiiiIiiiIii.<init>(wob:195)
    15.     at nul.IIIIiIiiIIII.enum(mic:32)
    16.     at nul.iIiIiIiiIiiI.enum(vob:138)
    17.     at nul.IiIIIIiiIiIi.enum(atb:4479)
    18.     at nul.IiIIIIiiIiIi.call(atb:23188)
    19.     at javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    20.     at java.util.concurrent.FutureTask.run(Unknown Source)
    21.     at java.lang.Thread.run(Unknown Source)
    22. Caused by: java.lang.UnsupportedOperationException: Calling methods that must query the session for information is no longer allowed within non-bot threads.
    23.     at nul.IiiiiIiiIiiI.enum(vgc:8)
    24.     at com.runemate.game.api.hybrid.Environment.getGameType(nyb:194)
    25.     at com.runemate.game.api.hybrid.Environment.isOSRS(nyb:103)
    26.     at com.Ipwnu2day.bots.tutorial_bot.GUIController.initialize(GUIController.java:61)
    27.     ... 17 more
    Here is my main class: (iChop.java)
    Code (Javascript):
    1. package com.Ipwnu2day.bots.tutorial_bot;
    2.  
    3. import com.runemate.game.api.client.embeddable.EmbeddableUI;
    4. import com.runemate.game.api.hybrid.input.Mouse;
    5. import com.runemate.game.api.hybrid.util.Resources;
    6. import com.runemate.game.api.script.framework.LoopingScript;
    7. import javafx.beans.property.ObjectProperty;
    8. import javafx.beans.property.SimpleObjectProperty;
    9. import javafx.fxml.FXMLLoader;
    10. import javafx.scene.Node;
    11. import javafx.scene.image.Image;
    12.  
    13. import javax.imageio.ImageIO;
    14. import java.awt.*;
    15. import java.io.IOException;
    16. import java.net.URL;
    17. import java.util.concurrent.ExecutionException;
    18.  
    19. /**
    20. * Created by XXEX0RCISMXX on 5/24/2016.
    21. */
    22.  
    23.  
    24. public class iChop extends LoopingScript implements EmbeddableUI {
    25.     private ObjectProperty<Node> botInterfaceProperty;
    26.  
    27.  
    28.     public iChop(){
    29.  
    30.         setEmbeddableUI(this);
    31.     }
    32.  
    33.     @Override
    34.     public void onLoop() {
    35.  
    36.         setLoopDelay(300, 600);
    37.     }
    38.  
    39.     /*public void onStart(){
    40.  
    41.     }*/
    42.  
    43.     @Override
    44.     public ObjectProperty<Node> botInterfaceProperty() {
    45.         if (botInterfaceProperty == null) {
    46.             FXMLLoader loader = new FXMLLoader();
    47.             loader.setController(new GUIController(this));
    48.             try {
    49.                 Node node = loader.load(getPlatform().invokeAndWait(() -> Resources.getAsStream("com/Ipwnu2day/bots/tutorial_bot/GUI.fxml")));
    50.                 botInterfaceProperty = new SimpleObjectProperty<>(node);
    51.             } catch (IOException | InterruptedException | ExecutionException e) {
    52.                 e.printStackTrace();
    53.             }
    54.         }
    55.         return botInterfaceProperty;
    56.     }
    57.  
    58.  
    59.  
    60.     //public long getToLevel(){
    61.      //   return Skill.WOODCUTTING.getExperienceToNextLevelAsPercent();
    62.   //  }
    63.  
    64.     //public int getStartLevel(){
    65.     //    return startLevel;
    66.    // }
    67.  
    68. }
    Here is my controller: (GUIController.java)
    Code (Javascript):
    1. package com.Ipwnu2day.bots.tutorial_bot;
    2.  
    3. import com.runemate.game.api.hybrid.Environment;
    4.  
    5. import com.runemate.game.api.hybrid.input.Mouse;
    6. import com.runemate.game.api.hybrid.util.Resources;
    7. import javafx.event.ActionEvent;
    8. import javafx.event.EventHandler;
    9. import javafx.fxml.FXML;
    10. import javafx.fxml.Initializable;
    11. import javafx.scene.control.Button;
    12. import javafx.scene.control.ComboBox;
    13. import javafx.scene.control.RadioButton;
    14. import javafx.scene.control.TitledPane;
    15. import javafx.scene.image.Image;
    16. import javafx.scene.image.ImageView;
    17.  
    18.  
    19. import javax.imageio.ImageIO;
    20. import java.awt.*;
    21. import java.io.IOError;
    22. import java.io.IOException;
    23. import java.net.URL;
    24. import java.util.ResourceBundle;
    25. import java.util.concurrent.ExecutionException;
    26.  
    27.  
    28. /**
    29. * Created by XXEX0RCISMXX on 5/25/2016.
    30. */
    31. public class GUIController implements Initializable {
    32.  
    33.     @FXML
    34.     private ImageView imageLogo;
    35.  
    36.     @FXML
    37.     private Button btnStart;
    38.  
    39.     @FXML
    40.     public ComboBox<String> selectTree;
    41.  
    42.     @FXML
    43.     public ComboBox<String> selectLocation;
    44.  
    45.     @FXML
    46.     private TitledPane groupBoxOptions;
    47.  
    48.     @FXML
    49.     public RadioButton radioBank;
    50.  
    51.     @FXML
    52.     public RadioButton radioPowerChop;
    53.  
    54.     @FXML
    55.     public RadioButton radioChopBurn;
    56.  
    57.     @FXML
    58.     public void initialize(URL location, ResourceBundle resources) {
    59.         try {
    60.             imageLogo.setImage(new Image(bot.getPlatform().invokeAndWait(() -> Resources.getAsStream("com/Ipwnu2day/bots/tutorial_bot/iChopLogo.png"))));
    61.             if (Environment.isOSRS()) {
    62.                 //selectTree.getItems().clear();
    63.                 selectTree.getItems().addAll("Normal Tree", "Oak Tree", "Willow Tree", "Maple Tree", "Ivy", "Magic Tree");
    64.                 //selectTree.getSelectionModel().selectFirst();
    65.                 //selectLocation.getItems().addAll("Anywhere");
    66.                 //selectLocation.getSelectionModel().selectFirst();
    67.                 selectTree.setOnAction(treeChanged());
    68.                 selectLocation.setOnAction(locationChanged());
    69.             }
    70.             if (Environment.isRS3()) {
    71.                 //selectTree.getItems().clear();
    72.                 selectTree.getItems().addAll("Normal Tree", "Oak Tree", "Willow Tree", "Maple Tree", "Ivy", "Magic Tree", "Elder Tree", "Crystal Tree");
    73.                 //selectTree.getSelectionModel().selectFirst();
    74.                 //selectLocation.getItems().addAll("Anywhere");
    75.                 ///selectLocation.getSelectionModel().selectFirst();
    76.                 selectTree.setOnAction(treeChanged());
    77.                 selectLocation.setOnAction(locationChanged());
    78.             }
    79.         } catch (InterruptedException | ExecutionException e) {
    80.             e.printStackTrace();
    81.         }
    82.     }
    83.  
    84.     private iChop bot;
    85.  
    86.     public GUIController(iChop bot) {
    87.         this.bot = bot;
    88.     }
    89.  
    90.     private EventHandler<ActionEvent> treeChanged() {
    91.         return eventTree -> {
    92.             selectLocation.getItems().clear();
    93.             switch (selectTree.getValue()) {
    94.                 case "Normal Tree":
    95.                     selectLocation.getItems().addAll("Anywhere");
    96.                     break;
    97.                 case "Oak Tree":
    98.                     selectLocation.getItems().addAll("Draynor Village", "Falador", "Lumbridge", "Seers Village", "Tree Gnome Village", "Varrock West");
    99.                     break;
    100.                 case "Willow Tree":
    101.                     selectLocation.getItems().addAll("Ardounge", "Catherby", "Crafting Guild", "Draynor Village", "Edgeville", "Falador", "Lumbridge", "Rimmington", "Seers Village", "Taverly");
    102.                     break;
    103.                 case "Maple Tree":
    104.                     selectLocation.getItems().addAll("Seers Village");
    105.                     break;
    106.                 case "Ivy":
    107.                     selectLocation.getItems().addAll("Varrock Palace (North)", "");
    108.                     break;
    109.                 case "Magic Tree":
    110.                     break;
    111.                 case "Elder Tree":
    112.                     break;
    113.                 case "Crystal Tree":
    114.                     break;
    115.                 default:
    116.                     break;
    117.             }
    118.         };
    119.     }
    120.  
    121.     private EventHandler<ActionEvent> locationChanged() {
    122.         return eventLocation -> {
    123.             if (selectLocation.getValue() == null) {
    124.                 groupBoxOptions.setDisable(true);
    125.             }
    126.             else {
    127.                 if (selectTree.getValue() == "Ivy" || selectTree.getValue() == "Crystal Tree") {
    128.                     radioBank.setDisable(true);
    129.                     radioChopBurn.setDisable(true);
    130.                 }
    131.                 else {
    132.                     radioBank.setDisable(false);
    133.                     radioChopBurn.setDisable(false);
    134.                 }
    135.                 switch (selectLocation.getValue()) {
    136.                     case "Anywhere":
    137.                         groupBoxOptions.setDisable(false);
    138.                         break;
    139.                     default:
    140.                         break;
    141.                 }
    142.             }
    143.         };
    144.     }
    145.  
    146.     public void saveSettings(){
    147.         bot.getPlatform().invokeLater(() -> {
    148.             bot.getSettings().setProperty("selectTree", selectTree.getValue());
    149.             bot.getSettings().setProperty("selectLocation", selectLocation.getValue());
    150.         });
    151.     }
    152.  
    153.     public void loadBot(){
    154.         saveSettings();
    155.         if (Environment.isOSRS()) {
    156.  
    157.         }
    158.     }
    159. }
    Can anyone help me?
    --- Double Post Merged, Jun 7, 2016, Original Post Date: Jun 7, 2016 ---
    Fixed it nevermind
     
  2. LorM

    Joined:
    May 16, 2019
    Messages:
    18
    Likes Received:
    6
    You deserve to be thrown in salt for not putting the fix >.<
     
    Fabreze likes this.

Share This Page

Loading...