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.

What.......the hell....

Featured Replies

Fuck logic, amirite?

47ddb5945398552ca10d15529e34f0c5.png

 

Percentage is not doing what it's supposed to? I'm like 99% sure my calculation is right... T_T maybe i'm missing some super small stupid detail but wut.

  • Author

Make sure you cast correctly

distPerc = (double)((currentDist / startDistance) * 100);

Still doesn't work :c

Edited by Paradox68

distPerc = (double)((currentDist / startDistance) * 100);

Still doesn't work :c

 

 

I don't think you're fixing the problem there,

distPerc = (((double)currentDist / (double)startDistance) * 100.0);

and make sure disPerc is of type double too, I think that should work?

  • Author

I don't think you're fixing the problem there,

distPerc = (((double)currentDist / (double)startDistance) * 100.0);

and make sure disPerc is of type double too, I think that should work?

 

111ce4c697b91e8b9a1dcf915df0392c.png

 

 

WTHHHHHH

You're updating distPerc once, and only once, at the top of your onLoop() method. This is the root of your problem.

 

You need to update both of them in your onPaint() method.

 

 

Edited by Final Calibur

  • Author

You're updating distPerc once, and only once, at the top of your onLoop() method. This is the root of your problem.

 

You need to update both of them in your onPaint() method.

 

 

I had them in onPaint before, same problem.

 

EDIT:

I DON'T KNOW HOW but putting it back in onPaint fixed it! thanks so much guys!

Edited by Paradox68

I had them in onPaint before, same problem.

 

In the image that you posted, this is the issue.

 

distPerc was never being updated after you start the script, however you are updating currentDist in your onPaint() method. This would lead to the Distance: display on your paint showing correctly, however the percentage display is stuck at the original calculated amount at the start of the script.

 

As everyone else is saying, you also need to make sure you're casting at least one of the variables in your distPerc calculation to a double (either currentDist or startDist), so that it performs floating point multiplication. This is for accuracy purposes.

Create an account or sign in to comment

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.