August 29, 20178 yr 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
August 29, 20178 yr 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, 20178 yr by HEZ
August 29, 20178 yr 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?
August 29, 20178 yr 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, 20178 yr by Fleeb
August 29, 20178 yr @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.
August 29, 20178 yr Author 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?
August 29, 20178 yr Author has anyone ever had this problem where paint isnt showing up? is it like a file messup? idk why onPaint isnt getting called.
August 30, 20178 yr 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
August 30, 20178 yr Author 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?
August 30, 20178 yr 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, 20178 yr by Fleeb
August 31, 20178 yr Author 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?
August 31, 20178 yr Author i made a new project and copied the code over but that didnt help. redownloaded osbot. nothing helps i dont get it
Create an account or sign in to comment