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

Best Way To Optimize Your Scripts!

Featured Replies

Hello fellow scripters,

 

you know that "int onLoop()" method you guys like to use a lot? Well depending on how much logic you handle within this method call, you could be making your bot use more CPU. The best way to reduce this CPU usage is to raise the value given to it. In essence, you shouldn't be looping at less than 150 ms because it's a complete waste of CPU power and makes your script more detectable!

 

Do you really think your brain makes concious decesions about the game your playing at 20 times a second (assuming your using return values of 50 ms)? No... in fact heres some data:

 

http://www.humanbenchmark.com/tests/reactiontime/

 

They're median response time for humans on their study is 215 ms.

 

I'm not exactly sure to what extent some scripters do this, but the more instructions you run per second, the more power your CPU needs to allocate to the script.

 

Additionally, if your script for some reason needs to spam click or something, then make sure that your script doesn't execute many instructions when its looping at higher speeds. In essence, if you made it only do this...

public int onLoop() {
   return 50;
}

... than your not going to be using much CPU. But if you have an onLoop() method FILLED with hundreds of if-statements and conditionals everywhere, you're going to be using MUCH MUCH more!

 

 

So tl;dr; Use a sleep time like gRandom(215, 80). That method uses a mean of 215 with a standard deviation of 80ms.

 

Additionally, RuneScape's servers loop exactly every 600ms. What does this mean? It means that for every step you take in RS while walking, it takes roughly 600ms. If you're running, the steps get sent twice every 600ms. When you click on an object, it takes approximately 600ms for it to open. Etc. Etc.

 

Thanks,

Hopefully you guys learned something.

Hey Laz, please add this to the javadocs so it comes up in the API

 

It would make it more helpful (I didn't realise the returned value did this), I assumed it was an exit status (d'oh)

  • 4 weeks later...
  • 2 weeks later...

I thought this was common sense O_o

 

Lol you'd be surprised at how often people ask me to look over their code and it says "return 0" at the end...

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.