Jump to content

Need help with my Alch script


Recommended Posts

Posted (edited)

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
  • Sad 2
Posted
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
        }

 

  • Like 1
Posted
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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...