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.

Working with Autocasting

Featured Replies

I was just wondering what would be the easiest way to 1. Check if i am autocasting a spell or what i am autocasting. and 2. how to select a spell to autocast. I couldnt really find any premade functions that dealt with the Combat tab in the magic interface.

Try autocast api made by botre in the snippets section

Check config to check if auto-cast is set. Anyways.. I think configs work with autocast

Autocast config is getConfigs().get(108)

Not sure if the 108 is related to what staff you are carrying or it's just static, I've done this with a staff of air

 

Value 0 is no spell selected

Value 3 is air strike

5 is water strike and so on

 

smile.png

Here is a snippet that does a spell change based on levels

private int getSpellChange()
{
    int currentSpell = self.getConfigs().get(108);
    int currentLevel = self.getSkills().getStatic(Skill.MAGIC);
    if (currentLevel >= 13) {
        if (currentSpell != 9) {
            return 4;
        } else{ 
            return 0;
        }
    } else if (currentLevel >= 9) {
        if (currentSpell != 7) {
            return 3;
        } else{ 
            return 0;
        }
    } else if (currentLevel >= 5) {
        if (currentSpell != 5) {
            return 2;
        } else{ 
            return 0;
        }
    } else if (currentLevel >= 1) {
        if (currentSpell != 3) {
            return 1;
        } else{ 
            return 0;
        }
    } 
    return 0;
}


private void changeSpell()
{
    if (self.getTabs().open(Tab.ATTACK)) {
        RS2Widget castWidget = self.getWidgets().get(593, 25);
        if (castWidget != null && castWidget.isVisible()) {
            if (castWidget.interact()) {
                new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) {
                    @[member=Override]
                    public boolean condition() throws InterruptedException {
                        return !castWidget.isVisible();
                    }
                }.sleep();
            }
        } else {
            RS2Widget spellWidget = self.getWidgets().get(201, 0 , getSpellChange());
            if (spellWidget != null && spellWidget.isVisible() && spellWidget.interact()) {
                new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) {
                    @[member=Override]
                    public boolean condition() throws InterruptedException {
                        return getSpellChange() == 0;
                    }
                }.sleep();
                if (MethodProvider.random(0, 1) == 0) {
                    self.getTabs().open(Tab.INVENTORY);
                }
            }
        }
    }
}   


Edited by Abuse

  • 2 weeks later...
  • Author

 

Autocast config is getConfigs().get(108)

Not sure if the 108 is related to what staff you are carrying or it's just static, I've done this with a staff of air

 

Value 0 is no spell selected

Value 3 is air strike

5 is water strike and so on

 

smile.png

Here is a snippet that does a spell change based on levels

private int getSpellChange()
{
    int currentSpell = self.getConfigs().get(108);
    int currentLevel = self.getSkills().getStatic(Skill.MAGIC);
    if (currentLevel >= 13) {
        if (currentSpell != 9) {
            return 4;
        } else{ 
            return 0;
        }
    } else if (currentLevel >= 9) {
        if (currentSpell != 7) {
            return 3;
        } else{ 
            return 0;
        }
    } else if (currentLevel >= 5) {
        if (currentSpell != 5) {
            return 2;
        } else{ 
            return 0;
        }
    } else if (currentLevel >= 1) {
        if (currentSpell != 3) {
            return 1;
        } else{ 
            return 0;
        }
    } 
    return 0;
}


private void changeSpell()
{
    if (self.getTabs().open(Tab.ATTACK)) {
        RS2Widget castWidget = self.getWidgets().get(593, 25);
        if (castWidget != null && castWidget.isVisible()) {
            if (castWidget.interact()) {
                new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) {
                    @[member='Override']
                    public boolean condition() throws InterruptedException {
                        return !castWidget.isVisible();
                    }
                }.sleep();
            }
        } else {
            RS2Widget spellWidget = self.getWidgets().get(201, 0 , getSpellChange());
            if (spellWidget != null && spellWidget.isVisible() && spellWidget.interact()) {
                new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) {
                    @[member='Override']
                    public boolean condition() throws InterruptedException {
                        return getSpellChange() == 0;
                    }
                }.sleep();
                if (MethodProvider.random(0, 1) == 0) {
                    self.getTabs().open(Tab.INVENTORY);
                }
            }
        }
    }
}   


sorry for the late reply but thanks so much! this will definitely come in handy. 

Try autocast api made by botre in the snippets section

i saw that but i dont really know how to add like a function like that into my script :(

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.