Parrot

From WowAce Wiki
Jump to: navigation, search
Summary
Parrot 1.0
Floating Combat Text of awesomeness. Caw. It'll eat your crackers.
TOC 2.4 (20400)
Category Combat Addons
Authors ckknight, profalbert
Details
Embeds LibRock-1.0, LibRockDB-1.0, LibRockEvent-1.0, LibRockTimer-1.0, LibRockHook-1.0, LibRockConsole-1.0, LibRockConfig-1.0, LibRockLocale-1.0, LibRockModuleCore-1.0, LibSharedMedia-3.0, AceLibrary, Deformat-2.0
Links
Betas Ace SVN Zip
Changelog FishEye

Contents

Display

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate. string boolean number number number string number string string

:ShowMessage("text" [, scrollArea] [, sticky] [, r] [, g] [, b] [, font] [, fontSize] [, outline] [, icon])

Arguments

"text"
string - the text you wish to show.
scrollArea
string - the scroll area to show in. Default: "Notification"
sticky
boolean - whether to show in the sticky-style, e.g. crits. Default: false
r
number - [0, 1] the red part of the color. Default: 1
g
number - [0, 1] the green part of the color. Default: 1
b
number - [0, 1] the blue part of the color. Default: 1
font
string - the font to use (as determined by SharedMedia-1.0). Defaults to the scroll area's setting.
fontSize
number - the font size to use. Defaults to the scroll area's setting.
outline
string - the font outline to use. Defaults to the scroll area's setting.
icon
string - the icon texture to show alongside the message.

Notes

  • See :GetScrollAreasValidate() for a validation list of scroll areas.
  • Messages are suppressed if the user has set a specific suppression matching the text.

Example

Parrot:ShowMessage("Hello, world!", "Notification", false, 0.5, 0.5, 1)


Animation Styles

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.

:GetAnimationStyleDefaultDirection(name)

Arguments

name
type - (needs documentation)


:HasAnimationStyle("name")

Arguments

"name"
string - the name of the animation style, in English.

Returns

boolean - whether the animation style has been registered or not.

Example

local has = Parrot:HasAnimationStyle("My funky style")

:RegisterAnimationStyle(data)

Arguments

data
table - a data table holding the details of an animation style.

Notes

  • The data table is of the following style:
{ 
name = "Name of the style in English", 
localName = "Name of the style in the current locale", 
func = function( 
frame, -- the Frame to work with 
xOffset, -- the horizontal offset from the center of the screen 
yOffset, -- the vertical offset from the center of the screen 
size, -- the size of the animation area to work within. 
percent, -- [0, 1] the current percentage done. 
direction, -- a string of the direction specified. 
num, -- the number of the Frame out of the others using the same area. 
max, -- the number of Frames using the same area 
uid, -- the unique ID of the Frame, for the given area. 
) 
frame:SetPoint(...) -- the Frame must be positioned here. 
end, 
init = function( -- this is optional 
frame, -- the Frame to work with 
xOffset, -- the horizontal offset from the center of the screen 
yOffset, -- the vertical offset from the center of the screen 
size, -- the size of the animation area to work within. 
direction, -- a string of the direction specified. 
uid, -- the unique ID of the Frame, for the given area. 
) 
this is called before the first func() is called. 
end, 
cleanup = function( -- this is optional 
frame, -- the Frame to work with 
xOffset, -- the horizontal offset from the center of the screen 
yOffset, -- the vertical offset from the center of the screen 
size, -- the size of the animation area to work within. 
direction, -- a string of the direction specified. 
uid, -- the unique ID of the Frame, for the given area. 
) 
this is called after the last func() is called. 
end, 
overlap = true, -- or false. This dictates whether Frames should be moved along prematurely if they are overlapping. 
defaultDirection = "UP", -- required if directions is given. 
directions = { -- this is optional 
UP = "Up" -- key-value of backend direction to localized name. This will be exposed to the user, who can choose what direction to go with. 
} 
}
  • the following fields are available on the frame: .fs (which is the fontstring), .icon (which is the icon, optional), .font, .fontSize, and .fontOutline. With these, you can manipulate the size of the fontstring with frame.fs:SetFont(frame.font, frame.fontSize*2, frame.fontOutline); if frame.icon then frame.icon:SetWidth(frame.fontSize*2); frame.icon:SetHeight(frame.fontSize*2) end to double its size.

Example

Parrot:RegisterAnimationStyle {
	-- simple vertical
	name = "Straight", 
	localName = L["Straight"],
	func = function(frame, xOffset, yOffset, size, percent, direction)
		if direction == "DOWN" then
			percent = 1 - percent
		end
		local y = yOffset + (percent - 0.5) * size
		local x = xOffset
		frame:SetPoint("CENTER", UIParent, "CENTER", x, y)
	end,
	defaultDirection = "DOWN",
	directions = {
		UP = L["Up"],
		DOWN = L["Down"],
	},
	overlap = true,
}


Scroll Areas

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.

:GetScrollAreasChoices()

Notes

This is to be used for LibRockConfig-1.0 tables.

Returns

table - A choices table for LibRockConfig-1.0 tables.

Example

{
	type = 'text',
	name = "Scroll area",
	desc = "Scroll area to use in Parrot.",
	choices = Parrot:GetScrollAreasChoices(),
	get = getScrollArea,
	set = setScrollArea,
}


Trigger Conditions

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate. string or number

:FirePrimaryTriggerCondition("name" [, arg] [, uid])

Arguments

"name"
string - the name of the trigger condition to fire, in English.
arg
string or number - a vital argument to provide information about the trigger condition.
uid
type - (needs documentation)

Notes

  • You have to register a trigger condition with :RegisterPrimaryTriggerCondition(data) first.
  • In most cases, if you use normal events in the registration or Parser-3.0, this shouldn't need to be called.

Example

Parrot:FirePrimaryTriggerCondition("My trigger condition", 50)

:HandleDamage(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount , school , resisted , blocked , absorbed , critical , glancing , crushing)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)
school
type - (needs documentation)
resisted
type - (needs documentation)
blocked
type - (needs documentation)
absorbed
type - (needs documentation)
critical
type - (needs documentation)
glancing
type - (needs documentation)
crushing
type - (needs documentation)


:RegisterPrimaryTriggerCondition(data)

Arguments

data
table - a data table holding the details of a primary trigger condition.

Notes

The data table is of the following style:

{ 
name = "Name of the condition in English", 
localName = "Name of the condition in the current locale", 
events = { -- this is optional 
NAME_OF_EVENT = value, -- where NAME_OF_EVENT is the event to check, only works when value is equal to arg1. Also, value could be true in which case it is always checked. 
there can be multiple events. 
}, 
getCurrent = function() -- this is optional and to be used with events. 
if not SomeCondition() then 
return nil -- condition won't fire. 
else 
return value -- numeric value. 
end 
end, 
param = { 
AceOptions argument here. 
do not specify get, set, name, or desc. 
} 
}

TODO documentation

Example

Parrot:RegisterPrimaryTriggerCondition {
	name = "Incoming block",
	localName = L["Incoming block"],
	parserEvent = {
		eventType = "Miss",
		missType = "Block",
		recipientID = "player",
	},
}

:RegisterSecondaryTriggerCondition(data)

Arguments

data
table - a data table holding the details of a secondary trigger condition.

Notes

The data table is of the following style:

{ 
name = "Name of the condition in English", 
localName = "Name of the condition in the current locale", 
check = function(param) 
return GetSomeValue() == param 
end, 
defaultParam = 0.5, -- the default value 
param = { 
AceOptions argument here. 
do not specify get, set, name, or desc. 
} 
}

Example

Parrot:RegisterSecondaryTriggerCondition {
	name = "Minimum power amount",
	localName = L["Minimum power amount"],
	defaultParam = 0.5,
	param = {
		type = 'range',
		min = 0,
		max = 10000,
		step = 1,
		bigStep = 50,
	},
	check = function(param)
		if UnitIsDeadOrGhost("player") then
			return false
		end
		return UnitMana("player")/UnitManaMax("player") >= param
	end,
}


Combat Events

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.

:AuraApplied(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , auraType , amount)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
auraType
type - (needs documentation)
amount
type - (needs documentation)


:AuraRemoved(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , auraType)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
auraType
type - (needs documentation)


:CancelEventsWithUID(uid)

Arguments

uid
type - (needs documentation)


:EnchantApplied(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellName , itemId , itemName)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellName
type - (needs documentation)
itemId
type - (needs documentation)
itemName
type - (needs documentation)


:EnchantRemoved(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellName , itemId , itemName)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellName
type - (needs documentation)
itemId
type - (needs documentation)
itemName
type - (needs documentation)


:EnvironmentalDamage(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , enviromentalType , amount , school , resisted , blocked , absorbed , critical , glancing , crushing)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
enviromentalType
type - (needs documentation)
amount
type - (needs documentation)
school
type - (needs documentation)
resisted
type - (needs documentation)
blocked
type - (needs documentation)
absorbed
type - (needs documentation)
critical
type - (needs documentation)
glancing
type - (needs documentation)
crushing
type - (needs documentation)


:EventIgnore()

No arguments

:GetAbbreviatedSpell(name)

Arguments

name
type - (needs documentation)


:HandleEvent(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , ...)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
...
type - (needs documentation)


:MeleeMissed(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , missType)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
missType
type - (needs documentation)


:PartyKill(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)


:RegisterCombatEvent(data)

Arguments

data
table - a data table holding the details of a combat event.

Notes

The data table is of the following style:

{ 
category = "Name of the category in English", 
name = "Name of the condition in English", 
localName = "Name of the condition in the current locale", 
defaultTag = "The default tagstring in the current locale", -- this can and should include relevant tags. 
parserEvent = { -- optional, will cause it to trigger when the filter passes. 
eventType = "Some eventType", 
see Parser-3.0 for more details. 
}, 
blizzardEvent = "NAME_OF_EVENT", -- optional, will cause it to trigger when the event fires. Incompatible with parserEvent. 
color = "7f7fff", -- some color in the form of "rrggbb", 
tagTranslations = { -- optional, highly recommended 
Amount = "amount", 
Name = "sourceName", -- equivalent to function(info) return info.sourceName end 
Value = function(info) 
return "|cffff0000" .. info.value .. "|r" 
end, 
these are mappings of Tag to info table key (or to a function that will be called). 
}, 
tagTranslationsHelp = { -- optional 
Amount = "The description of the [Amount] tag in the current locale.", 
Name = "The description of the [Name] tag in the current locale.", 
Value = "The description of the [Value] tag in the current locale.", 
}, 
canCrit = true, -- or false/nil. Will cause the event to go sticky on critical. 
throttle = { -- optional 
"Throttle type in English", 
'infoTableKey', -- the key with which to categorize by. 
'throttleCount', -- the key which will be filled based on how many throttled events are in the single instance. 
sourceName = L["Multiple"] -- any key-value mappings will change the info table if there are multiple throttled events. 
}, 
filterType = { -- optional 
"Filter type in English", 
'infoTableKey', -- the numeric key with which to check the filter against. 
}, 
}

Example

Parrot:RegisterCombatEvent{
	category = "Outgoing",
	name = "Melee dodges",
	localName = L["Melee dodges"],
	defaultTag = L["Dodge!"],
	parserEvent = {
		eventType = "Miss",
		missType = "Dodge",
		sourceID = "player",
		recipientID_not = "player",
		abilityName = false,
	},
	tagTranslations = {
		Name = "recipientName",
	},
	tagTranslationsHelp = {
		Name = L["The name of the enemy you attacked."],
	},
	color = "ffffff", -- white
}

:RegisterFilterType("name" , "localName" , default)

Arguments

"name"
string - the name of the throttle type in English.
"localName"
string - the name of the throttle type in the current locale.
default
number - the default filter amount.

Notes

Filters work by suppressing messages that do not live up to a certain minimum amount.

Example

Parrot_CombatEvents:RegisterFilterType("Incoming heals", L["Incoming heals"], 0)
-- allows for a filter on incoming heals, so that if you don't want to see small heals, it's easy to suppress.

:RegisterThrottleType("name" , "localName" , duration , waitStyle)

Arguments

"name"
string - the name of the throttle type in English.
"localName"
string - the name of the throttle type in the current locale.
duration
number - the default duration in seconds.
waitStyle
boolean - whether to wait for the duration before firing (true) or to fire as long as it hasn't fired in the past duration (false).

Notes

waitStyle is good to be set to true in events where you expect multiple hits at once and don't want to show the first hit and then the rest of the hits in one conglomerate chunk. waitStyle is good to be set to false in events where you expect a steady stream but not necessarily one that is coming from a single source.

Example

Parrot:RegisterThrottleType("DoTs and HoTs", L["DoTs and HoTs"], 2)

:SpellDamage(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount , school , resisted , blocked , absorbed , critical , glancing , crushing)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)
school
type - (needs documentation)
resisted
type - (needs documentation)
blocked
type - (needs documentation)
absorbed
type - (needs documentation)
critical
type - (needs documentation)
glancing
type - (needs documentation)
crushing
type - (needs documentation)


:SpellEnergize(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount , powerType)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)
powerType
type - (needs documentation)


:SpellExtraAttack(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)


:SpellHeal(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount , critical)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)
critical
type - (needs documentation)


:SpellHoT(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount , critical)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)
critical
type - (needs documentation)


:SpellInterrupt(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , extraSpellId , extraSpellName , extraSpellSchool)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
extraSpellId
type - (needs documentation)
extraSpellName
type - (needs documentation)
extraSpellSchool
type - (needs documentation)


:SpellLeech(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount , powerType , extraAmount)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)
powerType
type - (needs documentation)
extraAmount
type - (needs documentation)


:SpellMissed(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , missType)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
missType
type - (needs documentation)


:SpellPeriodicDrainLeech(timestamp , eventtype , srcGUID , srcName , srcFlags , dstGUID , dstName , dstFlags , spellId , spellName , spellSchool , amount , powerType , extraAmount)

Arguments

timestamp
type - (needs documentation)
eventtype
type - (needs documentation)
srcGUID
type - (needs documentation)
srcName
type - (needs documentation)
srcFlags
type - (needs documentation)
dstGUID
type - (needs documentation)
dstName
type - (needs documentation)
dstFlags
type - (needs documentation)
spellId
type - (needs documentation)
spellName
type - (needs documentation)
spellSchool
type - (needs documentation)
amount
type - (needs documentation)
powerType
type - (needs documentation)
extraAmount
type - (needs documentation)


:TriggerCombatEvent("category" , "name" , info , throttleDone)

Arguments

"category"
string - the name of the category in English
"name"
string - the name of the event in English
info
table - the info table to pass in
throttleDone
boolean - internal value

Notes

info can be any table and is meant to be recycled. The values within it will be exportable through the tagTranslations provided by :RegisterCombatEvent.

Example

local tmp = newList()
tmp.value = 50
Parrot:TriggerCombatEvent("Notification", "My event", tmp)
tmp = del(tmp)