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.

Beginner needs help

Featured Replies

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import javax.swing.text.Position;
import java.awt.*;

@ScriptManifest(author = "Sinatra", info = "", name = "Kil", version = 0.1, logo = "")
public class Skeleton extends Script {

    @Override
    public void onStart() {
        /*code that will run*/
        log("Welcome -- Starting the mothafukin script!");
    }

    @Override
    public int onLoop() throws InterruptedException {
        final NPC Cow = this.npcs.closest("Cow", "Cow calf");
            if(!this.myPlayer().isUnderAttack() && this.myPlayer().getInteracting() == null && Cow != null && Cow.isVisible()) {
                Cow.interact("Attack ");
                sleep(random(300, 600));

            } else {
                camera.toEntity(Cow);
                sleep(random(300, 600));
            }

        return (random(100,300));
    }

    @Override
    public void onExit() {
    log("Thank you for testing my script!");
        log("Let me know if you run in to problems!");
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

The script runs! But how do I make it not attack other peoples cows? It keeps spam clicking! sorry I am new :)

There should be an isUnderAttack method for the cow as well

  • Author

There should be an isUnderAttack method for the cow as well

thanks for the helpful information!

!cow.isUnderAttack && !cow.isAnimating

 

The cows tend to roam around a bit, so isAnimating might lose a lot of script effectiveness

The cows tend to roam around a bit, so isAnimating might lose a lot of script effectiveness

 

That is true, but cows also will be animating while they are under attack. So it also helps filter out cows that are being attacked. But I do agree that script effectiveness could be lost

 

Edited by OG Scripts

That is true, but cows also will be animating while they are under attack. So it also helps filter out cows that are being attacked. But I do agree that script effectiveness could be lost

 

 

You could debug the game and find the walking animation and the standing animation, then its just a matter of 

if(cow.getAnimation() == #### ){
etc
}

But who can be bothered doing that

Edited by Tom

  • Author

That is true, but cows also will be animating while they are under attack. So it also helps filter out cows that are being attacked. But I do agree that script effectiveness could be lost

 

So something like this 

if(!this.myPlayer().isUnderAttack() && !Cow.isUnderAttack() &&
                        this.myPlayer().getInteracting() == null && Cow != null && Cow.isVisible()) {
                    Cow.interact("Attack");

You could debug the game and find the walking animation and the standing animation, then its just a matter of 

if(cow.getAnimation() == #### ){
etc
}

But who can be bothered doing that

 

 

So something like this 

if(!this.myPlayer().isUnderAttack() && !Cow.isUnderAttack() &&
                        this.myPlayer().getInteracting() == null && Cow != null && Cow.isVisible()) {
                    Cow.interact("Attack");
if(!this.myPlayer().isUnderAttack() && !Cow.isUnderAttack() && !this.myPlayer().isAnimating()){
           
           Cow.interact("Attack");
}
  • Author
if(!this.myPlayer().isUnderAttack() && !Cow.isUnderAttack() && !this.myPlayer().isAnimating()){
           
           Cow.interact("Attack");
}

thanks again!

If you are in need of the npc attack and defending animations, search google for them. Know the name of the community site, but do not wish the break the rule on advertising. Should be the same since it's 2007 servers.

Edited by bob10

If you are in need of the npc attack and defending animations, search google for them. Know the name of the community site, but do not wish the break the rule on advertising. Should be the same since it's 2007 servers.

 

The client has debug information on this. :p

  • Author

If you are in need of the npc attack and defending animations, search google for them. Know the name of the community site, but do not wish the break the rule on advertising. Should be the same since it's 2007 servers.

just pm me

The client has debug information on this. tongue.png

Oh, true. I forgot about using it to check in-game.

 

just pm me

Cannot do so.

  • 1 year later...
NPC freeCow = getNpcs().closest(npc -> npc != null && npc.getName().equalsIgnoreCase("Cow") &&
                ((npc.getInteracting() == null && !npc.isUnderAttack()) || (npc.getInteracting() != null && npc.getInteracting() == myPlayer())));

 

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.