Jump to content

The Full Paint Tutorial - All aspects covered - Pug Tutorials


Pug

Recommended Posts

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 ^_^

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 4 weeks later...

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
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...