rowza Posted March 1, 2023 Share Posted March 1, 2023 (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 March 1, 2023 by rowza 2 Quote Link to comment Share on other sites More sharing options...
Chris Posted March 1, 2023 Share Posted March 1, 2023 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 } 1 Quote Link to comment Share on other sites More sharing options...
rowza Posted March 2, 2023 Author Share Posted March 2, 2023 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. Quote Link to comment Share on other sites More sharing options...
Chris Posted March 2, 2023 Share Posted March 2, 2023 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 Quote Link to comment Share on other sites More sharing options...
rowza Posted March 9, 2023 Author Share Posted March 9, 2023 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 1 Quote Link to comment Share on other sites More sharing options...