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.

Special Attack Weapons

Featured Replies



import org.osbot.script.Script;

public class Spec_Attacks {
    Script script = Context.script;

    enum SpecWeapon {
        DragonDagger("Dragon dagger", 1215, 25), DragonScim("Dragon scimitar",
                4587, 55), Whip("Abyssal whip", 4151, 50), Magic_Shortbow(
                "Magic shortbow", 861, 55), DragonDaggerP("Dragon dagger(p)",
                1231, 25), DragonBattleaxe("Dragon battleaxe", 1377, 100);
        private final int id;
        private final int specpercent;
        private final String name;

        SpecWeapon(String name, int id, int specpercent) {
            this.name = name;
            this.id = id;
            this.specpercent = specpercent;
        }

        public String getName() {
            return name;
        }

        public int getId() {
            return id;
        }

        public int getSpecPercent() {
            return specpercent;
        }

    }

    public static int possibleSpecsForSpecBar(SpecWeapon Spec) {
        int remanningspec = Context.script.combat.getSpecialPercentage();
        double d = remanningspec / Spec.getSpecPercent();
        long l = Math.round(d);
        String s = String.valueOf(l);
        int specsforafullbar = Integer.parseInt(s);
        return specsforafullbar;

    }

    public static void SwitchWeaponTo(String name, Integer timeout)
            throws InterruptedException {
        String g[] = { "Wear", "Wield" };
        long t = System.currentTimeMillis();
        if (!Context.script.equipmentTab.isWieldingWeapon(name)) {
            for (String option : g) {
                Context.script.client.getInventory().interactWithName(name,
                        option);
            }
            while (!Context.script.equipmentTab.isWieldingWeapon(name)
                    && System.currentTimeMillis() - t < timeout) {
                Context.script.sleep(50);
            }
        }
    }

}

 

import org.osbot.script.Script;

public class Context extends Script {
    public static Script script;

}

use

 

 

in your script you will need to do this i'm using the context class as i got several class's that use api methods so it's easier.

@Override
    public void onStart() {
        Context.script=this;
}

the first parameter is the name of the weapon or could have an Armour wouldn't matter and the 2nd parameter is for the dynamic sleep type thing in the spec attacks class i like 3000ms before it will retry

            if (Spec_Attacks.possibleSpecsForSpecBar(SpecWeapon.DragonDagger)>0){
            Spec_Attacks.SwitchWeaponTo(SpecWeapon.DragonDagger.getName(), 3000);
        }

Edited by TheScrub

Thank you very much. It will be so useful for me in the future. Noted down.

3 weapons, wat.

 

Beast calculation though. Because obviously specPercent / percentNeeded is too main stream.

Edited by Pseudo

  • Author

3 weapons, wat.

 

Beast calculation though. Because obviously specPercent / percentNeeded is too main stream.

 

lol so true haha

 

you know it!

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.