Ovale Spell Priority

Documentation

The basis

If a default script is available for your class, you should have one or two icons on your screen. You can move these icons by dragging them.

If you click on the icon, you hide or show some check boxes and/or list boxes. These allow to do simple customization (e.g. a warlock can choose which curse to cast).

You can not cast the spell by clicking on the icon, but the keyboard key to press is displayed in the icon bottom left corner (if your class uses several stances, and if the spell is in several spell bars at different places, it may be wrong).

The option interface

To customize the addon, please launch the Blizzard option dialog (accessible through ESCAPE and Interface). In the Add-ons tab, you should find Ovale.

The first sheet displays the script that creates the icons.

The second sheet "Apparence" allows you to resize the icons.

The third sheet "Profile" allows you to save or load the current profile or reset to the default profile.

The script

The script is a small program in a custom language that creates the icons and other things. The preferred way to edit it is to copy it in your favorite text editor (like Notepad), modify it, and copy it back to World of Warcraft. Click the Accept button to save the changes, and the Compile button to try your script.

The basic commands

Macro definition

Define

Define a new constant. Every occurrence of NEWDEFINITION will be replaced by value.

Define(NEWDEFINITION value)

NEWDEFINITION
The name of the definition
value
A value.

Functions that returns text strings

These functions returns strings that can be used as parameter to option functions.

SpellName

Returns the spell name using its identifier (a number). E.g. use it for the name of a check box or a list item

SpellName(spellId)

spellId
A spell identifier

L

Returns a generic text in the user langauge.

The text identifier may be AOE, Melee, None, or Blood.

L(text)

text
The text identifier.

Spell configuration

ScoreSpells

A list of SpellId that count against the scoring system. Every spell that is not in the list stops the scoring until a spell that is in the list is cast.

SpellInfo

Gives informations about a spell. It is not necessary for spells that does not have a cooldown.

SpellInfo(spellid cd=99 duration=99 canStopChannelling=3 toggle=1)

1
The SpellId
cd
The cooldown, in seconds
duration
Duration of the aura applied by this spell, in seconds (used only by OtherDebuffsExpires() at this time)
canStopChannelling
The channelling can be interrupted. The parameter is the number of ticks (e.g. canStopChannelling=3 for Mind Flay)
toggle
The spell is a toggle spell, like Heroic Strike (next-attack ability), or Divine Favor (next-spell ability)
glyph
A glyph spell Id. The character must have this glyph to use this spell infos
talent
A talent id. The character must have this talent to use this spell infos
addduration
Add a value to a duration already defined with another SpellInfo
addcd
Add a value to a cooldown already defined with another SpellInfo
inccounter
A counter identifier. Add one to the counter each time the spell is cast.
resetcounter
A counter identifier. Reset its value to zero each time the spell is cast.
buffnocd
A spell id. If the buff is present, the spell has no cooldown
targetlifenocd
A number between 0 and 100. If the target life is below this value (in percent), the spell has no cooldown

SpellList

SpellList(listname spellid1 spellid2...)

Allows to create a spell list of name ''listname''. Most functions that test auras (buffs and debuffs) and take a spell id as a parameter can use a spell list instead. In this case it will use the first spell id that matches any of the aura.

Default list names are:

  • Poison, Disease, Curse, and Magic: any spell of this school
  • fear, root, incapacitate, stun: any player spell that has this effect (does not contain any npc spell)
  • strengthagility, stamina, heroism: a buff
  • lowerarmor, magicaldamagetaken, lowerphysicaldamage, meleeslow, bleed: a debuff

SpellAddBuff

Tell Ovale that a spell applies one buff or more on the player.

SpellAddBuff(spellid buff1id=99 buff2id=99...)

1
The SpellId of the spell that applies the buffs
buff1id, buff2id...
The name of the parameter is the SpellId of the buff spell, and the value is its duration in seconds. if the value is 0 it means that the buff is removed. If the value is negative, it is the number of stacks that are removed.

SpellAddDebuff

Same as SpellAddBuff() but the spells are debuffs.

SpellAddTargetDebuff

Same as SpellAddDebuff() but the spells are applied to the target and not the player.

Option interface

AddCheckBox

Add a check box. AddCheckBox(checkboxId "Text")

checkboxId
An identifier that is used by CheckBoxOn or CheckBoxOff
"Text"
"Text" can be literal text enclosed in quotes or the SpellName or L function.
1
If this value is default, the checkbox is on by default
talent
A talent id. The character must have this talent
mastery
A number between 1 and 3. The character must have this tree as the primary talent tree.
glyph
A spell id. The character must have this glyph enabled.

AddListItem

Add a new item to a list. If the list does not exist, it is created.

AddListItem(listId itemId "Text")

listId
A list identifier. Use the same for each item in the list.
itemId
An item identifier
"Text"
A text
1
If the value is default, this list item is selected by default
talent
A talent id. The character must have this talent
mastery
A number between 1 and 3. The character must have this tree as the primary talent tree.
glyph
A spell id. The character must have this glyph enabled.

AddIcon

Add a new icon. A script should be enclosed in the braces to describe the icon.

You can set parameters in the form AddIcon key1=value1 key2=value2 {}. Valid parameters are :

size=small
show as a small icon
nocd=1
hide the icon when the action is on cooldown (parameter is the minimum number of seconds of cooldown before hiding the icon, e.g. 1 would hide the icon if the cooldown is more than 1 second)
help
any of main, offgcd, cd, aoe, buff, and mana: set the tooltip
mastery
A number between 1 and 3. The character must have this tree as the primary talent tree.

The AddIcon syntax

Nodes

The nodes are the basis of the script. A node may be:

  • a group, which is several nodes enclosed in braces
  • a keyword and its parameters (which are nodes)
  • a function

A node has:

  • a starting time, which can be "infinite"
  • an ending time, which can be "infinite"
  • an action
  • a priority Both starting and ending times define a time window. For example, if a spell is on cooldown but will be available in 2 seconds, its time window will be +2 to infinite. If a buff on the target expires in 3 seconds, its time window will be 0 to +3. The intersection of the two time windows would be from 2 to 3 seconds, and the union would be 0 to infinite.

The group

The script is a group itself.

The resulting node of a group is the node with the least remaining time. If two nodes have the same remaining time and the same priority, the first defined node is used. If a node has a lower priority than another node that would be clipped by the global cooldown, the higher priority node is chosen.

The keywords

if ''condition'' ''node''
The ''if'' node is the action and priority from the ''node'', but the time window is the intersection of the ''node'' time window and the ''condition'' time window (e.g. if TargetDebuffExpires(125) Spell(125))
unless ''condition'' ''node''
It is the same as ''node'' but the resulting time window is the ''node'' time window minus the ''condition'' time window
''node1'' or ''node2''
the time window is the union of the ''node1'' and ''node2'' time windows
''node1'' and ''node2''
The remaining time is the intersection between ''node1'' and ''node2'' time windows
''node1'' after ''node2''
The time window of ''node2'' is shifted by ''node1'' seconds
For example if you want to wait that a debuff A is present at least 1 second before casting a spell B, you may write if 1s after TargetDebuff(A) Spell(B)
''node1'' before ''node2''
The time window of ''node2'' is shifted by ''node1'' seconds
For example if you want that the spell A is cast at most 3s before the cooldown of the spell B expires, you may write if 3s before Spell(B) Spell(A)
between "node1" and "node2"
Returns the absolute difference between the starting time of ''node1'' and ''node2'', whichever is the first
from ''node1'' until ''node2''
Returns the difference between the starting time of ''node1'' and ''node2'' (the result is positive if ''node2'' comes after ''node1'', negative otherwise)
at least ''node1'' ''node2''
return 0 if ''node1''<=''node2'', infinite otherwise
at most ''node1'' ''node2''
return 0 if ''node1''>=''node2'', infinite otherwise
more than ''node1'' ''node2''
return 0 if ''node1''<''node2'', infinite otherwise
less than ''node1'' ''node2''
return 0 if ''node1''>''node2'', infinite otherwise

Functions with an action

The functions use the syntax FunctionName(parameter1=value1 parameter2=value2...). If the name of a parameter is committed, the default is 1, 2, etc.

Spell

1
The spell identifier
target
The target of the spell. Default is target. May be focus for example.
usable
Set this parameter to 1 if the spell should be hidden if it is not usable (special conditions not meet, not enough mana, etc.). E.g. use it for abilities that work only on some targets (undead, demons...), abilities that work only bellow a certain life percentage...
priority
Set the priority. Default is 3.
sound
Play a sound. Give the absolute full path to the sound.
soundtime
What should be the spell cooldown in seconds when the sound is played. Default is 0.5.

Macro

Same as Spell, but run a macro whose name is in parameter.

Item

Same as Spell, but use an item.

The parameter may be either an item identifier (the number that is used database web sites) or an inventory slot. See Wowpedia for a list of inventory slots.

Texture

A placeholder texture. May be used to denote anything that is not a spell like target swapping, movement, etc. See Wowpedia for a list.

Example: Texture(INV_Misc_Coin_01) will display coins. Time to earn some money, dying to boss enrage is not free!

Functions without actions

These functions do not return a priority or an action, only a remaining time. It means that they should only be used as the first node of ''if'' or ''unless'', or as any node of ''or'' or ''and''.

Many of these function use an optional target parameter. If not defined, the target is the player character. As it may be cumbersome to define it everywhere, there are two shortcut notations available for Function(target=''target''): - ''target''.Function() where ''target'' may be target, player, pet, partyN, raidN, focus... - TargetFunction() if the target is current player target

ArmorSetParts

Test how many armor set parts are equiped by the player

1
the set name (e.g. T11). Warning: may not be supported for all armor sets. Try first.
2
"more" or "less"
3
limit

BuffDuration

Test if the buff total duration (not the current remaining time) is more or less than a given value

1
buff spell id
2
"more", "equal", or "less"
3
the value

BuffExpires

Test if a buff will expire on the player after a given time

1
buff spell id
2
maximum expiration time
haste
the haste to apply to expiration time. spell is the only acceptable value. Default is no haste.
mine.
1 if the buff must have been applied by the player
stacks
Minimum stack size
forceduration=1
Ignore the actual current duration of the spell and use the one given by SpellInfo: used when the duration may change (e.g. see Glyph of Shred that allows Shred to expand the duration of Rip). Alternatively, you may use a time in seconds as a parameter to foreceduration
target
the unit with the buff

BuffGain

Test if some time elapsed since the last time the player gained this buff.

1
the spell id
2:
the minimum time elapsed

BuffPresent

Test if a buff is active.

1
buff spell id
2
minimum expiration time
haste
the haste to apply to expiration time. spell is the only acceptable value
mine
1 if the buff must have been applied by the player
stacks
Minimum stack size
forceduration=1
Ignore the actual current duration of the spell and use the one given by SpellInfo: used when the duration may change (e.g. see Glyph of Shred that allows Shred to expand the duration of Rip). Alternatively, you may use a time in seconds as a parameter to foreceduration
target
The unit with the buff

Casting

Test if the player casts a spell

1
the spell that should be cast

CastTime

Compare to a spell cast time

1
the spell id
2
"more", "equal", or "less"
3
a time in seconds

CheckBoxOff

Test if a list of checkboxes is off

1,...
the checkboxes names

CheckBoxOn

Test if a list of checkboxes is on

1,...
the checkboxes names

ComboPoints

Test how many combo points a feral druid or a rogue has

1
"less", "equal", or "more"
2
the limit

Counter

Compare to a counter value

1
the counter identifier
2
"more", "equal", or "less"
3
a number

DebuffExpires

Test if a debuff on the player is about to expires. See BuffExpires.

DebuffPresent

Test if a debuff is on the player. See BuffPresent.

Eclipse

Compare to the value of eclipse (negative for lunar, positive for solar)

1
"more", "equal", or "less"
2
a number from -100 to 100

EffectiveMana

Same as Mana but divides the current mana (or energy) value by the current mana cost reduction.

1
"more" or "less"
2
a number

EndCastTime

Returns the time at which a spell cast would end if cast after the current spell cast

1
The spell id

Glyph

Test if a glyph is on the player.

1
The glyph SpellId (not the object ItemId). e.g. 59333 for the Glyph of Blood Strike.

HasFullControl

Test if the player has full control of his character.

HasShield

Test if the player has a shield

HolyPower

Compare to the value of the holy power

1
"more", "equal", or "less"
2
a number from 0 to 3

InCombat

Test if the user is in combat

1
"yes" (default) or "no"

ItemCount

Compare with a number of items (may be used to count consumables).

GetItemCount(12345 more 2)

1
The ItemId of the item
2
more, equal, or less
3
The number to compare
charges
If 1, the item charges are counted (e.g. mana gems)

IsFeared

Test if the player is feared by another player

IsIncapacited

Test if the player has been incapacited by another player (Sap, Gouge, Repentance)

IsRooted

Test if the player is rooted by another player

IsStunned

Test if the player has been stunned by another player (Bash, Blackout, Cheap Shot, Concussion Blow, Hammer of Justice, Kidney Shot, Revenge Stun, Shockwave)

LastSwing

Some time after the last swing.

1
main, off, or any (default)
2
How long after the last swing

Level

Compare with the player level

1
"less" or "more"
2
the limit

LifePercent

Test if the player life is bellow/above a given value in percent

1
"less" or "more"
2
the limit, in percent

List

Test if a list item is selected

1
the list name
2
the item name

Mana

Test if the player mana is above/bellow a given value

1
"less" or "more"
2
the mana/energy/rage... limit

ManaPercent

Test if the player mana is above/bellow a given value in percent

ManaPercent(more 24)

1
"less" or "more"
2
the mana/energy/rage... limit

MaxHealth

Compare to the max health.

1
"less" or "more"
2
A value to compare to the max health
target
The target

NextSwing

Some time before the next swing

1
main, off, or any (default)
2
How long before the next swing

OtherDebuffExpires

Test if a debuff that has been placed on any other target that the current target is about to expires

OtherDebuffExpires(12345 2 15)

1
The SpellId of the debuff
2
The time before the expiration in seconds, or 0 if the debuff must have expired (0 is the default)
3
The maximum number of seconds after the expiration before the target is to be ignored (10 is the default)

OtherDebuffPresent

The oppposite of OtherDebuffExpires.

PetPresent

Test if any player pet is present (or not)

1
"yes" or "no"

Runes

Test how many runes are up (death rune count as any other rune).

Runes(frost 2 unholy 1 nodeath=1)

1
the type of rune (may be blood, unholy, frost, or death)
2
the minimum number of runes that are up
3
other type of rune (optional)
4
the minimum number of runes that are up (if 3 is present)
nodeath
Death runes are ignored in the count

Speed

Compare to the player current speed, 100 being normal walking speed.

1
"more" or "less"
2
A number, 100 is the normal walking speed.

Stance

Test if the player is in a given stance (or form)

1
the stance (a number, 1 being the first stance, 0 the normal stance if any)

Stealthed

Test if the player is stealthed

1
"yes" (default) or "no"

TalentPoints

Test how many talent points has been spent in a talent

1
the talent identifier (use /script print(Ovale.talentNameToId["Talent name"]) to retreive)
2
"more" or "less"
3
the limit

TargetBuffPresent

Same as BuffPresent but for the target. Has the following additionnal parameter:

target
the target of the buff, the current target being the default

TargetClass

Test the class of the target

1
the class (may be rogue, warrior, mage, etc.)
2
yes or no

TargetClassification

Test the target classification

1
normal, elite, or worldboss

TargetCreatureType

Test the target creature type

1
the creature type (may be Beast, Critter, Demon, Dragonkin, Elemental, Giant, Humanoid, Mechanical, or Undead).

TargetDeadIn

Test when the target will be dead (estimation based on the current dps on this target)

1
less or more
2
time in seconds

TargetDebuffExpires

Same as DebuffExpires but for another character than the player. There is an additionnal optionnal parameter:

target
the target of the buff, the current target being the default

TargetDebuffPresent

See TargetBuffPresent, but for debuffs.

TargetInRange

Test if the target is in range

1
the spell
2
yes or no

TargetIsCasting

Test if the target is casting any spell

1
yes (default) or no

TargetIsCasting

Test if the target is casting or channelling a spell

1
yes (default) or no
spell
the spell that is casted, default is any

TargetIsInterruptible

Test if the target is casting or channelling any spell that can be interrupted

1
yes (default) or no

TargetLife

Compare with the life of the target.

1
"less", "equal", or "more"
2
the limit

TargetLifeMissing

Compare to the hit points the target is missing.

1
"less", "equal", or "more"
2
the limit

TargetLifePercent

Test if the target life is bellow/above a given value in percent

1
"less", "equal", or "more"
2
the limit, in percents

TargetMana

Compare with the mana of the target.

1
"less", "equal", or "more"
2
the limit

TargetRelativeLevel

Test the target level difference with the player

1
"less", "equal", or "more"
2
[target level]-[player level] limit

TargetTargetIsPlayer

Test if the target's target is the player (or is not)

1
"yes" (it should be the player) or "no"

Threat

Compare to the percentage of the current target maximal threat (100 means that you have aggro).

1
"less", "equal", or "more"
2
the limit (0 to 100)

TimeInCombat

Compare to the duration of the combat

1
"more" or "less"
2
The time to compare, in seconds

TotemExpires

Test if a totem or ghoul expires

1
the totem type (earth, water, air, fire, ghoul)
2
the time before expiration

TotemPresent

Checks if a totem or ghoul is present

1
the totem type (earth, water, air, fire, ghoul)

Tracking

Test if a tracking is enabled (hunter tracking notably)

1
the tracking spell id
2
"no" or "yes" (default)

WeaponEnchantExpires

Test if a temporary weapon enchant expires (for Shaman and Rogues)

1
either mainhand of offhand
2
the time before expiration in seconds

You must login to post a comment. Don't have an account? Register to get one!

Table of contents

  1. 1 The basis
  2. 2 The option interface
  3. 3 The script
    1. 3.1 The basic commands
      1. 3.1.1 Macro definition
        1. 3.1.1.1 Define
      2. 3.1.2 Functions that returns text strings
        1. 3.1.2.1 SpellName
        2. 3.1.2.2 L
      3. 3.1.3 Spell configuration
        1. 3.1.3.1 ScoreSpells
        2. 3.1.3.2 SpellInfo
        3. 3.1.3.3 SpellList
        4. 3.1.3.4 SpellAddBuff
        5. 3.1.3.5 SpellAddDebuff
        6. 3.1.3.6 SpellAddTargetDebuff
      4. 3.1.4 Option interface
        1. 3.1.4.1 AddCheckBox
        2. 3.1.4.2 AddListItem
        3. 3.1.4.3 AddIcon
    2. 3.2 The AddIcon syntax
      1. 3.2.1 Nodes
      2. 3.2.2 The group
      3. 3.2.3 The keywords
      4. 3.2.4 Functions with an action
        1. 3.2.4.1 Spell
        2. 3.2.4.2 Macro
        3. 3.2.4.3 Item
        4. 3.2.4.4 Texture
      5. 3.2.5 Functions without actions
        1. 3.2.5.1 ArmorSetParts
        2. 3.2.5.2 BuffDuration
        3. 3.2.5.3 BuffExpires
        4. 3.2.5.4 BuffGain
        5. 3.2.5.5 BuffPresent
        6. 3.2.5.6 Casting
        7. 3.2.5.7 CastTime
        8. 3.2.5.8 CheckBoxOff
        9. 3.2.5.9 CheckBoxOn
        10. 3.2.5.10 ComboPoints
        11. 3.2.5.11 Counter
        12. 3.2.5.12 DebuffExpires
        13. 3.2.5.13 DebuffPresent
        14. 3.2.5.14 Eclipse
        15. 3.2.5.15 EffectiveMana
        16. 3.2.5.16 EndCastTime
        17. 3.2.5.17 Glyph
        18. 3.2.5.18 HasFullControl
        19. 3.2.5.19 HasShield
        20. 3.2.5.20 HolyPower
        21. 3.2.5.21 InCombat
        22. 3.2.5.22 ItemCount
        23. 3.2.5.23 IsFeared
        24. 3.2.5.24 IsIncapacited
        25. 3.2.5.25 IsRooted
        26. 3.2.5.26 IsStunned
        27. 3.2.5.27 LastSwing
        28. 3.2.5.28 Level
        29. 3.2.5.29 LifePercent
        30. 3.2.5.30 List
        31. 3.2.5.31 Mana
        32. 3.2.5.32 ManaPercent
        33. 3.2.5.33 MaxHealth
        34. 3.2.5.34 NextSwing
        35. 3.2.5.35 OtherDebuffExpires
        36. 3.2.5.36 OtherDebuffPresent
        37. 3.2.5.37 PetPresent
        38. 3.2.5.38 Runes
        39. 3.2.5.39 Speed
        40. 3.2.5.40 Stance
        41. 3.2.5.41 Stealthed
        42. 3.2.5.42 TalentPoints
        43. 3.2.5.43 TargetBuffPresent
        44. 3.2.5.44 TargetClass
        45. 3.2.5.45 TargetClassification
        46. 3.2.5.46 TargetCreatureType
        47. 3.2.5.47 TargetDeadIn
        48. 3.2.5.48 TargetDebuffExpires
        49. 3.2.5.49 TargetDebuffPresent
        50. 3.2.5.50 TargetInRange
        51. 3.2.5.51 TargetIsCasting
        52. 3.2.5.52 TargetIsCasting
        53. 3.2.5.53 TargetIsInterruptible
        54. 3.2.5.54 TargetLife
        55. 3.2.5.55 TargetLifeMissing
        56. 3.2.5.56 TargetLifePercent
        57. 3.2.5.57 TargetMana
        58. 3.2.5.58 TargetRelativeLevel
        59. 3.2.5.59 TargetTargetIsPlayer
        60. 3.2.5.60 Threat
        61. 3.2.5.61 TimeInCombat
        62. 3.2.5.62 TotemExpires
        63. 3.2.5.63 TotemPresent
        64. 3.2.5.64 Tracking
        65. 3.2.5.65 WeaponEnchantExpires

Facts

Date created
Jan 25, 2009
Last updated
Aug 14, 2012

Authors