View Full Version : Need some help with getting spellId
Thalon
11-27-2004, 12:33 AM
With this info I tried to get spellid
Example usage:
Code:
spellId = GetSpellIdByItsName("Ghostly Strike", "Rank 1");
Using
/script spellId = GetSpellIdByItsName("Ghostly Strike", "Rank 1");
in a macro in game I get : Error: Attempt to call global 'GetSpellIdByItsName' (a nil value) : was the responce =(
There is no such function by default in WoW. You'll have to a) get it from someone else or b) do it yourself. I would recommend that you do it in an AddOn.
Sarf
---
ADMIRATION, n. Our polite recognition of another's resemblance to ourselves.
Thalon
11-27-2004, 02:11 AM
Can anyone recommend a Addon that would give SpellIds?
My OneHitWonder (http://www.fukt.bth.se/~k/wow/scripts/OneHitWonder/) has some code for it.
If you are interested, check out OneHitWonder.lua (http://www.fukt.bth.se/~k/wow/scripts/OneHitWonder/Interface/AddOns/OneHitWonder/OneHitWonder.lua), function OneHitWonder_GetSpellId(spellName, spellRank)
Good luck!
Sarf
---
Women who seek to be equal to men lack ambition.
Thalon
11-27-2004, 06:22 AM
Ok installed it, changed the .toc file so itll run. Tried
/script function OneHitWonder_GetSpellId("Rake", "Rank 1")
/function OneHitWonder_GetSpellId("Rake", "Rank 1")
thousand other combos to no avail.. heh
I should just quit while im a ahead huh? =p
/script spellId = OneHitWonder_GetSpellId("Rake", "Rank 1");
The id will then be in spellId.
Sarf
---
We find the defendant innocent by reason of being generally clueless.
Thalon
11-27-2004, 08:46 PM
The command to return the spell Id would look like this in a macro?
script spellId = OneHitWonder_GetSpellId("Rake", "Rank 1");
return spellId; end
Oneday ill know this stuff ahhh
DoctorVanGogh
11-27-2004, 09:33 PM
Check http://www.fukt.bth.se/~k/wow/scripts/CastAnySpell/ - there's some code that get's spell ids. Or is this outdated sarf?
Thalon
11-28-2004, 04:15 AM
Well I assume this script works, I just need the string to return me the value of spellid
Thalon> No. This script simply puts spell id in a variable.
To use that id, simply do this:
/script CastSpell(spellId, "spell");
CastAnySpell is kinda outdated, yes. The ChatFrame.lua thing is, indeed, outdated. The CastAnySpell.lua should still "work" in that the code will work, but it needs to be put in ChatFrame.lua to actually do something.
Sarf
---
Sometimes I become spell-bound in the middle of Wal-Mart.
Thalon
11-29-2004, 04:08 AM
Got it workin =D
/script start, duration, enable = GetSpellCooldown(SpellId, "spell")
/script if ( ( ( start + duration) == 0) or ( ( start + duration ) < GetTime() )) then CastSpell(SpellId, "spell") else CastSpellByName("Sinister Strike(Rank 4)"); end
woot works like a charm tho everytime I load up I need to identify SpellId since this macro just fits the 256 limit in game, but thats OK this works NICE! Thanks Sarf
Another question... ahhh Sarf fountian of knowledge.
Is there A command to check if you can preform the desired action? I wanna cast Claw if the target is in front of me and Shred if im behind the target. A command like ummm :
/Script if ("Backstab(rank 4)") = IsUseableAction then CastSpellByName("Backstab(Rank 4)"); else CastSpellByName("Sinister Strike(Rank 5)"); end
Actually, there is... but you need to have the spell on an action bar, and you need to find out what it's ID is.
local isUsable, notEnoughMana = IsUsableAction(id);
That's the method to use.
Check for isUsable == true and notEnoughMana == false.
Sarf
---
"How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
'cause you weren't THERE" - TribGuru (http://www.bash.org/?255991)
Thalon
11-30-2004, 08:14 PM
/Script local isUseable, notEnoughMana = IsUseableAction(id);
/script if isuseable == 1 then CastSpellByName("Shred(Rank 2)"); else CastSpellByName("Claw(Rank 2)"); end
I get Error atempt to call global isuseableaction (A nil value) I assume thats because ive not been able to find a command to give up the button "id". It can't be simple like ---/script id = ActionButton(1);--- why!
The "id" that IsUsableAction wants is the actionbutton id.
So, if you keep your action you want to check for usability on, say, action button 1 on action bar 1, the id is 1. If you keep it on action button 12 on bar 6, it's 6*12 = 72.
Note:
It's IsUsableAction NOT IsUseableAction.
Sarf
---
Change your mind, it's starting to smell.
Thalon
12-07-2004, 09:50 AM
First I wanna say thanks sarf. Second Ide like to paypal to keep all this great stuff commin. Now for yet another question ide like help with.
I can't for the life of me get... 1 button todo Sinister strike if your facing your enemy and backstab if your behind. In Beta I just did
/Cast Backstab(rank 1)
/Cast Sinister Strike(rank 2)
and this worked fine exept ide get a few on-screen errors... now in retail attempting to cast a spell causes a very short cooldown not allowing (if the first spell fail's because your infront of your target) the macros attempt to cast the second.
For the life of me I can't find a command to check for "Targets orientation in relation to you" =p
Ahh... never thought of that. Darn. No way of getting that info now either. :/
Sarf
---
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
Thalon
12-07-2004, 06:38 PM
And theres no way to make a .1 second delay before attempting to cast Sinister strike if backstab fails?
vBulletin® v3.8.0 Beta 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.