I found this code in the old thread:
but it's not working for me, interrupter always uses Pummel onlyPHP Code:
elseif playerClass == "WARRIOR" then
if PQR_SpellAvailable(6552) then
return 6552
elseif PQR_SpellAvailable(102060) and PQR_SpellAvailable(6552) == false then
return 102060
elseif PQR_SpellAvailable(57755) and PQR_SpellAvailable(102060) == false and PQR_SpellAvailable(6552) == false then
return 57755
end
why?
I have tried to determine spell cd, but it did not help.
Last edited by WWF; 11-21-2013 at 11:15 PM.
Is there an easier way to create a table then this:
Edit, Not really "easier" but cleaner.Code:--Function Check if unit is CC'ed-- dispellableCCids = { } table.insert(dispellableCCids,{Spell = 110698, Dispeltime = 5 }) -- Hammer of Justice table.insert(dispellableCCids,{Spell = 44572, Dispeltime = 5}) -- Deep Freeze table.insert(dispellableCCids,{Spell = 118, Dispeltime = 5}) -- Polymorph table.insert(dispellableCCids,{Spell = 61305, Dispeltime = 5}) -- Polymorph: Black Cat table.insert(dispellableCCids,{Spell = 28272, Dispeltime = 5}) -- Polymorph: Pig table.insert(dispellableCCids,{Spell = 61721, Dispeltime = 5}) -- Polymorph: Rabbit table.insert(dispellableCCids,{Spell = 61780, Dispeltime = 5}) -- Polymorph: Turkey table.insert(dispellableCCids,{Spell = 28271, Dispeltime = 5}) -- Polymorph: Turtle table.insert(dispellableCCids,{Spell = 122, Dispeltime = 5}) -- Frost Nova table.insert(dispellableCCids,{Spell = 82691, Dispeltime = 5}) -- Ring of Frost table.insert(dispellableCCids,{Spell = 105593, Dispeltime = 5}) -- Fist of Justice table.insert(dispellableCCids,{Spell = 853, Dispeltime = 5}) -- Hammer of Justice table.insert(dispellableCCids,{Spell = 64044, Dispeltime = 5}) -- Psychic Horror table.insert(dispellableCCids,{Spell = 8122, Dispeltime = 5}) -- Psychic Scream table.insert(dispellableCCids,{Spell = 113792, Dispeltime = 5}) -- Psychic Terror table.insert(dispellableCCids,{Spell = 118905, Dispeltime = 5}) -- Static Charge table.insert(dispellableCCids,{Spell = 5782, Dispeltime = 5}) -- Fear table.insert(dispellableCCids,{Spell = 118699, Dispeltime = 5}) -- Fear table.insert(dispellableCCids,{Spell = 5484, Dispeltime = 5}) -- Howl of Terror table.insert(dispellableCCids,{Spell = 3355, Dispeltime = 5}) -- Freezing Trap
WoW LUA Script Developer
Need Something Custom? WarmaneScripts.com
Skype - grapejuice111
just create it over table insert?
the [1] is the table index and if you don't have that it will throw errorsCode:dispellableCCids = { [1] = {Spell = 110698, Dispeltime = 5}, [2] = {Spell = 44572, Dispeltime = 5} --etc etc }
so you could use it like
for i=1, #dispellableCCids do
if UnitBuffID("player", dispellableCCids[i].Spell) and dispellableCCids[i].DispelTime < CastTimeofdispellspellorsomethingelse then
return true
end
end
Please if someone helped you donate rep to them.
ah thats what i was looking for, Thanks
WoW LUA Script Developer
Need Something Custom? WarmaneScripts.com
Skype - grapejuice111
Not sure why you would ever define a table like that:
Code:dispellableCCids = { {Spell = 110698, Dispeltime = 5}, -- Hammer of Justice {Spell = 44572, Dispeltime = 5}, -- Deep Freeze {Spell = 118, Dispeltime = 5}, -- Hammer of Justice }
Hi,
i have just startet to create a custom rota with pqr. But im struggling always with the same problem:
I use a PQR_XXX.lua to create some global functions like:
orCode:function IsValidTarget(_spellid) if UnitAffectingCombat("player") ~= nil -- in combat ! and IsSpellInRange(GetSpellInfo(_spellid),"target") == 1 -- Rangecheck ! then return true else return false end end
(from Partykilla)
Code:function cdRemains(_spellid) if select(2,GetSpellCooldown(_spellid)) + (select(1,GetSpellCooldown(_spellid)) - GetTime()) > 0 then return select(2,GetSpellCooldown(_spellid)) + (select(1,GetSpellCooldown(_spellid)) - GetTime()) else return 0 end end
The cdRemains function works ! The IsValidTarget function not...
I tried using it at Plague Strike:
Code:-- 45462 Plague Strike -- 59921 Frost fever if not UnitDebuffID("target",55078) == true or UnitDebuffID("target",59921) == true then if cdRemains(45462) == 0 then if IsValidTarget(45462) == true then CastSpellByName(GetSpellInfo(45462)) end end end
Im always getting a Lua Error:
Any Ideas ?Code:Message: [string "-- 45462 Plague Strike ..."]:17: attempt to call global 'IsValidTarget' (a nil value) Time: 11/23/13 18:28:57 Count: 331 Stack: [string "-- 45462 Plague Strike ..."]:17: in function `?' [string "if PQR_Addon_Loaded == nil then..."]:765: in function `PQR_NextAbility' [string "if PQR_Addon_Loaded == nil then..."]:534: in function `PQR_ExecuteRotation' [string "if PQR_Addon_Loaded == nil then..."]:287: in function <[string "if PQR_Addon_Loaded == nil then..."]:214> Locals: (*temporary) = nil (*temporary) = 45462 (*temporary) = "attempt to call global 'IsValidTarget' (a nil value)"
Morphed spellid prob the problem, just pass a baseline spellid in the isspellinrange part
Last edited by crystal_tech; 11-23-2013 at 03:49 PM.
Please if someone helped you donate rep to them.
Still the same error. There must be something else.. Because if i gonna reuse _castSpell from PartyKilla it has the same error.
(it only happens at function calls with a parameter)
Code:function _castSpell(spellid,tar) if UnitCastingInfo("player") == nil and UnitChannelInfo("player") == nil and IsPlayerSpell(spellid) == true and cdRemains(spellid) == 0 then if tar ~= nil and rangeCheck(spellid,tar) == nil then return false elseif tar ~= nil and rangeCheck(spellid,tar) == true then CastSpellByName(GetSpellInfo(spellid),tar) return true elseif tar == nil then CastSpellByName(GetSpellInfo(spellid)) return true else return false end end end
Error:
Code:Message: [string "-- 45462 Plague Strike ..."]:17: attempt to call global '_castSpell' (a nil value) Time: 11/24/13 01:41:59 Count: 24 Stack: [string "-- 45462 Plague Strike ..."]:17: in function `?' [string "if PQR_Addon_Loaded == nil then..."]:765: in function `PQR_NextAbility' [string "if PQR_Addon_Loaded == nil then..."]:534: in function `PQR_ExecuteRotation' [string "if PQR_Addon_Loaded == nil then..."]:287: in function <[string "if PQR_Addon_Loaded == nil then..."]:214> Locals: (*temporary) = nil (*temporary) = 45462 (*temporary) = "attempt to call global '_castSpell' (a nil value)"
Last edited by nfx; 11-23-2013 at 08:50 PM.
Seems like your function isn't getting initialized - hence the "a nil value". You should check if the ability your function is getting initialized in is actually in your rotation and if it indeed is you should check the ability itself for lua-errors. use something like Lua: demo or download luac to validate it.
Last edited by troxxer; 11-24-2013 at 06:04 AM.
Finally i got it !
Its seems to be a problem that PQR is not reloading the PQR_xxx.Lua file.
I was adding functions to the lua and saved it. To test it i was starting the routine again, however all new added functions in the lua file where not initilized.
Thats why i always got this type of errors. The easiest way to fix it was to exit pqr, relog and start the routine.
Okay guys, been writing my own profiles behind the scenes for a while now but I'm stuck and can't get this to work properly, some help would be appreciated
local pc1 = "focus"
local range = 40
if PQR_UnitDistance(pc1, "player") < range then
if 100 * UnitHealth("focus") / UnitHealthMax("focus") < 90 then
if 100 * UnitHealth("focus") / UnitHealthMax("focus") > 2 then
if PQR_IsOutOfSight("focus", 0.1) then
RunMacroText("/MACRO")
RunMacroText("/stopspelltarget")
return true
end
end
end
end
I want it to cast a spell using my specific macro while a focus is both in LoS and in range. This coding works perfectly until I add the LoS check, then it doesn't cast the macro. If I remove the LoS check, it works just fine. Any help would be apprecaiated.
This doesn't cause the profile to hang or drop the framerate, it just causes the macro not to cast. A little perplexed.