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
  • onPaint isn't being called


    botslave

    Recommended Posts

    Hi Guys,

     

    For some reason the onPaint override is not being called on my script.

     

    https://imgur.com/Rnl063Y

     

    Tried both Graphics and Graphics2D

     

    Anything I did wrong? Do I need to extend/implement something?

     

    Oh and also none of the debug overlays show up for me :|

     

    Thanks

     

    For some reason the onPaint override is not being called on my script.

     

    https://imgur.com/Rnl063Y

     

    Tried both Graphics and Graphics2D

     

    Anything I did wrong? Do I need to extend/implement something?

     

    Oh and also none of the debug overlays show up for me :|

     

    Thanks

     

    EDIT: Nvm I fixed it - Dont open the client via the jar files in the install location otherwise the java engine stuff doesnt seem to run!

    Link to comment
    Share on other sites

    On your on start have you put
     

            
    try {
                image = ImageIO.read(new URL("http://i.imgur.com/Picuture.png"));
            } catch (IOException e){
                log("Failed to load image.");
            }
    

    Also for your 

            if (image != null){
                g.drawImage(image, 7,345, null);
            }
    

    Btw remove the logs before running the script or it will run at like 3 fps

    Link to comment
    Share on other sites

    On your on start have you put

     

            
    try {
                image = ImageIO.read(new URL("http://i.imgur.com/Picuture.png"));
            } catch (IOException e){
                log("Failed to load image.");
            }
    

    Also for your 

            if (image != null){
                g.drawImage(image, 7,345, null);
            }
    

    Btw remove the logs before running the script or it will run at like 3 fps

     

    Hey I guess I should have added this snippet, I already loaded the image from the web and that seems to work fine:

     

    https://imgur.com/C1gqeKF

     

    As for the logs, I will remove them later once I can get the damn thing working lol.

     

    It's more like onPaint() isn't being called at all, I dont see the logging in the client console and no image on the screen.

    Nvm I fixed it - Dont open the client via the jar files in the install location otherwise the java engine stuff doesnt seem to run!

    Link to comment
    Share on other sites

    If you are extending AbstractScript / TaskScript (I believe that is what it's called) -- do not implement PaintListener. I found out that doing that doesn't allow you to call the onPaint() method.

     

    The script classes that you use for super-classes already have PaintListener implemented so there is no need to reinvent the wheel on it.

    Link to comment
    Share on other sites

    EDIT: Nvm I fixed it - Dont open the client via the jar files in the install location otherwise the java engine stuff doesnt seem to run!

     

    How do you open the client without doing this? I am having the same issue

    Link to comment
    Share on other sites

    How do you open the client without doing this? I am having the same issue

    Open DBLauncher.jar not Client.jar, you download DBLauncher from the website if you can't find it.

    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.