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.

Frog Killer w/ Teleport support

Featured Replies

Made an updated version of my first Frog killing script. 

Whats new?

- Teleport to Lumbridge Castle if you have the proper runes in you're inventory, walks to bank and withdraws more Tuna.

- If you don't have the level to cast Teleport have no fear. I've added an option for walking as well :)

 

Id like to add:

- @Explv's sleep curious how I can add it to the API to use in all my scripts

- Moving of camera to NPC when im attacking it and it's not visible on screen

- Logging out (Stopping script) if out of Tuna in the bank

Feedback appreciated! :D

CODE:

 

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.ui.Spells;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;


@ScriptManifest(name = "Frog killer", logo = "", version = 1, author = "Imthabawse", info = "Kills frogs for gains")

public final class FrogKiller extends Script {

    private final Area killArea = new Area(3208, 3168, 3194, 3181);
    private final Area teleArea = new Area(3226, 3227, 3217, 3212);

    @Override
    public void onStart() {
        log("Welcome to Frog Killer.. let's get to it!");
    }

    @Override
    public int onLoop() throws InterruptedException {
        killFrog();
        bank();
        eat();
        return 2500;
    }





    private void eat() {
        if (myPlayer().getHealthPercent() < 55 && getInventory().contains("Tuna")) {
            log("I got an owie, let's eat!");
            getInventory().interact("Eat", "Tuna");
        }
    }


    private void bank() throws InterruptedException {
        if (!getInventory().contains("Tuna") && !myPlayer().isAnimating() && !myPlayer().isMoving() && getInventory().contains("Air rune", "Earth rune", "Law rune")) {
            log("Teleportings for cool kids!");
            getMagic().castSpell(Spells.NormalSpells.LUMBRIDGE_TELEPORT);
            new ConditionalSleep(10000) {
                @Override
                public boolean condition() {
                    return teleArea.contains(myPosition());
                }
            }.sleep();
            log("Walking to bank.. please wait patiently.");
            getWalking().webWalk(Banks.LUMBRIDGE_UPPER);
            log("Opening bank..");
            getBank().open();
            log("Withdrawling Tuna's..");
            getBank().withdrawAll("Tuna");
            getTabs().open(Tab.INVENTORY);
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return getInventory().contains("Tuna");
                }
            }.sleep();
        } else if (!getInventory().contains("Tuna") && !myPlayer().isAnimating() && !myPlayer().isMoving()) {
            log("Welp can't tele.. let's walk...");
            getWalking().webWalk(Banks.LUMBRIDGE_UPPER);
            log("Opening bank..");
            getBank().open();
            log("Withdrawlings Tuna's..");
            getBank().withdrawAll("Tuna");
            getTabs().open(Tab.INVENTORY);
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return getInventory().contains("Tuna");
                }
            }.sleep();
        }
    }


    private void killFrog() {
        if (!killArea.contains(myPosition()) && getInventory().contains("Tuna")) {
            log("Let's get to killing!");
            getWalking().webWalk(killArea);
        } else if (killArea.contains(myPosition()) && !myPlayer().isAnimating() && !myPlayer().isMoving() && getInventory().contains("Tuna")) {
            NPC frog = getNpcs().closest(killArea,"Giant frog","Big frog");
            if (!frog.isUnderAttack() && !frog.isHitBarVisible() && frog.isOnScreen()) {
                    log("DIE! FROG! DIE!");
                    frog.interact("Attack");
                    new ConditionalSleep(5000) {
                        @Override
                        public boolean condition() {
                            return myPlayer().isAnimating();
                        }
                    }.sleep();
                }
            }
        }
    }

It's getting better and better :)

Adding camera movement: 

        //NPC frog = getNpcs().closest(killArea,"Giant frog","Big frog");
        //it's better to use filter here with all conditions that you want for finding frog.
        //in your code before it would only return frog with correct frog name, however, it might return
        // you a frog that was already under attack/frog which has hit bar visible.
        NPC frog = npcs.closest(npc -> (npc.getName().equals("Giant frog") || npc.getName().equals("Big frog")) &&
                !npc.isUnderAttack() && !npc.isHitBarVisible());
        {
            if (frog != null) { //make sure to check if frog is not null
                if (!frog.isOnScreen()) {
                    if (camera.toEntity(frog)) { //move camera to Frog if it is not on the screen
                        //do something if camera was moved to frog - it should be on screen now
                    }
                }
                //if (frog != null && !frog.isUnderAttack() && !frog.isHitBarVisible() && frog.isOnScreen()) {
                log("DIE! FROG! DIE!");
                if (frog.interact("Attack")) { //add a condition to make sure you will call ConditionalSleep only if frog was interacted
                    new ConditionalSleep(5000) {
                        @Override
                        public boolean condition() {
                            return myPlayer().isAnimating();
                        }
                    }.sleep();
                }
            }
        }

 

And about logging out when you don't have any Tunas anymore, it's quite simple

        if (getBank().getAmount("Tuna") == 0) //checks if there is 0 Tunas in bank (you can check for any number, e.g. "< 10" ///less than 10
        {
            log("not enough tuna in bank");
            getBank().close();
            stop(true); // true to log out, false to stay logged in and just stop script
        }

 

Edited by Xx pk xX

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.