Skip 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.

Trouble Burying Bones

Featured Replies

I'm trying to make a basic chicken killer that collects feathers and buries bones. I had it attacking and collecting feathers fine but as soon as I added the bury option/case it breaks completely as it just stands there doing nothing. On top of this the client is also unresponsive forcing me to use task manager to close down the bot. 

 

Any ideas? 

 

Thanks

import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.model.Character;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.*;

@ScriptManifest(name = "EmpiresChickenKiller", author = "Empires", version = 1.0, info = "", logo = "") 
public class EmpiresChickenKiller extends Script {


    @Override
    public void onStart() {
        log("Welcome to EmpiresChickenKiller.");
        log("Lets get started...");
    }
    
    private enum State {
     ATTACK, WAIT, BURY
    };
    
    private Inventory playerInventory;
    
    private State getState(){
     if(myPlayer().isMoving() || combat.isFighting() || myPlayer().isUnderAttack())
      return State.WAIT; 
     else if(playerInventory.getEmptySlotCount() > 0)
      return State.ATTACK;
     else
      return State.BURY;
    }


    @Override
    public int onLoop() throws InterruptedException {
     
     switch(getState()) {
     
     case ATTACK:
     GroundItem featherCollect = groundItems.closest("Feather");
     if(featherCollect != null)
      featherCollect.interact("Take");
      sleep(random(500,700));
     
     GroundItem bonesCollect = groundItems.closest("Bones");
     if(bonesCollect != null)
      bonesCollect.interact("Take");
      sleep(random(400,600));
     
     NPC targetChicken = npcs.closest("Chicken");
     if(!targetChicken.isOnScreen())
      camera.toEntity(targetChicken);
     
     if(targetChicken != null && !targetChicken.isUnderAttack() && (targetChicken.getHealth() != 0))
      targetChicken.interact("Attack"); 
      sleep(random(500,800)); 
     break;


     case WAIT:
      sleep(random(300,500));
      break;
     
     case BURY:
     playerInventory.dropAllExcept("Feathers", "Bones");

     while(playerInventory.contains("Bones"))
      playerInventory.interact("Bury", "Bones");
      sleep(random(200,310)); 


     break;


     }
     
     return 100;

    }
    
    @Override
    public void onExit() {
        log("Thanks for using my script!");
    }

    @Override
    public void onPaint(Graphics2D g) {
        //This is where you will put your code for paint(s)
    }


}

you never initialized playerInventory.

This whole script is horrible.

This whole script is horrible.

 

It really is not horrible. No need for elitist remarks.

  • Author

you never initialized playerInventory.

Thanks for reply,

 

would you be able to hint me on how to do that? I tried using playerInventory.initializeModule() at the start of my onLoop() and it compiled but still crashed. Am I doing that right?

 

sorry for basic bitch question, first time scripting ://

Thanks for reply,

 

would you be able to hint me on how to do that? I tried using playerInventory.initializeModule() at the start of my onLoop() and it compiled but still crashed. Am I doing that right?

 

sorry for basic bitch question, first time scripting ://

 

What a nice guy :)

playerInventoy = getInventoy();
  • Author

 

What a nice guy smile.png

playerInventoy = getInventoy();

omg it works hahaha thanks so much  :)) been stuck for literally like 2 hours -_-

It really is not horrible. No need for elitist remarks.

Yes, it is horrible. The script will fail to run properly and/or crash so frequently that it wouldn't even be worth running. I could waste my time listing out everything that's wrong with this script if I wanted to. My comment has nothing to do with myself, it's about letting him know that he needs to improve if he wants to write a script that won't crash or spam click random rs entities.

Edited by Flamo

  • Author

Yes, it is horrible. The script will fail to run properly and/or crash so frequently that it wouldn't even be worth running. I could list out everything that's wrong with this script, it's not about being an Elitist, it's about letting him know that he needs to improve if he wants to write a fully functional script.

chill. well it is my first time writing one so its obviously gonna be a bit meh, but I did just ask you why it sucks so if you can list stuff can you let me know what about it that makes it bad?

Yes, it is horrible. The script will fail to run properly and/or crash so frequently that it wouldn't even be worth running. I could waste my time listing out everything that's wrong with this script if I wanted to. My comment has nothing to do with myself, it's about letting him know that he needs to improve if he wants to write a script that won't crash or spam click random rs entities.

 

XxMLGxX scripter tell us what he should add to his chicken killer.

chill. well it is my first time writing one so its obviously gonna be a bit meh, but I did just ask you why it sucks so if you can list stuff can you let me know what about it that makes it bad?

Yeah, I'd love to give you a explanation as to why your code is bad.

https://www.teamspeak.com/downloads

Install teamspeak, join "elitescripts.org" and poke me "Danny" in the java channel. I'm not going to waste my time writing a longwinded post that you won't understand when I could speak to you and clear things up in a fraction of the time.

Edited by Flamo

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.