GetSpellInfo menu

User Tag List

Thread: GetSpellInfo

Results 1 to 3 of 3
  1. #1
    kisjaksi's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GetSpellInfo

    If I type "/run print(GetSpellInfo("Heroic Strike"));" in game, it returns a lot of data (including the spell cost, which I need). But if I use it through a hook in C#, it only returns the spell name. I use the code from this post: http://www.mmowned.com/forums/world-...lackmagic.html
    What could be the problem?
    The cod I use:
    Code:
    ObjectManager.DoString("spellinfo=GetSpellInfo(\"Heroic Strike\");");
    string spellInfo = ObjectManager.GetLocalizedText("spellinfo");
    Last edited by kisjaksi; 12-01-2010 at 02:25 PM. Reason: additional info

    GetSpellInfo
  2. #2
    hp94's Avatar Legendary
    Reputation
    742
    Join Date
    Nov 2009
    Posts
    587
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a snippet from my addon where I needed to get information from that, feel free to pick it apart if you just need a few select things.

    Code:
    function RecievedSpellLink() -- for spell info
    	for i = 1, select("#", arg2) do
    		RecievedSpellLinkToBePrinted=((select(1,GetSpellLink(Query))))
    	end
    end
    
    function RecievedSpellInfo()
    	for i = 1, select("#", name, rank, icon, cost, isFunnel, powerType, castTime, minRange, maxRange) do
    		SortResources() --Determines when i == 6, to print correctly
    		if i == 1 then
    			if (select(i,GetSpellInfo(Query))) == nil then
    				--spell does not exist
    				print("\124cFF00FFFFSpell |r"..Query.."\124cFF00FFFF does not exist.")
    				return;
    			else
    				--spell does exist
    				RecievedSpellLink() --sorts link arguments cleanly
    				print("\124cFF00FFFFName:|r "..RecievedSpellLinkToBePrinted)
    			end
    		elseif i == 2 then
    			if (select(i,GetSpellInfo(Query))) == nil then
    				--no rank exists, but keep going, so no return
    			else
    				print("\124cFF00FFFFRank:|r "..(select(i,GetSpellInfo(Query)))) 
    				--rank exists, continue
    			end
    		elseif i == 3 then
    			print("\124cFF00FFFFIcon:|r "..(select(i,GetSpellInfo(Query))))
    		elseif i == 4 then
    			print("\124cFF00FFFFCost:|r "..(select(i,GetSpellInfo(Query))).."\124cFF00FFFF points of "..ResourceRequested)
    		elseif i == 5 then
    			--nil value
    		elseif i == 6 then
    			--nil value
    		elseif i == 7 then
    			print("\124cFF00FFFFCast Time:|r "..(select(i,GetSpellInfo(Query))).."\124cFF00FFFF milliseconds")
    		elseif i == 8 then
    			print("\124cFF00FFFFMinimum Range:|r "..(select(i,GetSpellInfo(Query))))
    		elseif i == 9 then
    			print("\124cFF00FFFFMaximum Range:|r "..(select(i,GetSpellInfo(Query))))
    		else
    			print("No Information Cached")
    		end
    	end
    end
    
    function SortResources() --for spell info
    	if (select(6,GetSpellInfo(Query))) == 0 then
    		ResourceRequested=("\124cFF0000FFMana")
    	elseif (select(6,GetSpellInfo(Query))) == -2 then
    		ResourceRequested=("\124cFFE000Health")
    	elseif (select(6,GetSpellInfo(Query))) == 1 then
    		ResourceRequested=("\124cFFFF0000Rage")
    	elseif (select(6,GetSpellInfo(Query))) == 2 then
    		ResourceRequested=("\124cFF00E000Focus")
    	elseif (select(6,GetSpellInfo(Query))) == 3 then
    		ResourceRequested=("\124cFF0000E0Energy")
    	elseif (select(6,GetSpellInfo(Query))) == 4 then
    		ResourceRequested=("\124cFF00FFB0Happiness")
    	elseif (select(6,GetSpellInfo(Query))) == 5 then
    		ResourceRequested=("\124cFFcebeceRune")
    	elseif (select(6,GetSpellInfo(Query))) == 6 then
    		ResourceRequested=("\124cFF00E0FFRunic Power")
    	else
    		ResourceRequested=("No Resource")
    	end
    end

  3. #3
    kisjaksi's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, you helped a lot!

Similar Threads

  1. Difference between CastSpellByID() and CastSpellByName(GetSpellInfo())
    By MrHeroe in forum WoW Bots Questions & Requests
    Replies: 1
    Last Post: 10-07-2013, 08:42 PM
All times are GMT -5. The time now is 09:19 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