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.

casting magic help

Featured Replies

I am making a script for 1-99 magic and so far I have wind strike, fire strike, and fire bolt. it buys runes and staves but my one problem is the attacking. this is the first thing I made in my script so I am confused on how to fix it because I have no previous java experience but I have some experience in c++ can anyone help me make a better attack script for the Lesser demon on top of the wizards tower because right now it just clicks constantly and selects the spell sometimes.
 

private void firestrikedemon() throws InterruptedException {
    if (getTabs().open(Tab.MAGIC)) {
        if (getMouse().click(true))
            sleep(random(1000, 2000));
        NPC enemy = getNpcs().closest("Lesser demon");
        if (enemy != null) {
            magic.castSpell(Spells.NormalSpells.FIRE_STRIKE);
            if (enemy != null && !enemy.interact("Attack"))
            if (enemy.interact()) {
                sleep(random(964,1960));
            }
        }
    }
}

demon_splash.java

  • Developer
8 hours ago, moops22 said:

I am making a script for 1-99 magic and so far I have wind strike, fire strike, and fire bolt. it buys runes and staves but my one problem is the attacking. this is the first thing I made in my script so I am confused on how to fix it because I have no previous java experience but I have some experience in c++ can anyone help me make a better attack script for the Lesser demon on top of the wizards tower because right now it just clicks constantly and selects the spell sometimes.
 

private void firestrikedemon() throws InterruptedException {
    if (getTabs().open(Tab.MAGIC)) {
        if (getMouse().click(true))
            sleep(random(1000, 2000));
        NPC enemy = getNpcs().closest("Lesser demon");
        if (enemy != null) {
            magic.castSpell(Spells.NormalSpells.FIRE_STRIKE);
            if (enemy != null && !enemy.interact("Attack"))
            if (enemy.interact()) {
                sleep(random(964,1960));
            }
        }
    }
}

demon_splash.java 17.86 kB · 0 downloads

So why not buy a staff and auto cast? or why do you wanna cast every spell by clicking it?

Above code could be changed to something like this:

        if(getMagic().isSpellSelected()){
            NPC enemy = getNpcs().closest("Lesser demon");
            if(enemy != null){
                if(enemy.interact("Attack")){
                    ConditionalSleep2.sleep(2500, () -> !getMagic().isSpellSelected());
                }
            }
        }else{
            if(getMagic().castSpell(Spells.NormalSpells.FIRE_STRIKE)){
                ConditionalSleep2.sleep(2500, () -> getMagic().isSpellSelected());
            }
        }

Edited by Khaleesi

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.