Proper way to check if a skill is equipped? menu

User Tag List

Results 1 to 3 of 3
  1. #1
    GFuryan's Avatar Member
    Reputation
    2
    Join Date
    Mar 2017
    Posts
    9
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Proper way to check if a skill is equipped?

    I'm trying to test if a particular skill is being used/equipped and I'm using the following check Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == SkeletonMageSkillSNO) != null

    However, it doesn't seem to be working (always returns true). Is there an alternate method or something erroneous in the code above? Thanks!

    Proper way to check if a skill is equipped?
  2. #2
    esix's Avatar Member
    Reputation
    4
    Join Date
    Dec 2018
    Posts
    4
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LINQ .Where doesn't return null, it returns an empty enumerable, so your result is always true.

    Code:
    Hud.Game.Me.Powers.UsedSkills.Any(x => x.SnoPower == Hud.Sno.SnoPowers.Necromancer_SkeletalMage) //returns true/false
    Hud.Game.Me.Powers.UsedSkills.FirstOrDefault(x => x.SnoPower == Hud.Sno.SnoPowers.Necromancer_SkeletalMage) //returns skill or null
    Hud.Game.Me.Powers.UsedSkills.FirstOrDefault(x => x.SnoPower == Hud.Sno.SnoPowers.Necromancer_SkeletalMage) != null //this is another option for true/false
    Hud.Game.Me.Powers.GetUsedSkill(Hud.Sno.SnoPowers.Necromancer_SkeletalMage) //returns skill or null? I just found out about this function so haven't tested it

  3. #3
    GFuryan's Avatar Member
    Reputation
    2
    Join Date
    Mar 2017
    Posts
    9
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help

Similar Threads

  1. LUA Function to check if Global Cooldown is done.
    By Wopak in forum WoW UI, Macros and Talent Specs
    Replies: 4
    Last Post: 01-07-2023, 04:41 AM
  2. [Bot] how to check if an item is shield/belt/boots/... ?
    By aj3423 in forum Diablo 3 Memory Editing
    Replies: 1
    Last Post: 08-17-2012, 04:21 AM
  3. Is there a way to check if gamecard codes are valid without using them?
    By epic twig in forum World of Warcraft General
    Replies: 4
    Last Post: 04-09-2011, 02:40 PM
  4. Anyone know a fast way to check if pins work?
    By Blazzored in forum World of Warcraft General
    Replies: 0
    Last Post: 12-30-2008, 06:28 PM
  5. How to check if a thread is copypasta.
    By XinuX in forum Community Chat
    Replies: 8
    Last Post: 08-13-2008, 10:35 AM
All times are GMT -5. The time now is 02:05 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search