January 16, 201610 yr Okay, so I've had this knocking around for a while. It uses my Context class but replacing it with Script should work fine. Handles casting on different types of entity, checks for runes etc. Easy to add banking for also, loop through requirements and withdraw accordingly using. Usage: final Spell highAlch = new Spell(context, Spells.NormalSpells.HIGH_LEVEL_ALCHEMY, SpellTarget.SPELL_ON_ITEM, "Oak longbow (u)", new ItemRequirement("Nature rune", 1), new ItemRequirement("Fire rune", 5)); if (highAlch.canUse()) { highAlch.canUse(); } else { for (ItemRequirement rune : highAlch.getRunes()) { String name = rune.getName(); int amount = rune.getCount(); if (context.getInventory().getAmount(name) < amount) { context.log("Not enough " + name + "!"); } } } magic.zip Edited January 16, 201610 yr by Valkyr
January 16, 201610 yr if (highAlch.canUse()) { highAlch.canUse(); } EDIT: Also, make a rune requirement enum, you lazy bum Edited January 16, 201610 yr by FrostBug
January 16, 201610 yr Author if (highAlch.canUse()) { highAlch.canUse(); } EDIT: Also, make a rune requirement enum, you lazy bum highAlch.cast() XD .cast() also checks canUse anyway, just there for example