1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Cant get bot to cast Magic_Imbue

Discussion in 'Developer Support' started by TheChuck, May 31, 2018.

  1. TheChuck

    Joined:
    Sep 25, 2017
    Messages:
    5
    Likes Received:
    2
    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.

    Code (Text):
    1. package com.rootbots.runecrafting.LavaRunes.leafs;
    2.  
    3. import com.runemate.game.api.hybrid.Environment;
    4. import com.runemate.game.api.hybrid.entities.GameObject;
    5. import com.runemate.game.api.hybrid.local.Camera;
    6. import com.runemate.game.api.hybrid.local.hud.interfaces.Inventory;
    7. import com.runemate.game.api.hybrid.local.hud.interfaces.SpriteItem;
    8. import com.runemate.game.api.hybrid.location.Coordinate;
    9. import com.runemate.game.api.hybrid.region.GameObjects;
    10. import com.runemate.game.api.rs3.local.hud.Powers;
    11. import com.runemate.game.api.script.framework.tree.LeafTask;
    12.  
    13. /**
    14. * NOTES:
    15. * if we arent at castle wars, and we have 26 essence, we are and the altar is visible
    16. Use Magic Imbue and use Earth Rune on Altar
    17. */
    18. public class CraftRune extends LeafTask {
    19.  
    20.     Coordinate altarRegion = new Coordinate(2583, 4840, 0);
    21.  
    22.     @Override
    23.     public void execute() {
    24.         Environment.getBot().getLogger().info("Starting craftRune.java");
    25.         GameObject altarRegion = GameObjects.newQuery().names("Altar").results().nearest();
    26.         if (altarRegion.isVisible()) {
    27.             Powers.Magic.Lunar.MAGIC_IMBUE.activate();
    28.         }
    29.         SpriteItem invItems = Inventory.newQuery().names("Earth rune").results().first();
    30.         if (invItems != null) {
    31.             invItems.click();
    32.             altarRegion.click();
    33.         } else {
    34.             Camera.turnTo(altarRegion);
    35.         }
    36.     }
    37. }
    38.  
     
  2. auxi

    Joined:
    May 24, 2016
    Messages:
    1,113
    Likes Received:
    990
    If this is OSRS then you can't use the Powers class as it's for RS3. I am not entirely sure what the alternative is as I don't script bot for OSRS but I'm sure you'll be able to find it in the jdocs.
     
  3. TheChuck

    Joined:
    Sep 25, 2017
    Messages:
    5
    Likes Received:
    2
    Thank you a ton @auxi because this is for OSRS. And that is likely my issue.
     
    auxi likes this.

Share This Page

Loading...