Get an Epic Experience with Premium

Lua Browser

Development Tools Login to Add Favorites
  • 3 Likes
  • World of Warcraft
  • 44 Monthly Downloads
  • Supports: 4.0.1
  • 2,936 Total Downloads
  • Updated 11/10/2010
  • Created 02/27/2010
  • 12 Favorites
  • Project Site
  • Comments
  • Release Type: Inactive
  • License: All Rights Reserved
  • Newest File: 10.11.10
or
Support development! **
Donate

About Lua Browser

Description


Using Lua Browser allows you to easily browse through the Lua environment, tables, widgets and other values.
This can be quite useful when developing addons.

The currently browsed root will have a reference in the global variable "lbRoot", this makes it easier to manipulate it using /run scripts and the likes.

Please note this is an advanced tool, do not use this unless you know what you are doing.

Controls


The Left click action depends on which item is under the mouse.
Tables and Widgets will be opened like a folder in normal file browsing. Hold down shift to try and open any possible metatables this table might have.
For functions, the function will be called, if you hold down shift, it will be called with "self" as the first parameter.

Right clicking will go back in history, to the previous browsed table.
If you hold down shift while right clicking, the key will be deleted!

You can link things into the chat editbox like normally. Open up the chat editbox, hold down shift and click an item.

Slash Commands


The slash command for Lua Browser is "/lb". Below are the valid parameters.

/lb filter <word>
You can use this to filter out what is shown, very useful in _G.

/lb code <code>
Executes the code and browses the result. If the result is not a table, you should add curly brackets like this: "{ <code> }".

/lb codemeta <code>
Works exactly like the "/lb code" slash command, but will browse the metatable of the code.

/lb mouse
Sometimes frames are unnamed, and the easiest way to get to them is through GetMouseFocus().

/lb mousemeta
Allows you to browse the meta table of the widget under the mouse.

Lua Browser Changes | 2010 Nov 10
- Changed the TOC version to 40000 for the 4.0.1 pre Cataclysm patch.
- Added a "/lb codemeta" slash command. This works exactly like the "/lb code" slash command, but will return the metatable of the code.
- Added "/luabrowser" as an alternative, to the already existing "/lb" slash command.
- Filters now searches the value of strings and numbers for a match.
- If the currently browsed root is a frame, and that frame has a name, it will now be display in the top right.

Lua Browser Changes | 2010 Jun 28
- Corrected the error that could happen when clicking on an item, which was introduced with the latest "ChatFrameEditBox" fix.

Lua Browser Changes | 2010 Jun 27
- Fixed the ChatFrameEditBox issues.

Lua Browser Changes | 2010 Feb 27
- Changed the TOC version to 30300 for the 3.3 patch.

Lua Browser Changes | 2009 May 18
- Changed the TOC version to 30100 for the 3.1 patch.
- If you move the mouse over the window showing the address of the current root, it will show a tip with how many of each data type is in this table.
- Filter settings are now saved per root, instead of a global setting, this should make browsing back and forth from _G a lot more pleasent.
- Did a few code optimisations.

Lua Browser Changes | 2009 Apr 07
- Fixed a bug that caused not all keys in a table to be shown.

Lua Browser Changes | 2009 Apr 06
- Now sets the global variables "lbRoot" to the current browsed table. This is done so you can easily work with the table in a custom script using "/run" or similar.
- Some other issues related to showing tables with metatables, is now fixed by using rawget() everywhere instead of normal table access.
- Removed some global pollution from the sort function.
- Now shows the current table address next to the close button.
- If a table had a metatable with an "index" function, which would return a value or give an error when accessing table[0], Lua Brower were not able to detect widget objects. This problem has been resolved by testing existence with rawget().
- Fixed an error if a table key was anything but a string or number.
- If you hold down shift when selecting a type filter, it will be selected exclusivly.
- Added the slash command "/lb mousemeta", allows you to browse the meta table of the widget under the mouse.
- Removed the global slash command "/lb global <key>", use "/lb code <code>" instead.

Comments

First Previous Page 1 of 2 Next Last
  • #14

    Awesome addon.  Thanks for the great help you've provided as I create and improve my addons!

    Author of Bitten's SpellFlash.

  • #15

    Thanks! It's nice to know this tool has been useful to others as well :)

  • #12
    Exceptionally useful tool, cool design too!! Thanks for making it, it sped up my addon development a lot.

    The only additional features I might think of here are:
    - adding some kind of direction bar on top of the frame so I can check where am I quickly or maybe even click one of the parent tables on that bar to return quickly few levels up instead of right clicking my way through all of them. My addon's main frame is currently called "mf" so something like "you're inside _G.mf.unit.["0xF13079AA00005850"] would be great
    - adding autorefresh feature to update the table key/value listing currently displayed at given intervals (as long as you're not currently watching _G I guess), something like /lb refresh 5 - refresh every 5 seconds. Set to 0 to disable

  • #11
    [codegreen]
    Nice to hear my work has helped others :)

    [orgevo]
    Thanks for the feedback, will think of something to make it a little more user friendly.
  • #10
    I'd really like to see a tooltip or info panel, something along those lines, that allows you to quickly & easily see what the commands & mouse buttons do.
    Maybe it was too many drugs when I was young, or something, but I find myself often having to tab out and check the readme or head back to the website because I can't recall which button I'm supposed to press to call a function and which I'm supposed to press to delete data. Not exactly the tasks you want to mix up, lol...

    In my opinion, it's the only thing missing from this awesome tool. And since your users are all developers (I'd imagine), well, we don't even care if it looks pretty! Just give us a black box with white text on the lower right of the screen that I can't move or resize and it randomly clips my cursor back to my desktop - whatever! At least I'll be able to remember what the buttons do :D
  • #9
    This add on saved me!!! Thanks a ton! If i get my addon up on curse I will give you credit!
  • #7
    [OmniusPrime]
    There actually used to be a root parameter, but I removed it since it was redundant when you can do "/lb code _G".
  • #8
    Oh, OK. Wouldn't have thought of that from the description of the "code" parameter - it sounded more like a /run equivalent or something. Thanks ...
  • #17

    4 years late, and I don't even know if this addon still works, but if it does, maybe this will help someone! When the description says "executes the code and displays the result", it just means that any expression needs to be evaluated before it is displayed. For example, if you /code {2+3} it should display 5 - the code was executed. For a table that is already in memory, "executing it" simply returns the table itself, which is exactly what you want to browse. I would guess the command is phrased that way to emphasize that any FUNCTION you input will be executed in order to have its RESULTS browsed.

  • #5
    [OmniusPrime]
    Thank for you finding out the cause of this issue. One of the problems was also that I checked for the window being visible, before checking for shift being pressed.
    To search for something specific, you can use the "/lb filter", but things are often a little hard to find, as a lot of stuff don't actually have a global name.
  • #13
    I have one question, because /lb filter always seems to nearly kill my client. Is there a way (if you opened the browse window with /lb) to only "search" through the current level/table?
  • #6
    You're welcome 8^). I just tried the filter thing and it did what I wanted. I've also noticed that if I've used a parameterized /lb the next time I do just /lb it gives me the same output, so I added a "root" parameter that shows _G just like if it was the first time since login. Don't know if it's going to be that useful yet but ... 8^).
  • #3
    Just downloaded the new version. Put the mouse over any screen object (ie minimap,buttonbar, etc), type /lb mouse, window opens. Left-click on anything in the window produces a Lua error "attempt to index a nil value" in core.lua line 174. No other non-Blizzard addons loaded.
  • #4
    The following change in core.lua will correct the error:

    -- link value
    local activeWindow = ChatEdit_GetActiveWindow();
    if (activeWindow and activeWindow:IsVisible()) and (IsShiftKeyDown()) then
    activeWindow:Insert(self.key.." = "..tostring(v));
    -- table

    Looks like this will be very useful for debugging an addon I want to write - though I might try and see how a search function might be implemented to make finding what I want to look at easier, unless I can figure out what part of the frame the mouse has to be over to put the frame root in the box ...
  • #2
    Very nice for addon dev.

    Curse.com volounteer Moderator

  • To post a comment, please login or register a new account.
Login to Curse

Don't have an account? Create One.

Get an epic experience with Curse Premium
  • Faster addon downloads
  • Premium-Only Beta Giveaways
  • Ad-Free Curse experience
  • Premium Curse Client
  • and many More Features
  • Learn More »

Landmark Beta Key Giveaway!

Get My Code!