Вы находитесь на странице: 1из 30

################################################# # # # WoWPlus' Lua Engine # # Last edited: 26.08.12 # # # # http://www.wow-plus.

net/ # # # ################################################# => ---------------- IMPORTANT ---------------- <= The following functions must be defined in all scripts: Load() - Executed upon loading the script. Unload() - Executed upon unloading the script. => ------------------------------------------- <=

################################################# # # # General # # # ################################################# >===============================================< | Generic Functions | >===============================================< * Can be accessed through the "Plus" library. * Example: Plus.Unload(); Syntax: Unload(); Return: nil Description: Terminates the use of the current Lua file. Syntax: IsInGame(); Return: If the player is currently ingame, it returns true. Otherwise it returns false. Description: Returns whether the player is ingame. Syntax: IsKeyPressed( Key ); Return: If the specified key is pressed, this function returns true. Otherwise i t returns false. Description: Returns whether the specified key is pressed. Syntax: DoString( "String" ); Return: Multiple return values (only strings), depending on the execution string . Description: Runs the specified string in WoW's Lua handler in fully permitted m ode. This function will always push a string value! For booleans: "true"

, "false". An example how to determine if the local player can attack our targ et would be: CanAttackTarget = Plus.DoString( "return UnitCanAttack( 'player', 'target' )" ); Syntax: LoadMap( MapID ); Return: nil Description: Loads the specified map (clientside) so you can explore maps which you normally couln't. Syntax: GetMapID(); Return: On success, this function returns your current map id. On failure, it re turns nil. Description: Gets your current map id. Syntax: GetWoWPath(); Return: Returns the WoW executable's path. Description: This function returns the exact path to the WoW executable, without the executable's name. Syntax: GetModulePath(); Return: Returns the module executable's path. Description: This function returns the exact path to the module executable, with out the executable's name. Syntax: GetTimeStamp(); Return: Returns the WoW timestamp. Description: Obtains the current timestamp which is used by WoW. Syntax: GetScriptName(); Return: Returns the executing script's name. Description: Gets the executing script's name. Syntax: ReadConfigSetting( "Key", ["Default"] ); Return: Reads a string from the scripts default configuration. Description: Gets a string at the given key from the scripts configuration secti on. If the specified key does not exist, it will return the specified d efault value. Syntax: WriteConfigSetting( "Key", "Value" ); Return: nil Description: Writes a string to the given key in the scripts configuration secti on. Syntax: GetDirectoryFiles( PathMask, [AsTable] ); Return: This function returns the files in the specified folder. Description: Returns the files in the specified folder. The filetype can be spec ified in mask. If AsTable was specified, it will return the files in a table. Othe rwise it will return multiple strings. Example on how to list all .txt files in module folder: Plus.GetDirectoryFiles( Plus.GetModulePath() + "*.txt" ); Syntax: ShellExecute( "FilePath", ["Parameters", ["WorkingDirectory"]] ); Return: On success, this function returns true. On failure, it returns false. Description: Executes the specified file. FilePath, Parameters and WorkingDirectory are UTF-8 encoded strings .

Syntax: ExplodeString( "String", ["Delimiter", [AsTable]] ); Return: This function returns the parsed substrings. Description: Explodes a string to it's substrings, seperated by delimiter. If AsTable is true, it will return the substrings in a table.

>===============================================< | Notifications | >===============================================< * Can be accessed through the "Plus" library. * Example: Plus.SetNotificationState( false ); Syntax: SetNotificationState( Enable ); Return: nil Description: Toggles the display of notifications by the executing script. Syntax: GetNotificationState(); Return: If notifications are enabled for the executing script, it returns true. Otherwise it returns false. Description: Returns whether notifications are displayed by the executing script . Syntax: PrintChat( "Message" ); Return: nil Description: Prints the specified message to the default WoW chat frame. Syntax: PrintConsole( "Message" ); Return: nil Description: Prints the specified message in the default WoW console. Syntax: PrintBubble( "Message" ); Return: nil Description: Prints the specified message as chat message bubble. Syntax: PrintWarning( "Message" ); Return: nil Description: Prints the specified message as raid warning.

>===============================================< | Hacks | >===============================================< * * * * * * * * * * * * Can be accessed through the "Plus" library. Example: Plus.SetHackState( "AirWalk", true ); Hack Types: "AirWalk", "Hover", "SuperFly", "WallClimb", "TalkToAll", "WireFrame", "M2Collision", "WMOCollision", "TerrainCollision",

* * * *

"NoFallDamage", "WaterWalk", "RunningCast", "AntiAck"

Syntax: SetHackState( "Hack", Enable ); Return: nil Description: Sets the specified hack's state. Syntax: GetHackState( "Hack" ); Return: On success, this function returns the hack state (true/false). On failur e, it returns nil. Description: Gets the specified hack state (enabled/disabled). Syntax: IsTeleportActive(); Return: If there is an active teleport, it returns true. Otherwise it returns fa lse. Description: Returns whether there is an active teleport event. Syntax: CreateTeleportEvent( X, Y, Z ); Return: On success, this function returns true. On failure, it returns false. Description: Creates a teleport event to the specified coordinates. Syntax: CancelTeleportEvent(); Return: nil Description: Cancels a teleport event, if any.

################################################# # # # Memory Management # # # ################################################# >===============================================< | Memory | >===============================================< * Can be accessed through the "Memory" library. * Example: Memory.GetModuleBase(); Syntax: GetModuleBase( ["Module"] ); Return: On success, this function returns the module base address. On failure, i t returns nil. Description: Gets the image base of the specified module. If there are no parameters, it will return the main module. Syntax: Allocate( [Size] ) Return: Returns the address of the newly allocated memory. Description: Allocates a memory region in the current process. Syntax: Free( Offset, [Size] ); Return: Returns whether the call succeeded. Description: Frees the specified memory region. Syntax: Call( Offset, \"Call Convention\", \"Return Type\", [Base], [...] ) Return: On success, this function returns the result of an external function cal

l. On failure or void return type, it returns nil. Description: Executes an external function in the WoW process. May crash if used incorrectly. The call convention determines how the stack will be managed. The return type specifies what it should interpret as the function returns. Syntax: Hook( Handler, Offset ); Return: On success, this function returns the hook identifier. On failure, it re turns nil. Description: Hooks a function at the given offset. The handler is executed when the specified function is executed. The handler will be provided with the following arguments: Identifier, Address, EAX, EBP, EBX, ECX, EDI, EDX, EIP, ESI, ESP Syntax: HookSetContext( EAX, EBP, EBX, ECX, EDI, EDX, EIP, ESI, ESP ); Return: nil Description: Sets the hook context registers/address. This function must be called inside a hook function only. Syntax: Unhook( Address ); Return: nil Description: Removes the specified hook. Syntax: UnhookID( Identifier ); Return: nil Description: Removes the specified hook callback. Syntax: Read( Offset, "Type" ); Return: On success, this function returns the desired data. On failure, it retur ns nil. Description: Reads the data at the given offset. The type specifies which kind of data it should read. Syntax: ReadBuffer( Offset, Count, [AsTable] ); Return: On success, this function returns a sequence of bytes (matching the leng th of count). If AsTable was specified, it will return the bytes in a table instead. On failure, it returns nil. Description: Reads the data at the given offset. The count specifies, how much bytes it should read. Syntax: ReadString( Offset, [Length] ); Return: On success, this function returns the string. On failure, it returns nil . Description: Reads a string at the given offset. If no length is specified the function will assume that the string is zero terminated. Syntax: Write( Offset, Value, "Type" ); Return: On success, this function returns true. On failue, it returns false. Description: Writes the given value to the specified offset. The type specifies which kind of data it should write. Syntax: WriteBuffer( Offset, Table/... ); Return: On success, this function returns true. On failue, it returns false. Description: Writes the given table or sequence of bytes to the specified offset . Syntax: WriteString( Offset, "String", [Length] )

Return: On success, this function return true. On failure, it returns false. Description: Writes the given string to the specified offset. If no length is specified the function will write the whole string. Syntax: GetProcAddress( "Module", "Procedure" ); Return: On success, this function returns the address of the specified procedure . On failue, it returns nil. Description: Gets the specified exported procedure from the given import library .

>===============================================< | Bit | >===============================================< * Can be accessed through the "Bit" library. * Example: Bit.And( 0x1010, 0x0010 ); Syntax: And( Value, Mask ); Return: Returns the result of a bitwise AND operation. Description: Performs a bitwise AND operation. Syntax: Or( Value, Mask ); Return: Returns the result of a bitwise OR operation. Description: Performs a bitwise OR operation. Syntax: Xor( Value, Mask ); Return: Returns the result of a bitwise XOR operation. Description: Performs a bitwise XOR operation. Syntax: Not( Value ); Return: Returns the result of a bitwise NOT operation. Description: Performs a bitwise NOT operation. Syntax: Shift( Value, Bits ); Return: Returns the result of a bitwise shifting operation. Description: Performs a bitwise shifting operation. If bits is negative, the value will be shift left. Otherwise the va lue will be shift right.

################################################# # # # Callbacks # # # ################################################# >===============================================< | Event | >===============================================< * Can be accessed through the "Event" library. * Example: Event.RegisterCallback( SomeScript_OnEnterWorld, "OnEnterWorld" ); * Reference: http://www.wow-plus.net/forums/showthread.php?218

Syntax: RegisterCallback( Handler, "Type" ); Return: This function returns the event identifier. The identifier can be used t o remove events. Description: Registers a event callback. The handlers is executed when the speci fied event occurs. A event callback must be declared as "Function( Identifier, Type )" . Identifier specifies the callback identifier and Type specifies the event that was raised. To see which callback types are valid, look at the lua callbacks th read in scripts forum. Syntax: RemoveCallback( Identifier ); Return: nil Description: Removes the specified callback. After this call, the handlers will not be executed if the event occ urs.

>===============================================< | Frame Event | >===============================================< * Can be accessed through the "Event" library. * Example: Event.RegisterFrameCallback( SomeScript_OnButtonClick, ButtonControl, "OnClick" ); * Reference: http://www.wow-plus.net/forums/showthread.php?144 Syntax: RegisterFrameCallback( Handler, Control, "Type" ); Return: On success, this function returns the frame event identifier, which can be used to remove frame events. On failure, it returns nil. Description: Registers a frame callback. The handler is executed when the specif ied control raises this event. A frame callback must be declared as "Function( Identifier, Control , Type )". Identifier specifies the frame callback identifier and Control spec ifies the event sender. To see which callback types are valid, look at the control's create function description. Syntax: RemoveFrameCallback( Identifier ); Return: nil Description: Removes the specified frame callback. After this call, the handlers will not be executed if the event occ urs.

>===============================================< | Timer Event | >===============================================< * Can be accessed through the "Event" library. * Example: Event.RegisterTimerCallback( SomeScript_OnTimerTick, 1000, true ); Syntax: RegisterTimerCallback( Handler, Interval, [Repeat] ); Return: This function returns the timer identifier. The identifier can be used t

o remove timer events. Description: Registers a timer callback. The handler is executed when the specif ied timer expires. A timer callback must be declared as "Function( Identifier, Interva l )". Identifier specifies the timer identifier, and Interval specifies t he timer interval. If repeat is true, the function will register itself again, after t he timer has expired. Syntax: RemoveTimerCallback( Identifier ); Return: nil Description: Removes the timer callback specified by identifier. After this call, the handlers will not be executed if the timer exp ires.

>===============================================< | Command Event | >===============================================< * Can be accessed through the "Event" library. * Example: Event.RegisterCommandCallback( SomeScript_OnSomeCommand, "SomeCommand " ); Syntax: RegisterCommandCallback( Handler, "Command" ); Return: This function returns the command identifier. The identifier can be used to remove command events. Description: Registers a command callback. The handler is executed when the spec ified command is provided in ".script" A command callback must be declared as "Function( Identifier, Comma nd, ... )" Identifier specifies the command callback identifier, Command speci fies the first parameter in ".script". Command callbacks can check for variable number of arguments. Param eters will be non-nil if they exist. Syntax: RemoveCommandCallback( Identifier ); Return: nil Description: Removes the specified command callback. After this call, the handlers will not be executed when the specifi ed command is provided in ".script"

>===============================================< | Signal Event | >===============================================< * Can be accessed through the "Event" library. * Example: Event.RegisterSignalCallback( SomeScript_OnWhisperReceived, FRAMEEVEN T_CHAT_MSG_WHISPER ); * Reference: http://www.wow-plus.net/forums/showthread.php?141 Syntax: RegisterSignalCallback( Handler, Event ); Return: This function returns the signal identifier. The identifier can be used to remove signal events.

Description: Registers a signal callback. The handler is executed when the speci fied event is signaled by WoW. A signal callback must be declared as "Function( Identifier, Signal , ... )". Identifier specifies the signal callback identifier and Signal spec ifies the signal event that was raised by WoW. The function passess all event parameters from WoW after the Signal parameter. To see which signal events are valid, look at the "Frame Events Dum p"-Thread in scripts forum. Syntax: RemoveSignalCallback( Identifier ); Return: nil Description: Removes the specified signal callback. After this call, the handlers will not be executed when the specifi ed event is signaled by WoW.

>===============================================< | Movement Event | >===============================================< * Can be accessed through the "Event" library. * Example: Event.RegisterMovementCallback( SomeScript_OnJump, MOVEMENTEVENT_JUMP ); * Reference: http://www.wow-plus.net/forums/showthread.php?142 Syntax: RegisterMovementCallback( Handler, Movement ); Return: This function returns the movement identifier. The identifier can be use d to remove movement events. Description: Registers a movement callback. The handler is executed when the spe cified movement event occurs. A movement callback must be declared as "Function( Identifier, Move ment )". Identifier specifies the movement callback identifier and Movement specifies the movement event that was raised by WoW. To see which movement events are valid, look at the "Movement Event s Dump"-Thread in scripts forum. Syntax: RemoveMovementCallback( Identifier ); Return: nil Description: Removes the specified movement callback. After this call, the handlers will not be executed when the specifi ed movement event occurs.

>===============================================< | Key Event | >===============================================< * Can be accessed through the "Event" library. * Example: Event.RegisterKeyCallback( SomeScript_OnEnter, KEYEVENT_ENTER ); * Reference: http://www.wow-plus.net/forums/showthread.php?149 Syntax: RegisterKeyCallback( Handler, Key ); Return: This function returns the key identifier. The identifier can be used to

remove key events. Description: Registers a key callback. The handler is executed when the specifie d key is pressed. A key callback must be declared as "Function( Identifier, Key )". Identifier specifies the key callback identifier and Key specifies the key that was pressed. To see which key events are valid, look at the "Virtual Key List"-T hread in scripts forum. Syntax: RemoveKeyCallback( Identifier ); Return: nil Description: Removes the specified key callback. After this call, the handlers will not be executed when the specifi ed key is pressed.

################################################# # # # Player Management # # # ################################################# >===============================================< | Player | >===============================================< * Can be accessed through the "Player" library. * Example: Player.CastSpell( "Fishing" ); Syntax: CastSpell( "SpellName", [Object] ); Return: If the player successfully started casting the spell, the return value i s true. Otherwise it's false. Description: Casts a spell by name. Syntax: CastSpellByID( SpellID, [Object] ); Return: If the player successfully started casting the spell, the return value i s true. Otherwise it's false. Description: Casts a spell by spell ID. Syntax: CastCurrentSpell( X, Y, Z ); Return: If the player successfully started casting the spell, the return value i s true. Otherwise it's false. Description: Casts the current pending spell by simulating a terrain click. Syntax: MoveTo( X, Y, Z, [Precision] ); Return: If the player successfully started moving, the return value is true. Oth erwise it's false. Description: Moves the player directly to a location (X, Y, Z). Syntax: CancelMoveTo(); Return: nil Description: Cancels all previous MoveTo events. Syntax: IsMoveToActive(); Return: If the player is moving due to a MoveTo event, the return value is true. Otherwise it's false. Description: Determines whether a MoveTo event is active.

Syntax: Face( X, Y ); Return: nil Description: Faces the player at a location (X, Y). Syntax: SetRotation( Rotation ); Return: nil Description: Sets the players rotation to the given angle. Syntax: Interact( Object ); Return: nil Description: Tries to interact with the specified object. Syntax: Target( Object ); Return: nil Description: Tries to target the specified object.

################################################# # # # Object Management # # # ################################################# >===============================================< | Object Manager | >===============================================< * Can be accessed through the "ObjectManager" library. * Example: ObjectManager.GetActivePlayer(); Syntax: GetActivePlayer(); Return: On success, this function returns the local player. On failure, it retur ns nil. Description: Returns the local player from the object list. Syntax: GetActiveMover(); Return: On success, this function returns the active mover object. On failure, i t returns nil. Description: Returns the active mover from the object list. Syntax: GetCurrentTarget(); Return: On success, this function returns the local target. On failure, it retur ns nil. Description: Returns the local target unit from the object list. If the player does not have a target, this function fails (nil). Syntax: GetCorpseLocation(); Return: On success, this function returns the local corpse location (X, Y, Z). O n failure, it returns nil. Description: Returns the local corpse location. If the player is not a ghost, this function fails (nil). Syntax: GetObjectListEntry( Index ); Return: On success, this function returns the object. On failure, it returns nil . Description: Returns the object, which is associated to the specified index.

Syntax: GetObjectListEntryCount(); Return: This function returns the number of objects in the object list. Description: This function may be used to iterate over all objects.

>===============================================< | Object | >===============================================< * Can be accessed through the "Object" library. * Example: Object:IsValid(); Syntax: Object:IsValid(); Return: This function returns, whether the specified object is still valid (in o ur Object Manager). Description: Returns, whether the specified object is valid. Syntax: Object:GetGUID(); Return: On success, this function returns the specified unit's guid. On failure, it returns nil. Description: Returns the specified object's guid. Syntax: Object:GetPointer(); Return: On success, this function returns the object's pointer. On failure, it r eturns nil. Description: Returns the pointer of the specified object. May be used for memory editing reasons. Syntax: Object:GetDescriptor( Descriptor, "Type" ); Return: On success, this function returns the object's descriptor field. On fail ure, it returns nil. Description: Returns the content of the specified object's descriptor field. Syntax: Object:SetDescriptor( Descriptor, Value, "Type" ); Return: On success, this function returns true. On failure, it returns false. Description: Sets the content of the specified object's descriptor field. Syntax: Object:GetType(); Return: On success, this function returns the object's type. On failure, it retu rns nil. Description: Returns the object's type. 0 - Object, 1 - Item, 2 - Container, 3 - Unit, 4 - Player, 5 - GameObject, 6 - DynamicObject, 7 - Corpse, 8 - AiGroup, 9 - AreaTrigger Syntax: Object:GetLocation(); Return: On success, this function returns the object's location (X, Y, Z). On fa ilure, it returns nil. Description: Returns the specified object's location.

Syntax: Object:GetPitch(); Return: On success, this function returns the object's pitch. On failure, it ret urns nil. Description: Returns the specified object's pitch. Syntax: Object:GetRotation(); Return: On success, this function returns the object's rotation. On failure, it returns nil. Description: Returns the specified object's rotation. Syntax: Object:GetName(); Return: On success, this function returns the object's name. On failure, it retu rns nil. Description: Returns the specified object's name. Syntax: Object:IsActiveQuestGiver(); Return: Returns whether the object is a quest giver. Description: Returns whether the object is currently a quest giver. Syntax: Object:IsQuestGiver(); Return: Returns whether the object is a quest giver. Description: Returns whether the object is a quest giver at some stage. Syntax: Object:IsQuestObjective(); Return: Returns whether the object is a current quest objective. Description: Returns whether the object is currently an objective of an active q uest. Syntax: Object:SetTracked( Tracked ); Return: nil Description: Sets the specified object's tracking state. Tracked objects will be displayed on the minimap. Syntax: Object:GetTracked(); Return: On success, this function returns the specified object's tracking state. On failure, it returns nil. Description: This function returns, whether the specified object is currently tr acked.

>===============================================< | Unit (Object) | >===============================================< * Can be accessed through the "Object" library. * Example: Unit:IsValid(); Syntax: Unit:GetTarget(); Return: On success, this function returns the unit's target. On failure, it retu rns nil. Description: Returns the specified unit's target unit. If the unit does not have a target, this function fails (nil). Syntax: Unit:GetReaction( Unit ); Return: On success, this function returns the reaction between the specified uni ts. On failure, it returns nil. Description: Returns the unit's reaction. 0 - Hated,

1 2 3 4 5 6 7

Hostile, Unfriendly, Neutral, Friendly, Honored, Revered, Exalted

Syntax: Unit:GetCreatureRank(); Return: On success, this function returns the unit's creature rank. On failure, it returns nil. Description: Returns the specified unit's creature rank. 0 - Normal, 1 - Elite, 2 - RareElite, 3 - WorldBoss, 4 - Rare, 5 - Trivial Syntax: Unit:SetDisplayID( DisplayID ); Return: nil Description: Sets the specified display id for the given unit. If display id is 0, it will set it back. Syntax: Unit:GetDisplayID(); Return: On success, this function returns the specified unit's display id. On fa ilure, it returns nil. Description: Gets the specified unit's display id. Syntax: Unit:SetMountDisplayID( DisplayID ); Return: nil Description: Sets the specified mount display id for the given unit. If display id is 0, it will set it back. Syntax: Unit:GetMountDisplayID(); Return: On success, this function returns the specified unit's mount display id. On failure, it returns nil. Description: Gets the specified unit's mount display id.

################################################# # # # User Interface # # # ################################################# >===============================================< | Control Base Class | >===============================================< * All controls inherit these base class functions. Syntax: Control:Destroy(); Return: nil Description: Dispatches the use of the specified control. After this call, the control is invalid and has to be recreated for further use.

Syntax: Control:IsValid(); Return: Returns whether the specified control is valid. Description: Checks if the specified control is currently valid. Syntax: Control:GetVisible(); Return: On success, this function returns whether the specified control is curre ntly visible. On failure, it returns nil. Description: Returns the visibility of the specified control. Syntax: Control:SetVisible( Visible ); Return: nil Description: Sets the visibility of the specified control.

>===============================================< | Border | >===============================================< * Can be accessed through the "Border" library. * Example: Border.Create( SomeFrame, 10, 10, 50, 50, 3 ); Syntax: Border.Create( Frame, X, Y, [Width, Height, [Thickness, [Color]]] ); Return: On success, this function returns the border. On failure, it returns nil . Description: Creates a border control. The control is persistent as long as the parent frame is. Syntax: Border:GetPosition(); Return: On success, this function returns the specified border's position. On fa ilure, it returns nil. Description: Gets the specified border's position. Syntax: Border:SetPosition( X, Y ); Return: nil Description: Sets the specified border's position. Syntax: Border:GetThickness(); Return: On success, this function returns the specified border's thickness. On f ailure, it returns nil. Description: Gets the specified border's thickness. Syntax: Border:SetThickness( Thickness ); Return: nil Description: Sets the specified border's thickness. Syntax: Border:GetWidth(); Return: On success, this function returns the specified border's width. On failu re, it returns nil. Description: Gets the specified border's width. Syntax: Border:SetWidth( Width ); Return: nil Description: Sets the specified border's width. Syntax: Border:GetHeight(); Return: On success, this function returns the specified border's height. On fail ure, it returns nil.

Description: Gets the specified border's height. Syntax: Border:SetHeight( Height ); Return: nil Description: Sets the specified border's height. Syntax: Border:GetColor(); Return: On success, this function returns the specified border's color. On failu re, it returns nil. Description: Gets the specified border's color. Syntax: Border:SetColor( Color ); Return: nil Description: Sets the specified border's color.

>===============================================< | Button | >===============================================< * Can be accessed through the "Button" library. * Example: Button.Create( SomeFrame, "Button Text", 10, 10 ); Syntax: Button.Create( Frame, "Text", X, Y, [Width, Height, [Color, [ForeColor]] ] ); Return: On success, this function returns the button. On failure, it returns nil . Description: Creates a button control. The control is persistent as long as the parent frame is. Handlers: This control supports following handlers: "OnClick" - Gets called whenever the button is clicked. Syntax: Button:GetPosition(); Return: On success, this function returns the specified button's position. On fa ilure, it returns nil. Description: Gets the specified button's position. Syntax: Button:SetPosition( X, Y ); Return: nil Description: Sets the specified button's position. Syntax: Button:GetText(); Return: On success, this function returns the specified button's text. On failur e, it returns nil. Description: Returns the specified button's text. Syntax: Button:SetText( "Text" ); Return: nil Description: Sets the specified button's text. Syntax: Button:GetWidth(); Return: On success, this function returns the specified button's width. On failu re, it returns nil. Description: Gets the specified button's width. Syntax: Button:SetWidth( Width ); Return: nil Description: Sets the specified button's width.

Syntax: Button:GetHeight(); Return: On success, this function returns the specified button's height. On fail ure, it returns nil. Description: Gets the specified button's height. Syntax: Button:SetHeight( Height ); Return: nil Description: Sets the specified button's height. Syntax: Button:GetColor(); Return: On success, this function returns the specified button's color. On failu re, it returns nil. Description: Gets the specified button's color. Syntax: Button:SetColor( Color ); Return: nil Description: Sets the specified button's color. Syntax: Button:GetForeColor(); Return: On success, this function returns the specified button's fore color. On failure, it returns nil. Description: Gets the specified button's fore color. Syntax: Button:SetForeColor( Color ); Return: nil Description: Sets the specified button's fore color.

>===============================================< | CheckBox | >===============================================< * Can be accessed through the "CheckBox" library. * Example: CheckBox.Create( SomeFrame, "Checkbox Text", 10, 10, true ); Syntax: CheckBox.Create( Frame, "Text", X, Y, [Checked, [Color, [ForeColor]]] ); Return: On success, this function returns the checkbox. On failure, it returns n il. Description: Creates a checkbox control. The control is persistent as long as th e parent frame is. Handlers: This control supports following handlers: "OnClick" - Gets called whenever the checkbox is clicked. Syntax: CheckBox:GetPosition(); Return: On success, this function returns the specified checkbox's position. On failure, it returns nil. Description: Gets the specified checkbox's position. Syntax: CheckBox:SetPosition( X, Y ); Return: nil Description: Sets the specified checkbox's position. Syntax: CheckBox:GetText(); Return: On success, this function returns the specified checkbox's text. On fail ure, it returns nil. Description: Returns the specified checkbox's text.

Syntax: CheckBox:SetText( "Text" ); Return: nil Description: Sets the specified checkbox's text. Syntax: CheckBox:GetChecked(); Return: On success, this function returns the specified checkbox's checked state . On failure, it returns nil. Description: Gets the specified checkbox's checked state. Syntax: CheckBox:SetChecked( Checked ); Return: nil Description: Sets the specified checkbox's checked state. Syntax: CheckBox:GetColor(); Return: On success, this function returns the specified checkbox's color. On fai lure, it returns nil. Description: Gets the specified checkbox's color. Syntax: CheckBox:SetColor( Color ); Return: nil Description: Sets the specified checkbox's color. Syntax: CheckBox:GetForeColor(); Return: On success, this function returns the specified checkbox's fore color. O n failure, it returns nil. Description: Gets the specified checkbox's fore color. Syntax: CheckBox:SetForeColor( Color ); Return: nil Description: Sets the specified checkbox's fore color.

>===============================================< | Frame | >===============================================< * Can be accessed through the "Frame" library. * Example: Frame.Create( "Window Text", 150, 150, true, 0xFF00FF00 ); Syntax: Frame.Create( "WindowTitle", [Width, Height, [TopMost, [Color, [ForeColo r]]]] ); Return: On success, this function returns the frame. On failure, it returns nil. Description: Creates a GUI frame. The frame is persistent as long as the executi ng lua script is loaded. If TopMost is true, the frame will always be in front of all other windows. Syntax: Frame.CreateEmpty( "WindowTitle", [Width, Height, [TopMost]] ); Return: On success, this function returns the frame. On failure, it returns nil. Description: Creates an empty GUI frame. The frame is persistent as long as the executing lua script is loaded. If TopMost is true, the frame will always be in front of all other windows. Syntax: Frame:Destroy(); Return: nil Description: Dispatches the use of the specified frame and all of it's controls. After this call, the frame is invalid and has to be recreated for f

urther use. Syntax: Frame:IsValid(); Return: Returns whether the specified frame is valid. Description: Checks if the specified frame is currently valid. Syntax: Frame:GetVisible(); Return: On success, this function returns whether the specified frame is current ly visible. On failure, it returns nil. Description: Gets the visibility of the specified frame. Syntax: Frame:SetVisible( Visible ); Return: nil Description: Sets the visibility of the specified frame. Syntax: Frame:GetPosition(); Return: On success, this function returns the specified frame's position. On fai lure, it returns nil. Description: Gets the specified frame's position. Syntax: Frame:SetPosition( X, Y ); Return: nil Description: Sets the specified frame's position. Syntax: Frame:GetWidth(); Return: On success, this function returns the specified frame's width. On failur e, it returns nil. Description: Gets the specified frame's width. Syntax: Frame:SetWidth( Width ); Return: nil Description: Sets the specified frame's width. Syntax: Frame:GetHeight(); Return: On success, this function returns the specified frame's height. On failu re, it returns nil. Description: Gets the specified frame's height. Syntax: Frame:SetHeight( Height ); Return: nil Description: Sets the specified frame's height. Syntax: Frame:GetTopMost(); Return: On success, this function returns whether the specified frame is current ly top most. On failure, it returns nil. Description: Returns, whether the specified frame is currently in top most state . Syntax: Frame:SetTopMost( TopMost ); Return: nil Description: Sets the top most state of the specified frame.

>===============================================< | Label | >===============================================< * Can be accessed through the "Label" library. * Example: Label.Create( SomeFrame, "Label Text", 10, 10 );

Syntax: Label.Create( Frame, "Text", X, Y, [Bold, Italic, [Color]] ); Return: On success, this function returns the label. On failure, it returns nil. Description: Creates a label control. The control is persistent as long as the p arent frame is. Syntax: Label:GetPosition(); Return: On success, this function returns the specified label's position. On fai lure, it returns nil. Description: Gets the specified label's position. Syntax: Label:SetPosition( X, Y ); Return: nil Description: Sets the specified label's position. Syntax: Label:GetText(); Return: On success, this function returns the specified label's text. On failure , it returns nil. Description: Returns the specified label's text. Syntax: Label:SetText( "Text" ); Return: nil Description: Sets the specified label's text. Syntax: Label:GetColor(); Return: On success, this function returns the specified label's color. On failur e, it returns nil. Description: Gets the specified label's color. Syntax: Label:SetColor( Color ); Return: nil Description: Sets the specified label's color.

>===============================================< | Line | >===============================================< * Can be accessed through the "Line" library. * Example: Line.Create( SomeFrame, 10, 10, 100, 100, 5 ); Syntax: Line.Create( Frame, StartX, StartY, EndX, EndY, [Width, [Color]] ); Return: On success, this function returns the line. On failure, it returns nil. Description: Creates a line control. The control is persistent as long as the pa rent frame is. Syntax: Line:GetStartPosition(); Return: On success, this function returns the specified line's start. On failure , it returns nil. Description: Returns the specified line's start position (x1, y1). Syntax: Line:SetStartPosition( X, Y ); Return: nil Description: Sets the specified line's start position (x1, y1). Syntax: Line:GetEndPosition(); Return: On success, this function returns the specified line's end. On failure,

it returns nil. Description: Returns the specified line's end position (x2, y2). Syntax: Line:SetEndPosition( X, Y ); Return: nil Description: Sets the specified line's end position (x2, y2). Syntax: Line:GetWidth(); Return: On success, this function returns the specified line's width. On failure , it returns nil. Description: Gets the specified line's width. Syntax: Line:SetWidth( Width ); Return: nil Description: Sets the specified line's width. Syntax: Line:GetColor(); Return: On success, this function returns the specified line's color. On failure , it returns nil. Description: Gets the specified line's color. Syntax: Line:SetColor( Color ); Return: nil Description: Sets the specified line's color.

>===============================================< | ListBox | >===============================================< * Can be accessed through the "ListBox" library. * Example: ListBox.Create( SomeFrame, 10, 10, 100, 100 ); Syntax: ListBox.Create( Frame, X, Y, [Width, Height, [Color, [ForeColor]]] ); Return: On success, this function returns the listbox. On failure, it returns ni l. Description: Creates a listbox control. The control is persistent as long as the parent frame is. Handlers: This control supports following handlers: "OnSelectedIndexChanged" - Gets called whenever a new item gets sele cted. Syntax: ListBox:GetPosition(); Return: On success, this function returns the specified listbox's position. On f ailure, it returns nil. Description: Gets the specified listbox's position. Syntax: ListBox:SetPosition( X, Y ); Return: nil Description: Sets the specified listbox's position. Syntax: ListBox:GetWidth(); Return: On success, this function returns the specified listbox's width. On fail ure, it returns nil. Description: Gets the specified listbox's width. Syntax: ListBox:SetWidth( Width ); Return: nil

Description: Sets the specified listbox's width. Syntax: ListBox:GetHeight(); Return: On success, this function returns the specified listbox's height. On fai lure, it returns nil. Description: Gets the specified listbox's height. Syntax: ListBox:SetHeight( Height ); Return: nil Description: Sets the specified listbox's height. Syntax: ListBox:GetEntryCount(); Return: On success, this function returns the listbox's entry count. On failure, it returns nil. Description: Gets the listbox's entry count (number of items in the listbox - al so counts invisible entrys). Syntax: ListBox:GetSelectedItem(); Return: On success, this function returns the selected listbox entry. On failure , it returns nil. Description: Gets the selected listbox entry. Syntax: ListBox:GetSelectedIndex(); Return: On success, this function returns the selected listbox entry index. On f ailure, it returns nil. Description: Gets the selected listbox entry index. Syntax: ListBox:SelectItem( ListBoxEntry ); Return: nil Description: Selects the specified listbox entry. Syntax: ListBox:SelectIndex( Index ); Return: nil Description: Selects the specified listbox entry index. Syntax: ListBox:GetItemByIndex( Index ); Return: On success, this function returns the listbox entry. On failure, it retu rns nil. Description: Gets the specified listbox entry by it's index (top -> bottom). Syntax: ListBox:GetIndexByItem( ListBoxEntry ); Return: On success, this function returns the specified listbox entry's index. O n failure, it returns nil. Description: Gets the specified listbox entry's index (top -> bottom). Syntax: ListBox:ScrollTo( Index ); Return: nil Description: Scrolls the listbox to the given entry index. If Index is 0 it will scroll to the end of the listbox. Syntax: ListBox:GetColor(); Return: On success, this function returns the specified listbox's color. On fail ure, it returns nil. Description: Gets the specified listbox's color. Syntax: ListBox:SetColor( Color ); Return: nil Description: Sets the specified listbox's color. Syntax: ListBox:GetForeColor();

Return: On success, this function returns the specified listbox's fore color. On failure, it returns nil. Description: Gets the specified listbox's fore color. Syntax: ListBox:SetForeColor( Color ); Return: nil Description: Sets the specified listbox's fore color.

>===============================================< | ListBoxEntry | >===============================================< * Can be accessed through the "ListBoxEntry" library. * Example: ListBoxEntry.Create( SomeListBox, "ListBoxEntry Text", true ); Syntax: ListBoxEntry.Create( ListBox, "Text", [Centered, Highlighted, [InsertPos ition, [Color, [ForeColor]]]] ); Return: On success, this function returns the listbox entry. On failure, it retu rns nil. Description: Creates a listbox entry. The control is persistent as long as the p arent listbox is. If center is true, it will center the text relative to the listbox' s dimensions. Handlers: This control supports following handlers: "OnClick" - Gets called whenever the entry is clicked. "OnDoubleClick" - Gets called whenever the entry is double clicked. Syntax: ListBoxEntry:GetText(); Return: On success, this function returns the specified listbox entry's text. On failure, it returns nil. Description: Returns the specified listbox entry's text. Syntax: ListBoxEntry:SetText( "Text" ); Return: nil Description: Sets the specified listbox entry's text. Syntax: ListBoxEntry:GetCentered(); Return: On success, this function returns the specified listbox entry's centered state. On failure, it returns nil. Description: Gets the specified listbox entry's centered state. Syntax: ListBoxEntry:SetCentered( Centered ); Return: nil Description: Sets the specified listbox entry's centered state. Syntax: ListBoxEntry:GetHighlighted(); Return: On success, this function returns the specified listbox entry's highligh ted state. On failure, it returns nil. Description: Gets the specified listbox entry's highlighted state. Syntax: ListBoxEntry:SetHighlighted( Highlighted ); Return: nil Description: Sets the specified listbox entry's highlighted state. Syntax: ListBoxEntry:GetColor(); Return: On success, this function returns the specified listbox entry's color. O n failure, it returns nil.

Description: Gets the specified listbox entry's color. Syntax: ListBoxEntry:SetColor( Color ); Return: nil Description: Sets the specified listbox entry's color. Syntax: ListBoxEntry:GetForeColor(); Return: On success, this function returns the specified listbox entry's fore col or. On failure, it returns nil. Description: Gets the specified listbox entry's fore color. Syntax: ListBoxEntry:SetForeColor( Color ); Return: nil Description: Sets the specified listbox entry's fore color.

>===============================================< | Rectangle | >===============================================< * Can be accessed through the "Rectangle" library. * Example: Rectangle.Create( SomeFrame, 10, 10, 100, 20 ); Syntax: Rectangle.Create( Frame, X, Y, [Width, Height, [Color]] ); Return: On success, this function returns the rectangle. On failure, it returns nil. Description: Creates a rectangle control. The control is persistent as long as t he parent frame is. Syntax: Rectangle:GetPosition(); Return: On success, this function returns the specified rectangle's position. On failure, it returns nil. Description: Gets the specified rectangle's position. Syntax: Rectangle:SetPosition( X, Y ); Return: nil Description: Sets the specified rectangle's position. Syntax: Rectangle:GetWidth(); Return: On success, this function returns the specified rectangle's width. On fa ilure, it returns nil. Description: Gets the specified rectangle's width. Syntax: Rectangle:SetWidth( Width ); Return: nil Description: Sets the specified rectangle's width. Syntax: Rectangle:GetHeight(); Return: On success, this function returns the specified rectangle's height. On f ailure, it returns nil. Description: Gets the specified rectangle's height. Syntax: Rectangle:SetHeight( Height ); Return: nil Description: Sets the specified rectangle's height. Syntax: Rectangle:GetColor(); Return: On success, this function returns the specified rectangle's color. On fa

ilure, it returns nil. Description: Gets the specified rectangle's color. Syntax: Rectangle:SetColor( Color ); Return: nil Description: Sets the specified rectangle's color.

>===============================================< | TextBox | >===============================================< * Can be accessed through the "TextBox" library. * Example: TextBox.Create( SomeFrame, "TextBox Text", 10, 10, 100, 20, 5 ); Syntax: TextBox.Create( Frame, "Text", X, Y, [Width, Height, MaxLength, [Centere d, [Color, [ForeColor]]]] ); Return: On success, this function returns the textbox. On failure, it returns ni l. Description: Creates a textbox. The control is persistent as long as the parent listbox is. If center is true, it will center the text relative to the textbox' s dimensions. MaxLength specifies the maximum input length. Handlers: This control supports following handlers: "OnClick" - Gets called whenever the textbox is clicked. "OnFocus" - Gets called whenever the textbox is focused. "OnContentChanged" - Gets called whenever the textbox changes it's c ontent. "OnReturn" - Gets called whenever the user presses the enter key. Syntax: TextBox:GetPosition(); Return: On success, this function returns the specified textbox's position. On f ailure, it returns nil. Description: Gets the specified textbox's position. Syntax: TextBox:SetPosition( X, Y ); Return: nil Description: Sets the specified textbox's position. Syntax: TextBox:GetText(); Return: On success, this function returns the specified textbox's text. On failu re, it returns nil. Description: Returns the specified textbox's text. Syntax: TextBox:SetText( "Text" ); Return: nil Description: Sets the specified textbox's text. Syntax: TextBox:GetWidth(); Return: On success, this function returns the specified textbox's width. On fail ure, it returns nil. Description: Gets the specified textbox's width. Syntax: TextBox:SetWidth( Width ); Return: nil Description: Sets the specified textbox's width.

Syntax: TextBox:GetHeight(); Return: On success, this function returns the specified textbox's height. On fai lure, it returns nil. Description: Gets the specified textbox's height. Syntax: TextBox:SetHeight( Height ); Return: nil Description: Sets the specified textbox's height. Syntax: TextBox:GetMaxLength(); Return: On success, this function returns the specified textbox's max length. On failure, it returns nil. Description: Gets the specified textbox's max length. Syntax: TextBox:SetMaxLength( MaxLength ); Return: nil Description: Sets the specified textbox's max length. Syntax: TextBox:GetCentered(); Return: On success, this function returns the specified textbox's centered state . On failure, it returns nil. Description: Gets the specified textbox's centered state. Syntax: TextBox:SetCentered( Centered ); Return: nil Description: Sets the specified textbox's centered state. Syntax: TextBox:GetColor(); Return: On success, this function returns the specified textbox's color. On fail ure, it returns nil. Description: Gets the specified textbox's color. Syntax: TextBox:SetColor( Color ); Return: nil Description: Sets the specified textbox's color. Syntax: TextBox:GetForeColor(); Return: On success, this function returns the specified textbox's fore color. On failure, it returns nil. Description: Gets the specified textbox's fore color. Syntax: TextBox:SetForeColor( Color ); Return: nil Description: Sets the specified textbox's fore color. Syntax: TextBox:Focus(); Return: nil Description: Sets the current textbox into focused state.

################################################# # # # Drawing # # # ################################################# >===============================================< | D3D |

>===============================================< * Can be accessed through the "D3D" library. * Example: D3D.GetScreenCoordinates( 0, 0, 0 ); * Reference: http://www.wow-plus.net/forums/showthread.php?151 Syntax: GetScreenCoordinates( X, Y, Z ); Return: On success, this function returns the screen coordinates. On failure, or screen coordinates off-screen, it returns nil. Description: Gets the 2D screen coordinates of a 3D world location. Syntax: GetScreenResolution(); Return: On success, this function returns the screen resolution. On failure, it returns nil. Description: Gets the resolution of the WoW window. Syntax: SetMouseText( "Text", [Color] ); Return: nil Description: Displays text that will follow the user's mouse. Syntax: ClearMouseText(); Return: nil Description: Clears the text that is following the user's mouse. Syntax: TraceLine( X1, Y1, Z1, X2, Y2, Z2, [Flags] ); Return: This function returns the location where collision occurred. If no colli sion is detected, it returns nil. Description: Traces a line in the 3D world and checks for collision. >===============================================< | D3DObject Base Class | >===============================================< * All D3DObjects inherit these base class functions. Syntax: D3DObject:Destroy(); Return: nil Description: Dispatches the use of the specified D3D object. After this call, the object is invalid and has to be recreated for further use. Syntax: D3DObject:IsValid(); Return: Returns whether the specified D3D object is valid. Description: Checks if the specified D3D object is currently valid. Syntax: D3DObject:GetVisible(); Return: On success, this function returns whether the specified D3D object is cu rrently visible. On failure, it returns nil. Description: Returns the visibility of the specified D3D object. Syntax: D3DObject:SetVisible( Visible ); Return: nil Description: Sets the visibility of the specified D3D object.

>===============================================<

| Box | >===============================================< * Can be accessed through the "Box" library. * Example: Box.Create( 10, 10, 50, 50 ); Syntax: Box.Create( X, Y, Width, Height, [Color, [ForeColor, [BorderWidth]]] ); Return: On success, this function returns the box. On failure, it returns nil. Description: Creates a 2D box. The object is persistent as long as the script is . Syntax: Box:GetPosition(); Return: On success, this function returns the specified box's position. On failu re, it returns nil. Description: Gets the specified box's position. Syntax: Box:SetPosition( X, Y ); Return: nil Description: Sets the specified box's position. Syntax: Box:GetWidth(); Return: On success, this function returns the specified box's width. On failure, it returns nil. Description: Gets the specified box's width. Syntax: Box:SetWidth( Width ); Return: nil Description: Sets the specified box's width. Syntax: Box:GetHeight(); Return: On success, this function returns the specified box's height. On failure , it returns nil. Description: Gets the specified box's height. Syntax: Box:SetHeight( Height ); Return: nil Description: Sets the specified box's height. Syntax: Box:GetColor(); Return: On success, this function returns the specified box's color. On failure, it returns nil. Description: Gets the specified box's color. Syntax: Box:SetColor( Color ); Return: nil Description: Sets the specified box's color. Syntax: Box:GetForeColor(); Return: On success, this function returns the specified box's forecolor. On fail ure, it returns nil. Description: Gets the specified box's forecolor. Syntax: Box:SetForeColor( ForeColor ); Return: nil Description: Sets the specified box's forecolor. Syntax: Box:GetBorderWidth(); Return: On success, this function returns the specified box's borderwidth. On fa ilure, it returns nil.

Description: Gets the specified box's borderwidth. Syntax: Box:SetBorderWidth( BorderWidth ); Return: nil Description: Sets the specified box's borderwidth.

>===============================================< | Cube | >===============================================< * Can be accessed through the "Cube" library. * Example: Cube.Create( 10, 10, 10, 50, 50, 50 ); Syntax: Cube.Create( X, Y, Z, Width, Depth, Height, [DepthCollision, [Color, [Fo reColor, [BorderWidth]]]] ); Return: On success, this function returns the cube. On failure, it returns nil. Description: Creates a 3D cube. The object is persistent as long as the script i s. Syntax: Cube:GetPosition(); Return: On success, this function returns the specified cube's position. On fail ure, it returns nil. Description: Gets the specified cube's position. Syntax: Cube:SetPosition( X, Y, Z ); Return: nil Description: Sets the specified cube's position. Syntax: Cube:GetWidth(); Return: On success, this function returns the specified cube's width. On failure , it returns nil. Description: Gets the specified cube's width. Syntax: Cube:SetWidth( Width ); Return: nil Description: Sets the specified cube's width. Syntax: Cube:GetDepth(); Return: On success, this function returns the specified cube's depth. On failure , it returns nil. Description: Gets the specified cube's depth. Syntax: Cube:SetDepth( Depth ); Return: nil Description: Sets the specified cube's depth. Syntax: Cube:GetHeight(); Return: On success, this function returns the specified cube's height. On failur e, it returns nil. Description: Gets the specified cube's height. Syntax: Cube:SetHeight( Height ); Return: nil Description: Sets the specified cube's height. Syntax: Cube:GetDepthCollision(); Return: On success, this function returns the specified cube's depth collison st

ate. On failure, it returns nil. Description: Gets the specified cube's depth collision state. Syntax: Cube:SetDepthCollision( DepthCollision ); Return: nil Description: Sets the specified cube's depth collision state. Syntax: Cube:GetColor(); Return: On success, this function returns the specified cube's color. On failure , it returns nil. Description: Gets the specified cube's color. Syntax: Cube:SetColor( Color ); Return: nil Description: Sets the specified cube's color. Syntax: Cube:GetForeColor(); Return: On success, this function returns the specified cube's forecolor. On fai lure, it returns nil. Description: Gets the specified cube's forecolor. Syntax: Cube:SetForeColor( ForeColor ); Return: nil Description: Sets the specified cube's forecolor. Syntax: Cube:GetBorderWidth(); Return: On success, this function returns the specified cube's borderwidth. On f ailure, it returns nil. Description: Gets the specified cube's borderwidth. Syntax: Cube:SetBorderWidth( BorderWidth ); Return: nil Description: Sets the specified cube's borderwidth.

Вам также может понравиться