HTM 31 Share Posted December 18, 2020 (edited) Hey guys, i have a script that worked fine in DB2 that i coded, i havent really been around since DB3 came out so i've been learning the new api and cleaning my scripts up for DB3. i've changed everything over to correct api standards but im still having the same issue when i start my script. This screenshot is the only info i get from the client side. in intellij is runs without issues but once it is Jar'd and put into db3 it basically freezes. the scripts starts and runs but is beyond laggy. this one is more of an aio i was working on and still in progress but here is the pastebin import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.methods.skills.Skills; import org.dreambot.api.methods.skills.SkillTracker; import org.dreambot.api.utilities.Timer; import javax.swing.*; import java.awt.*; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import static org.dreambot.api.methods.MethodProvider.log; import static org.dreambot.api.methods.skills.Skill.FISHING; import static org.dreambot.api.methods.skills.Skill.WOODCUTTING; import static org.dreambot.api.utilities.Timer.formatTime; public class GuiHelper extends JFrame { private GuiHelper(Main m) { context = m; } public static Timer timeRan; private static Main context = null; ///////////////fishing variables///////////// static FishingHelper fishingHelper; BarbarianFish barbFisher; private static String fishingLocation; public static boolean isFishing = false; ////////////////////////////////////////////// ///////////////Woodcutting Variables////////// private static String WoodcuttingLocation; private static String woodcuttingLocation; private static boolean isWoodcutting = false; //////////////////////////////////////////////// private static boolean isFiremaking; private static boolean isMining; private static boolean isCooking; private static boolean isSmithing; private static boolean isFletching; public static boolean getisFishing() { return isFishing; } public static void setisFishing(boolean val) { isFishing = val; } ///////////////////////////////^^^^StartUp GUI^^^^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ///////////Below gui controls the gui that starts when the bot is played on DB\\\\\\\\\\\\\\\\ ///////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ public static List<Skill> SkillSelector(Component client, Main context) { SkillTracker.start(); JFrame frame = new JFrame(); frame.setTitle("AioSkillSelector"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLocationRelativeTo(client); frame.setPreferredSize(new Dimension(400, 200)); frame.getContentPane().setLayout(new BorderLayout()); frame.setVisible(true); frame.pack(); JPanel settingPanel = new JPanel(); settingPanel.setLayout(new GridLayout(0, 2)); JLabel label = new JLabel(); label.setText("Select Skill:"); settingPanel.add(label); JCheckBox fishingCheckBox = new JCheckBox(); fishingCheckBox.setText("Fishing"); settingPanel.add(fishingCheckBox); JCheckBox woodcuttingCheckBox = new JCheckBox(); woodcuttingCheckBox.setText("WoodCutting"); settingPanel.add(woodcuttingCheckBox); JCheckBox firemakingCheckBox = new JCheckBox(); firemakingCheckBox.setText("Firemaking"); settingPanel.add(firemakingCheckBox); JCheckBox miningCheckBox = new JCheckBox(); miningCheckBox.setText("Mining"); settingPanel.add(miningCheckBox); JCheckBox cookingCheckBox = new JCheckBox(); cookingCheckBox.setText("Cooking"); settingPanel.add(cookingCheckBox); JCheckBox smithingCheckBox = new JCheckBox(); smithingCheckBox.setText("Smithing"); settingPanel.add(smithingCheckBox); JCheckBox fletchingCheckBox = new JCheckBox(); fletchingCheckBox.setText("Fletching"); settingPanel.add(fletchingCheckBox); frame.getContentPane().add(settingPanel, BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); JButton button = new JButton(); button.setText("Next"); button.addActionListener(e -> { isFishing = fishingCheckBox.isSelected(); if (fishingCheckBox.isSelected()) { setisFishing(true); log("fishing set true"); GuiHelper.createFishingGUI(client, context); } isFletching = fletchingCheckBox.isSelected(); isWoodcutting = woodcuttingCheckBox.isSelected(); isFiremaking = firemakingCheckBox.isSelected(); isMining = miningCheckBox.isSelected(); isCooking = cookingCheckBox.isSelected(); isSmithing = smithingCheckBox.isSelected(); frame.dispose(); }); buttonPanel.add(button); frame.getContentPane().add(buttonPanel, BorderLayout.SOUTH); return new ArrayList<>(); } Edited December 18, 2020 by hoke2012 Link to comment Share on other sites More sharing options...
Pseudo 178 Share Posted December 18, 2020 In your onStart/gui loading, are you using SwingUtilities.invokeLater to initialize your GUI? HTM 1 Link to comment Share on other sites More sharing options...
HTM 31 Author Share Posted December 18, 2020 15 minutes ago, Pseudo said: In your onStart/gui loading, are you using SwingUtilities.invokeLater to initialize your GUI? honestly i've spent the last hour trying to figure "invokeLate" out. this is what i have as my onStar public void onStart() { SwingUtilities.invokeLater(GuiHelper.SkillSelector(Instance.getCanvas(), this)); log("Welcome to AIO by Hoke2012.");} i still seem to be facing issues though Link to comment Share on other sites More sharing options...
Pseudo 178 Share Posted December 18, 2020 (edited) public void onStart() { SwingUtilities.InvokeLater(new Runnable() { @Override public void run() { Gui g = new Gui(); g.setVisible(true); } }); } Edited December 18, 2020 by Pseudo purepanic 1 Link to comment Share on other sites More sharing options...
HTM 31 Author Share Posted December 18, 2020 problem resolves :))) Link to comment Share on other sites More sharing options...
yeeter01 487 Share Posted December 18, 2020 (edited) Glad you figured it out. Also for future script conversions I have an updater that should work for the most part to automatically update db2 source -> db3. Any issues let me know. Edited December 18, 2020 by yeeter01 Pseudo 1 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