Here is a (very) basic scaffold of how to create your own rotation, so if you want to learn to code you can get started.
With AI and a bit of good will you can go pretty far by yourself.
It's made for classic era, you'll have to adapt it if you play other versions of the game.
In your Wow Addon folder create a directory with a name of your choosing.
This is your addon directory.
In this directory create a file named like your directory and the ".toc" extension (for example RenameMe.toc)
In this file write RenameMe.lua (change the name according to what you chose initially).
In the same directory create a file named RenameMe.lua (also change the name).
This is where your code will live.
Lines starting with - - are comments to help you understand what we're doing.
Start Nilname then launch wow. If your priest has power word fortitude he will autobuff himself.
Beware of performances if you adjust the frequency of the pulse function, I wouldn't put it under 0.1 (100 ms).
Code:
local myClass = UnitClass("PLAYER")
local function doPriestThings()
-- Power Word: Fortitude is availlable for 10c at lvl 1 at the priest trainer, so it's very easy to test this script
local powerWordFortitude = "Power Word: Fortitude"
-- find a non harmful buff on the player, in this case we're looking for Power Word: Fortitude
local aura = AuraUtil.FindAuraByName(powerWordFortitude, "PLAYER", "HELPFUL")
if not aura then
print(powerWordFortitude .. " not found")
-- get the spellId for PWF so that we can cast the best one availlable to the player
-- (rank 1 doesn't have the same id as rank 2 for example)
local spellId = C_Spell.GetSpellIDForSpellIdentifier(powerWordFortitude)
if spellId then
local isUsable, insufficientPower = C_Spell.IsSpellUsable(spellId)
if isUsable then
print("Casting " .. powerWordFortitude)
-- /!\ this is a protected function, without the unlocker it wouldn't work
CastSpellByID(spellId)
elseif insufficientPower then
print("Not enough mana to cast " .. powerWordFortitude)
else
print("Cannot cast " .. powerWordFortitude .. " now")
end
end
end
end
local function pulse()
if myClass == "Priest" then
-- we separate the priest logic into a separate function to keep the code clean
doPriestThings()
elseif myClass == "Warrior" then
-- create your own warrior logic here
print("I'm a warrior")
-- etc for the other classes
else
print(myClass .. " logic hasn't been implemented yet")
end
-- schedule the next pulse in 2 seconds
-- this will keep the script running every 2 seconds until the player logs out
C_Timer.After(2, pulse)
end
-- first call to the pulse function.
-- this will be executed once when the player logs in.
pulse()
Every line of code in this addon is legal per Blizzard book, except
Code:
CastSpellByID(spellId)
If you use this addon without Nilname it will error.
Use the addons buggraber and bugsack to check the errors.
Quote:
Originally Posted by policeno
I would like this function, working with GMR would be great!
|
NN works with GMR.