ggdre 0 Share Posted January 24, 2023 (edited) EDIT: Solved by enabling script paint in menu... someone please delete this to hide my shame I'll start off by saying I'm completely new to programming with DreamBot and Java as a whole. Tried writing my first DB script today (a simple banking woodcutter) but can't for the life of me get onPaint() to paint my strings. I've ready many of the (really great) guides on this forum and still can't get it to work. I know I must be missing something simple - here is my code: private Timer timer; @Override public void onPaint(Graphics graphics) { Graphics2D g = (Graphics2D)graphics; // Have tried both with and without casting to Graphics2D g.setColor(Color.GREEN); g.setFont(new Font("Arial",Font.PLAIN,12)); g.drawString("XP/hour: " + SkillTracker.getGainedExperiencePerHour(Skill.WOODCUTTING),15,15); g.drawString("Total XP: " + SkillTracker.getGainedExperience(Skill.WOODCUTTING),15,35); g.drawString("Running for: " + timer,15,55); super.onPaint(g); // Have also tried with and without with no luck } I'm not calling onPaint() on paint anywhere else, which is my first thought as someone familiar with Python. Please help if you know how! Edited January 24, 2023 by ggdre I'm an idiot Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now