- Thread Author
- #1
Here is the source of the class i'm trying to use. Everything works fine and gets to this point and then opens the magic book but doesn't select the magic imbue spell...
Any help would be greatly appreciated. I'm extremely new to Java and am happy to have gotten this far on my own. But I very well could be doing something wrong.
Any help would be greatly appreciated. I'm extremely new to Java and am happy to have gotten this far on my own. But I very well could be doing something wrong.
Code:
package com.rootbots.runecrafting.LavaRunes.leafs;
import com.runemate.game.api.hybrid.Environment;
import com.runemate.game.api.hybrid.entities.GameObject;
import com.runemate.game.api.hybrid.local.Camera;
import com.runemate.game.api.hybrid.local.hud.interfaces.Inventory;
import com.runemate.game.api.hybrid.local.hud.interfaces.SpriteItem;
import com.runemate.game.api.hybrid.location.Coordinate;
import com.runemate.game.api.hybrid.region.GameObjects;
import com.runemate.game.api.rs3.local.hud.Powers;
import com.runemate.game.api.script.framework.tree.LeafTask;
/**
* NOTES:
* if we arent at castle wars, and we have 26 essence, we are and the altar is visible
Use Magic Imbue and use Earth Rune on Altar
*/
public class CraftRune extends LeafTask {
Coordinate altarRegion = new Coordinate(2583, 4840, 0);
@Override
public void execute() {
Environment.getBot().getLogger().info("Starting craftRune.java");
GameObject altarRegion = GameObjects.newQuery().names("Altar").results().nearest();
if (altarRegion.isVisible()) {
Powers.Magic.Lunar.MAGIC_IMBUE.activate();
}
SpriteItem invItems = Inventory.newQuery().names("Earth rune").results().first();
if (invItems != null) {
invItems.click();
altarRegion.click();
} else {
Camera.turnTo(altarRegion);
}
}
}