May 19, 20178 yr Hello all, I am trying to incorporate alching into a script but I can not seem to get it. I am currently using the getMagic().castSpellOnEntity(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY, item); method. the "item" is gotten through the inventory like so: Item item = getInventory().getItem("item to alch"); but it says that Item cannot be used as an Entity (even though i looked into the api and it seems like Item extends the Entity class so I thought i would be able to turn an inventory into a useable entity.) can anyone guide me in the right direction? should i not use "CastSpellOnEntity" ? thanks
May 19, 20178 yr An Item is not an Entity: Only RS2Objects, Characters, GroundDecoration, GroundItem... etc are What you should be doing instead is calling the castSpell() method, and then interacting with the appropriate inventory item Edited May 19, 20178 yr by Explv
May 19, 20178 yr if (getMagic().isSpellSelected()) { getInventory().interact("Cast", "Item"); } else { getMagic().castSpell(Spells.NormalSpells._LEVEL_ALCHEMY); }
Create an account or sign in to comment