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.

Starting a Basic script, need some help

Featured Replies

Whats up y'all finally started to make a script =D as I posted in the tutorials, I needed some help, and I got a bit but most of it was done by myself...(; Just got some questions if any scripter can answer feel free to post/pm me your skype. Thanks!

 

Here is the code I have questions about:

 

 

package woodcutter;

 
import java.awt.Graphics;
 
import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;
import org.osbot.script.rs2.model.Entity;
import org.osbot.script.rs2.model.Player;
import org.osbot.script.rs2.ui.Bank;
import org.osbot.script.rs2.ui.Inventory;
import org.osbot.script.rs2.utility.Area;
 
 
@ScriptManifest(author = "Highball", info = "Chops Willow Trees in Drynor", name = "Woodcutter", version = 0)
public class WoodCutter extends Script{
 
 
final String WILLOW_NAME = "willow";
final Area BANK_AREA = new Area(3092,3240,2097,3246);
final Area WILLOW_AREA = new Area(3081,3223,3092,3239);
final int BANK_BOOTH_ID = 2196;
 
 
 
// code used at start
public void onStart(){
 
 
}
 
// code to be executed at the end
public void onExit(){
 
}
 
// code in loop
public int onLoop() throws InterruptedException {
 
Inventory inven = client.getInventory();
Player player = myPlayer();
Bank bank = client.getBank();
 
if(!inven.isFull()){
// chop
 
 
if(WILLOW_AREA.contains(player)){
org.osbot.script.rs2.model.Entity willow = closestObjectForName(WILLOW_NAME); 
 
if (willow != null) 
if (willow.isVisible()) {
if (!player.isAnimating()) {
if(!player.isMoving()) {
willow.interact("chop down");
sleep(random(700,800));
}
}
}else{
client.moveCameraToEntity(willow);
 
}
}
}else{
walk(WILLOW_AREA);
}
 
 
 
// bank
if(BANK_AREA.contains(player)){
Entity bankbooth = closestObject(BANK_BOOTH_ID);
 
 
if(bank.isOpen()) {
bank.depositAll();
 
 
}else{
if(bankbooth != null){
if(bankbooth.isVisible()) {
bankbooth.interact("bank");
sleep(random(700,800));
}else{
client.moveCameraToEntity(bankbooth);
}
 
}
 
}
 
} else {
walk(BANK_AREA);
}
 
 
 
return 50;
 
 
}
 
// paint
public void onPaint(Graphics g) {
}
}
 

 

Edited by highball

  • Author

Thanks zappa sent you a pm with my skype

 

Yo zappa, after running it for a min, it still has problems with clicking on the bank booth...any idea why that is?

Edited by highball

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.