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.

Woodcutting Bot Help

Featured Replies

Hello. I am creating a woodcutting bot but i need some help with code can anyone help me out... I have inserted my code below i need help with 2 things and they are... The bot keeps spam clicking on the same tree until it chops down the tree. And i need to make the camera adjust to the tree smile.png

 

 

 
 
 
package Woodcutter;
 
import java.awt.Graphics2D;
 
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.Skill;
 
@ScriptManifest(author = "Test", info = "Chops", logo = "N/A", name = "WoodCutter", version = 1.0)
public class Woodcutter extends Script {
 
private int beginningXP;
private int currentXp;
private int xpGained;
private int currentLevel;
private int beginningLevel;
private int levelsGained;
// code to be executed at the start of script
@Override
public void onStart() {
log("Starting Woodcutter");
log("Starting Woodcutter");
beginningXP = skills.getExperience(Skill.WOODCUTTING);
beginningLevel = skills.getStatic(Skill.WOODCUTTING);
}
 
private enum State {
CHOP, BANK, WAIT;
};
 
private State getState() {
if (!(inventory.isFull()))
return State.CHOP;
if (inventory.isFull())
return State.BANK;
return State.WAIT;
 
}
 
@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case CHOP:
Entity willowTree = objects.closest("Tree");
if (willowTree != null)
willowTree.interact("Chop down");
break;
 
case BANK:
if (inventory.isFull()) {
inventory.dropAll();
 
}
break;
 
case WAIT:
sleep(random(500, 700));
break;
}
return 50;
}
 
// code to be executed at the end
@Override
public void onExit() {
 
}
 
@Override
public void onPaint(Graphics2D g) {
currentXp = skills.getExperience(Skill.WOODCUTTING);
xpGained = currentXp - beginningXP;
g.drawString("XP Gained: " + xpGained, 25, 50);
currentLevel = skills.getStatic(Skill.WOODCUTTING);
g.drawString("Beginning Level: " + beginningLevel, 25, 60);
g.drawString("Current Level: " + currentLevel, 25, 70);
levelsGained = currentLevel - beginningLevel;
g.drawString("Levels Gained: " + levelsGained, 25, 80);
}
}
 
 
 

Something like:

 

if (willowTree != null && !myPlayer().isAnimating())

 

Should ensure that you only chop a tree when your character is not already animating.

 

As for your second question I''m not sure exactly what you are asking.

 

Edited by Molly

to make the camera move to the tree,

 

this.camera.toEntity(tree); 

 

(I think)

 

So your code fixed is:

package Woodcutter;
 
import java.awt.Graphics2D;
 
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.Skill;
 
@ScriptManifest(author = "Test", info = "Chops", logo = "N/A", name = "WoodCutter", version = 1.0)
public class Woodcutter extends Script {
 
private int beginningXP;
private int currentXp;
private int xpGained;
private int currentLevel;
private int beginningLevel;
private int levelsGained;
// code to be executed at the start of script
@Override
public void onStart() {
log("Starting Woodcutter");
log("Starting Woodcutter");
beginningXP = skills.getExperience(Skill.WOODCUTTING);
beginningLevel = skills.getStatic(Skill.WOODCUTTING);
}
 
private enum State {
CHOP, BANK, WAIT;
};
 
private State getState() {
if (!(inventory.isFull()) && !this.myPlayer().isAnimating())
return State.CHOP;
if (inventory.isFull())
return State.BANK;
return State.WAIT;
 
}
 
@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case CHOP:
Entity willowTree = objects.closest("Tree");
if (willowTree != null){
this.camera.toEntity(willowTree);
willowTree.interact("Chop down");}
break;
 
case BANK:
if (inventory.isFull()) {
inventory.dropAll();
 
}
break;
 
case WAIT:
sleep(random(500, 700));
break;
}
return 50;
}
 
// code to be executed at the end
@Override
public void onExit() {
 
}
 
@Override
public void onPaint(Graphics2D g) {
currentXp = skills.getExperience(Skill.WOODCUTTING);
xpGained = currentXp - beginningXP;
g.drawString("XP Gained: " + xpGained, 25, 50);
currentLevel = skills.getStatic(Skill.WOODCUTTING);
g.drawString("Beginning Level: " + beginningLevel, 25, 60);
g.drawString("Current Level: " + currentLevel, 25, 70);
levelsGained = currentLevel - beginningLevel;
g.drawString("Levels Gained: " + levelsGained, 25, 80);
}
}

 

Hello. I am creating a woodcutting bot but i need some help with code can anyone help me out... I have inserted my code below i need help with 2 things and they are... The bot keeps spam clicking on the same tree until it chops down the tree. And i need to make the camera adjust to the tree smile.png

 

 

 
 
 
package Woodcutter;
 
import java.awt.Graphics2D;
 
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.Skill;
 
@ScriptManifest(author = "Test", info = "Chops", logo = "N/A", name = "WoodCutter", version = 1.0)
public class Woodcutter extends Script {
 
private int beginningXP;
private int currentXp;
private int xpGained;
private int currentLevel;
private int beginningLevel;
private int levelsGained;
// code to be executed at the start of script
@Override
public void onStart() {
log("Starting Woodcutter");
log("Starting Woodcutter");
beginningXP = skills.getExperience(Skill.WOODCUTTING);
beginningLevel = skills.getStatic(Skill.WOODCUTTING);
}
 
private enum State {
CHOP, BANK, WAIT;
};
 
private State getState() {
if (!(inventory.isFull()))
return State.CHOP;
if (inventory.isFull())
return State.BANK;
return State.WAIT;
 
}
 
@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case CHOP:
Entity willowTree = objects.closest("Tree");
if (willowTree != null)
willowTree.interact("Chop down");
break;
 
case BANK:
if (inventory.isFull()) {
inventory.dropAll();
 
}
break;
 
case WAIT:
sleep(random(500, 700));
break;
}
return 50;
}
 
// code to be executed at the end
@Override
public void onExit() {
 
}
 
@Override
public void onPaint(Graphics2D g) {
currentXp = skills.getExperience(Skill.WOODCUTTING);
xpGained = currentXp - beginningXP;
g.drawString("XP Gained: " + xpGained, 25, 50);
currentLevel = skills.getStatic(Skill.WOODCUTTING);
g.drawString("Beginning Level: " + beginningLevel, 25, 60);
g.drawString("Current Level: " + currentLevel, 25, 70);
levelsGained = currentLevel - beginningLevel;
g.drawString("Levels Gained: " + levelsGained, 25, 80);
}
}

 

 

 

to make the camera move to the tree,

 

this.camera.toEntity(tree); 

 

(I think)

 

So your code fixed is:

package Woodcutter;
 
import java.awt.Graphics2D;
 
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.Skill;
 
@ScriptManifest(author = "Test", info = "Chops", logo = "N/A", name = "WoodCutter", version = 1.0)
public class Woodcutter extends Script {
 
private int beginningXP;
private int currentXp;
private int xpGained;
private int currentLevel;
private int beginningLevel;
private int levelsGained;
// code to be executed at the start of script
@Override
public void onStart() {
log("Starting Woodcutter");
log("Starting Woodcutter");
beginningXP = skills.getExperience(Skill.WOODCUTTING);
beginningLevel = skills.getStatic(Skill.WOODCUTTING);
}
 
private enum State {
CHOP, BANK, WAIT;
};
 
private State getState() {
if (!(inventory.isFull()) && !this.myPlayer().isAnimating())
return State.CHOP;
if (inventory.isFull())
return State.BANK;
return State.WAIT;
 
}
 
@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case CHOP:
Entity willowTree = objects.closest("Tree");
if (willowTree != null){
this.camera.toEntity(willowTree);
willowTree.interact("Chop down");}
break;
 
case BANK:
if (inventory.isFull()) {
inventory.dropAll();
 
}
break;
 
case WAIT:
sleep(random(500, 700));
break;
}
return 50;
}
 
// code to be executed at the end
@Override
public void onExit() {
 
}
 
@Override
public void onPaint(Graphics2D g) {
currentXp = skills.getExperience(Skill.WOODCUTTING);
xpGained = currentXp - beginningXP;
g.drawString("XP Gained: " + xpGained, 25, 50);
currentLevel = skills.getStatic(Skill.WOODCUTTING);
g.drawString("Beginning Level: " + beginningLevel, 25, 60);
g.drawString("Current Level: " + currentLevel, 25, 70);
levelsGained = currentLevel - beginningLevel;
g.drawString("Levels Gained: " + levelsGained, 25, 80);
}
}

You are awesome :)

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.