Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Way to add component listener to frame?


    Calculus

    Recommended Posts

    Is there a way to add a component listener to the dreambot client? I've been searching for a way, but can't find one. I tried this:

    getClient().getInstance().getApplet().addComponentListener(new ComponentAdapter() {
                @Override
                public void componentMoved(ComponentEvent e) {
                    MethodProvider.log("HI");
                }
            });
    

    Sadly, that's the applet (just the runescape screen inside of dreambot's JFrame). Is there a way to access component listeners for the dreambot JFrame itself?

     

    Thanks.

    Link to comment
    Share on other sites

    • 2 weeks later...

    No, you really didn't. There is no way to access dreambot's frames.

    fuck off troll

    import org.dreambot.api.methods.*;
    import org.dreambot.api.script.*;
    
    import java.awt.*;
    import java.awt.event.*;
    
    @ScriptManifest(name = "i can get the dreambot frame haha", description = "xd", author = "cockulus", version = 69, category = Category.AGILITY)
    public final class TheresLiterallyNoWayToGetTheDreambotFrame extends AbstractScript {
    
    @Override
    public void onStart() {
    Frame calculusSaidThatItsLiterallyImpossibleToAccessTheDreambotFrame = getDreambotFrame();
    if (calculusSaidThatItsLiterallyImpossibleToAccessTheDreambotFrame == null) {
    throw new RuntimeException("uh oh");
    }
    calculusSaidThatItsLiterallyImpossibleToAccessTheDreambotFrame.addComponentListener(new ComponentAdapter() {
    @Override
    public void componentMoved(ComponentEvent e) {
    MethodProvider.log("LOOOOL IM SOKE BAKED MANG");
    }
    });
    }
    
    @Override
    public int onLoop() {
    return 69_420;
    }
    
    private static Frame getDreambotFrame() {
    for (Frame frame : Frame.getFrames()) {
    if (frame.getTitle().toLowerCase().contains("dreambot")) {
    return frame;
    }
    }
    return null;
    }
    }
    
    
    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.