What am I doing wrong?
I've modified a modified script/addon (written by Gello, and Daan) for autoinnerfire/druid buffs.
I've modded it for my shaman, and it seems that the weapon buffs for shaman are not considered buffs, so the IsBuffActive command won't handle it. I've tried to use a timer, and here is what I have: 2 global variables: Code:
WBuffTimer = GetTime(); Code:
elseif not found1 and AutoAllBuff and not mounted and not shapeshifted and (Rebuff < WBuffTimer) then Thanks! |
I have never played a shaman, but if it's a true weapon enchant like Feedback or poisons, check out GetWeaponEnchantInfo():
http://www.wowwiki.com/API_GetWeaponEnchantInfo You may be able to use it in place of checking for normal buffs. In what you posted above, you have: WBuffTimer = GetTime(); Rebuff = 1; So when you initially move, Rebuff < WBuffTimer so it runs: WBuffTimer = GetTime(); Rebuff = (WBuffTimer + 290); WBuff_Cast() But after that, Rebuff will never be less than WBuffTimer again. You'll want to move WBuffTimer to before the "if" statement. so it's like: WBuffTimer = GetTime(); if something then -- stuff elseif not found1 and AutoAllBuff and not mounted and not shapeshifted and (Rebuff < WBuffTimer) then Rebuff = (WBuffTimer + 290); WBuff_Cast() end But I'd check out GetWeaponEnchantInfo() it may be a better route. |
Thanks for the timely reply Gello! I posted asking about the shaman weapon buff over in the macro help section over a week ago, should have posted here instead!
I now understand why my time based function wasnt' being called, and I've fixed it. I tried using the GetWeaponEnchantInfo() command, but I"m not sure if I'm doing it properly. So outside of my if statement, I'd have, GetWeaponEnchantInfo(); then inside I'd say... elseif AutoAllBuff and not mounted and not shapeshifted and (not hasMainHandEnchant == 1) then ? Well, obviously that isnot right, because it does not work. I'm also trying to encompass group buffing into the script for mages and druids. Is there a way to check for spell range when attempting to buff a party member? As it is right now: local i=GetNumPartyMembers(); if i > 3 then ClearTarget(); TargetUnit("party4"); Thorns_Cast_Other() and... function Thorns_Cast_Other() local i,done,name,id=1,false; if (not IsBuffActive("Thorns","target")) then while not done do name = GetSpellName(i,BOOKTYPE_SPELL); if not name then done=true; elseif name=="Thorns" then id = i; gid = i; end i = i+1; end CastSpell(id,BOOKTYPE_SPELL); SpellTargetUnit("target") end end I'd like to modify it so that it checks if the target is out of range, but I only know how to do that with action buttons with the IsActionInRange command :( . Any tips? |
GetWeaponEnchantInfo returns 6 values. To get those six values you would do:
v1, v2, v3, v4, v5, v6 = GetWeaponEnchantInfo() tho you'll want to use more descriptive variables probably. Per the wiki, it will then fill those values with: hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges In lua you don't need to pull every value. If your weapon enchant only goes to main hand weapon and you only want hasMainHandEnchant, you can just do hasenchant = GetWeaponEnchantInfo() I would experiment with those. Dunno what shaman buffs can go on weapons (ie, this function alone won't tell if you have a particular buff), how they get on the weapons, etc. Use message() to test values. ie, try the enchant then enter /script v1,v2,v3,etc = GetWeaponEnchantInfo(); message(v1); and you may be able to see if it's workable. |
Thanks for the help Gello!
local hasenchant = GetWeaponEnchantInfo(); with elseif AutoAllBuff and not mounted and not shapeshifted and not hasenchant then WBuff_Cast() is working perfectly! Appreciate it. |
All times are GMT -6. The time now is 01:01 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI