Jump to content

Need help with my Alch script


rowza

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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