Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cost of Drawing / Reducing paint refresh rate

Featured Replies

Just had a thought. If you wanted to limit your refresh rate to say 10fps.

 

Instead of redrawing each time in your onpaint. Have an Image stored in memory, then ever 1/10th of a second update it in your paint code.

 

So some code off the top of my head. functions wont be right and you will have to put everything that you currently do in redrawImage and have it output to a single image of just the stuff to be drawn.

currenttime = System.currentTimeMilliseconds();
if(nextdrawtime-currenttime <= 0)
{
	storedImage = redrawImage();
	nextdrawtime = currenttime+100;
}

g.draw(storedImage); // I know that won't be correct call, on phone and don't use paint much

 

That would mean every 100ms it updates the storedImage with the new stuff that should be on screen then draws it. If its less than 100ms since last redraw of image, just draw image from memory, which should be a lot less resource intensive then doing all of the other stuff. In theory at least, just an idea, no clue if it will have intended effect.

Edited by venetox

Just add a timer and find the average frequency of the paint and only paint every x time.

 

In LoL, it's based on every time DX EndScene is called, which is effectively measured through FPS. So if your FPS is 300, there's no sense in drawing 300x a second when your monitor is only 60 Hz.

Just add a timer and find the average frequency of the paint and only paint every x time.

 

In LoL, it's based on every time DX EndScene is called, which is effectively measured through FPS. So if your FPS is 300, there's no sense in drawing 300x a second when your monitor is only 60 Hz.

 

It's capped at 60  (I think) FPS.

I wouldn't recommend going this way, everything will look stuttered.

It's capped at 60  (I think) FPS.

I wouldn't recommend going this way, everything will look stuttered.

 

Yeah it would be better if there was an event for when the client paints, since onPaint is probably ran at the same frequency as onLoop.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.