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

How to Properly use .activate();

Discussion in 'Developer Support' started by DesignDecay, Jun 20, 2015.

  1. DesignDecay

    Joined:
    May 6, 2015
    Messages:
    16
    Likes Received:
    0
    Yes, I'm using the normal spellbook. For me, it opens the prayer window and then doesn't select a prayer.
    Code (Text):
    1. package com.designdecay.barrows;
    2.  
    3. import com.runemate.game.api.script.framework.task.Task;
    4. import com.runemate.game.api.rs3.local.hud.Powers;
    5.  
    6. public class Fight extends Task {
    7.    
    8.     @Override
    9.     public boolean validate() {
    10.          return true;
    11.     }
    12.     @Override
    13.     public void execute() {
    14.         Powers.Prayer.PROTECT_FROM_MELEE.toggles();
    15.     }
    16. }
    If you have both an on hand and off hand magic weapon equipped it will ask you this what to set the spell for.
    https://i.imgur.com/s98oVds.png

    Can you confirm what the proper behavior is for .isSelected();?
     
  2. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    The prayer class doesn't have an isSelected, if you're referring to the magic class then it simply verifies if the spell is selected. By selected, I'm referring to the white border around certain spells once they're enabled.

    Regarding the method, it's toggle() not toggles() to start. Beyond that, it'll immediately return false if you don't have the required level, but if it's opening the window it means it's going beyond that so I'm not sure what the issue is. Are all prayers not working or is it only the one you're trying to use. Also confirm you're using prayers and not curses or vice versa.

    Regarding that interface... loan me an account and I'll look into it.
     

Share This Page

Loading...