By registering with us, you'll be able to discuss, share and private message with other members of our community.
Sign up now!There is nothing RuneMate specific about the JavaFX controller. You should be able to find plenty of tutorials online on how to set up and use JavaFX controllers online.Great video.
Any chance you could make a #2 that demonstrates the a gui controller for EmbeddableUI that has a few config buttons and a bot status update ?
Great video.
Any chance you could make a #2 that demonstrates the a gui controller for EmbeddableUI that has a few config buttons and a bot status update ?
Scene Builder can also generate a controller for your design.There is nothing RuneMate specific about the JavaFX controller. You should be able to find plenty of tutorials online on how to set up and use JavaFX controllers online.
I followed the video and got this error
Gyazo - 9fec431ad6da5e31e016d0e2e15dc08c.png
I'm assuming its because my controller was made without embeddableUI in mind.
EDIT: I got my controller working now. But would be nice to know how to do all that spiffy stuff like show profit /xp now that there is no paint. Or even a status
package com.skelware.runemate.script.staking;
import com.runemate.game.api.client.embeddable.EmbeddableUI;
import com.runemate.game.api.hybrid.util.Resources;
import com.runemate.game.api.script.framework.LoopingScript;
import com.skelware.runemate.script.staking.ui.UIController;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import java.io.IOException;
import java.io.InputStream;
public class StakingSalvation extends LoopingScript implements EmbeddableUI {
private ObjectProperty<? extends Node> ui;
public StakingSalvation() {
this.setEmbeddableUI(this);
}
@Override
public void onLoop() {
}
@Override
public void onStop() {
System.out.println("stop");
}
@Override
public ObjectProperty<? extends Node> botInterfaceProperty() {
System.out.println("botInterfaceProperty");
if (ui == null) {
try {
final FXMLLoader loader = new FXMLLoader();
final InputStream input = Resources.getAsStream("com/skelware/runemate/script/staking/ui/UIDocument.fxml");
final Parent document = loader.load(input);
loader.setController(new UIController());
ui = new SimpleObjectProperty<>(document);
} catch (final IOException e) {
e.printStackTrace();
}
}
return ui;
}
}
If you can see it, the method must have been called.Why is botInterfaceProperty never called? I do see the UI in Spectre, but that's about it.
Well system out did not log anything to the console, but the "stop" is logged to the console. So it most definitely is not called, unless system out is suppressed at certain stages, @Cloud?If you can see it, the method must have been called.
What else would load the fxml then? Welp I know nothing further so I will leave this hereWell system out did not log anything to the console, but the "stop" is logged to the console. So it most definitely is not called, unless system out is suppressed at certain stages, @Cloud?
Yeah it just seems like system out is not passed through. If I create a deliberate error in my controller's constructor it logs the error correctly with the expected stack trace.What else would load the fxml then? Welp I know nothing further so I will leave this here![]()
javafx.fxml.LoadException:
unknown path
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2579)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425)
at com.deathizpro.bots.EmbeddableUITutorial.EmbeddableUITutorial.botInterfaceProperty(EmbeddableUITutorial.java:28)
at nul.iIIiiIiIIIii.initialize(nvb:233)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at nul.IiiIIiiiiiii.try(gp:140)
at nul.IiiIIiiiiiii.try(gp:146)
at nul.iIIiiIiIIIii.<init>(nvb:150)
at nul.iIiiIIiIIIiI.try(vgc:78)
at nul.IIIiIIiIIiii.try(bub:1)
at nul.IiIiiIiiIiiI.try(ltb:17782)
at nul.IiIiiIiiIiiI.call(ltb:1177)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.deathizpro.bots.EmbeddableUITutorial.TestUIController.initialize(TestUIController.java:21)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
... 16 more
When I first tried the tutorial, I had the same problem as this Gyazo - 9fec431ad6da5e31e016d0e2e15dc08c.png, since my controller is looking for a botand stage to be passed in. Probably because it wasn't made with EmbeddableUI in mind. I changed the constructor on that to not require those and not pass in or set a script & stage (not sure if that was the right thing to do but all errors cleared) and now when I run the bot my UI doesn't pop up and I run into
Code:javafx.fxml.LoadException: unknown path at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2579) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425) at com.deathizpro.bots.EmbeddableUITutorial.EmbeddableUITutorial.botInterfaceProperty(EmbeddableUITutorial.java:28) at nul.iIIiiIiIIIii.initialize(nvb:233) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409) at nul.IiiIIiiiiiii.try(gp:140) at nul.IiiIIiiiiiii.try(gp:146) at nul.iIIiiIiIIIii.<init>(nvb:150) at nul.iIiiIIiIIIiI.try(vgc:78) at nul.IIIiIIiIIiii.try(bub:1) at nul.IiIiiIiiIiiI.try(ltb:17782) at nul.IiIiiIiiIiiI.call(ltb:1177) at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at com.deathizpro.bots.EmbeddableUITutorial.TestUIController.initialize(TestUIController.java:21) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) ... 16 more
which is the same problem I have here Question - javafx.fxml.LoadException: unknown path
One or more of your FXML elements isn't properly declared, most likely.
Use this to make sure you're declaring all your elements.
![]()
You're missing the @FXML annotations.Should I be declaring the anchorpane and label as well? My Gui only has 1 label, 1 button, 1 combobox, and the anchorpane itself. Without the anchorpane and label declared my skeleton looks like
![]()
And my controller class looks like
![]()
You're missing the @FXML annotations.
We use essential cookies to make this site work, and optional cookies to enhance your experience.