roguehippo Posted August 29, 2017 Posted August 29, 2017 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
whipz Posted August 29, 2017 Posted August 29, 2017 Are you running in low cpu mode ? or low resource mode ?
HEZ Posted August 29, 2017 Posted August 29, 2017 (edited) 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 August 29, 2017 by HEZ
Apaec Posted August 29, 2017 Posted August 29, 2017 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?
Fleeb Posted August 29, 2017 Posted August 29, 2017 (edited) 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. Edited August 29, 2017 by Fleeb
HEZ Posted August 29, 2017 Posted August 29, 2017 @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.
roguehippo Posted August 29, 2017 Author Posted August 29, 2017 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?
roguehippo Posted August 29, 2017 Author Posted August 29, 2017 has anyone ever had this problem where paint isnt showing up? is it like a file messup? idk why onPaint isnt getting called.
Fleeb Posted August 30, 2017 Posted August 30, 2017 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
roguehippo Posted August 30, 2017 Author Posted August 30, 2017 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?
Fleeb Posted August 30, 2017 Posted August 30, 2017 (edited) 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 August 30, 2017 by Fleeb
roguehippo Posted August 31, 2017 Author Posted August 31, 2017 i deleted my local and data folders. the paint still doesnt show up. the paint does show up for my other scripts. should i just remake the project and copy and paste code?
roguehippo Posted August 31, 2017 Author Posted August 31, 2017 i made a new project and copied the code over but that didnt help. redownloaded osbot. nothing helps i dont get it