-------------------- "Unit "----------------------
"Partyn"
The Nth Party member excluding the player (1, 2, 3 or 4 ).
"Partypetn"
The pet of the nth Party member (N is 1, 2, 3, or 4) (Added in 1.5.0 ).
"Raidn"
The raid member with raidindex N (1, 2, 3,..., 40 ).
"Raidpetn"
The pet of the raid member with raidindex N (1, 2, 3,..., 40) (Added in 1.5.0)
-------------------- "Unit "----------------------
Unitaura ("unit", index or "buffname" [, filter])-returns information about a buff/debuff of a certain unit.
Unitbuff ("unit", index or "buffname" [, castable])-retrieves info about a buff of a certain unit.
Unitdebuff ("unit", index or "buffname" [, removable])-retrieves info about a debuff of a certain unit.
Getcombopoints ()-Get the current number of combo points.
Unithealth ("unit")-returns the current health, in points, of the specified unit.
Unithealthmax ("unit")-returns the maximum health, in points, of the specified unit.
Unitpower ("unit" [, type])-returns current power of the specified unit (replaces unitmana () as of wow 3.0.2)
Unitpowermax ("unit" [, type])-returns max power of the specified unit (replaces unitmanamax () as of wow 3.0.2)
Unitmana ("unit")-returns the current Mana (or energy, rage, etc), in points, of the specified unit. (Replaced by unitpower () as of wow 3.0.2)
Unitmanamax ("unit")-returns the maximum mana (or energy, rage, etc), in points, of the specified unit. (Replaced by unitpowermax () as of wow 3.0.2)
Getnumpartymembers ()-returns the number of other players in your party (0-4 ).
Getnumraidmembers ()-returns the number of players in your raid group.
Getspellcooldown (spellname | spellid, "booktype")-retrieves data on the cooldown of a specific spell.
Protected castspellbyname ("name" [, onself])-cast the specified spell by display name. as of patch 2.0, this function has been restricted to blizzard signed UI Mod. note: you can still use this function to open craft windows and activate lock picking.
Isspellinrange ("spellname", [unit])-is nil for no valid target, 0 for out of range, 1 for in range.
Protected targetunit ("unit")-selects the specified unit as the current target.
Hasfullcontrol ()
Hassoulstone ()
Isfalling ()-returns 1 if your character is currently plummeting to their doom.
Isflying ()-returns 1 if flying, otherwise nil.
Isflyablearea ()-returns 1 if it is possible to fly here, nil otherwise.
Isindoors ()-returns 1 if you are indoors, otherwise nil. Returns nil for indoor areas where you can still mount.
Ismounted ()-returns 1 if mounted, otherwise Nil
Isoutdoors ()-returns 1 if you are outdoors, otherwise nil. Returns 1 for indoor areas where you can still mount.
Isoutofbounds ()-returns 1 if you fell off the map.
Isresting ()-returns 1 if your character is currently resting.
Isstealthed ()-returns 1 If stealthed or shadowmeld, otherwise Nil
Isswimming ()-returns 1 if your character is currently swimming.
Tigers anger + 60 oblique (buff)
If anger <40 then
If cool (tigers anger) then
End
Castspellbyname ("name" [, onself ])
Else
Skew
End
-------------------------
If combo Points <> 5 then
Attack
Else
Terminator (target blood volume) DOT/kill
End
Val minimum lifecycle = 100%
Int member ID
Cyclic team members
{
If (no buff1)
{
If (minimum lifecycle of a member)
{
Member name = member name
}
}
}
Buff1 for "member name"
Power ^
> Print (13 ^ 2) 169
Modulo %
> Print (8% 3) 1
Equal =
Not equal ~ =
You can use the "=" operator to test whether a value is equivalent to nil.
And, break, do, else, elseif, for, function, if, in, local, nil, not, or, repeat, return, then, true, until, and while
Foo = 14
> X = "hello"
> Y = "azelas"
> Print (X.. Y)
----------------------
> X = tonumber ("1234 ")
If <Boolean expression> then
-- Statement Block
End
If <Boolean expression> then
-- Statement Block 1
Elseif <Boolean expression> then
-- Statement Block 2
Elseif <Boolean expression> then
-- Statement block 3
Else
-- Statement block 4
End
While <Boolean expression> do
-- Loop body
End
Repeat
---- Loop body
Until <Boolean expression>
For variable name = initial value, end value, step do
---- Loop body
End
Alice = {}
> Print (Alice ["name"])
Alice [1] = "Test Data"
Alice [1] = Nil
Returns the length of an array.
> TBL = {"A", "B", "C "}
> Print (# TBL)
3
The syntax of table. insert () is:
Table. insert (array, [subscript,] value)
The parameter meanings are as follows:
Array -- array of elements to be added
Subscript -- position of the added element
Value -- the value of this element
Value = table. Remove (array [, subscript])
Table. Sort ()
String. sub ()
Multiple return values in wow
B, c, d = converthextorgb ("ffffff ")
> TBL = {"apple", "banana", "Pear "}
> For index, value in ipairs (TBL) Do
> Print (index, value)
> End
1 Apple
2 bananas
3 pears
> TBL = {
> "Apple ",
> "Bananas ",
> "Li ",
> Width = 100,
> Height = 100,
>>}
> For key, value in pairs (TBL) Do
> Print (key, value)
> End
1 Apple
2 bananas
3 pears
The height is 100.
Width 100
Strsplit (SEP, STR)
> Print (strsplit (":", "foo: bar: blah "))
Foo bar blah,
5.18 create a comparison Function
If we directly use the table. Sort () function, it will report an error because it does not know how to sort the three objects in the guid:
> Table. Sort (guid)
Attempt to compare two table values
Stack traceback:
[C]: In function 'sort'
Stdin: 1: In main chunk
[C]:?
Therefore, we need to determine how to sort, that is, to write a comparison function. This function has two parameters, which are similar to any two objects in our table, in this function, we specify how to determine the object size. sort () knows how to sort tables:
> Sortlevel = function (a, B)
> Return a. level <B. Level
> End
Here we randomly specify the sorting by object level. A and B are any two objects in the guid table. We compared their level attributes in sortlevel, and return their comparison results, tabl. sort () can use this comparison result to complete sorting, as long as it is written as follows:
> Table. Sort (guid, sortlevel)
Then, use the for loop again to output:
> For key, value in pairs (guid) Do
> Print (key, value. Name)
> End
1. Mo Ran
2. Mo Ran's son
3. Mo Ran's wife
We can see that the objects in the table have changed the order.
Type description
Number)
All numbers (including hexadecimal numbers and those using scientific Notation) belong to this category.
String)
One Character Sequence
Boolean)
True and false
Function)
A function is a set of statements that can be called, as described in chapter 3rd.
Table)
A table is a mixture of traditional hash tables and arrays.
Thread)
The value of the thread type is a collaborative program that can be used for asynchronous computing (lightweight, limited thread)
User Data)
User Data is similar to the struct type in C language.