Download
(6Kb)
Download
Updated: 12-08-20 11:49 PM
Pictures
File Info
Compatibility:
Shadowlands patch (9.0.2)
Shadowlands pre-patch (9.0.1)
Visions of N'Zoth (8.3.0)
Updated:12-08-20 11:49 PM
Created:07-07-14 01:59 PM
Downloads:2,383
Favorites:11
MD5:

Output

Version: 1.0.6
by: Vrul [More]

Provides an API and slash commands for outputting variable information to chat. The information is presented in the following format: index type value name

index - an integer starting with one and incrementing for each new line

type - the return of type(variable), or the return of variable:GetObjectType() if applicable

value - the return of tostring(variable) (functions, tables, threads, and userdata the return is truncated so that "table: 0000B6D0" is instead "B6D0")

name - the global name for the variable if one exists (for functions, tables, threads, and userdata only). If the variable is a table and has a GetName method then the name will be colored yellow if _G[variable:GetName()] == variable or red otherwise

The formatted output is also preceded and trailed by blank lines as needed to help make reading multiple different output calls easier.


API

output(...)

Output variable information as described above.

Arguments:

... - (any) Variables to have their information output.

output.chatFrame = variable

Change which chat frame output is directed to.

Arguments:
variable - (number or nil) The index of the desired chat frame, a value of 0 or nil will use DEFAULT_CHAT_FRAME.
(string) The name of the desired chat frame
(table) The chat frame object to use

output.header(...)

Similar to print(...) but will add a blank line before outputting if needed and will not result in a blank line between it and any output calls that immediately follow.

Arguments:
... - (any) The information to be output.

output.ipairs(variable)

Output information for the array portion of a table.

Arguments:
variable - (table) Table to have its array contents output.

output.metatable(variable)

Syntactic sugar for output(getmetatable(variable)) or output.pairs(getmetatable(variable)) or output.pairs(getmetatable(variable).__index) as appropriate.

Arguments:
variable - (any) The variable whose metatable information should be output.

output.pairs(variable)

Output information for each key - value pair contained in a table.

Arguments:
variable - (table) Table to have its contents output.

output.parse(variable)

Syntactic sugar for output(SecureCmdOptionParse(variable)).

Arguments:
variable - (string) The parameters to be parsed.

output.print(...)

Similar to print(...) but will output to output.chatFrame instead. This function will not automatically add preceding and trailing blank lines like the other functions do.

Arguments:
... - (any) The information to be output.

Slash Commands

/print ... - Same as /run output.print(...)

/out ... - Same as /run output(...)

/output ... - Same as /run output(...)

/ipairs ... - Same as /run output.ipairs(...)

/pairs ... - Same as /run output.pairs(...)

/parse ... - Same as /run output.parse(...)

/metatable ... - Same as /run outpu*****tatable(...)

Version 1.0.6 (12/08/2020)
- Removed !Output_Search specific code
- Moved some code to a library to share with !Output_Search

Version 1.0.5 (10/15/2020)
- TOC bump for 9.0

Version 1.0.4 (06/09/2018)
- TOC bump for 8.0

Version 1.0.3 (07/18/2016)
- Internal resolution of strings altered to return the string instead of _G[string]

Version 1.0.2 (07/09/2016)
- Cleaned up look of string results
- Added support for !Output_Search

Version 1.0.1 (10/14/2014)
- TOC bump for 6.0

Version 1.0 (07/07/2014)
- Initial release
Optional Files (0)


Post A Reply Comment Options
Unread 07-10-16, 07:25 PM  
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view AddOns

Forum posts: 404
File comments: 322
Uploads: 33
Re: Libraries?

Originally Posted by myrroddin
With this, can you output library or AddOn API, or exclusively Blizzard API?
You can use output.chatFrame to assign a different ScrollingMessageFrame to be output to. Or you could make something that emulates a ScrollingMessageFrame (need methods: AddMessage, GetMaxLines, and GetMessageInfo) and use the AddMessage method to capture the output for outside use.
Report comment to moderator  
Reply With Quote
Unread 07-09-16, 04:55 PM  
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1240
File comments: 226
Uploads: 21
Libraries?

With this, can you output library or AddOn API, or exclusively Blizzard API?
Report comment to moderator  
Reply With Quote
Unread 07-07-14, 04:32 PM  
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view AddOns

Forum posts: 5892
File comments: 327
Uploads: 28
Sounds useful but what will the output look like ?
Perhaps some screenshots of examples.
__________________

[SIGPIC][/SIGPIC]
Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: