-
Member
Question Regarding PQR Scripts
Hello Everyone, I want to modify one of the available pve ret paladin scripts to auto cleanse the character when it gets a debuff on it. Can someone tell me how this can be done. Thank you.
-
Active Member
Code:
-- make a list of debuffs
local cleanseDebuffs = {123, 436, 56756} -- insert debuff spellid's here, you can also put names
for _,v in pairs(cleanseDebuffs) do --iterate
if UnitDebuff("player",GetSpellInfo(v)) then -- if you have the debuff in the table above
CastSpellByID(*your cleanse spellID here*,"player") -- cast cleanse on yourself
end
end
you can also do spell names
Code:
-- make a list of debuffs
local cleanseDebuffs = {"Crippling Poison", "Wound Poison", "stuffs"}
for _,v in pairs(cleanseDebuffs) do
if UnitDebuff("player",GetSpellInfo(v)) then -- if you have the debuff in the table above
CastSpellByName(*your cleanse NAME here*,"player") -- cast cleanse on yourself
end
end
-
Post Thanks / Like - 1 Thanks
rantas (1 members gave Thanks to Numba1stunna1 for this useful post)
-
Member
Numba1stunna1, thanks. I thought it was a simple thing. I guess I have to read on PQR scripting.
-
Active Member
It's all Lua, the "--" means I added a comment to the script for each line (to help you understand). Without the comments, the script should look like:
Code:
local cleanseDebuffs = {123, 436, 56756}
for _,v in pairs(cleanseDebuffs) do
if UnitDebuff("player",GetSpellInfo(v)) then
CastSpellByID(*your cleanse spellID here*,"player")
end
end
There are two things you need to learn to properly write profiles: Lua language and WoW API. WoW API are simply functions to return information pertaining to WoW. http://wowprogramming.com/docs/api_categories Keep in mind, different WoW versions have different return values. A good way to try to find these return values is to print them (non-nil values). Lua can be learned here: http://www.lua.org/ A majority of time used when making a profile is debugging, efficiency, and data. PvE profiles are very easy to make, whereas a good PvP profile requires logistics and are much more time consuming.
Last edited by Numba1stunna1; 11-09-2015 at 03:25 AM.