Jump to content

paint not showing up


roguehippo

Recommended Posts

hello everyone, for some reason i cant get my paint to show up. ive looked through the tutorials and cant tell what im doing wrong. im just trying to get a purple box with some exp trackers. the exp tracker has been set to track prayer. heres the code:

 public void onPaint(Graphics2D g) 
    {
        Color purpleBackGround = new Color(138,43,226,bgShade);
        g.setColor(purpleBackGround);
        g.fillRect(0, 200, 800, 50);
        g.setColor(Color.LIGHT_GRAY);
        g.drawString("Prayer XP Gained: " + getExperienceTracker().getGainedXP(Skill.PRAYER),5,210);
    }

thanks for the help

Link to comment
Share on other sites

 public void onPaint(Graphics2D g) {

	super.onPaint(g2d);

        Color purpleBackGround = new Color(138,43,226,bgShade);

        g.setColor(purpleBackGround);

        g.drawRect(0, 200, 800, 50);

        g.setColor(Color.LIGHT_GRAY);

        g.drawString("Prayer XP Gained: " + getExperienceTracker().getGainedXP(Skill.PRAYER),5,210);

    }

Try this:)

Edited by HEZ
Link to comment
Share on other sites

5 hours ago, roguehippo said:

hello everyone, for some reason i cant get my paint to show up. ive looked through the tutorials and cant tell what im doing wrong. im just trying to get a purple box with some exp trackers. the exp tracker has been set to track prayer. heres the code:

 public void onPaint(Graphics2D g) 
    {
        Color purpleBackGround = new Color(138,43,226,bgShade);
        g.setColor(purpleBackGround);
        g.fillRect(0, 200, 800, 50);
        g.setColor(Color.LIGHT_GRAY);
        g.drawString("Prayer XP Gained: " + getExperienceTracker().getGainedXP(Skill.PRAYER),5,210);
    }

thanks for the help

At a glance, the code looks okay. Have you started the exp tracker? in your onStart, do something along the lines of getExperienceTracker.start(Skill.PRAYER) I think.

41 minutes ago, HEZ said:

 public void onPaint(Graphics2D g) {

	super.onPaint(g2d);

        Color purpleBackGround = new Color(138,43,226,bgShade);

        g.setColor(purpleBackGround);

        g.drawRect(0, 200, 800, 50);

        g.setColor(Color.LIGHT_GRAY);

        g.drawString("Prayer XP Gained: " + getExperienceTracker().getGainedXP(Skill.PRAYER),5,210);

    }

Try this:)

Not sure what you're doing here?

Link to comment
Share on other sites

55 minutes ago, HEZ said:

 public void onPaint(Graphics2D g) {

	super.onPaint(g2d);

        Color purpleBackGround = new Color(138,43,226,bgShade);

        g.setColor(purpleBackGround);

        g.drawRect(0, 200, 800, 50);

        g.setColor(Color.LIGHT_GRAY);

        g.drawString("Prayer XP Gained: " + getExperienceTracker().getGainedXP(Skill.PRAYER),5,210);

    }

Try this:)

if the problem was that script.onpaint wasn't being called, how could your super.onpaint() call be reached. your solution doesnt make any sense

@roguehippo your code works fine, so the issue is unrelated to the paint code. Make sure that you're compiling to the correct osbot directory, and clicking "refresh" before running your script.

G6TCzza.png


 

 

Edited by Fleeb
Link to comment
Share on other sites

@Apaec @Fleeb My bad guys didn't really read the post properly, purely ripped some code off a prayer script I wrote, adapted it to fit his variables, without really explaining myself. If that code is working fine for Fleeb, it could be several things that are causing this. His software may be compiling to the wrong location, a lot of the time it'll default to compile to the location where your class files etc.. are stored, @roguehippo if you update other aspects of the script do they change after compiling? Also, what program are you scripting with? And are any parts of the paint appearing, such as just the box with no tracker? Sorry for the original confusion.

Link to comment
Share on other sites

just woke up, thanks guys for the help, 

6 hours ago, Apaec said:

At a glance, the code looks okay. Have you started the exp tracker? in your onStart, do something along the lines of getExperienceTracker.start(Skill.PRAYER) I think.

Not sure what you're doing here?

i have started the tracker for the prayer skill in on start.

@Fleeb compiling to the correct osbot directory? do you mean like file directory to save the script in the right folder?

Link to comment
Share on other sites

9 hours ago, roguehippo said:

just woke up, thanks guys for the help, 

i have started the tracker for the prayer skill in on start.

@Fleeb compiling to the correct osbot directory? do you mean like file directory to save the script in the right folder?

if you're using windows, your osbot directory should be located in C:\users\yourname\osbot

if it isn't in there, check the other user directories for the osbot folder

Link to comment
Share on other sites

2 hours ago, Fleeb said:

if you're using windows, your osbot directory should be located in C:\users\yourname\osbot

if it isn't in there, check the other user directories for the osbot folder

i could find osbot but then what. its pretty weird that the code works but the paint just wont show up. is it a compiling issue? or maybe a problem with my client download?

Link to comment
Share on other sites

2 hours ago, roguehippo said:

i could find osbot but then what. its pretty weird that the code works but the paint just wont show up. is it a compiling issue? or maybe a problem with my client download?

try deleting your osbot folder completely, then running the client and seeing if your script still appears. Lmk know what happens 

Edited by Fleeb
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...