Anyone know what I did wrong here? Looks fine to me, I keep getting a nil error in-game.
Code:--if we are in ret and not might then apply might else if we have might and we dont have kings or wild then apply kings if (select(2, GetSpecializationInfo(GetSpecialization()))) == "Retribution" then if not UnitBuffID("player", 19740) then CastSpellByName(GetSpellInfo(19740), "player") end elseif UnitBuffID("player", 19740) and not UnitBuffID("player", 20217) and not UnitBuffID("player", 1126) then CastSpellByName(GetSpellInfo(20217), "player") end end -- if we are in prot and we dont have kings or wild then apply kings else if we have kings or wild we and dont have might then apply might if (select(2, GetSpecializationInfo(GetSpecialization()))) == "Protection" then if not UnitBuffID("player", 20217) and not UnitBuffID("player", 1126) then CastSpellByName(GetSpellInfo(20217), "player") end elseif UnitBuffID("player", 20217) or UnitBuffID("player", 1126) then CastSpellByName(GetSpellInfo(19740), "player") end end
My Svn - https://subversion.assembla.com/svn/averykeys-svn/
Lol for mods booting the internet toughguy but back to pqr and a question for KickMyDog.....Is misdirection written into your code? I'm trying to do some raid solos and would to be able to cast MD+glyph to my pet everytime its up!...If not how could I add that in easily thx!!!
this is the general idea, I don't have the code, but if you search a few profiles you should be able to find all the code needed.
if mdknown then // for lower levels
if haveglyph then
if md is available and pet exist then
cast md on pet
end
end
end
re post from 261 so people can see
My Svn - https://subversion.assembla.com/svn/averykeys-svn/
I need a little more info, I have tried my SV and BM profiles, I don't run with a MM spec myself. I have not noticed this at all.
There is a check in the function to see if you do not have hawk, so if you have hawk already it should not cast. However, are you using Hawk or Iron Hawk? I did not test with Iron Hawk since I do not use it.PHP Code:
function F_SwitchToHawk()
if not UnitBuffID("player", 13165)
and UnitExists("target")
then CastSpellByName(GetSpellInfo(13165),nil) end
end
I would ignore the datafile stuff, I put that in by mistake. The Aspect code is all in the ability - "Aspects"
There is no delay hard coded in, because generally one should not be running all over the place. So basically I didn't bother, I might tweak it a little so that it stays in fox longer and then as a result it will do more focus builders then switching to hawk and a normal rotation after you either stop moving or focus gets close to maximum. That would require more extensive testing, I wanted to get something out quickly to address the changes that Blizzard put into the patch today.
I would try switching the code that you are using to cast the spell. I was having issues with that when I tried to use my old functions for Aspect Switching, it would refuse to cast the spells until I changed to what Shueron was using in his code. Try this:
PHP Code:
if (select(2, GetSpecializationInfo(GetSpecialization()))) == "Retribution" then
if not UnitBuffID("player", 19740) -- check for might
or not UnitBuffID("player", 116956) -- check for grace of air
or not UnitBuffID("player", 93435) -- roar of courage
then CastSpellByName(GetSpellInfo(19740),nil) -- cast might
end
elseif not UnitBuffID("player", 20217) -- check for kings
or not UnitBuffID("player", 1126) --check for motw
or not UnitBuffID("player", 90363) -- shale spider
then CastSpellByName(GetSpellInfo(20217),nil) -- cast kings
end
end
Last edited by kickmydog; 09-12-2012 at 04:09 AM.
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-bot-maps-profiles/422388-kickmydog-bm-mm-sv-hunter-profiles.html#post2793017
CastSpellByName(GetSpellInfo(13165),nil) will the nil just reference to the ability properties?
edit:
Stance check /buff for anyone wanting, haven't tried it in my profile so be weary of errors :O
local hasSeal
local seal = GetShapeshiftForm()
if seal >= 1 and seal <= 4 then hasSeal end
if not hasSeal then CastShapeshiftForm(1) end
Thanks to everyone who has been helping me, going to go through the thread and make sure you all get the rep you deserve!
edit2: kickmydog, the edit didn't work, got any other ideas?
Last edited by averykey; 09-12-2012 at 04:11 AM.
My Svn - https://subversion.assembla.com/svn/averykeys-svn/
Well one thing i do when testing code is to start with the simplest thing and then start to add to it.
Remove the specialisation check and see if the unitbuff stuff works with just Might or Kings. If they do then there is no reason why the rest of the unit buff stuff shouldn't work. Then I would check the specialisation code again. Although do you really need a specialisation check, don't you have different rotations for each one, or is your ret/prot code all in one?
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-bot-maps-profiles/422388-kickmydog-bm-mm-sv-hunter-profiles.html#post2793017
It will be, I got tired of having 50+ abilities in my rotation; the rotation was harder to maintain having to scroll up and down all the time and moving all of the spells to the correct spots, right now I have singled it down to around 10 abilities and it should work if I can get this specialization check working.
I removed it and still got the error so I'm not sure what the culprit here is, I will paste the error from in-game and then disable my addons to see if one of them could be the culprit.
Last edited by averykey; 09-12-2012 at 04:36 AM.
My Svn - https://subversion.assembla.com/svn/averykeys-svn/
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-bot-maps-profiles/422388-kickmydog-bm-mm-sv-hunter-profiles.html#post2793017
Anyone else having a problem with Crystal Techs Affliction profile, it totally stops rotation between 4.5-5 million dmg on a target dummy then i have close it down and restart.....forgot about the debug ill post back
tested in dungeons all good
Last edited by hbkx1; 09-12-2012 at 05:02 AM.
Here a function to check if you have a certai Glyph inscribed to get you going.
PHP Code:
-- Check if Player has a Glyph inscribed. Accepts Glyph Index or Glyph Name
-- Signature
---- psaHasGlyph("glyph") or psaHasGlyph(glyph)
-- Arguments:
---- glyph: Glyph name or Index to query
-- Returns:
---- true if player has glyphName inscribed, otherwise false (true/false)
function psaHasGlyph(glyph)
for glyphIndex = 1, NUM_GLYPH_SLOTS do
if tonumber(glyph) ~= nil then
if select(4, GetGlyphSocketInfo(glyphIndex)) == glyph then
return true;
end
else
if GetSpellInfo((select(4, GetGlyphSocketInfo(glyphIndex)))) == glyph then
return true;
end
end
end
return false;
end
docs/api/GetSpecializationInfo - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons
Hey do you know why I'm getting a nil error whenever I try any of the below?
local specid = select(1, GetSpecializationInfo(GetSpecialization()))
local specname = select(2, GetSpecializationInfo(GetSpecialization()))
if specid == 70 then
do stuff
end
if specname == "Retribution" then
do stuff
end
I've also the below and for id as well
if select(2, GetSpecializationInfo(GetSpecialization())) == "Retribution" then
dostuff
end
still no luck
Here is the full code, I have no idea why this isn't working.
PHP Code:
--if we are in ret and not might then apply might else if we have might and we dont have kings or wild then apply kings
if select(2, GetSpecializationInfo(GetSpecialization())) == "Retribution" then
if not UnitBuffID("player", 19740) then
CastSpellByName(GetSpellInfo(19740), "player")
end
elseif UnitBuffID("player", 19740) and not UnitBuffID("player", 20217) and not UnitBuffID("player", 1126) then
CastSpellByName(GetSpellInfo(20217), "player")
end
end
--if we are in prot and we dont have kings or wild then apply kings else if we have kings or wild we and dont have might then apply might
if select(2, GetSpecializationInfo(GetSpecialization())) == "Protection" then
if not UnitBuffID("player", 20217) and not UnitBuffID("player", 1126) then
CastSpellByName(GetSpellInfo(20217), "player")
end
elseif UnitBuffID("player", 20217) or UnitBuffID("player", 1126) and not UnitBuffID("player", 19740) then
CastSpellByName(GetSpellInfo(19740), "player")
end
end
I get a nil error every time, I have no idea what is wrong, I have tried removing the specialization code as well but I still get errors, I don't see anything wrong with my buff code.
My Svn - https://subversion.assembla.com/svn/averykeys-svn/