Miscellaneous Game / Scripting Information |
Where do I grind at level X?
I've compiled a list from a bunch of sources here.
|
Can you compare various priest heals and tell me which one is best?
I used to work all this out on scraps of paper, then I upgraded to a text file, but
finally I made an OpenOffice spreadsheet (Excel 97 version)
listing all the level 70 spells, some talent choices and +healing config. Conclusion? I miss my Heal2!
|
How do I find out what's in a slot / inventory item?
There are two ways to do this that I can see:
The final function I use handles both bags and inventory:
function GetItemName(bag, slot)
local linktext = nil;
if (bag == -1) then
linktext = GetInventoryItemLink("player", slot);
else
linktext = GetContainerItemLink(bag, slot);
end
if linktext then
local _,_,name = string.find(linktext, "^.*%[(.*)%].*$");
return name;
else
return "";
end;
end;
|
How do I get my frames to arrange like the standard wow frames do
(sliding over from the left)?
The container (bag) frames have their own custom code which uses SetPoint
to adjust them relative to each other, but frames like the CharacterInfo
and Merchant use common functions from UIParent.lua.
To start with you'll need to add this in your initialization:
UIPanelWindows["MyFrameName"] = { area = "left", pushable = 5 };
area is left (most frames), middle (menu or if 2 left frames are open),
fullscreen (map), or doublewide (auction). pushable specifies the priority
of your window. If 2 other "left" windows are already open,
when a third frame opens, the one with the lowest priority
is closed.
Finally, you'll need to use ShowUIPanel(frame) and HideUIPanel(frame) instead
of frame:Show() / Hide();
|
What's the deal with the colon in LUA? Like TargetName:GetText().
Since lua doesn't really have objects (it has tables, which may contain both
variables and member functions) there are some unusual things it does to support
them. Like if I defined:
function Label.GetText()
return Label._mytext;
end
I could only have 1 label, or else the GetText function would have to be
defined in each instance of a label (there are ways around this, but it's
still a pain). To make it work, you'd conceptually do this:
function Label_GetText(self)
return self._mytext;
end
However LUA makes this easier by giving us the : operator, which implicitly
passes self as the first parameter (which is how C++/Object Pascal does it anyway)
function Label:GetText()
return self._mytext;
end
Labels we want to use descend from this "class" so they have the GetText(self)
method. (Technically they are "prototyped" by the Label definition above and
copy the declaration to themselves).
|
|