Tom Posted August 25, 2016 Share Posted August 25, 2016 (edited) I was desperately browsing stackoverflow for an answer to "this is runescape" so as not to look overwhelmed by your argument while you were editting your reply your turn i had lasagna for dinner your turn Edited August 25, 2016 by Tom Quote Link to comment Share on other sites More sharing options...
Token Posted August 25, 2016 Share Posted August 25, 2016 i had lasagna for dinner your turn i was a bad boy and got sent to my room without dinner jagex turn Quote Link to comment Share on other sites More sharing options...
Botre Posted August 25, 2016 Share Posted August 25, 2016 (edited) Static self-references in scripts oh lord. What if you run multiple instances of the same script on the same JVM / bot client ? Your turn Edited August 25, 2016 by Botre 1 Quote Link to comment Share on other sites More sharing options...
macalroy Posted August 25, 2016 Author Share Posted August 25, 2016 What the fuck is going on Quote Link to comment Share on other sites More sharing options...
Tom Posted August 26, 2016 Share Posted August 26, 2016 Static self-references in scripts oh lord. What if you run multiple instances of the same script on the same JVM / bot client ? Your turn what does happen? I thought I would have heard more about it if it was tragic. Quote Link to comment Share on other sites More sharing options...
Explv Posted August 26, 2016 Share Posted August 26, 2016 your turn Your turn Quote Link to comment Share on other sites More sharing options...
Token Posted August 26, 2016 Share Posted August 26, 2016 Your turn your turn Quote Link to comment Share on other sites More sharing options...
Explv Posted August 26, 2016 Share Posted August 26, 2016 What the fuck is going on your turn Quote Link to comment Share on other sites More sharing options...
Team Cape Posted August 26, 2016 Share Posted August 26, 2016 your turn i just feel like helping you guys spam your turn Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted August 26, 2016 Share Posted August 26, 2016 (edited) package com.loudpacks.gui; import org.osbot.rs07.script.Script; public class Settings extends JFrame { private JPanel master; private Consumer<Boolean> callback; public Settings(Script script) { master = new JPanel(); setTitle("Settings"); setSize(300, 120); setResizable(false); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setLocationRelativeTo(null); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(1, 1, 10, 10)); buttonPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); JButton buttonStart = new JButton("Start"); buttonStart.addActionListener(event -> { callback.accept(true); dispose(); }); buttonPanel.setMaximumSize(new Dimension(getWidth(), 100)); buttonPanel.add(buttonStart); master.add(buttonPanel); master.setLayout(new BoxLayout(master, BoxLayout.Y_AXIS)); add(master); setVisible(true); } public void setCallback(Consumer<Boolean> callback) { this.callback = callback; } } package com.loudpacks.script; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.ScriptManifest; import com.loudpacks.api.LoudScript; import com.loudpacks.gui.Settings; @ScriptManifest(author = "LoudPacks", info = "", logo = "", name = "LoudCCTracker", version = 1.0) public class main extends LoudScript { private long start = 0; public static InventoryMonitor monitor; @[member='Override'] public void onStart() { Settings settings = new Settings(this); settings.setCallback(b -> { start = System.currentTimeMillis(); //add tasks, etc it will hand here til your settings callback is set to true; }); } @[member='Override'] public void onExit() { } @[member='Override'] public void onPaint(Graphics2D g){ super.onPaint(g); } } Do something like this maybe. Edited August 26, 2016 by LoudPacks Quote Link to comment Share on other sites More sharing options...
macalroy Posted August 26, 2016 Author Share Posted August 26, 2016 package com.loudpacks.gui; import org.osbot.rs07.script.Script; public class Settings extends JFrame { private JPanel master; private Consumer<Boolean> callback; public Settings(Script script) { master = new JPanel(); setTitle("Settings"); setSize(300, 120); setResizable(false); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setLocationRelativeTo(null); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(1, 1, 10, 10)); buttonPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); JButton buttonStart = new JButton("Start"); buttonStart.addActionListener(event -> { callback.accept(true); dispose(); }); buttonPanel.setMaximumSize(new Dimension(getWidth(), 100)); buttonPanel.add(buttonStart); master.add(buttonPanel); master.setLayout(new BoxLayout(master, BoxLayout.Y_AXIS)); add(master); setVisible(true); } public void setCallback(Consumer<Boolean> callback) { this.callback = callback; } } package com.loudpacks.script; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.ScriptManifest; import com.loudpacks.api.LoudScript; import com.loudpacks.gui.Settings; @ScriptManifest(author = "LoudPacks", info = "", logo = "", name = "LoudCCTracker", version = 1.0) public class main extends LoudScript { private long start = 0; public static InventoryMonitor monitor; @[member='Override'] public void onStart() { Settings settings = new Settings(this); settings.setCallback(b -> { start = System.currentTimeMillis(); //add tasks, etc it will hand here til your settings callback is set to true; }); } @[member='Override'] public void onExit() { } @[member='Override'] public void onPaint(Graphics2D g){ super.onPaint(g); } } Do something like this maybe. JavaFX doesn't work like that because the constructor of the Application class can't take an argument Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted August 26, 2016 Share Posted August 26, 2016 JavaFX doesn't work like that because the constructor of the Application class can't take an argument Ah, I've never used javaFX but I figured it was worth a shot. Quote Link to comment Share on other sites More sharing options...
macalroy Posted August 26, 2016 Author Share Posted August 26, 2016 Ah, I've never used javaFX but I figured it was worth a shot. It would make so much more sense if it could take arguments in its constructor, but noooooo Quote Link to comment Share on other sites More sharing options...
Explv Posted August 27, 2016 Share Posted August 27, 2016 It would make so much more sense if it could take arguments in its constructor, but noooooo Just so you know, because you are running JavaFX from a Swing application you don't need to extend the application class. https://docs.oracle.com/javase/8/javafx/interoperability-tutorial/swing-fx-interoperability.htm Quote Link to comment Share on other sites More sharing options...
macalroy Posted August 27, 2016 Author Share Posted August 27, 2016 Just so you know, because you are running JavaFX from a Swing application you don't need to extend the application class. https://docs.oracle.com/javase/8/javafx/interoperability-tutorial/swing-fx-interoperability.htm because you are running JavaFX from a Swing application Swing application Well, I wasn't doing that as far as I know. But that makes it like 20x better. You sir, are a God. Quote Link to comment Share on other sites More sharing options...