xaklon 10 Share Posted January 17, 2017 How can I fetch data from the bot, like the output line when the action is taken to prospect an ore, or to examine an object? I want to fetch this data, retrieve it as a String, and then simply create a check in my script with the output. Link to comment Share on other sites More sharing options...
Prison Break 85 Share Posted January 17, 2017 (edited) you get data from rs by right clicking stuff & clicking examine Edited January 17, 2017 by EX Teenager Link to comment Share on other sites More sharing options...
Neffarion 459 Share Posted January 17, 2017 (edited) are you talking about the game outputting messages to the chat when you do something?if so just implement MessageListener in the script Edited January 17, 2017 by Neffarion xaklon 1 Link to comment Share on other sites More sharing options...
xaklon 10 Author Share Posted January 17, 2017 (edited) are you talking about the game outputting messages to the chat when you do something? if so just implement MessageListener in the script That's what I was talking about, thank you so much! Super helpful as always! Thanks so much Neffarion! Side q, not to start another thread: what is the actual code that I must write to actually code my JFrame rather than using WindowBuilder? I am familiar with AWT but not how it interacts with the external archives. Edited January 17, 2017 by mw130 Link to comment Share on other sites More sharing options...
Neffarion 459 Share Posted January 17, 2017 That's what I was talking about, thank you so much! Super helpful as always! Thanks so much Neffarion! Side q, not to start another thread: what is the actual code that I must write to actually code my JFrame rather than using WindowBuilder? I am familiar with AWT but not how it interacts with the external archives. Kinda confused on what you really want to know. Just create a normal JFrame (with any swing frame designer or by yourself) and onStart inside the script you just open it xaklon 1 Link to comment Share on other sites More sharing options...
xaklon 10 Author Share Posted January 17, 2017 Kinda confused on what you really want to know. Just create a normal JFrame (with any swing frame designer or by yourself) and onStart inside the script you just open it Right, the issue I was having was that in onStart() I cannot add the JFrame to the component, and i can't extend JComponent. Would you make it a completely separate GUI class and just have them interact as classes? Again, your help is amazing! Let me know if you need more clarity. Thanks Neffarion. Link to comment Share on other sites More sharing options...
Neffarion 459 Share Posted January 17, 2017 Right, the issue I was having was that in onStart() I cannot add the JFrame to the component, and i can't extend JComponent. Would you make it a completely separate GUI class and just have them interact as classes? Again, your help is amazing! Let me know if you need more clarity. Thanks Neffarion. What i usually do is have a class that is the JFrame itself (example: MyFrame.java) public class MyFrame extends JFrame { private main script; public MyFrame(main s){ script = s; .... } // Your other gui stuff.... } Then on your main method where you have the onLoop and onStart private MyFrame gui; .... public void onStart(){ main m = this; try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { gui = new MyFrame(m); gui.setVisible(true); } }); while (gui.isVisible()) { sleep(500); } } catch (Exception ex) { MethodProvider.log(ex.toString()); } } Now you can just access either from both sides for whatever you need There is probably other ways but this one works if you want to use it. xaklon 1 Link to comment Share on other sites More sharing options...
xaklon 10 Author Share Posted January 17, 2017 What i usually do is have a class that is the JFrame itself (example: MyFrame.java) public class MyFrame extends JFrame { private main script; public MyFrame(main s){ script = s; .... } // Your other gui stuff.... } Then on your main method where you have the onLoop and onStart private MyFrame gui; .... public void onStart(){ main m = this; try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { gui = new MyFrame(m); gui.setVisible(true); } }); while (gui.isVisible()) { sleep(500); } } catch (Exception ex) { MethodProvider.log(ex.toString()); } } Now you can just access either from both sides for whatever you need There is probably other ways but this one works if you want to use it. You're awesome man - you should post that as a tutorial for others! Yeah, got it perfectly now w/ your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now