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.

Need help with my Alch script

Featured Replies

Im struggling with something and its probably very simple fix , How ever im sick of reading the API overview and coming back with the same solution. 
MagicSpell i thought that gets the magicspell or am i just been totaly Ret***ed and not writing it correctly? 

 

 /// Actual Code for script to run 
    @Override
    public int onLoop() throws InterruptedException {
        if (inventory.contains(NATURE_RUNE_ID) && inventory.contains(ITEM_TO_ALCH_ID)) {
            MagicSpell highAlch = magic.getSpell("High Level Alchemy");
            if (highAlch != null && highAlch.canCast()) {
                highAlch.select();
                sleep(random(300, 500));
                inventory.getItem(ITEM_TO_ALCH_ID).interact();
                sleep(random(600, 800));
            }
        }
        return random(300, 500);
    }

Description    Resource    Path    Location    Type
The method canCast() is undefined for the type MagicSpell    MovieAlch.java    /MovieAlch/src    line 24    Java Problem
The method getSpell(String) is undefined for the type Magic    MovieAlch.java    /MovieAlch/src    line 23    Java Problem
The method select() is undefined for the type MagicSpell    MovieAlch.java    /MovieAlch/src    line 25    Java Problem
 

Edited by rowza

55 minutes ago, rowza said:

Im struggling with something and its probably very simple fix , How ever im sick of reading the API overview and coming back with the same solution. 
MagicSpell i thought that gets the magicspell or am i just been totaly Ret***ed and not writing it correctly?

 

We have a Magic API that can handle interaction for you:
 

        if (getMagic().isSpellSelected()) {
            // spell is selected so now we can interact with item
        } else if (getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) {
            // we successfully casted spell
        }

 

  • Author
13 hours ago, Chris said:

We have a Magic API that can handle interaction for you:
 

        if (getMagic().isSpellSelected()) {
            // spell is selected so now we can interact with item
        } else if (getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) {
            // we successfully casted spell
        }

 

Thanks for the speedy responsor but still getting the same errors on same line with even putting this in.

3 hours ago, rowza said:

Thanks for the speedy responsor but still getting the same errors on same line with even putting this in.

skill issue. jk just check your imports

  • Author
On 3/2/2023 at 3:28 PM, Chris said:

skill issue. jk just check your imports

No No, your right. Skill issue haha. Least im trying though :D

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.