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.

help i have a error on camera position

Featured Replies

Hello i am lepie and new here.

I dont have any experience with bots, so i try to make somthing.  can some one help me. Sorry for my bad english.

 

thanks

 Woodcutter;

import java.awt.Graphics;
import org.osbot.rs07.api.Camera;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "lepie1990", info = "wodcutter", logo = "", name = "woodcutter", version = 1.0)

public class Woodcutter extends Script {

	int tree[] = { 1278, 1286, 1276 };
	int oak[] = { 1751 };
	int willow[] = { 1750, 1756, 1758, 1760 };

	final Area tree_Varrock_Weast_area = new Area(3177, 3376, 3133, 3458);
	final Area Bank_Varock_Weast_ex_area = new Area(3162, 3485, 3168, 3492);
	final Area Bank_Varock_Weas_Great_area = new Area(3185, 3433, 3181, 3446);
	final Area Bank_Varock_East_area = new Area(3254, 3420, 3251, 3422);

	final String TREE_NAME1 = "Tree";
	final String OAK_NAME = "Oak";
	final String WILLOW_NAME = "Willow";

	final int AnimationChop = 879;
	final int AnimationStilStaan = -1;
	final int Sleeptime = 5000;

	final int BoothBank_Varock_Weas_Great_id = 7409;

	Camera camera;
	Player player;

	// game loop
	public int onLoop() throws InterruptedException {
		// make tree a object
		RS2Object CLOSEST_TREE = objects.closest(tree);
		RS2Object BoothBank = objects.closest(BoothBank_Varock_Weas_Great_id);

		// check is inventory is full
		if (!inventory.isFull()) {
			int CLOSEST_TREE_ID = CLOSEST_TREE.getId();// debug
			String CLOSEST_TREE_NAME = CLOSEST_TREE.getName();// debug
			logger.debug(CLOSEST_TREE_ID);// debug
			logger.debug(CLOSEST_TREE_NAME);// debug

			// chop the tree
			LookForTreeToChop(CLOSEST_TREE);

		} else {
			// bank
			logger.debug("bank or drop or bonfire");

			Banking(Bank_Varock_Weas_Great_area, BoothBank);
		}
		return 10;
	}

	// paint info
	public void onPaint(Graphics g) {

	}

	public void ChopDown(RS2Object CLOSEST_TREE_TO_CHOP) throws InterruptedException {
		// check of player is bushy with tasks
		if (myPlayer().getInteracting() == null) {
			// check is player is moving
			if (!myPlayer().isMoving()) {
				// check is player do nothing
				if (myPlayer().getAnimation() == AnimationStilStaan) {
					// chop down the tree
					CLOSEST_TREE_TO_CHOP.interact("Chop down");
					sleep(Sleeptime);
					logger.debug(myPlayer().getAnimation()); // debug
				}
			}
		}
	}

	public void LookForTreeToChop(RS2Object CLOSEST_TREE_TO_CHOP) throws InterruptedException {
		// check for nearby tree to chop
		if (CLOSEST_TREE_TO_CHOP != null) {
			logger.debug("tree not null");// debug
			// check if tree is on screen
			if (CLOSEST_TREE_TO_CHOP.isVisible()) {
				logger.debug("tree is visble");// debug
				// chop down the tree
				ChopDown(CLOSEST_TREE_TO_CHOP);
			} else {

				// turn the camera towards the tree
				camera.toPosition(CLOSEST_TREE_TO_CHOP.getPosition());
				logger.debug("Turn camera");// debug
			}
		}
	}

	public void Banking(Area Bank, RS2Object BankBooth) {
		// check if player is in the bank
		if (Bank.contains(player)) {
			logger.debug("Player is in the bank");// debug
			// check for nearby Bankbooth
			if (BankBooth != null) {
				logger.debug("Bank is not null");// debug
				if (BankBooth.isVisible()){
					logger.debug("Bank is viable");// debug
					BankBooth.interact("Bank");
				}
			}
		} else {
			// walking thwarts the bank
			walking.walk(Bank);
		}
	}

	public void onStart() {
	}

	// code to be executed at the end
	public void onExit() {

	}

}

 

8 hours ago, Lepie1990 said:

Thanks a lot.

I see now that i have posted in the wrong section:o

For suggestions i suggestion u to use Names instead of static IDs and as for turning camera and all try using InteractionEvent and controling the threshold? but usually using normal .interact() will check if its visible and etc if not it will turn camera by default.
Instead of using static sleeps use ConditionalSleeps.
Also walking.walk() is using for short distance u should use walking.webWalk() for long distance(for example while walking to bank).

I suggest u going thro @Explvs guide:

 

Edited by progamerz

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.