Capnbry Logo "All the goodies an underclocked PR200 used to serve up."
spacer  ·  fez  ·  l337  ·  linus  ·  themoon  ·  chef  ·  capnbry.net  ·  ln9.net  ·  leoninedev.com  · 

Here you will find information and addons related to Blizzard's World of Warcraft MMOG. Older versions of my mods are available from here.

Add Ons
dumpitemcache.png Dump Item Cache
DumpItemCache.zip (22.2k) Monday, June 25th 2007 03:59 PM
Dumps sellvalues out of your itemcache.wdb. Used to create an initial 'SellValues' array for use in the SellValue addon. A good start for common loot prices. Fixed for client v1.8. Source included.

Screenshot 1
lua.png lua.txt
lua.txt (21.8k) Monday, June 25th 2007 03:59 PM
Syntax highlighting script for UltraEdit (originally provided by mrainey56 on the UltraEdit forums, then completed by me adding the WoW API functions). Includes lua, wow api, and xml ui highlighting.

Screenshot 1
sellvalue.jpg Sell Value
SellValue v45 (14.1k) Friday, September 28th 2007 01:39 PM
Remember the sell price for items when not at the merchant.

Screenshot 1
Screenshot 2
stancesets1.jpg Stance Sets
StanceSets v20 (6.4k) Thursday, May 24th 2007 02:08 PM
Builds on the WeaponQuickSwap addon by adding a panel where you can drag and drop weapon sets per stance / shape.

Screenshot 1
steadyclaw.jpg Steady Claw
SteadyClaw v9 (2.5k) Friday, September 28th 2007 01:39 PM
A macro helper for Hunter pets to to only use a spammable ability when a primary ability isn't about to be up.

Screenshot 1
wqs.jpg Weapon Quick Swap
WeaponQuickSwap v39 (9.3k) Thursday, May 24th 2007 02:03 PM
UI Addon to allow you to switch weapons quickly with a single keystroke.

Screenshot 1
usebyname.jpg Use By Name
UseByName v12 (2k) Monday, June 25th 2007 03:59 PM
Discontinued - Replaced in WoW 2.0: /use or /script UseItemByName()
Adds a /usebyname <item> command. Item is a case-insensitive substring match or a regex.

Screenshot 1
oppattacks.jpg Opportunistic Attacks
OpportunisticAttacks v13 (42.8k) Monday, June 25th 2007 03:59 PM
Discontinued - Can no longer conditionally cast from a macro in WoW 2.0
Use the first spell or style which is not in cooldown or unavailable. Eg: /script OppAttack("Riposte", "Sinister Strike)". Doesn't work all that well and I'm considering just dumping it because even I don't use it.

Screenshot 1
Utilities
wowtorrentex.gif WoW Torrent Extract
WoWTorrentEx v4 (32.6k) Tuesday, April 14th 2009 07:21 PM
Updated for WoW 3.1. Program to extract and launch the .torrent file out of the crappy Blizzard downloader (source included). Screenshot is Azureus

Screenshot 1
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:
  • Use a tooltip - If you use GameToolTip:GetBagItem(#,#) the tooltip will fill with the information about the item. You can then read the name of the item from GameToolTipTextLeft1. Of course, this makes the tooltip appear on the user's screen and could interfere with other controls which expect that they have control of the tooltip. You could subclass the tooltip frame and use this copy for your purpose (which I think is how Cosmos does it), but that seems like a bit of a hack. However, you can get the full item information in this way.
  • Use the item's linktext - This is the way that I like to do it. There is GetInventoryItemLink("player", slot) for items on your person, and GetContainerItemLink(bag, slot) for items in bags. The text you get back contains a slew of control codes for changing the color and providing an item ID used for the actual link, so you'll want to strip that off. I use a regex capture
        local _,_,name = string.find(linktext, "^.*%[(.*)%].*$");
          
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).
All material Copyright 2005 Bryan Mayland, except where otherwise noted.