Jump to content

The Full Paint Tutorial - All aspects covered - Pug Tutorials


Recommended Posts

Posted

Great tutorial! Looks like you put some time into this.

 

thanks Hayden, i plan on adding more content to the first post over the coming hours/days :) will also add example scripts to each section so that people can see it all in the right place.

 

I clicked on it from recent topics, so i couldn't see which section it was in doge.png

 

haha jokingggg dont worry all good ^_^

Posted

Nice informative tut pug! Maybe add in buttons, percentage to level bars etc..? just a thought smile.png

 

hey pecher, thanks. Yep guna add it all eventually wrote all thats there in one day and since got snowed under with my rc script :) will add all that you see in my paints later on :)

Posted (edited)

Very nice guide.

However, having many recurring calculations in your onPaint could become unnecessarily expensive, I recommend creating  separate looping threads with a custom loop times holding the values the paint should then draw . It does make a difference in performance cost to make the script calculate the data to be painted every 5 seconds instead of every lets say 500ms, and from a consumer point of view it doesn't make a huge difference because most of the time they aren't even around to watch that data (considering botting is essentially an AFK activity). Performance is key!

 

Edited by Botrepreneur
Posted

Very nice guide.

However, having many recurring calculations in your onPaint could become unnecessarily expensive, I recommend creating a separate looping thread with a custom loop time holding the values the paint should then draw (this thread would also go to sleep whenever the paint is hidden). It does make a difference in performance cost to make the script calculate the data to be painted every 5 seconds instead of every lets say 500ms, and from a consumer point of view it doesn't make a huge difference because most of the time they aren't even around to watch that data (considering botting is essentially an AFK activity). Performance is key!

 

Never actually though of that but just adding a sleep in onPaint would have the same effect right while being a bit simpler?

Posted

Never actually though of that but just adding a sleep in onPaint would have the same effect right while being a bit simpler?

 

Multiple threads for different paint data is the best way to go imo, for example: you might want to have real-time display of the run time which would be relatively cheap in terms of processing but only a once every 5 seconds update of your experience tracker(s) which would be more costly.

 

But if you don't mind applying the same performance cost restrictions to all calculations, then pausing your onPaint could do just that indeed ^^

 

 

 

 

  • Like 1
  • 4 weeks later...
Posted (edited)

Do NOT add a sleep in the onPaint method facep.gif

 

OSBot subclasses the Canvas (specifically to override the getGraphics method) which allows us to paint directly over the game image buffer. Adding a sleep will not only make your paint update slower but also the game frame rate.

Edited by Swizzbeat
  • Like 2

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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