APPENDIX A
Frame Reference
This appendix contains information on all the frame types that you can create in World of Warcraft, with all the XML attributes and elements as well as all Lua methods and available script handlers. Frame types follow an object-oriented model, meaning that a frame type can inherit attributes and methods from another frame type. You can find an introduction to object-oriented programming in Chapter 6 if you are not familiar with this topic. You may wonder why there is such an appendix in this book, as you can probably find most of the information covered here on the Internet. WoWWiki has a few good pages that deal with exactly the same topic as this appendix. However, the information there is scattered over multiple pages and many of the articles are outdated or incomplete. This appendix is up to date as of patch 3.1 (the next patches probably won’t change anything important in the frame API) and contains everything you need to know about a particular frame type in one place.
Object K^fa_p is an abstract frame type; that is, you cannot create frames from this type. But this type is the base class for all other frame types as every other type inherits from K^fa_p. This means that all of the methods, XML attributes, and XML elements listed here are available for all frames. This frame type is sometimes also called QEK^fa_p, which is probably the type’s internal name used in the C++ code of the game.
XML Attributes The K^fa_p type has the following XML attributes.
]hld] Defines the frame’s transparency (0 – 1). Default: 1.
405 406 APPENDIX A N FRAME REFERENCE
l]najp Defines the frame’s parent.
j]ia Defines the frame’s name.
ejdanepo The template to use.
renpq]h Creates a template. Default: b]hoa.
Lua Methods The K^fa_p type has the following Lua methods.
k^fa_p6Cap=hld]$% Returns the frame’s alpha value.
k^fa_p6CapAbba_pera=hld]$% Returns the frame's effective alpha value by multiplying its alpha value with the parent’s effective alpha.
k^fa_p6CapJ]ia$% Returns the name of the frame.
k^fa_p6CapK^fa_pPula$% Returns the type of the k^fa_p.
k^fa_p6CapL]najp$% Returns the parent of the frame.
k^fa_p6EoK^fa_pPula$k^fPula% Returns 1 if k^fa_p is of the type k^fPula, or of a type that inherits from k^fPula. For example, ?na]paBn]ia$?da_g>qppkj%6EoK^fa_pPula$>qppkj% returns 1 because the type ?da_g>qppkj inherits from the type >qppkj.
k^fa_p6Oap=hld]$% Sets the frame’s transparency (0 – 1). APPENDIX A N FRAME REFERENCE 407 k^fa_p6OapL]najp$k^f% Sets the frame’s parent.
Font Bkjp is an object that inherits from K^fa_p and represents a font that can be used by BkjpOpnejcs or >qppkjs.
XML Attributes The Bkjp type has the following XML attributes. bkjp The path to the font file you want to use. fqopebuD Sets the horizontal justification setting. This can either be HABP, NECDP, or ?AJPAN. Default: ?AJPAN. fqopebuR Sets the vertical justification setting. This can either be >KPPKI, PKL, or IE@@HA. Default: IE@@HA. ikjk_dnkia Uses a monochrome font. Default: b]hoa. kqpheja The outline to use; can be JKJA, JKNI=H, or PDE?G. Default: JKJA. ol]_ejc The spacing between characters. Default: 0.
XML Elements The Bkjp type has the following XML elements.
BkjpDaecdp Controls the height of the font with its R]hqa attribute.
?khkn Controls the color of the font with its n, c, ^, and ] attributes. 408 APPENDIX A N FRAME REFERENCE
Od]`ks Contains the two elements ?khkn and Kbboap. ?khkn controls the color with the attributes n, c, ^, and ], and Kbboap controls the shadow offset with one of the elements =^o@eiajoekj or Nah@eiajoekj.
Lua Methods The Bkjp type has the following Lua methods.
bkjp6?kluBkjpK^fa_p$kpdanK^fa_p% Copies all settings from kpdanK^fa_p.
bkjp6CapBkjp$% Returns the font file used.
bkjp6CapBkjpK^fa_p$% Returns the font object itself. This method makes sense when called from a frame that inherits from Bkjp.
bkjp6CapFqopebuD$% Returns the horizontal alignment of the text.
bkjp6CapFqopebuR$% Returns the vertical alignment of the text.
bkjp6CapIqhpehejaEj`ajp$% Returns the multiline indention setting.
bkjp6CapOd]`ks?khkn$% Returns the color of the font’s shadow.
bkjp6CapOd]`ksKbboap$% Returns the offset of the shadow.
bkjp6CapOl]_ejc$% Returns the spacing between characters.
bkjp6CapPatp?khkn$% Returns the color of the text. APPENDIX A N FRAME REFERENCE 409 bkjp6OapBkjp$l]pd% Sets the font file to use. bkjp6OapBkjpK^fa_p$bkjp% This method makes sense only when called from a frame (such as a Iaoo]caBn]ia) that inherits from a Bkjp. This method can then set or change the used font object for the text of the frame. bkjp6OapFqopebuD$]hecj% Sets the horizontal justification setting. The ]hecj argument can be HABP, NECDP, or ?AJPAN. bkjp6OapFqopebuR$]hecj% Sets the vertical justification setting. The ]hecj argument can be PKL, >KPPKI, or IE@@HA. bkjp6OapIqhpehejaEj`ajp$ej`ajp% Controls whether to indent the continuation of a string that does not fit in a single line. bkjp6OapOd]`ks?khkn$n(c(^(]% Sets the color of the shadow. bkjp6OapOd]`ksKbboap$t(u% Sets the offset of the shadow. bkjp6OapOl]_ejc$j% Sets the spacing between characters. bkjp6OapPatp?khkn$n(c(^(]% Sets the color of the text.
Region Nacekj inherits from K^fa_p. The only way to create a Nacekj is by calling bn]ia6 ?na]paPephaNacekj$% or using the XML element PephaNacekj of a frame; you cannot use ?na]paBn]ia to create a Nacekj. It is the base class for everything that is visible on your screen (Bn]ia, Patpqna, and so on), as it defines sizes and anchors.
XML Attributes The Nacekj type has the following XML attributes. oap=hhLkejpo Fits the frame into its parent. Default: b]hoa. 410 APPENDIX A N FRAME REFERENCE
de``aj Defines whether the frame starts visible or hidden. Default: b]hoa.
XML Elements The Nacekj type has the following XML elements.
Oeva Oeva consists of either the element =^o@eiajoekj or Nah@eiajoekj. The former refers to an absolute size that depends only on the effective scale of the frame, while the latter refers to a size relative to the whole screen. Both have the attributes t and u that specify the actual size. A detailed description can be found in Chapter 5.
=j_dkno Consists of one or more Anchor elements. An anchor has the attributes Lkejp, Nah]peraLkejp, and Nah]peraPk and the element Kbboap which, like Oeva, consists of =^o@eiajoekj or Nah@eiajoekj and specifies the offset. A detailed description can be found in Chapter 5.
Lua Methods The Nacekj type has the following Lua methods.
nacekj6?ha]n=hhLkejpo$% Removes all points but does not change the position. You have to set a new point in order to move the frame.
nacekj6Cap>kppki$% Returns the y coordinate of the frame’s bottom.
nacekj6Cap?ajpan$% Returns the x and y coordinates of the frame’s center.
nacekj6CapDaecdp$% Retrieves the frame’s height.
nacekj6CapHabp$% Returns the x coordinate of the frame’s left border.
nacekj6CapJqiLkejpo$% Returns the number of anchor points. APPENDIX A N FRAME REFERENCE 411 nacekj6CapLkejp$j% Retrieves the jth point of the frame. The return values are equivalent to the arguments passed to OapLkejp when creating the anchor. nacekj6CapNa_p$% Returns the frame’s bottom left x and y coordinates followed by the width and height. nacekj6CapPkl$% Returns the y coordinate of the frame’s top. nacekj6CapSe`pd$% Returns the width of the frame. nacekj6De`a$% Hides the frame. nacekj6EoLnkpa_pa`$% Returns 1 if the frame is a protected frame. nacekj6EoOdksj$% Determines whether the frame is shown. This does not take the frame’s parent into account; see EoReoe^ha. nacekj6EoReoe^ha$% Determines whether the frame and all of its parents (and grandparents, and so on) are shown. nacekj6Oap=hhLkejpo$bn]ia% Stretches the frame to fit into bn]ia. nacekj6OapDaecdp$daecdp% Sets the frame’s height. nacekj6OapLkejp$lkejp(nah]peraBn]ia(nah]peraLkejp(t(u% Adds an anchor point. See Chapter 5 for a detailed description. nacekj6OapSe`pd$se`pd% Sets the frame’s width. 412 APPENDIX A N FRAME REFERENCE
nacekj6Opkl=jei]pejc$% Stops all currently playing animations.
nacekj6Cap=jei]pekjCnkqlo$% Returns all animation groups of the frame.
nacekj6?na]pa=jei]pekjCnkql$j]ia(ejdanepo% Creates a new animation group for the frame.
nacekj6Eo@n]ccejc$% Determines whether the user is currently dragging the frame or its parent.
nacekj6?]j?d]jcaLnkpa_pa`Op]pa$% Determines whether you are allowed to call a protected method from tainted code at the moment.
Frame Bn]ia inherits from Nacekj, which means it has all the methods and attributes of K^fa_p and Nacekj.
XML Attributes The Bn]ia type has the following XML attributes.
pklharah Fits the frame into its parent. Default: b]hoa.
ikr]^ha Defines whether the frame starts visible or hidden. Default: b]hoa.
naoev]^ha Makes the frame resizable. Default: b]hoa.
bn]iaOpn]p] Defines the frame strata. Frame strata are described in Chapter 5.
bn]iaharah Defines the level of the frame. APPENDIX A N FRAME REFERENCE 413 aj]^haIkqoa Enables mouse input. Default: b]hoa. aj]^haGau^k]n` Enables keyboard input. Default: b]hoa.
_h]ila`PkO_naaj Prevents the frame from being dragged off the screen. Default: b]hoa. fqilJ]rec]paAj]^ha` Allows the element to be selected with a gamepad or joystick. fqilJ]rec]paOp]np Sets the frame as first frame to be selected when using a gamepad or joystick. Default: b]hoa.
XML Elements The Bn]ia type has the following XML elements.
PephaNacekj A frame of the type Nacekj, which is used as the title region of the frame.
Naoeva>kqj`o Consists of the two elements IejNaoeva and I]tNaoeva, which can contain an =^o@eiajoekj or a Nah@eiajoekj element defining the minimum and maximum size of the frame.
>]_g`nkl Defines the backdrop. A detailed description is available in Chapter 5.
DepNa_pEjoapo Sets the rectangle in which the frame accepts mouse clicks via the attributes left, right, top, and bottom.
H]uano Contains multiple H]uan elements, which in turn may contain multiple Patpqnas or BkjpOpnejcs. A detailed description is available in Chapter 5.
Bn]iao Contains multiple frames of any type that inherits from Bn]ia. 414 APPENDIX A N FRAME REFERENCE
O_nelpo Contains the script handlers.
Lua Methods The Bn]ia type has the following Lua methods.
bn]ia6=hhks=ppne^qpa?d]jcao$% A protected method. Allows tainted code to change attributes in the current execution path while in combat.
bn]ia6?na]paBkjpOpnejc$j]ia(h]uan(ejdanepoBnki% Creates a new BkjpOpnejc object in the layer h]uan as child of the frame.
bn]ia6?na]paPatpqna$% Creates a new Patpqna object in the layer as child of the frame.
bn]ia6?na]paPephaNacekj$% Creates a new PephaNacekj, a frame of the type Nacekj. A title region comes with predefined script handlers (unchangeable, because OapO_nelp doesn’t exist for Nacekjs) for Kj@n]cOp]np and Kj@n]cOpkl; these handlers call Op]npIkrejc and OpklIkrejcKnOevejc respectively on the Nacekj’s parent if it is movable.
bn]ia6@eo]^ha@n]sH]uan$h]uanHarah% Hides the given layer level.
bn]ia6Aj]^ha@n]sH]uan$h]uanHarah% Displays the given layer level.
bn]ia6Aj]^haFkuope_g$% Enables joystick and gamepad input for the frame.
bn]ia6Aj]^haGau^k]n`$% Enables keyboard events.
bn]ia6Aj]^haIkqoa$% Enables mouse events.
bn]ia6Aj]^haIkqoaSdaah$% Enables mouse wheel events. APPENDIX A N FRAME REFERENCE 415 bn]ia6Cap=ppne^qpa$]ppn% Returns the value of ]ppn. bn]ia6Cap>]_g`nkl$% Returns the frame’s backdrop as a table in the same format as Oap>]_g`nkl expects it. bn]ia6Cap>]_g`nkl>kn`an?khkn$% Returns the color of the backdrop’s border. bn]ia6Cap>]_g`nkl?khkn$% Returns the color of the backdrop. bn]ia6Cap>kqj`oNa_p$% Like CapNa_p but takes the frame’s layers into account. bn]ia6Cap?deh`naj$% Returns how many children the frame has. bn]ia6Cap?h]ilNa_pEjoapo$% Returns all children of the frame. bn]ia6Cap@alpd$% Get the frame’s depth on 3D monitors. bn]ia6CapAbba_pera@alpd$% Returns the frame’s effective depth by taking the parent’s depth into account. bn]ia6CapAbba_peraO_]ha$% Returns the effective scale of the frame. bn]ia6CapBn]iaHarah$% Returns the frame level, which determines whether a frame is in front of or behind another frame in the same stratum. bn]ia6CapBn]iaOpn]p]$% Returns the stratum the frame is in. bn]ia6CapDepNa_pEjoapo$% Returns the rectangle that defines where the frame can be clicked. 416 APPENDIX A N FRAME REFERENCE
bn]ia6CapI]tNaoeva$% Returns the maximum width and height the frame can be resized to by the user.
bn]ia6CapIejNaoeva$% Returns the minimum width and height.
bn]ia6CapJqi?deh`naj$% Returns all children of the frame.
bn]ia6CapJqiNacekjo$% Returns the number of regions in the frame.
bn]ia6CapNacekjo$% Returns all regions (Patpqnas and BkjpOpnejcs) of the frame.
bn]ia6CapO_]ha$% Returns the frame’s scale.
bn]ia6CapO_nelp$o_nelp% Returns the function assigned to O_nelpD]j`han.
bn]ia6CapPephaNacekj$% Returns the title region of the frame.
bn]ia6D]oO_nelp$o_nelp% Determines whether the frame can have the script handler o_nelp.
bn]ia6DkkgO_nelp$o_nelp(bqj_% Hooks the script handler o_nelp with the function bqj_.
bn]ia6Ecjkna@alpd$ecjkna% Displays the frame in the default depth if ecjkna is pnqa.
bn]ia6Eo?h]ila`PkO_naaj$% Determines whether the frame is clamped to the screen.
bn]ia6EoArajpNaceopana`$arajp% Determines whether arajp is registered. APPENDIX A N FRAME REFERENCE 417 bn]ia6EoEcjknejc@alpd$% Returns pnqa if Ecjkna@alpd was called with pnqa. bn]ia6EoFkuope_gAj]^ha`$% Returns pnqa if the frame accepts joystick and gamepad input. bn]ia6EoFqilJ]rec]paAj]^ha`$% Determines whether the frame can be selected with a joystick or gamepad. bn]ia6EoFqilJ]rec]paOp]np$% Returns 1 if the frame is the first frame that is selected in an environment with a gamepad or joystick instead of a mouse. bn]ia6EoGau^k]n`Aj]^ha`$% Returns 1 if the frame receives keyboard events. bn]ia6EoIkqoaAj]^ha`$% Returns 1 if the frame receives mouse events. bn]ia6EoIkqoaSdaahAj]^ha`$% Returns 1 if the frame receives mouse wheel events. bn]ia6EoIkr]^ha$% Returns 1 if the frame is movable. bn]ia6EoNaoev]^ha$% Returns 1 if the frame is resizable. bn]ia6EoPklharah$% Returns 1 if the frame is a top-level frame. bn]ia6EoQoanLh]_a`$% Returns 1 if the qoanlh]_a` attribute is set. bn]ia6Hksan$% Reduces the frame’s level. bn]ia6N]eoa$% Increases the frame’s level. 418 APPENDIX A N FRAME REFERENCE
bn]ia6Naceopan=hhArajpo$% Registers all available events for debugging purposes.
bn]ia6NaceopanArajp$arajp% Registers the given event.
bn]ia6NaceopanBkn@n]c$^pj-(***% Enables the Kj@n]cOp]np/Opkl handlers for the given mouse buttons.
bn]ia6Oap=ppne^qpa$]ppne^qpa(r]hqa% Sets ]ppne^qpa to r]hqa.
bn]ia6Oap>]_g`nkl$^]_g@nkl% Sets the frame’s backdrop; ^]_g@nkl is a table in the following format:
w ^cBeha9^cBeha(a`caBeha9a`caBeha(peha9b]hoa( pehaOeva9-2(a`caOeva9/.( ejoapo9whabp9,(necdp9,(pkl9,(^kppki9,y y
A description of backdrops can be found in Chapter 5.
bn]ia6Oap>]_g`nkl>kn`an?khkn$n(c(^(]% Sets the border color of the backdrop.
bn]ia6Oap>]_g`nkl?khkn$n(c(^(]% Sets the background color of the background.
bn]ia6Oap?h]ilNa_pEjoapo$t(u(se`pd(daecdp% Sets the rectangle that is used to determine whether the frame is on or off the screen.
bn]ia6Oap?h]ila`PkO_naaj$_h]ila`% Prevents the user from dragging the frame off the screen.
bn]ia6Oap@alpd$`alpd% Sets the frame’s depth on 3D monitors.
bn]ia6OapBn]iaHarah$harah% Sets the frame’s level. APPENDIX A N FRAME REFERENCE 419 bn]ia6OapBn]iaOpn]p]$opn]p]% Sets the frame’s strata. bn]ia6OapDepNa_pEjoapo$t(u(se`pd(daecdp% Sets the rectangle in which the frame accepts mouse clicks. bn]ia6OapE@$e`% Sets the ID of the frame. bn]ia6OapFqilJ]rec]paAj]^ha`$aj]^ha`% Makes the frame selectable with a gamepad or joystick. bn]ia6OapI]tNaoeva$se`pd(daecdp% Sets the maximum size of the frame. bn]ia6OapIejNaoeva$se`pd(daecdp% Sets the minimum size of the frame. bn]ia6OapIkr]^ha$ikr]^ha% Makes the frame movable with Op]npIkrejc. bn]ia6OapNaoev]^ha$ikr]^ha% Makes the frame resizable. bn]ia6OapO_]ha$o_]ha% Sets the scale of the frame. bn]ia6OapO_nelp$o_nelp(bqj_% Sets the script handler for o_nelp to bqj_. bn]ia6OapPklharah$pklHarah% Makes the frame a top-level frame. bn]ia6OapQoanLh]_a`$qoanLh]_a`% Saves the position of the frame. bn]ia6Op]npIkrejc$% Attaches the frame to your mouse cursor. 420 APPENDIX A N FRAME REFERENCE
bn]ia6Op]npOevejc$% Starts to resize the frame.
bn]ia6OpklIkrejcKnOevejc$% Stops resizing or moving the frame.
bn]ia6Qjnaceopan=hhArajpo$% Unregisters all events.
bn]ia6QjnaceopanArajp$arajp% Unregisters the given event.
Script Handlers The Frame type has the following script handlers.
Kj=jeiBejeoda`$oahb% Kj=ppne^qpa?d]jca`$oahb(]ppne^qpaJ]ia(r]hqa% Kj?qnokn?d]jca`$oahb(t(u(s(d% Kj@kq^ha?he_g$oahb(^qppkj% Kj@n]cOp]np$oahb(^qppkj% Kj@n]cOpkl$oahb% KjAjpan$oahb(ikpekj% KjAjpanLnaooa`$oahb% KjAo_]laLnaooa`$oahb% KjArajp$oahb(arajp(***% KjDe`a$oahb% KjGau@ksj$oahb(gau% KjGauQl$oahb(gau% KjHa]ra$oahb(ikpekj% KjHk]`$oahb% KjIkqoa@ksj$oahb(^qppkj% KjIkqoaQl$oahb(^qppkj% KjIkqoaSdaah$oahb(`ahp]% KjNa_aera@n]c$oahb% KjOdks$oahb% KjOeva?d]jca`$oahb(se`pd(daecdp% APPENDIX A N FRAME REFERENCE 421
KjOl]_aLnaooa`$oahb% KjP]^Lnaooa`$oahb% KjQl`]pa$oahb(ah]loa`%
FontString BkjpOpnejc inherits from Nacekj. You cannot create a BkjpOpnejc via ?na]paBn]ia; you have to create it by calling the method ?na]paBkjpOpnejc of a frame object or by defining it in the 8H]uano: element in the XML description of a frame. BkjpOpnejcs have all methods of Bkjps except for ?kluBkjpK^fa_p. However, BkjpOpnejcs do not inherit from Bkjp; bkjpopnejc6EoK^fa_pPula$Bkjp% returns jeh.
XML Attribute The BkjpOpnejc type has only one XML attribute. patp The text on the button.
Lua Methods The BkjpOpnejc type has the following Lua methods. bkjpOpnejc6?]jJkjOl]_aSn]l$% Returns 1 if the font string is set to wrap in the middle of a word. bkjpOpnejc6Cap@n]sH]uan$% Returns the layer the font string is in. Layers are explained in detail in Chapter 5. bkjpOpnejc6CapOpnejcDaecdp$% Returns the height needed by the font string. bkjpOpnejc6CapOpnejcSe`pd$% Returns the width of the font string. bkjpOpnejc6CapPatp$% Returns the displayed text. bkjpOpnejc6Oap=hld]Cn]`eajp$op]np(hajcpd% Creates an alpha gradient starting at op]np over hajcpd pixels. 422 APPENDIX A N FRAME REFERENCE
bkjpOpnejc6Oap@n]sH]uan$h]uan% Changes the draw layer.
bkjpOpnejc6OapBkni]ppa`Patp$bipOpn(***% Sets formatted text.
bkjpOpnejc6OapJkjOl]_aSn]l$jkjOl]_a% Controls whether the font string is allowed to wrap in the middle of a string.
bkjpOpnejc6OapPatp$patp% Sets the text.
bkjpOpnejc6OapPatpDaecdp$daecdp% Sets the text height.
bkjpOpnejc6OapRanpat?khkn$n(c(^(]% Sets the vertex color of the font string.
Texture Patpqna inherits from Nacekj. You cannot create a Patpqna via ?na]paBn]ia; you have to create it by calling the method ?na]paPatpqna of a frame object or by defining it in the 8H]uano: ele- ment in the XML description of a frame.
XML Attributes The Patpqna type has the following XML attributes.
]hld]Ik`a Controls the effect of the texture’s alpha channel. This can be one of the following values: @EO=>HA, >HAJ@ (default), =HLD=GAU, =@@, or IK@.
beha The file containing the texture to display.
XML Elements The Patpqna type has the following XML elements.
?khkn Sets the texture to a solid color, with the attributes n, c, ^, and ]. APPENDIX A N FRAME REFERENCE 423
Cn]`eajp Creates a gradient on the texture; the attribute kneajp]pekj of this element controls the ori- entation and can either be DKNEVKJP=H (default) or RANPE?=H. The two elements Iej?khkn and I]t?khkn of the Cn]`eajp element set the start and end color.
Pat?kkn`o Controls the texture coordinates with the attributes habp, necdp, pkl, and ^kppki.
Lua Methods The Patpqna type has the following Lua methods. patpqna6Cap>haj`Ik`a$% Returns the blend mode. patpqna6Cap@n]sH]uan$% Returns the draw layer. patpqna6CapPat?kkn`Ik`ebeaoNa_p$% Returns 1 if texture coordinates modify the display rectangle and jeh if they stretch the texture. patpqna6CapPatpqna$% Returns the path of the texture used. patpqna6CapRanpat?khkn$% Returns the vertex color. patpqna6Eo@ao]pqn]pa`$% Returns 1 if the texture is desaturated. patpqna6Oap>haj`Ik`a$% Sets the blend mode. patpqna6Oap@ao]pqn]pa`$`ao]pqn]pa`% Changes the desaturation state of the texture. patpqna6Oap@n]sH]uan$h]uan% Changes the draw layer. 424 APPENDIX A N FRAME REFERENCE
patpqna6OapCn]`eajp$kneajp]pekj(op]npN(op]npC(op]np>(aj`N(aj`C(aj`>% Creates a gradient over the whole texture. The kneajp]pekj argument can be either DKNEVKJP=H or RANPE?=H.
patpqna6OapCn]`eajp=hld]$kneajp]pekj(op]npN(op]npC(op]np>(op]np=(aj`N(aj`C( aj`>(aj`=% Same as OapCn]`eajp but with an additional alpha value.
patpqna6OapNkp]pekj$]jcha(_t(_u% Rotates the texture ]jcha degrees around the center point _t/_u, which is relative to the center of the texture. Default values for _t and _u are 0.
patpqna6OapPat?kkn`$habp(necdp(^kppki(pkl% Sets texture coordinates. Chapter 8 contains a detailed description.
patpqna6OapPat?kkn`Ik`ebeaoNa_p$ik`ebeao% Sets whether texture coordinates change the displayed part of the texture or stretch the texture.
patpqna6OapPatpqna$behaknn(c(^(]% Loads and displays the provided files or fills the texture with a solid color.
patpqna6OapRanpat?khkn$n(c(^(]% Sets the vertex color of the texture. You can think of the vertex color as a colored light shining on the texture.
Button >qppkj inherits from Bn]ia; it can be used to create clickable buttons.
XML Attributes The >qppkj type has only one XML attribute.
patp The text on the button.
XML Elements The >qppkj type has the following XML elements. APPENDIX A N FRAME REFERENCE 425
>qppkjPatp The font string that is used for the button’s text.
@eo]^ha`?khkn A color object (uses n, c, ^, and ] attributes); sets the vertex color for the disabled texture.
@eo]^ha`Bkjp Sets the font for the disabled button in its opuha attribute (expects the name of a Bkjp object).
@eo]^ha`Patpqna A texture object; sets the disabled button texture.
Decdhecdp?khkn A color object; sets the vertex color for the highlight texture.
DecdhecdpBkjp Sets the font for the highlighted button in its opuha attribute (expects the name of a Bkjp object).
DecdhecdpPatpqna A texture object. The highlight button texture.
Jkni]hBkjp Sets the font for the normal button in its opuha attribute (expects the name of a Bkjp object).
Jkni]hPatpqna A texture object; sets the normal button texture.
Lqoda`PatpKbboap A dimension object that defines the text offset when the button is pushed.
Lqoda`Patpqna A texture object; sets the pushed button texture.
Lua Methods The >qppkj type has the following Lua methods.
^qppkj6?he_g$% Executes the button’s Kj?he_g handler. 426 APPENDIX A N FRAME REFERENCE
^qppkj6@eo]^ha$% Disables the button.
^qppkj6Aj]^ha$% Enables the button.
^qppkj6Cap>qppkjOp]pa$% LQODA@ or JKNI=H.
^qppkj6Cap@eo]^ha`BkjpK^fa_p$% Returns the disabled font object.
^qppkj6Cap@eo]^ha`Patpqna$% Returns the disabled texture.
^qppkj6CapBkjpOpnejc$% Returns the used font string.
^qppkj6CapDecdhecdpBkjpK^fa_p$% Returns the highlight font object.
^qppkj6CapDecdhecdpPatpqna$% Returns the highlight texture.
^qppkj6CapJkni]hBkjpK^fa_p$% Returns the normal font object.
^qppkj6CapJkni]hPatpqna$% Returns the normal texture.
^qppkj6CapLqoda`PatpKbboap$% Returns the x and y offsets of the pushed text.
^qppkj6CapLqoda`Patpqna$% Returns the pushed texture.
^qppkj6CapPatp$% Returns the displayed text. APPENDIX A N FRAME REFERENCE 427
^qppkj6CapPatpDaecdp$% Returns the text’s height.
^qppkj6CapPatpSe`pd$% Returns the text’s width.
^qppkj6EoAj]^ha`$% Checks whether the button is enabled.
^qppkj6Hk_gDecdhecdp$% Shows the highlight texture.
^qppkj6NaceopanBkn?he_go$^pj-(***% Registers the given mouse buttons for click events.
^qppkj6Oap>qppkjOp]pa$% Sets the button’s state (JKNI=H or LQODA@).
^qppkj6Oap@eo]^ha`BkjpK^fa_p$bkjp% Sets the disabled font object.
^qppkj6Oap@eo]^ha`Patpqna$patpqna% Sets the disabled texture.
^qppkj6OapBkjpOpnejc$bjpOpn% Sets the BkjpOpnejc object used.
^qppkj6OapBkni]ppa`Patp$bkni]pOpn(***% Sets formatted text.
^qppkj6OapDecdhecdpBkjpK^fa_p$bkjp% Sets the highlight font object.
^qppkj6OapDecdhecdpPatpqna$patpqna% Sets the highlight texture.
^qppkj6OapJkni]hBkjpK^fa_p$bkjp% Sets the normal font object. 428 APPENDIX A N FRAME REFERENCE
^qppkj6OapJkni]hPatpqna$patpqna% Sets the normal texture.
^qppkj6OapLqoda`PatpKbboap$t(u% Sets the pushed text’s offsets.
^qppkj6OapLqoda`Patpqna$patpqna% Sets the pushed texture.
^qppkj6OapPatp$patp% Sets the displayed text.
^qppkj6Qjhk_gDecdhecdp$% Hides the highlight texture.
Script Handlers The >qppkj type has the following script handlers.
Lkop?he_g$oahb(^qppkj% Lna?he_g$oahb(^qppkj% Kj?he_g$oahb(^qppkj(`ksj%
CheckButton ?da_g>qppkj inherits from >qppkj and represents a check box.
XML Attributes The ?da_g>qppkj type has only one XML attribute.
_da_ga` Can be set to pnqa to check the button by default.
XML Elements The ?da_g>qppkj type has the following XML elements.
@eo]^ha`?da_ga`Patpqna A texture object; sets the texture that is shown on disabled checked buttons. APPENDIX A N FRAME REFERENCE 429
?da_ga`Patpqna A texture object; sets the texture that is shown on normal checked buttons.
Lua Methods The ?da_g>qppkj type has the following Lua methods.
_da_g>qppkj6Cap?da_ga`$% Returns 1 if the button is checked.
_da_g>qppkj6Cap?da_ga`Patpqna$% Returns the texture object of checked buttons.
_da_g>qppkj6Cap@eo]^ha`?da_ga`Patpqna$% Returns the texture object of disabled checked buttons.
_da_g>qppkj6Oap?da_ga`$_da_ga`% Sets the check button to _da_ga`.
_da_g>qppkj6Oap?da_ga`Patpqna$patpqna% Sets the normal checked texture.
_da_g>qppkj6Oap@eo]^ha`?da_ga`Patpqna$patpqna% Sets the disabled checked texture.
Cooldown ?kkh`ksj is the cooldown display that can be seen on action bars. It inherits from Bn]ia.
XML Attributes The ?kkh`ksj type has the following XML attributes. naranoa Set this to pnqa for a reverse cooldown. Default: b]hoa.
`n]sA`ca Set this to pnqa to draw edges around the cooldown display. Default: b]hoa.
Lua Methods The ?kkh`ksj type has the following Lua methods. 430 APPENDIX A N FRAME REFERENCE
_kkh`ksj6Oap?kkh`ksj$op]np(`qn]pekj% Displays a cooldown that started at start (timestamp as returned by CapPeia$% and CapOlahh?kkh`ksj$olahhJ]ia%) with the given duration in seconds.
_kkh`ksj6OapNaranoa$naranoa% Set this to pnqa for a reverse cooldown.
ColorSelect ?khknOaha_p is a frame that allows the user to pick a color. This frame type inherits from Bn]ia.
XML Elements The ?khknOaha_p type has the following XML attributes.
?khknSdaahPatpqna A texture object that is used for the color wheel.
?khknSdaahPdqi^Patpqna A texture object that is used for the color wheel thumbnail.
?khknR]hqaPatpqna A texture object that is used for the color selector.
?khknR]hqaPdqi^Patpqna A texture object that is used for the color selector thumbnail.
Lua Methods The ?khknOaha_p type has the following Lua methods.
_khknOaha_p6Cap?khknDOR$% Returns the selected color as HSV (hue, saturation, value) values.
_khknOaha_p6Cap?khknNC>$% Returns the selected color as RGB.
_khknOaha_p6Cap?khknR]hqaPatpqna$% Returns the color value texture object. APPENDIX A N FRAME REFERENCE 431
_khknOaha_p6Cap?khknR]hqaPdqi^Patpqna$% Returns the color value thumbnail texture object.
_khknOaha_p6Cap?khknSdaahPatpqna$% Returns the color wheel texture.
_khknOaha_p6Cap?khknSdaahPdqi^Patpqna$% Returns the color wheel thumbnail texture.
_khknOaha_p6Oap?khknDOR$d(o(r% Sets the selected color to the given HSV value.
_khknOaha_p6Oap?khknNC>$n(c(^% Sets the selected color to the given RGB value.
_khknOaha_p6Oap?khknR]hqaPatpqna$patpqna% Sets the color value texture.
_khknOaha_p6Oap?khknR]hqaPdqi^Patpqna$% Sets the color value thumb texture.
_khknOaha_p6Oap?khknSdaahPatpqna$% Sets the color wheel texture.
_khknOaha_p6Oap?khknSdaahPdqi^Patpqna$% Sets the color wheel thumb texture.
Script Handlers The ?khknOaha_p type has only one script handler.
Kj?khknOaha_p$oahb(n(c(^%
EditBox A`ep>kt is a frame that allows the user to enter text. It inherits from Bn]ia. A`ep>ktes have all methods of Bkjps except for ?kluBkjpK^fa_p. However, A`ep>ktes do not inherit from Bkjp; a`ep>kt6EoK^fa_pPula$Bkjp% returns jeh. 432 APPENDIX A N FRAME REFERENCE
XML Attributes The A`ep>kt type has the following XML attributes.
]qpkbk_qo Automatically grabs the focus when it is shown. Default: b]hoa.
^hejgOlaa` The blink speed of the cursor. Default: 0.5.
deopknuHejao Determines how many history lines will be saved. Default: 0.
ecjkna=nnkso Ignores the arrow keys so you can still move with them while the edit box has the focus. Default: b]hoa.
happano The maximum number of allowed letters. Default 0: (meaning no limit).
iqhpeHeja Creates a multiple-line edit box. Default: b]hoa.
jqiane_ Accepts only numbers. Default: b]hoa.
XML Elements The A`ep>kt type has the following two XML attributes.
Decdhecdp?khkn A color element that sets the color of highlighted text with its n, c, and ^ attributes.
PatpEjoapo Controls the padding between the text and border with its habp, necdp, pkl, and ^kppki attributes.
Lua Methods The A`ep>kt type has the following Lua methods.
a`ep>kt6=``DeopknuHeja$patp% Adds patp to the history. APPENDIX A N FRAME REFERENCE 433 a`ep>kt6?ha]nBk_qo$% Removes the focus from the edit box. a`ep>kt6Cap=hp=nnksGauIk`a$% Returns 1 if the edit box ignores the arrow keys. a`ep>kt6Cap>hejgOlaa`$% Returns the blink speed. a`ep>kt6Cap?qnoknLkoepekj$% Returns the cursor position. a`ep>kt6CapDeopknuHejao$% Returns the maximum number of history lines. a`ep>kt6CapEj`ajpa`Skn`Sn]l$% Returns the indented word wrap setting. a`ep>kt6CapEjlqpH]jcq]ca$% Returns the input language; NKI=J for non-Asian clients. a`ep>kt6CapI]t>upao$% Returns the maximum number of bytes the edit box can store. a`ep>kt6CapI]tHappano$% Returns the maximum number of letters the edit box can store. a`ep>kt6CapJqiHappano$% Returns the current number of letters. a`ep>kt6CapJqi^an$% Tries to interpret the entered text as a number. a`ep>kt6CapPatpEjoapo$% Returns the text insets. a`ep>kt6D]oBk_qo$% Returns 1 if the edit box currently has the focus. 434 APPENDIX A N FRAME REFERENCE
a`ep>kt6DecdhecdpPatp$op]np(aj`% Highlights the text from op]np to aj`. Omit the arguments to highlight the whole text.
a`ep>kt6Ejoanp$patp% Inserts patp at the current position.
a`ep>kt6Eo=qpkBk_qo$% Returns 1 if the edit box automatically grabs the focus.
a`ep>kt6EoEjEIA?kilkoepekjIk`a$% Returns 1 if the IME mode is enabled. This is a feature for Asian clients.
a`ep>kt6EoIqhpeHeja$% Returns 1 for multiple-line edit boxes.
a`ep>kt6EoJqiane_$% Returns 1 for numeric edit boxes.
a`ep>kt6EoL]ooskn`$% Returns 1 for password edit boxes.
a`ep>kt6Oap=hp=nnksGauIk`a$ecjkna=nnkso% Sets the option whether to ignore arrow keys.
a`ep>kt6Oap=qpkBk_qo$]qpkBk_qo% Sets the auto focus option.
a`ep>kt6Oap>hejgOlaa`$^hejgOlaa`% Sets the cursor blink speed.
a`ep>kt6Oap?qnoknLkoepekj$lko% Sets the cursor position.
a`ep>kt6OapBk_qo$% Grabs the focus.
a`ep>kt6OapDeopknuHejao$j% Sets the maximum number of history lines. APPENDIX A N FRAME REFERENCE 435 a`ep>kt6OapEj`ajpa`Skn`Sn]l$sn]l% Sets the word wrap setting. a`ep>kt6OapI]t>upao$j% Sets the maximum number of bytes accepted by the edit box. a`ep>kt6OapI]tHappano$j% Sets the maximum number of letters accepted by the edit box. a`ep>kt6OapIqhpeHeja$iqhpeHejao% Creates a multiple-line edit box. a`ep>kt6OapJqi^an$j% Sets a numeric edit box to j. a`ep>kt6OapJqiane_$% Makes the edit box accept only numbers. a`ep>kt6OapL]ooskn`$% Hides entered characters. a`ep>kt6OapPatpEjoapo$habp(necdp(pkl(^kppki% Sets the padding between the text and the border of the edit box. a`ep>kt6PkcchaEjlqpH]jcq]ca$h]jcq]ca% Uses another input language; only important for Asian clients.
Script Handlers The A`ep>kt type has the following script handlers.
Kj?d]n$oahb(_d]n% Kj?d]n?kilkoepekj$oahb(_d]n% Kj?qnokn?d]jca`$oahb(t(u(se`pd(daecdp% KjA`epBk_qoC]eja`$oahb% KjA`epBk_qoHkop$oahb% KjEjlqpH]jcq]ca?d]jca`$oahb(h]jcq]ca% KjPatp?d]jca`$oahb% KjPatpOap$oahb% 436 APPENDIX A N FRAME REFERENCE
GameTooltip C]iaPkkhpel frames can be used as tooltips. This type inherits from Bn]ia. Tooltips are auto- matically resized as you add more lines with their methods.
Lua Methods The C]iaPkkhpel method has the following Lua methods.
c]iaPkkhpel6=``@kq^haHeja$habp(necdp(hN(hC(h>(nN(nC(n>% Adds a line with two font strings to the tooltip. hN, hC, and h> control the color of the left text habp and nN, nC, and n> the color of the right text code inline.
c]iaPkkhpel6=``BkjpOpnejco$habp(necdp% Adds a double line consisting of two font string objects to the tooltip.
c]iaPkkhpel6=``Heja$patp(n(c(^% Adds a new single line.
c]iaPkkhpel6=``Patpqna$patpqnaL]pd% Adds the given texture file.
c]iaPkkhpel6=llaj`Patp$patp% Appends patp to the end of the last line.
c]iaPkkhpel6B]`aKqp$% Fades the tooltip and hides it.
c]iaPkkhpel6?ha]nHejao$% Removes all content from the tooltip.
c]iaPkkhpel6Cap=j_dknPula$% Returns the current anchor type. These types are explained in Chapter 4.
c]iaPkkhpel6CapEpai$% Returns the name and link of the currently displayed item.
c]iaPkkhpel6CapIejeiqiSe`pd$% Returns the minimum width of the tooltip. APPENDIX A N FRAME REFERENCE 437 c]iaPkkhpel6CapKsjan$% Returns the tooltip’s owner. c]iaPkkhpel6CapL]``ejc$% Returns the padding to other objects. c]iaPkkhpel6CapOlahh$% Returns the currently displayed spell. c]iaPkkhpel6CapQjep$% Returns the currently displayed unit. c]iaPkkhpel6EoAmqella`Epai$% Returns 1 if the tooltip displays a currently equipped item. c]iaPkkhpel6EoKsja`$% Returns 1 if the tooltip has an owner. c]iaPkkhpel6EoQjep$% Returns 1 if the tooltip displays a unit. c]iaPkkhpel6JqiHejao$% Returns the maximum number of lines. c]iaPkkhpel6Oap=_pekj$ohkpE`% Shows the tooltip of a given action button slot. c]iaPkkhpel6Oap=j_dknPula$]j_dknPula(tKbboap(uKbboap% Sets an anchor type.
Setting Tooltip Contents The following methods deal with setting the tooltip to specific items or spells. There is no description of these methods, as the names and arguments are self-explanatory and the func- tions are rarely needed.
c]iaPkkhpel6Oap=q_pekjEpai$ej`at% c]iaPkkhpel6Oap=q_pekjOahhEpai$% c]iaPkkhpel6Oap>]_gl]_gPkgaj$e`% c]iaPkkhpel6Oap>]cEpai$^]`(ohkp% 438 APPENDIX A N FRAME REFERENCE
c]iaPkkhpel6Oap>qu^]_gEpai$e`% c]iaPkkhpel6Oap?qnnaj_uPkgaj$e`% c]iaPkkhpel6OapAmqeliajpOap$e`% c]iaPkkhpel6OapAteopejcOk_gapCai$e`% c]iaPkkhpel6OapChuld$e`% c]iaPkkhpel6OapCqeh`>]jgEpai$e`% c]iaPkkhpel6OapDulanhejg$hejg% c]iaPkkhpel6OapDulanhejg?kil]naEpai$hejg% c]iaPkkhpel6OapEj^ktEpai$e`% c]iaPkkhpel6OapEjrajpknuEpai$e`% c]iaPkkhpel6OapHkkpEpai$e`% c]iaPkkhpel6OapHkkpNkhhEpai$e`% c]iaPkkhpel6OapIan_d]jp?kopEpai$e`% c]iaPkkhpel6OapIan_d]jpEpai$e`% c]iaPkkhpel6OapLap=_pekj$e`% c]iaPkkhpel6OapMqaopEpai$mqaop(e`% c]iaPkkhpel6OapMqaopHkcEpai$e`% c]iaPkkhpel6OapMqaopHkcNas]n`Olahh$e`% c]iaPkkhpel6OapMqaopHkcOla_e]hEpai$e`% c]iaPkkhpel6OapMqaopNas]n`Olahh$e`% c]iaPkkhpel6OapOaj`I]ehEpai$e`% c]iaPkkhpel6OapOd]laodebp$e`% c]iaPkkhpel6OapOk_gapCai$e`% c]iaPkkhpel6OapOk_gapa`Epai$e`% c]iaPkkhpel6OapOlahh$olahhE`% c]iaPkkhpel6OapP]hajp$e`% c]iaPkkhpel6OapPkpai$e`% c]iaPkkhpel6OapPn]_gejc$e`% c]iaPkkhpel6OapPn]`aLh]uanEpai$e`% c]iaPkkhpel6OapPn]`aOgehhEpai$e`% c]iaPkkhpel6OapPn]`aP]ncapEpai$e`% c]iaPkkhpel6OapPn]ejanOanre_a$e`% c]iaPkkhpel6OapQjep$qE`% APPENDIX A N FRAME REFERENCE 439
c]iaPkkhpel6OapQjep=qn]$qE`(e(behpan% c]iaPkkhpel6OapQjep>qbb$qE`(e(behpan% c]iaPkkhpel6OapQjep@a^qbb$qE`(e(behpan% c]iaPkkhpel6OapIejeiqiSe`pd$se`pd% Sets the minimum width. c]iaPkkhpel6OapKsjan$bn]ia% Sets the owner of the tooltip. A tooltip is hidden when its owner is hidden. c]iaPkkhpel6OapL]``ejc$% Sets the padding.
MessageFrame Iaoo]caBn]ia is a frame that displays a few font strings; older font strings are hidden as you append new strings. It looks like a chat frame but without the scroll bars. Iaoo]caBn]ia has all methods of Bkjps except for ?kluBkjpK^fa_p. However, Iaoo]caBn]ia does not inherit from Bkjp; iaoo]caBn]ia6EoK^fa_pPula$Bkjp% returns jeh.
XML Attributes The Iaoo]caBn]ia method has the following XML attributes.
`eolh]u@qn]pekj The time after which an element is removed. b]`a Enables the fade out effect. Default: pnqa* b]`a@qn]pekj Duration of the fade effect. Default: 3.0. bkjp The font used. ejoanpIk`a Where to insert new messages; PKL or >KPPKI. Default: >KPPKI. 440 APPENDIX A N FRAME REFERENCE
XML Elements
The Iaoo]caBn]ia type has one available XML element.
patpEjoapo Controls the padding of the displayed text with the attributes habp, necdp, pkl, and ^kppki.
Lua Methods The Iaoo]caBn]ia type has the following Lua methods.
iaoo]caBn]ia6=``Iaoo]ca$ioc(n(c(^% Adds a message in the given color.
iaoo]caBn]ia6?ha]n$% Clears the frame.
iaoo]caBn]ia6CapB]`a@qn]pekj$% Returns the fade duration.
iaoo]caBn]ia6CapB]`ejc$% Returns the duration of the fade effect.
iaoo]caBn]ia6CapEjoanpIk`a$% Returns the insert mode.
iaoo]caBn]ia6CapPeiaReoe^ha$% Returns the time after which a message is hidden.
iaoo]caBn]ia6OapB]`a@qn]pekj$b]`a@qn]pekj% Sets the duration of the fade effect.
iaoo]caBn]ia6OapB]`ejc$b]`aKqp% Enables or disables the fade effect.
iaoo]caBn]ia6OapEjoanpIk`a$ejoanpIk`a% Sets the insert mode (PKL or >KPPKI).
iaoo]caBn]ia6OapPeiaReoe^ha$p% Sets the time after which a message is hidden. APPENDIX A N FRAME REFERENCE 441
Model Ik`ah is a frame that inherits from Bn]ia and displays a 3D model.
XML Attributes The Ik`ah type has the following XML attributes. beha The path of the model to display. bkcJa]n The near fog distance. Default: 0.0. bkcB]n The far fog distance. Default: 1.0. chks The glow intensity. Default: 1.0. o_]ha The scale of the model. This is a different value than the OapO_]ha/CapO_]ha scale.
XML Elements The Ik`ah type has only one XML attribute.
Bkc?khkn Controls the color of the fog with its n, c, ^, and ] attributes.
Lua Methods The Ik`ah type has the following Lua methods. ik`ah6=`r]j_aPeia$% This must be called by the KjQl`]pa handler if you want to play animations in the model. ik`ah6?ha]nBkc$% Removes the fog. ik`ah6?ha]nIk`ah$% Removes the model. 442 APPENDIX A N FRAME REFERENCE
ik`ah6CapB]_ejc$% Returns the direction the model is looking in.
ik`ah6CapBkc?khkn$% Returns the color of the fog.
ik`ah6CapBkcB]n$% Returns the maximum fog distance.
ik`ah6CapBkcJa]n$% Returns the minimum fog distance.
ik`ah6CapHecdp$% Returns the current light situation. The return values are the same as the arguments to OapHecdp.
ik`ah6CapIk`ah$% Returns the model used.
ik`ah6CapIk`ahO_]ha$% Returns the scale of the model.
ik`ah6CapLkoepekj$% Returns the position of the model inside the displayed scene.
ik`ah6Nalh]_aE_kjPatpqna$% Unknown.
ik`ah6Oap?]ian]$e`% Sets the camera to a camera that is defined in the model file.
ik`ah6OapB]_ejc$b]_ejc% Sets the facing to a radian value.
ik`ah6OapBkc?khkn$n(c(^(]% Sets the color of the fog.
ik`ah6OapBkcB]n$% Sets the fog’s far clip distance. APPENDIX A N FRAME REFERENCE 443 ik`ah6OapBkcJa]n$% Sets the fog’s near clip distance. ik`ah6OapChks$j% Sets the glow intensity. ik`ah6OapHecdp$aj]^ha`(kije(`enT(`enU(`enV(]i^Ejpajoepu(£ ]i^N(]i^>(`enEjpajoepu(`enN(`enC(`en>% Sets the light to use; all arguments except the first are optional. You will rarely have to call this as the default light is fine. ik`ah6OapIk`ah$l]pd% Sets the model file to use. ik`ah6OapIk`ahO_]ha$o_]ha% Scales the model. ik`ah6OapLkoepekj$t(u(v% Places the model at position x, y, and z in the displayed scene. ik`ah6OapOamqaj_a$e`% Sets the animation ID that will be played. This ID is defined in the model file. ik`ah6OapOamqaj_aPeia$e`(peia% Sets the model to a specific point in time of a specific sequence ID.
PlayerModel Lh]uanIk`ah is derived from Ik`ah and can be used to display players and NPCs.
Lua Methods The Lh]uanIk`ah type has the following Lua methods. lh]uanIk`ah6NabnaodQjep$% Refreshes the currently displayed unit; for example, to update the worn equipment. lh]uanIk`ah6Oap?na]pqna$_na]pqnaE`% Sets the model to display the given creature. This only works on creatures in your local cache, meaning creatures you have already seen. 444 APPENDIX A N FRAME REFERENCE
lh]uanIk`ah6OapNkp]pekj$nkp]pekj% Rotates the model.
lh]uanIk`ah6OapQjep$qjepE@% Displays the model of the given unit ID.
DressUpModel @naooQlIk`ah inherits from Lh]uanIk`ah and is a specialized version of it that provides func- tions to preview items.
Lua Methods The @naooQlIk`ah type has the following Lua methods.
lh]uanIk`ah6@naoo$% Equips the player’s default equipment.
lh]uanIk`ah6PnuKj$epai% Equips the given item link or item ID.
lh]uanIk`ah6Qj`naoo$% Undresses the displayed player.
TabardModel P]^]n`Ik`ah inherits from Lh]uanIk`ah and is a specialized version of it that provides functions to preview guild tabards.
Lua Methods The P]^]n`Ik`ah type has the following Lua methods.
p]^]n`Ik`ah6?]jO]raP]^]n`Jks$% Returns 1 if the tabard can be saved.
p]^]n`Ik`ah6?u_haR]ne]pekj$r]ne]pekjPula(ej`at% Cycles through the different available options.
p]^]n`Ik`ah6CapHksan>]_gcnkqj`BehaJ]ia$% Returns the filename of the lower background texture. APPENDIX A N FRAME REFERENCE 445 p]^]n`Ik`ah6CapHksanAi^haiBehaJ]ia$% Returns the filename of the lower emblem texture. p]^]n`Ik`ah6CapHksanAi^haiPatpqna$% Returns the lower emblem texture. p]^]n`Ik`ah6CapQllan>]_gcnkqj`BehaJ]ia$% Returns the filename of the upper background texture. p]^]n`Ik`ah6CapQllanAi^haiBehaJ]ia$% Returns the filename of the upper emblem texture. p]^]n`Ik`ah6CapQllanAi^haiPatpqna$% Returns the upper emblem texture. p]^]n`Ik`ah6Ejepe]hevaP]^]n`?khkno$% Initializes the tabard frame. p]^]n`Ik`ah6O]ra$% Saves the tabard.
ScrollFrame O_nkhhBn]ia inherits from Bn]ia and represents a scroll bar that can be used to scroll another frame.
XML Elements The O_nkhhBn]ia type has only one XML element.
O_nkhh?deh` An arbitrary frame that is scrolled by the scroll bar.
Lua Methods The O_nkhhBn]ia type has the following Lua methods. o_nkhhBn]ia6CapDknevkjp]hO_nkhh$% Returns the current scroll offset. 446 APPENDIX A N FRAME REFERENCE
o_nkhhBn]ia6CapDknevkjp]hO_nkhhN]jca$% Returns the maximum scroll range.
o_nkhhBn]ia6CapO_nkhh?deh`$% Returns the frame that is being scrolled by the scroll frame.
o_nkhhBn]ia6CapRanpe_]hO_nkhh$% Returns the vertical scroll offset.
o_nkhhBn]ia6CapRanpe_]hO_nkhhN]jca$% Returns the maximum vertical scroll range.
o_nkhhBn]ia6OapDknevkjp]hO_nkhh$kbboap% Sets the current horizontal scroll position.
o_nkhhBn]ia6OapO_nkhh?deh`$bn]ia% Sets bn]ia as the scroll child, that is, the frame that is being scrolled.
o_nkhhBn]ia6OapRanpe_]hO_nkhh$kbboap% Sets the current vertical scroll position.
o_nkhhBn]ia6Ql`]paO_nkhh?deh`Na_p$% Updates the displayed area of the scroll child. This method is called automatically when the user scrolls in your frame.
Script Handlers The O_nkhhBn]ia type has the following script handlers.
KjDknevkjp]hO_nkhh$oahb(kbboap% KjO_nkhhN]jca?d]jca`$oahb(tN]jca(uN]jca% KjRanpe_]hO_nkhh$oahb(kbboap%
ScrollingMessageFrame O_nkhhejcIaoo]caBn]ia is a frame type that is derived from Bn]ia; it can be used to display multiple messages with a scroll bar, as in a chat frame. O_nkhhejcIaoo]caBn]ia has all XML attributes and elements and Lua methods of Iaoo]caBn]ia. However, it is technically not a message frame, as o_nkhhejcIaoo]caBn]ia6 EoK^fa_pPula$Bkjp% returns jeh. The methods and attributes of Iaoo]caBn]ia are not listed here. APPENDIX A N FRAME REFERENCE 447
XML Attributes The O_nkhhejcIaoo]caBn]ia type has only one XML attribute. i]tHejao The maximum number of lines that can be added to the scroll frame. Default: 8.
Lua Methods The O_nkhhejcIaoo]caBn]ia type has the following Lua methods. o_nkhhejcIaoo]caBn]ia6=``Iaoo]ca$patp(n(c(^(e`(]``PkOp]np% Adds a message with the given color and ID. The ID can later be used to change the color of the message with Ql`]pa?khkn>uE@. The ]``PkOp]np argument can be used to insert the mes- sage at the opposite side from the default insert position. o_nkhhejcIaoo]caBn]ia6=p>kppki$% Determines whether the frame is scrolled to the very bottom. o_nkhhejcIaoo]caBn]ia6=pPkl$% Determines whether the frame is currently scrolled to the very top. o_nkhhejcIaoo]caBn]ia6Cap?qnnajpHeja$% Returns the line number of the last added message. Lines are zero-based; the first line has the line ID 0. Note that a message can consist of multiple lines. o_nkhhejcIaoo]caBn]ia6Cap?qnnajpO_nkhh$% Returns the number of messages that are currently not visible at the bottom. o_nkhhejcIaoo]caBn]ia6CapDulanhejgoAj]^ha`$% Determines whether hyperlinks are enabled or disabled in the scrolling message frame. o_nkhhejcIaoo]caBn]ia6CapI]tHejao$% Returns the maximum number of lines that can be displayed. o_nkhhejcIaoo]caBn]ia6CapJqiHejao@eolh]ua`$% Returns the number of lines that are currently visible in the frame. o_nkhhejcIaoo]caBn]ia6CapJqiIaoo]cao$% Returns the number of messages that were added to the scrolling message frame. 448 APPENDIX A N FRAME REFERENCE
o_nkhhejcIaoo]caBn]ia6L]ca@ksj$% Scrolls down by one page.
o_nkhhejcIaoo]caBn]ia6L]caQl$% Scrolls up by one page.
o_nkhhejcIaoo]caBn]ia6O_nkhh@ksj$% Scrolls down.
o_nkhhejcIaoo]caBn]ia6O_nkhhQl$% Scrolls up.
o_nkhhejcIaoo]caBn]ia6O_nkhhPk>kppki$% Scrolls to the bottom.
o_nkhhejcIaoo]caBn]ia6O_nkhhPkPkl$% Scrolls to the top.
o_nkhhejcIaoo]caBn]ia6OapDulanhejgoAj]^ha`$aj]^ha`% Enables or disables hyperlinks in the frame.
o_nkhhejcIaoo]caBn]ia6OapO_nkhhKbboap$kbboap% Scrolls to a given position from the bottom. Negative offsets will scroll to a position relative to the top.
o_nkhhejcIaoo]caBn]ia6Ql`]pa?khkn>uE@$e`(n(c(^% Changes the color of all messages inserted with the given e`.
SimpleHTML OeilhaDPIH is a frame type that is derived from Bn]ia; it allows you to display simple HTML. You can read the Wikipedia article dppl6++aj*segela`e]*knc+sege+DPIH if you are not familiar with HTML. The following elements are allowed in a OeilhaDPIH frame.
ÊU8]dnab9dulanhejg:patp8+]: to create links. Clicking on the link calls the KjDulanhejg?he_ga` handler with the usual arguments. It is not possible to use URLs here. ÊUÊ8^n+: to start a new line. APPENDIX A N FRAME REFERENCE 449
ÊUÊ8d-:, 8d.:, 8d/:, and 8l: for normal text. The attribute ]hecj can be used to control the text alignment and can be habp, necdp, or _ajpan. ÊUÊ8eicon_9patpqnaL]pd]hecj9habp+necdp+_ajpanse`pd9tdaecdp9u+: to embed images. All attributes except for on_ are optional.
You also need the obligatory 8dpih: and 8^k`u: tags or World of Warcraft won’t recognize your code as HTML. Your text should look like this:
8dpih: 8^k`u: 8))ukqn_k`adana)): 8+^k`u: 8+dpih:
OeilhaDPIH has all the methods of Bkjp except for ?kluBkjpK^fa_p. But there is a small dif- ference: all Bkjp methods take an optional first parameter that can be either l, d-, d., or d/ to change the styles of the different available text types. The default value for this optional parameter is l. All XML attributes and elements of Bkjp are also available; they control the style of 8l: tags. The elements BkjpOpnejcDa]`an- – / can be used to set the style of 8d-: – 8d/: tags from XML.
XML Attributes The OeilhaDPIH type has the following XML attributes. beha An HTML file to load. dulanhejgBkni]p Defines how HTML links are displayed; this will be processed by opnejc*bkni]p with the first argument being the target of your link and the second the text. The default value is xD!oxd!oxd, which means your link is displayed like a regular in-game link. patp The HTML text to display.
XML Elements The OeilhaDPIH type has only one XML element.
BkjpOpnejcDa]`an- – / BkjpOpnejc objects that are used for d- – d/ styled texts.
Lua Methods The OeilhaDPIH type has the following Lua methods. 450 APPENDIX A N FRAME REFERENCE
oeilhaDPIH6CapDulanhejgBkni]p$% Returns the hyperlink format.
oeilhaDPIH6CapDulanhejgoAj]^ha`$% Returns whether hyperlinks are enabled.
oeilhaDPIH6OapDulanhejgBkni]p$bip% Sets the hyperlink format.
oeilhaDPIH6OapDulanhejgoAj]^ha`$aj]^ha`% Enables or disables hyperlinks.
oeilhaDPIH6OapPatp$dpih% Sets the HTML to display.
Slider Ohe`an inherits from Bn]ia and is a frame type to input numeric values.
XML Attributes The Ohe`an type has the following XML attributes.
`ab]qhpR]hqa The default value of the slider. Caution: this triggers the script handler KjR]hqa?d]jca` before KjHk]` is called.
`n]sH]uan The layer in which the slider’s textures will be drawn. Default: KRANH=U.
i]tR]hqa The maximum value of the slider.
iejR]hqa The minimum value of the slider.
kneajp]pekj DKNEVKJP=H or RANPE?=H (default). APPENDIX A N FRAME REFERENCE 451 r]hqaOpal The step size.
XML Elements The Ohe`an type has the following XML elements.
Pdqi^Patpqna A texture object. This texture is used as a thumb (small draggable dot).
Lua Methods The Ohe`an type has the following Lua methods. ohe`an6@eoh]^a$% Disables the slider. ohe`an6Aj]^ha$% Enables the slider. ohe`an6CapIejI]tR]hqao$% Returns the minimum and maximum values that can be set by the user. ohe`an6CapKneajp]pekj$% Returns the orientation; can be either DKNEVKJP=H or RANPE?=H. ohe`an6CapPdqi^Patpqna$% Returns the thumb texture. ohe`an6CapR]hqa$% Returns the current value. ohe`an6CapR]hqaOpal$% Returns the step size. ohe`an6EoAj]^ha`$% Returns 1 if the slider is enabled. ohe`an6OapIejI]tR]hqao$iej(i]t% Sets the minimum and maximum values. 452 APPENDIX A N FRAME REFERENCE
ohe`an6OapKneajp]pekj$kneajp]pekj% Sets the orientation; can be DKNEVKJP=H or RANPE?=H.
ohe`an6OapPdqi^Patpqna$patpqna% Sets the thumb texture.
ohe`an6OapR]hqa$r]h% Sets the current value.
ohe`an6OapR]hqaOpal$% Sets the step size.
Script Handlers The Ohe`an type has only one script handler.
KjR]hqa?d]jca`$oahb(r]hqa%
StatusBar Op]pqo>]n inherits from Bn]ia and can be used to display progress, like a timer.
XML Attributes The Op]pqo>]n type has the following XML attributes.
`ab]qhpR]hqa The default value of the slider.
`n]sH]uan The layer in which the bar’s textures will be drawn. Default: =NPSKNG.
i]tR]hqa The maximum value of the bar.
iejR]hqa The minimum value of the bar.
kneajp]pekj DKNEVKJP=H or RANPE?=H (default). APPENDIX A N FRAME REFERENCE 453 nkp]paoPatpqna Can be set to pnqa to rotate the texture to fit the status bar. Allows you to use horizontal tex- tures for vertical bars. Default: b]hoa.
XML Elements The Op]pqo>]n type has the following XML elements.
>]n?khkn Controls the color of the status bar with its n, c, ^, and ] attributes.
>]nPatpqna A texture object that is used for the status bar.
Lua Methods The Op]pqo>]n type has the following Lua methods. op]pqo>]n6CapIejI]tR]hqao$% Returns the minimum and maximum values of the bar. op]pqo>]n6CapKneajp]pekj$% Returns the orientation. op]pqo>]n6CapNkp]paoPatpqna$% Returns the rotate texture setting. op]pqo>]n6CapOp]pqo>]nPatpqna$% Returns the texture. op]pqo>]n6CapR]hqa$% Returns the current value. op]pqo>]n6OapIejI]tR]hqao$iej(i]t% Sets the minimum and maximum values. op]pqo>]n6OapKneajp]pekj$kneajp]pekj% Sets the orientation to either DKNEVKJP=H or RANPE?=H. op]pqo>]n6OapNkp]paoPatpqna$% Changes the texture rotation setting. 454 APPENDIX A N FRAME REFERENCE
op]pqo>]n6OapOp]pqo>]n?khkn$n(c(^(]% Changes the color of the bar.
op]pqo>]n6OapOp]pqo>]nPatpqna$patpqna% Changes the bar’s texture.
op]pqo>]n6OapR]hqa$r]hqa% Sets the value. APPENDIX B
Combat Log and Unit Reference
This appendix contains all the information you are ever going to need about the combat log and combat-related functions. You can probably find all the information presented here on the Internet (for example on WoWWiki), but it is scattered. It can be useful to have all the com- bat-related events and units in a single place. Combat Log Events The two combat log events ?KI>=P[HKC[ARAJP and ?KI>=P[HKC[ARAJP[QJBEHPANA@ have the same arguments; the only difference is that the unfiltered event is called for all combat log events, while the normal event is fired only for events that pass through your currently active combat log filter. You should always use the unfiltered event in your addon unless you are writing a combat log replacement that uses the combat log filter settings. These events receive numerous arguments (up to 20) based on the subevent. The basic event arguments are also covered in Chapter 9, which deals with the combat log. Standard Arguments As listed in Table B-1, there are eight standard arguments, which are always available.
Table B-1. The First Eight Combat Log Arguments Argument Name Description peiaop]il A timestamp that contains the exact time when the event occurred. This can be used as the second argument to `]pa$bip(peia%. arajp The subevent. okqn_aCQE@ The GUID (globally unique identifier) of the entity that generated the event. okqn_aJ]ia The name of the entity that generated the event. For example, if you cast a spell this is your name. okqn_aBh]co Flags that contain additional information about the entity that generated this event. Table B-11 later in this appendix shows how we can extract information from this bit field. `aopCQE@ The GUID of the target. `aopJ]ia The target’s name. `aopBh]co Flags of the target.
455 456 APPENDIX B N COMBAT LOG AND UNIT REFERENCE
Additional Arguments for the Prefixes OLAHH[ and N=JCA[ Table B-2 lists the arguments appended to all OLAHH[& and N=JCA[& subevents.
Table B-2. Additional Arguments of OLAHH and N=JCA Events Argument Name Description olahhE` The ID of the spell. This is the same ID that is also used by many WoW database sites, like Wowhead. You can build a URL with the following pattern to retrieve additional information about a spell ID from such a site: dppl6++sss*sksda]`*_ki+;olahh98olahhE`: olahhJ]ia The name of the spell. olahhO_dkkh The school of the spell. This is a bit field.
Additional Argument for the Prefix AJRENKJIAJP=H[ The AJRENKJIAJP=H[& events define only one additional argument, the string ajrenkjiajp]hPula. This value is one of the following strings:
ÊUÊ@NKSJEJC ÊUÊB=HHEJC ÊUÊB=PECQA ÊUÊBENA ÊUÊH=R= ÊUÊOHEIA
Additional Arguments for the Suffix [@=I=CA All subevents that end in [@=I=CA receive the additional arguments listed in Table B-3.
Table B-3. Additional Arguments of Events with the Suffix [@=I=CA Argument Name Description ]ikqjp The amount of damage the attack did. krangehh The overkill damage if the target died from the attack. o_dkkh The school of the damage; like the spell’s school, this is a bit field. naoeopa` The amount of damage that was resisted. ^hk_ga` The amount of blocked damage. ]^okn^a` The amount of absorbed damage. _nepe_]h 1 if the hit was critical, nil otherwise. ch]j_ejc 1 if it was a glancing strike, nil otherwise. _nqodejc 1 if it was a crushing blow, nil otherwise. APPENDIX B N COMBAT LOG AND UNIT REFERENCE 457
Additional Arguments for the Suffix [DA=H All subevents that end in [DA=H receive the additional arguments listed in Table B-4.
Table B-4. Additional Arguments of Events with the Suffix [DA=H Argument Name Description ]ikqjp The amount of damage the attack did kranda]hejc The overheal _nepe_]h 1 if the hit was critical, nil otherwise
Additional Arguments for the Suffix [IEOOA@ All subevents that end in [IEOOA@ receive the additional arguments listed in Table B-5.
Table B-5. Additional Arguments of Events with the Suffix [IEOOA@ Argument Name Description ieooPula The reason the spell or attack missed ]ikqjp The amount of damage that missed
The ieooPula is one of the following strings:
ÊUÊ=>OKN> ÊUÊ>HK?G ÊUÊNABHA?P ÊUÊNAOEOP (]ikqjp is jeh if the whole spell was resisted) ÊUÊRQHJAN=>EHEPU (]ikqjp will be negative, as a vulnerability results in more damage dealt)
Additional Argument for the Suffix [B=EHA@ There is only one additional argument for failed spells or attacks: ieooPula. Don’t confuse this suffix with the suffix [IEOOA@ and its argument with the same name. A failed spell was not cast at all, for example because of insufficient mana. A missed spell or attack was cast but resisted or parried, for example. ieooPula is here already a localized string that is displayed as it is in your UI and not an identifier.
Additional Argument for the Suffix [ATPN=[=PP=?GO There is only one additional argument for actions that cause extra attacks: ]ikqjp, the num- ber of additional attacks granted. All of the extra attacks will generate the usual OSEJC[@=I=CA events. 458 APPENDIX B N COMBAT LOG AND UNIT REFERENCE
Additional Arguments for the Suffixes [AJANCEVA, [@N=EJ, and [HAA?D Subevents that end in [AJANCEVA, [@N=EJ, or [HAA?D receive the additional arguments listed in Table B-6.
Table B-6. Additional Arguments of Events with the Suffixes [AJANCEVA, [@N=EJ, and [HAA?D Argument Name Description ]ikqjp The amount of power gained. lksanPula The power type (mana, energy, health, and so on). atpn]=ikqjp Only available for [HAA?D. The additional power that was drained from the affected target but was not transferred to the caster (for example, when using Drain Life with full health).
The argument lksanPula is a number that identifies the power type. There are global variables available that should be used instead of the numeric identifiers as it makes your code more readable and resilient to API changes. Table B-7 lists all global variables with their respective values.
Table B-7. Possible Values for lksanPula Variable Value OLAHH[LKSAN[I=J= 0 OLAHH[LKSAN[N=CA 1 OLAHH[LKSAN[BK?QO 2 OLAHH[LKSAN[AJANCU 3 OLAHH[LKSAN[D=LLEJAOO 4 OLAHH[LKSAN[NQJAO 5 OLAHH[LKSAN[NQJE?[LKSAN 6
Additional Arguments for Dispels and Interrupts There are four events used when buffs are canceled prematurely: OLAHH[@EOLAH if it was dis- pelled, OLAHH[@EOLAH[B=EHA@ if a display attempt was resisted, OLAHH[OPKHAJ if a buff was stolen (for example by Steal Magic), and OLAHH[=QN=[>NKGAJ[OLAHH if a damage-sensitive debuff (like Polymorph) was broken by an attack on the target. The event OLAHH[EJPANNQLP is fired when a spell is interrupted; it uses the same argu- ments as the dispel events, so it’s listed here. Table B-8 lists the additional arguments of these events. APPENDIX B N COMBAT LOG AND UNIT REFERENCE 459
Table B-8. Additional Arguments of Dispel and Interrupt Events Argument Name Description atpn]OlahhE` The ID of the spell that was interrupted or dispelled. atpn]OlahhJ]ia The name of the interrupted/dispelled spell. atpn]O_dkkh The school (bit field) of the interrupted/dispelled spell. ]qn]Pula Only available for OLAHH[@EOLAH, OLAHH[=QN=[>NKGAJ[OLAHH, and OLAHH_OPKHAJ; this value is either >QBB or @A>QBB.
Additional Arguments for Buff Events There are six buff-related events:
¡OLAHH[=QN=[=LLHEA@ ¡OLAHH[=QN=[NAIKRA@ ¡OLAHH[=QN=[=LLHEA@[@KOA ¡OLAHH[=QN=[NAIKRA@[@KOA ¡OLAHH[=QN=[NABNAOD ¡OLAHH[=QN=[>NKGAJ
All of them receive the additional argument ]qn]Pula, which is either >QBB or @A>QBB. The events ending with [@KOA also receive the argument ]ikqjp, which indicates the value of buff stacks on the affected unit after the event. Note that the event OLAHH[=QN=[>NKGAJ[OLAHH is, despite the name, a dispel event and uses different arguments.
Additional Arguments for Damage Shield Events There are three events related to damage shields: @=I=CA[ODEAH@ is fired when an attacker is damaged by the effect of a shield (such as Fire Shield). This event behaves like a OLAHH[@=I=CA event and receives the same arguments as such an event. @=I=CA[ODEAH@[IEOOA@ uses the same arguments as OLAHH[IEOOA@. Another shield type is one that splits the damage among multiple persons; it uses the event @=I=CA[OLHEP, which takes the same arguments as @=I=CA[ODEAH@.
Additional Arguments for Enchant Events Applying enchants or temporary effects like poisons or Shaman weapon buffs generates the event AJ?D=JP[=LLHEA@. The event AJ?D=JP[NAIKRA@ is fired when the effect wears off. Both events use the arguments listed in Table B-9. 460 APPENDIX B N COMBAT LOG AND UNIT REFERENCE
Table B-9. Additional Arguments of Events with the Prefix AJ?D=JP[ Argument Name Description olahhJ]ia The name of the spell or poison used epaiE` The ID of the targeted item epaiJ]ia The name of the targeted item
The Spell School Bit Field The default UI provides bit masks to extract flags from this bit field. Table B-10 shows all global variables that hold bit masks for spell bit fields.
Table B-10. Bit Masks for Spell Schools Variable Bit Mask O?DKKH[I=OG[JKJA 0x0 O?DKKH[I=OG[LDUOE?=H 0x1 O?DKKH[I=OG[DKHU 0x2 O?DKKH[I=OG[BENA 0x4 O?DKKH[I=OG[J=PQNA 0x8 O?DKKH[I=OG[BNKOP 0x10 O?DKKH[I=OG[OD=@KS 0x20 O?DKKH[I=OG[=N?=JA 0x40
The Unit Flags Bit Field Table B-11 shows the global variables that can be used as bit masks on the okqn_aBh]co and `aopBh]co arguments.
Table B-11. Bit Masks for Unit Flags Variable Bit Mask ?KI>=PHKC[K>FA?P[=BBEHE=PEKJ[IEJA 0x00000001 ?KI>=PHKC[K>FA?P[=BBEHE=PEKJ[L=NPU 0x00000002 ?KI>=PHKC[K>FA?P[=BBEHE=PEKJ[N=E@ 0x00000004 ?KI>=PHKC[K>FA?P[=BBEHE=PEKJ[KQPOE@AN 0x00000008 ?KI>=PHKC[K>FA?P[NA=?PEKJ[BNEAJ@HU 0x00000010 ?KI>=PHKC[K>FA?P[NA=?PEKJ[JAQPN=H 0x00000020 ?KI>=PHKC[K>FA?P[NA=?PEKJ[DKOPEHA 0x00000040 ?KI>=PHKC[K>FA?P[?KJPNKH[LH=UAN 0x00000100 ?KI>=PHKC[K>FA?P[?KJPNKH[JL? 0x00000200 ?KI>=PHKC[K>FA?P[PULA[LH=UAN 0x00000400 ?KI>=PHKC[K>FA?P[PULA[JL? 0x00000800 ?KI>=PHKC[K>FA?P[PULA[LAP 0x00001000 APPENDIX B N COMBAT LOG AND UNIT REFERENCE 461
Variable Bit Mask ?KI>=PHKC[K>FA?P[PULA[CQ=N@E=J 0x00002000 ?KI>=PHKC[K>FA?P[PULA[K>FA?P 0x00004000 ?KI>=PHKC[K>FA?P[P=NCAP 0x00010000 ?KI>=PHKC[K>FA?P[BK?QO 0x00020000 ?KI>=PHKC[K>FA?P[I=EJP=JG 0x00040000 ?KI>=PHKC[K>FA?P[I=EJ=OOEOP 0x00080000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP- 0x00100000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP. 0x00200000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP/ 0x00400000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP0 0x00800000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP1 0x01000000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP2 0x02000000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP3 0x04000000 ?KI>=PHKC[K>FA?P[N=E@P=NCAP4 0x08000000 ?KI>=PHKC[K>FA?P[JKJA 0x80000000
Unit IDs A unit ID is a string that identifies a player or NPC. What are called primary unit IDs that con- sist of single identifier (for example lh]uan); secondary (as well as tertiary, and so on) unit IDs can be built by appending suffixes to primary IDs. Table B-12 lists all primary unit IDs.
Table B-12. Primary Unit IDs Prefix Description bk_qo Your focus target. lh]uan You. lap Your pet. l]npuj The nth party member. Note that you are not your own party member, meaning that you cannot refer to yourself by using such a unit ID. 0 < n < 5. l]npulapj The pet of the nth party member. 0 < n < 5; you cannot refer to your own pet with this unit ID. n]e`j The nth raid member. This can, unlike l]npuj, be you. n]e`lapj The pet of the nth raid member. This can, unlike n]e`lapj, be you. ]naj]j The enemy players in arena matches. 0 < n < 6. p]ncap Your current target. ikqoakran The unit your mouse is currently over. jkja Refers to no unit. jl_ The NPC you are currently interacting with. Interacting means that you have a win- dow like the flight map or quest dialog of the NPC opened. 462 APPENDIX B N COMBAT LOG AND UNIT REFERENCE
The two suffixes p]ncap and lap can be appended to any unit ID to refer to the target or pet of a unit. Note that there is no difference between l]npulapj and l]npujlap when using the unit ID in a unit function like QjepJ]ia$qE`%. But l]npulapj is a primary unit ID, while l]npujlap is secondary. There are some events that are only fired for primary IDs; for example, QJEP[P=NCAP is fired every time a unit with a primary ID changes its target. You will therefore see the l]npulapj and n]e`lapj IDs as arguments in many QJEP[& events.
Unit Functions There are several functions available that retrieve information about the unit identified by a given unit ID:
ÊUÊQjep=bba_pejc?ki^]p$qE`%: Checks if the unit is in combat. ÊUÊQjep=nikn$qE`%: Returns the armor of the unit ID. This can only be used on yourself. ÊUÊQjep=pp]_g>kpdD]j`o$qE`%: Returns 1 if the unit wields two weapons. ÊUÊQjep=pp]_gLksan$qE`%: Returns the melee attack power. This can only be used on yourself. ÊUÊQjep=pp]_gOlaa`$qE`%: Returns the attack speed of the unit in seconds. ÊUÊQjep=qn]$qE`(^qbbE`(behpan%: Returns information about a specific buff on the unit. The first buff on a unit has the ID 1, the second 2, and so on. The third operational argument is a string that sets a filter. Possible values for the filter are the following:
ÊUÊ?=J?AH=>HA: Matches buffs that can be canceled. ÊUÊJKP[?=J?AH=>HA: Matches buffs that cannot be canceled. ÊUÊD=NIBQH: Matches spells that do harm. ÊUÊDAHLBQH: Matches helpful spells ÊUÊLH=UAN: Matches buffs cast by you. ÊUÊN=E@: Matches buffs that you can cast on other raid members. You can combine multiple filters in the filter string. The default value for behpan is DAHLBQH, meaning that it only returns buffs. For example, D=NIBQHLH=UAN matches all harmful spells that have been cast by you. The return values of this function are j]ia, n]jg, e_kj, _kqjp, `a^qbbPula, `qn]pekj, atlen]pekjPeia, qjep?]opan, and eoOpa]h]^ha. ÊUÊQjep?]j=ooeop$qE`-(qE`.%: Determines whether a unit can assist another unit. ÊUÊQjep?]j=pp]_g$qE`-(qE`.%: Determines whether a unit can attack another unit. ÊUÊQjep?]j?kklan]pa$qE`-(qE`.%: Determines whether two units can cooperate; that is, whether both units are players of the same faction. The difference between this func- tion and Qjep?]j=ooeop is that a player can assist an NPC but not cooperate with one. ÊUÊQjep?d]n]_panLkejpo$qE`%: Returns the number of unspent talent points of a unit. ÊUÊQjep?h]oo$qE`%: Returns the localized class of a player followed by the English name of the class in capital letters. APPENDIX B N COMBAT LOG AND UNIT REFERENCE 463
ÊUÊQjep?h]ooebe_]pekj$qE`%: Gets the classification of a unit; this can be jkni]h, pnere]h (“gray” mobs), ahepa, n]na, n]naahepa, or sknh`^koo. ÊUÊQjep?na]pqnaB]iehu$qE`%: Gets the creature family of a beast (for example, Cat or Spider). ÊUÊQjep?na]pqnaPula$qE`%: Gets the creature type of a unit (for example, Beast or Giant). ÊUÊQjep@abajoa$qE`%: Gets the defense skill of a unit. ÊUÊQjep@ap]eha`Pdna]pOepq]pekj$qE`-(qE`.%: Returns the threat situation between two units. The return values are eoP]jgejc, op]pqo, pdna]pl_p, n]spdna]pl_p, pdna]pr]hqa. ÊUÊQjepAteopo$qE`%: Determines whether a unit ID references an existing unit. ÊUÊQjepB]_pekjCnkql$qE`%: Returns the faction of a unit (for example, Sons of Hodir or Alliance). ÊUÊQjepCQE@$qE`%: Returns the GUID of a unit. ÊUÊQjepD]oNahe_Ohkp$qE`%: Determines whether a unit has a relic slot. ÊUÊQjepDa]hpd$qE`%: Returns the current health of a unit. ÊUÊQjepDa]hpdI]t$qE`%: Returns the maximum health of a unit. ÊUÊQjepEjL]npu$qE`%: Determines whether a unit is in your party. ÊUÊQjepEjN]e`$qE`%: Determines whether a unit is in your raid. ÊUÊQjepEjN]jca$qE`%: Returns 1 if qE` is less than 30 yards away from you. ÊUÊQjepEo=BG$qE`%: Determines whether a player is AFK. ÊUÊQjepEo?d]nia`$qE`%: Checks whether a unit is mind-controlled. ÊUÊQjepEo?kjja_pa`$qE`%: Checks whether a player is online. ÊUÊQjepEo?knloa$qE`%: Determines whether a unit is a corpse. ÊUÊQjepEo@a]`$qE`%: Determines whether a unit is dead. ÊUÊQjepEo@a]`KnCdkop$qE`%: Determines whether a unit is dead or in ghost forms. ÊUÊQjepEo@J@$qE`%: Checks whether a unit has DND enabled. ÊUÊQjepEoAjaiu$qE`-(qE`.%: Checks whether two units can attack each other. ÊUÊQjepEoBaecj@a]pd$qE`%: Determines whether a unit is feigning death. This only works on units in your party or raid. ÊUÊQjepEoBneaj`$qE`-(qE`.%: Returns 1 if two units are friendly towards each other. ÊUÊQjepEoCdkop$qE`%: Checks whether a unit is in ghost form. ÊUÊQjepEoLRL$qE`%: Checks whether a unit is flagged for PvP. ÊUÊQjepEoLRLBnaaBkn=hh$qE`%: Checks whether a unit is flagged for FFA PvP (for example in the Stranglethorn Arena). ÊUÊQjepEoL]npuHa]`an$qE`%: Determines whether a unit is the leader of a party. ÊUÊQjepEoLh]uan$qE`%: Determines whether a unit is a player. 464 APPENDIX B N COMBAT LOG AND UNIT REFERENCE
ÊUÊQjepEoLhqoIk^$qE`%: Returns 1 for elite mobs. ÊUÊQjepEoP]lla`$qE`%: Checks whether a mob is tapped by someone else. ÊUÊQjepEoP]lla`>uLh]uan$qE`%: Checks whether a mob is tapped by you. ÊUÊQjepEoPnere]h$qE`%: Checks whether a mob is trivial (“gray”). ÊUÊQjepEoQjep$qE`-(qE`.%: Checks whether two unit IDs reference the same unit. ÊUÊQjepEoReoe^ha$qE`-%: Checks whether a unit is in your range (about 100 yards). ÊUÊQjepHarah$qE`%: Gets the level of a unit. ÊUÊQjepJ]ia$qE`%: Returns the name and server (in battlegrounds) of a player. ÊUÊQjepKjP]te$qE`%: Checks whether a unit is on a taxi service. ÊUÊQjepLh]uan?kjpnkhha`$qE`%: Checks whether a unit is controlled by a player. ÊUÊQjepLh]uanKnLapEjL]npu$qE`%: Determines whether the unit is a member of your party or a pet of a party member. ÊUÊQjepLh]uanKnLapEjN]e`$qE`%: Works like QjepLh]uanKnLapEjL]npu but for raid groups. ÊUÊQjepLksan$qE`(lksanPula%: Gets the current amount of lksanPula (mana, energy, and so on) of a unit. lksanPula uses the same values as mentioned in the combat log arajp above. ÊUÊQjepLksanI]t$qE`(lksanPula%: Gets the maximum amount of lksanPula of a unit. ÊUÊQjepLksanPula$qE`%: Gets the current power type of a unit. ÊUÊQjepN]_a$qE`%: Gets the localized race of a unit followed by a non-localized capitalized string. ÊUÊQjepN]jca`=pp]_gLksan$qE`%: Returns the ranged attack power. This only works on yourself. ÊUÊQjepNa]_pekj$qE`-(qE`.%: Determines the reaction of qE`- towards qE`.. Possible val- ues are bneaj`hu, jaqpn]h, and dkopeha. ÊUÊQjepTL$qE`%: Gets the current XP of qE`-. This only works on yourself. ÊUÊQjepTLI]t$qE`%: Gets the maximum XP of qE`-. This only works on yourself. Index
Numbers and Symbols access control list (ACL), 82 3D application Ace3 framework, 283–295 creating simple, 400–402 advanced Hello, World with, 286 creating the sky in, 402 first steps with, 285–286 creating trees, 401 simple Hello, World addon with, 283–284 \36 (ASCII code for $), 395 web site address for information about, \124, Lua escape code, 259 283 255-character limit, circumventing in mac- Ace3 libraries, embedding, 284 ros, 354–355 AceAddon-3.0 object, OnInitialize method : (colon) operator, 62, 172 of, 287 -- (double hyphens), designating comments AceAddon object, 290 with, 16 AceConfig-3.0 == (equality test operator), 27 configuration with, 290–295 == (equality operator), 15 web site address for documentation, 295 = (equality sign), assigning a value to a vari- AceConfig frame, automatically generated, able with, 17 293 % (modulo operator), used in FindNextPosi- AceConfig table, creating for Hello, World tion method, 217 mod, 292–293 ~= (negation of the equality test) operator, 27 AceConsole, / commands with, 286 | (pipe symbol), as escape character, 258 AceDB-3.0, 286 / (slash) commands, creating, 63–65 creating new with default values, 287–288 [] (square brackets), using in strings, 19–20 data types, 288–289 || (two pipe symbols), representing normal saved variables with, 287–289 pipe symbol, 259 AceDB-3.0 API documentation, web site ad- /ahwgui, creating, 294 dress, 288 /channel
addon communications ENVIRONMENTAL_ prefix, 456 basics of, 228–230 _EXTRA_ATTACKS suffix, 457 building poker game client with, 227–240 _FAILED suffix, 457 example of concatenation in Lua, 367–370 _LEECH suffix, 458 ADDON LOADED event, calling Poker_ in Lua, 15 TableBrowser.ADDON_LOADED of events with _DAMAGE suffix, 456–457 function, 224 of events with _HEAL suffix, 457 addon messages of events with _MISSED suffix, 457 function for sending test, 229 prefixes SPELL_ and RANGE_, 456 playing around with, 229–230 standard for combat log events, 455–456 receiving, 229 arithmetic expressions. See arithmetic opera- security and, 230–232 tors sending, 228 arithmetic operators, 26–27 addons arrays available message channels, 228 created by using tables, 160–161 displaying chat time stamp using a hook, understanding, 374–377 158 what they look like internally, 374–375 naming, 228 array size, in Lua, 375–377 profiling in WoW, 363–364 ARTWORK layer, creating template for en- that make use of graphs, 165 tries with, 116–118 AddOn Studio IDE, 9 Assignments, in Lua, 37–38 AddText method, 289 associated array, 377 adjacency matrix, 166 associative array, 23 amount argument, for events with DAMAGE attackingUnit prototype, 177 suffix, 243 Attack(target) method, 173 anchor, function of, 99–100 attributes ANCHOR_CURSOR, using, 74 building unit frames with, 326–331
cards CHAT_MSG_WHISPER event, demonstrating additions to localization file, 196 event handler with, 75 calculating a rating of a hand, 200–202 chat time stamps, addon that displays using code loop that generates all 52 cards, 196 a hook, 158 creating, 196–197 check boxes. See check buttons drawing in game, 216 checkButton, GetChecked() method, 146 extracting and rating the best hands, check buttons, for setting permissions, 199–200 143–144 fields in table, 196 CheckButton type, 428–429 function comparing values of two cards, Lua methods, 429 199 XML attributes, 428 getting, 197–198 XML elements, 428 loop for testing correct creation of, 197 CheckFlagCarrier method, 335 shuffling and drawing, 215–216 Child, of frame, 98 cardsByRank table, creating, 196 Chunk, in Lua, 57 card type scores, 201 clampedToScreen="true" attribute, 106 caster’s flags, 257 class and prototype, interchangable use of, CastingBarFrameTemplate, defined by Inter- 175 face\FrameXML\CastingbarFrame. class data type, 288 xml, 263 closing tag, of XML element, 94 cast sequence command, 344–345 closures, in Lua, 152–154 CastSpellByName(“name”) function, 319 collectgarbage(), testing garbage collector Celes, Waldemar, Lua developed by, 1 with, 188–189 |c escape-sequence, 259 collectgarbage(option) function, memory channel argument, 228 usage returned by, 362 character classes, examples of usage, 49–50 collectgarbage(option, value) function, con- characters, with special meaning in Lua, 50 trolling garbage collector with, 188 char data type, 288 collision, in hash table, 378 ChatFrame1.AddMessage function, 158 color code, format of, 259 chat frames colored texts, 259–260 and their script handlers, 71–72 color option type, 295 determining default, 259 color reset code, 259 storage of default, 71 ColorSelect type using escape sequences in, 258–263 Lua methods, 430–431 ChatlinkTooltips script handlers, 431 creating, 71–74 XML attributes, 430 module in action, 69 combat log, and unit references, 455–464 chat messages COMBAT LOG EVENT, 455 hiding, 91–92 working with, 241–244 sending, 355–356 combat log events, 455–461 CHAT_MSG_ADDON standard arguments, 455–456 complete event handler, 231 COMBAT LOG EVENTS, working with, 241–244 event arguments, 229 COMBAT LOG EVENT UNFILTERED, 455 event handler for, 231 working with, 241–244 CHAT_MSG_ADDON event, registering, 235 COMBATLOG_OBJECT_RAIDTARGET_ CHAT_MSG_GUILD, 75 MASK variable, 255 CHAT_MSG_RAID, 75 NINDEX 469
COMBATLOG_OBJECT_REACTION_ CooldownMonitor_Anchor frame, 267 HOSTILE mask, 255 CooldownMonitor.lua file COMBATLOG_OBJECT_TYPE_PLAYER mask, adding code for status bar timer construc- 255 tor to, 268–269 combat logs, creating, 244 building, 256–274 commands, available for macros, 340–346 creating print local variable in, 260 comments, in XML, 94 detecting spells, 256–258 community cards, 239–240 CooldownMonitor.StartTimer function, cre- and player cards, 216 ating, 263, 269–270 compile-time errors, 181 CooldownMonitor.Unlock function, Show- concatenation MovableBar called by, 303 example in addon communication, CooldownMonitor.xml file 367–370 adding frame to, 267 graph of memory usage, 369 code for template, 264–265 of strings in Lua, 20 Cooldown type, 429–430 vs. table.concat function performance, 370 Lua methods, 429 conditions XML attributes, 429 adding to macros, 346–353 Core.lua file, creating real addon code in, available for all secure commands, 284–286 346–348 coroutine.create(func) function, 391 combining to build complex expressions, coroutine library, in Lua, 390–392 349–351 coroutine.resume(co, ...) function, 391 conflicts, resolving in hash tables, 378 coroutine.running() function, 391 control structures, 29 coroutines in Lua, 33–37 available functions that work with, 391 simple, 351–352 creating example of, 391–392 conventions, used in examples, 364–366 coroutine.status(co) function, 391 CooldownBars.lua coroutine.wrap(func) function, 391 adding Lua functions to, 266 coroutine.yield(...) function, 391 building new and improved, 301 CPU profiling, in WoW, 363–364 file, 263 CPU time, measuring amount used by Lua CooldownBarTemplate, children of, 265 scripts, 362 CooldownMonitor CreateBar, arguments when creating a bar, adding options to, 304–308 302 adding wrapper functions to main file, 300 createCounter function, 152–153 basic options, 305 CreateFlagCarrierButton method, called building, 256–274 when Warsong Gulch is joined, creating folder and TOC file for, 256 334–335 creating XML and Lua files for, 256 CreateFrame function, 70 improving with Deadly Bar Timers (DBT), creating timers from template with, 265 299–308 createGetter function, 307 integrating Deadly Bar Timers (DBT) in, CreateMonster function, 174 302–303 createSetter function, 307 option to show test bars, 305 CreateVector(x, y, z) function, 170 option to unlock and move bars, 305 critical argument, for events with DAMAGE placing functions in to be accessed from suffix, 243 outside the table, 258 crushing argument, for events with DAMAGE using Combat Log to build, 241–274 suffix, 243 470 NINDEX
currentPlayer attribute, 214 DeadlyBossMods.com, 5 Curse, web site address, 5 Deadly Boss Mods’ module, 61–62 Curse.com, free Subversion repositories for dealer button, moving, 216–217 addons from, 400 debug library, function available in World of custom timer, creating, 232 Warcraft, 54 cvar (console variable), tuning options with, debugstack() function, 182 358 debug.traceback() function, 182 cyclic lists, in Lua, 165 Decursive addon, 2 cyclic references, 155 deep copy function, 156 DEFAULT_CHAT_FRAME global variable, 71 default chat frame held in, 259 D default UI digging through, 130–131 DAMAGE SHIELD events arguments for, 459 extracting, 66–67 DAMAGE suffix, arguments of events with, 242–243 defaultValue attribute, for sliders, 141 _DAMAGE suffix, arguments of events with, de Figueiredo, Luiz Henrique, Lua developed 456–457 by, 1 data structures delete(list, node) function, using in doubly linked lists, 164 in Lua, 22 De Morgan’s Law, 349 object orientation and, 180–181 desc field, in AceOptions table, 290 using another, 222 description option type, 295 using tables to build, 160–168 destFlags argument, combat log events, 242 data types destGUID argument, combat log events, 242 basic in Lua, 17–26 destName argument, combat log events, 242 provided by AceDB-3.0, 288 DevTools, event trace window, 5 DBM. See Deadly Boss Mods Dialogs, static popup, 130–135 DBM-Core addon, 299 DIALOG strata, frameStrata attribute, 104 DBT. See Deadly Bar Timers (DBT)
F frame:SetPoint(point, relativeTo, relative- faction data type, 288 Point, x, y) method, creating a new factionrealm data type, 288 anchor with, 100 _FAILED suffix, argument for, 457 frame:SetWidth(width) method, 102 fake events, for event handler in Lua, 368–369 frames Far Cry, Lua used by, 1 adding capability to display to our Lua file, 136 FauxScrollFrame_OnVerticalScroll, calling, 124 basics of, 98–106 FauxScrollFrame_Update, calling, 125–126 children of, 98 files, restarts and editing existing, 63 creating in World of Warcraft, 95–95 filterIncoming function, 91 creating normal for new poker mod, 135 filterOutgoing function, 91 for adding a secure hook to event handler, 322 filters, combining multiple in filter string, 462 movable, 106 finalizer metamethod, 387 overview of XML file, 146–148 findHighCard(cards) function, 208 restrictions on protected, 324–325 FindNextPosition method, 217 retrieving name of, 95 findPair(cards) function, testing, 207 saving frame position with, 106 finite-state machines (FSM), 210–211 using as event listeners, 70–71 designing poker game servers as, 209 using Lua to create, 118–119 diagram showing all states as bubbles, 210 using, 74 FlagCarrier variable, 335 frame size Flash Heal (Rank 11) spell, adding for testing, 257 retrieving, 102 flyable bug, circumventing, 358–359 setting, 101 folder structure, for WoW addons, 58–59 frame strata, 103–104
head, doubly linked lists, 161 if-else-elseif block, available in a macro, headers, creating a template for, 112–113 351–352 header templates, attributes of, 331–333 if/else control structure, 15 header type, 295 if statements, 33 Healing Wave, macro that casts, 342 working with local variables in, 39 _HEAL suffix, arguments of events with, 457 writing alternative to, 39 HelloAce.toc, creating, 283–284 if-then-else-end construct, 28 Hello, World inactive attribute, in OnPlayerJoin method, in Warhammer Online, 396–399 212 with SciTE, 394–395 inCombat variable, mods stored in, 246 Hello, World mod /in command, using in macros, 357 creating AceConfig table for, 292–293
language written in, 2 Lua.org/Lua-users.org, 5 measuring CPU time used by a script, 362 Lugre measuring memory usage in, 362 Lua and, 399–402 measuring performance in, 362–366 Lua binding for OGRE 3D, 393 more about functions in, 151–158 Main function called by, 400 other uses for, 393–403 setting up, 400 setting frame size in, 102 web site address, 399 setting the strata from, 104 wiki web site address, 402 simple event handler in, 367–368 speed of, 2 strings in, 367–371 M table.concat(tbl, delimiter) function in, macro feedback, 353 370 macros tips, tricks, and optimization, 361–392 adding conditions to, 346–353 using, 13–14 available commands for, 340–346 using in macros, 355–359 circumventing 255-character limit in, variables and data types, 16–26 354–355 web site address, 2 for interrupting spells, 352 web site for apps and games that use, 393 in Lua, 339–360 web site for libraries and bindings, 403 inserting healing spell of class to use, 341 Lua code, executing in-game, 62 suppressing error messages in, 357–358 LuaEdit IDE, 8 that incorporate a logical OR in expres- LuaForge, bitlib project page, 190 sions, 350–351 Lua libraries, more about, 190–192 timers in, 356–357 Lua methods tuning options, 358 Button type, 425–428 ultimate for lazy healers, 351 CheckButton type, 429 using Lua in, 355–359 ColorSelect type, 430–431 Main function, called by Lugre, 400 Cooldown type, 429 math.cos function, example that calls, 373 DressUpModel type, 444 math library, functions available in, 43–45 EditBox type, 432–435 math.random, 215 FontString type, 421–422 math.randomseed, in Lua, 215 Font type, 408–409 math.sin function, example that calls, 373 Frame type, 414–420 max field, 291 GameTooltip method, 436–437 maxValue attribute, for sliders, 141 MessageFrame method, 440 memory profiling, in WoW, 364 Model type, 441–443 memory usage Object type, 406–407 if something goes wrong, 369–370 PlayerModel type, 443–444 measuring in Lua, 362 Region type, 410–412 merge sort, sorting algorithm, 366 ScrollFrame type, 445–446 MessageFrame method, 439–440 ScrollMessageFrame type, 447–448 messages SimpleHTML type, 449–450 receiving addon, 229 Slider type, 451–452 sending addon, 228 StatusBar type, 453–454 message types, needed in poker addon, 233 TabardModel type, 444–445 metamethods, and metatables, 169–171 Texture type, 423–424 NINDEX 477 metatables multiple inheritance, 107 adding to all tables in a given table, in Lua, 177–180 224–225 multiselect option type, 295 attaching to a saved table, 224–225 MyMod.SPELL_CAST_START function, up- and metamethods, 169–171 dating, 255 basic functions used when working with, 169 overloading operators, 169–170 N metatables and variables, saved, 222–225 \n, embedding new line characters with, 20 methods vs. attributes, 173 name field, in AceOptions table, 290 min field, 291 namespaces, in Lua, 186–187 minValue attribute, for sliders, 141 nearest neighbor algorithm, 167–168 MISSED suffix, arguments of events with, 458–459 .NET Framework (LuaInterface), 1 _MISSED suffix, arguments of events with, NewAddon method, 285 457 _newindex method, in Lua, 379 missTYPE argument, 457 NewLibrary method, 278 mixins, 285 newList function, 163 Model type NewPlayer commands, 239 Lua methods, 441–443 newproxy() function, 392 XML attributes, 441 nextNode function, using in doubly linked XML elements, 441 lists, 164 .mod file nil type, 18 event handlers available, 398–399 nodes, in doubly linked lists, 161 in Warhammer Online, 397 normal slash commands, 340 modulo operator (%), used in FindNextPosi- web site for Blizzard list of available, 340 tion method, 217
OGRE 3D, Pro OGRE 3D Programming about, OnValueChanged handler 399 adding variables used in, 143 OGRE 3D project, web site address, 402 arguments for, 141 OGRE (Lugre), 3D engine from Lua, 1 for sliders, 141 OK/Create button, creating, 145–146 OnVerticalScroll script handler, invoking, 124 OnBeforeSave handler, 395–396 opening tag, of XML element, 94 OnClick handler, code behind, 330–331 Open method, of library AceConfigDia- OnDisable method, 285 log-3.0, 293 OnDragEnd script handler, 106 operating system library (os), 54–55 OnDragStart script handler, 106 operator precedence, examples of, 30 adding to
RANGE event, arguments for, 242 return keyword, 15 RANGE_ prefixes, arguments for, 456 return statement, 36 range type, 295 example of, 276 for a numeric value, 291 RGB color model, web site for information rawget function, 381 about, 259 |r (color reset code), 259 Rock, FuBar based on, 296 realm data type, 288 root element, in XML document, 94 receive function, in simple event handler, 367 runCmd function, 356 ReceiveHit method, 177 Runed Titanium Rod, code behind a small ReceiveHit(attacker) method, 173 link to, 260 recursion, 15 runtime errors, 181 recursive table functions, 155–156 tail calls, 154–155 recursive table functions, 155–156 S recycling, tables in Lua, 386–387 say chat, macro that sends two messages to, Region type 339 Lua methods, 410–412 Say(text) method, 173 XML attributes, 409–410 Scale option, 307–308 XML elements, 410 schedule function, 220–221 RegisterChatCommand(cmd, func) method, for timing library, 77–79 creating a slash command in Ace Schedule method, 220 with, 286 Scheduler, for timing library, 77–79 RegisterEventHandler(event, func) function, school argument, for events with DAMAGE 398 suffix, 243 RegisterEvent method, 77 SciTE (Scintilla-based Text Editor), 10 RegisterForClicks method, 109 configuration file, 394 RegisterForDrag method, adding to OnLoad customized version for writing addons, 8 script handler, 272 customizing with Lua, 393–396 RegisterForDrags method, 327 Hello, World with, 394–395 RegisterUnitWatch(frame) function, calling validating XML in, 96 for target frame, 329 web site for config commands, 394 regular expressions, available classes for, 49 web site for documentation, 396 relational operators, 26–28 script handlers relativePoint attribute, 99 Button type, 428
ScrollFrame type select option type, 295 Lua methods, 445–446 self.BetTimeout, unscheduling calls to, 219 script handlers, 446 SendCards method, 216 XML elements, 445 SendState method, 212 Scrolling, with the mouse wheel, 127 server:Showdown() method, 217–218 ScrollingMessageFrame, chat frame type, 71 Server.lua, for building the poker server, ScrollMessageFrame type, 446–448 208–219 Lua methods, 447–448 server object, creating, 209–210 XML attributes, 447 servers table, that holds all currently running secure action button servers, 210 advanced, 335–338 SetAttribute(attribute, value) method, setting Warsong Gulch battleground mod, attributes of secure frames with, 326 334–335 SetAttribute method, of protected frames, SecureActionButtonTemplate, 331 326 secure action button templates, using, SetDefaultSize method, calling, 294 333–338 setfenv(func or level, environment) function, secure action button types, all possible val- 185 ues for, 333–334 SetFormattedText method, 371 secure and tainted code, in World of War- SetFuBarText method, 297–298 craft, 319–324 SetGeneralLocalization method, 315 secure button setglobal(name, value) function, provided by adding attributes to, 336–338 World of Warcraft, 184 XML file for, 336 SetHyperlink, calling SetOwner method SecureButton_GetModifiedAttribute helper before calling, 74 function, 331 setmetatable function, 170 securecall(func, ...) function, 322 setmetatable(table, metatable) function, 169 secure functions, hooking, 321–322 SetOwner method, 74 secure slash commands, 340 SetPoint method available for pets, 343 anchoring a frame to a nameless frame available for raid roles, 343–344 with, 105 available miscellaneous, 344 setting new point with, 101 for your (focus) target, 342–343 SetPortraitTexture(texture, unit) function, in player frame, 328 list of available for spells and items, 341 SetPosition method, creating, 270 secure state driver, in target frame, 329 SetScript, 70 secure templates SetSlot method, 239 list of, 325–326 setter function, of option, 291 using for unit frame mod, 324–333 setter option, for Width option, 307 working with, 319–338 SetText method, 371 SecureUnitButton_OnClick function, defined in FrameXML/SecureTemplates.lua, SetTexture, 240 330–331 SetUserPlaced method, 267 SecureUnitButtonTemplate, 324 shared subtables, 155 security and addon messages, 230–232 short-circuited operator, in Lua, 29 SelectEntry, 122 #show and #showtooltip commands, 353 Selection, fixing code for, 127–128 showdown state, 217–218 select option, IconLeft and IconRight pos- Show method, as protected method, 324 sible combinations, 305 482 NINDEX
ShowTestBars method, 301 Slider type, 450 calling, 305 Lua methods, 451–452 #showtooltip command, 353 script handlers, 452 showTooltip function, 74 XML attributes, 450–451 ShuffleCard method, with compare helper XML elements, 451 function, 215 sorting, the list, 121–122 SimpleHTML type, 448 sound files, playing and testing, 59 Lua methods, 449–450 sourceFlags argument, combat log events, XML attributes, 449 242 XML elements, 449 sourceGUID argument, combat log events, SimpleTimingLib 242 optimizing, 383–387 sourceName argument, combat log events, optimizing using another data structure, 242 383–384 special warnings and announces, 313–314 supporting old, 222 specWarnSurge object, warning text if Ma- updating to use LibStub, 279–283 lygos casts Power Surge on you , 247 SimpleTimingLib-1.0 SPELL_CAST_START subevents, printing to building, 280–281 chat frame, 243 TOC file for, 282–283 SPELL event, arguments for, 242 SimpleTimingLib-1.1, building simple, spellID argument, SPELL event, 242 384–386 spell link, 261 Simple Timing Library 2.0, adding object- spellName argument, SPELL event, 242 orientation to, 220–222 SPELL_ prefixes, arguments for, 456 SimpleTimingLibTest, building skeleton ad- spells don for, 279 adding new to table, 257 SimpleTimingLibTest.lua, 282–283 detecting in CooldownMonitor.lua file,
defining for button, 108 TOC (table of contents) file format, 59–62 exercise, 138 TOC files, for Deadly Boss Mods, 310–311 for scroll frames, 123–124 toggle option type, 295 using group header, 331–333 tooltip content, setting , 437–439 working with secure, 319–338 tooltips |T escape-sequence, added to onSpellCast adding to FuBar plugin, 298 function, 262 using, 73–74 Test prefix, script for simple, 229 TortoiseSVN (for Windows), web site, 400 Texas Hold’em tostringall function, 244 a crash course in, 198–199 tostring(arg) function, 21 using advanced Lua to extend addon, transition actions, defined by states, 211 195–226 transitions, between finite-state machines web site for Wikipedia article, 198 states, 210 writing of example game, 93–149 traveling salesman problem, 167–168 text attribute, 105 trees, creating in 3D application, 401 textures, 105, 261–262 trinket macro, 357 adding by hand using the
Curse, 5, 400 World of Warcraft(WOW) Deadly Boss Mods, 5, 275, 300 addon messages provided by, 227–240 Deadly Boss Mods documentation, 305, addons, 2–4 308 API functions provided by, 58 detailed diffs for all patches, 67 available metadata attributes, 60–61 DevTools, 5 bitlib in, 190 downloading bitlib, 190 CPU profiling in, 363–364 downloading FuBar, 296 default UI, 2 downloading LibFuBarPlugin-3.0, 296 frame types you can create in, 405–454 event list, 398 heavily modified UI, 2 Interface AddOn Kit, 7 in-game tools, 5–7 Java, 97 Lua used as UI by, 1 list of applications and games that use memory profiling in, 364 Lua, 393 optimizing string.format function in, 371 Lua, 2 profiling addons in, 363–364 Lua libraries and bindings, 403 running, 57, 58 LuaEdit IDE, 8 secure and tainted code, 319–324 Lua.org/Lua-users.org, 5 table.wipe(t) provided by, 386 Lugre, 399 using your own metadata attributes, 61 MPQ Editor, 7 virtual file system provided by, 58–59 official Lugre wiki, 402 XML file in, 94 OGRE 3D project, 402 World of Warcraft XML, elements in, 94–96 options available in format strings, 52 WoW (World of Warcraft) RGB color model information, 259 first addon, 58–63 SciTE documentation, 396 running a, 57, 58 SVN repository, 400 WowAce.com Swatter, 6 for LibFuBarPlugin-3.0 documentation, TinyPad, 7 299 TortoiseSVN (for Windows), 400 web site address, 277 UI & Macros forum, 5 WowAce project page, web site address, 296 vector math information, 169 WowAce/Curse, web site address, 5 Warhammer Online, 396, 399 WoW addons Wikipedia Texas Hold’em article, 198 creating our first, 58–63 wowace.com, 277 defined , 2–4 WowAce project page, 296 WoW API WowAce/Curse, 5 creating, 57, 67 WoWLua, 6 using, 62–63 WoW UI Designer, 9 Wowhead,looking up the spell on, 244 WoWWiki page, 4, 62, 360 WoWLua, in-game script editor, 6 weighted, defined, 166 WoW UI Designer, 9 while loops, 33–34 WoWWiki, table of useful pages, 4 widget or frame functions, 62 WoWWiki page, web site address, 62, 360 Width option, 307–308 wrapper function, 43 wstrings, 399 wxWidgets (wxLua), 1 NINDEX 487
XYZ XML file, in World of Warcraft, 94 XML XML-IDs, advantage of, 119 basics of, 94–96 XML terminology, 94 comments in, 94 XOR operator. See binary XOR operator creating a secure action button with, xpcall(func, errorHandler) function, for 336–338 catching/handling errors, 182 debugging, 97–98