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.

Camera (Pitch & Yaw) Help

Featured Replies

So for some reason I cannot set the camera to move to specific pitch and yaw degrees. Everytime I do I get different results on current pitch and yaw.

My Code:

if (camera != null) {
    targetPitch = random(22, 67);
    targetYaw += 1;
    camera.movePitch(targetPitch);
    camera.moveYaw(targetYaw);
    log("Camera moved successfully to position [Current(Pitch: " + camera.getPitchAngle() + ", Yaw:" + camera.getYawAngle() + "), Target(Pitch: " + targetPitch + ", Yaw: " + targetYaw + ")]");
    return;
}



Results (Log):

Camera moved successfully to position [Current(Pitch: 24, Yaw: 0), Target(Pitch: 25, Yaw: 7)]
Camera moved successfully to position [Current(Pitch: 33, Yaw: 1), Target(Pitch: 33, Yaw: 8)]
Camera moved successfully to position [Current(Pitch: 58, Yaw: 3), Target(Pitch: 57, Yaw: 9)]

 

Is there a way I can get it to the specific target, so I'm able to do a check with a boolean statement?

camera.movePitch() and camera.moveYaw()  both return boolean so you can use them in an if statement.

if you want to turn to a target or position you can  use  toEntity or toPosition .

More info here. https://osbot.org/api/org/osbot/rs07/api/Camera.html

 

You're using a random number for your pitch and your target yaw is just your old value +1. If you want to test a specific location put a specific number as your target.

 

Edited by zwaffel

Those functions have a margin of +-6, I believe.

But as zwaffel mentioned both return a boolean either way.
Or you could check if the currentPitch is within 6 of the targetPitch.
Or you could keep recalling the function until it has the exact position you want.

  • Author
On 6/5/2019 at 6:23 PM, zwaffel said:

camera.movePitch() and camera.moveYaw()  both return boolean so you can use them in an if statement.

if you want to turn to a target or position you can  use  toEntity or toPosition .

More info here. https://osbot.org/api/org/osbot/rs07/api/Camera.html

 

You're using a random number for your pitch and your target yaw is just your old value +1. If you want to test a specific location put a specific number as your target.

 

That actually helped me knowing it was a boolean statement, but it did not solve trying to set the actual pitch and yaw to it's specific target.

On 6/5/2019 at 6:50 PM, Neanel said:

Those functions have a margin of +-6, I believe.

But as zwaffel mentioned both return a boolean either way.
Or you could check if the currentPitch is within 6 of the targetPitch.
Or you could keep recalling the function until it has the exact position you want.

Recalling the function doesn't help any, still ends up being the same, and yeah currently working on a fix for when the camera stops moving to return another boolean as true, hopefully this will solve my issue.

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.