Go Back   WowAce Forums > Official Addon Threads > General AddOns
General AddOns Authors, post your release ready addons here to get feedback or just to let everyone know about it.

Reply
 
Thread Tools
Old 11-04-2008   #1
Wintrow2
Full Member
 
Wintrow2's Avatar
 
Join Date: Oct 2008
Location: Wevelgem, BE
Posts: 136
Default LibMindReader

http://www.wowace.com/projects/mindreader/

LibMindReader is a mixin library (can also run 'not mixed in') that generates an AceConfigDialog-table from a variable. Running this table then allows the user to peek, poke and prod the variable in the following ways:

- The table structure is shown as a tree. Efforts have been done do avoid recursiveness due to tables linking each other.

- Selecting a table node in the tree shows an input box where the user can input some code and execute it as a method of that node.

- Selecting a number or a string shows an input box where the value can be viewed and edited. Editing is not available if the number or string is not a member of a known table.

- Selecting a function shows an execute button to execute the function. An inputbox is also provided to type in code to generate parameters for the call.

Because the parameters of a function can not be determined from within Lua the addon being debugged can provide LibMindReader with a tip through calling of :AddFtionTip(func, paramstring, ismethod) or :AddFtionTips(tiptable).

When building the AceConfig-node for the function LibMindReader will use paramstring to help the user.

The builds can be managed using a standalone addon called MindBrowser (not yet created)

See also http://www.wowace.com/projects/mindreader/pages/usage/
__________________
The end of BeneCast
Or is it?
Loving SVN
Wintrow2 is offline   Reply With Quote
Old 11-06-2008   #2
Arrowmaster
Hero Member
 
Join Date: Apr 2006
Posts: 807
Default Re: LibMindReader

I fail to see the purpose of this. Libraries should not be written if nobody is going to use them. Useless libraries will have to answer to my wrath eventually. Libraries that don't follow the same short project naming convention as the rest of the libraries will also have to answer to my wrath. And you used WowAddonStudio, you can't really get much more fail than that. I need a 'move to curseforge' moderator option.
Arrowmaster is offline   Reply With Quote
Old 11-06-2008   #3
OrionShock
Legendary Member
 
OrionShock's Avatar
 
Join Date: May 2006
Location: Arizona
Posts: 3,500
Default Re: LibMindReader

Arrowmaster, things like this are useful for debugging weird shit IMO, i've had several instances where this sort of thing would have been useful to find out why a function isn't working properly or where things are in following a "what is self in this context" problem. Tho i got by with /dump, this would have been prefered.
__________________
Author of GuildCraft, SickOfClickingDailies, and CursorCooldown

"I was there in the beginning... and things were very different back then" --An Echo from a time before.
OrionShock is offline   Reply With Quote
Old 11-06-2008   #4
Arrowmaster
Hero Member
 
Join Date: Apr 2006
Posts: 807
Default Re: LibMindReader

Is that the purpose of this? That's nothing like what the post or description describe it as from what I could tell.
Arrowmaster is offline   Reply With Quote
Old 11-06-2008   #5
Phanx
Seal Cub Clubbing Club
 
Phanx's Avatar
 
Join Date: May 2005
Posts: 5,576
Send a message via AIM to Phanx Send a message via MSN to Phanx Send a message via Yahoo to Phanx
Default Re: LibMindReader

Quote:
Originally Posted by Wintrow2 View Post
Because the parameters of a function can not be determined from within Lua the addon being debugged can provide LibMindReader with a tip through calling of :AddFtionTip(func, paramstring, ismethod) or :AddFtionTips(tiptable).
So... this is basically something you expect addon authors to spend extra time and effort writing extra code to support only to avoid having to remember what other functions they wrote and what those do? That's what I'm getting from your description and the example on your project page...
Phanx is offline   Reply With Quote
Old 11-06-2008   #6
sylvanaar
Legendary Member
 
Join Date: Nov 2006
Posts: 2,674
Default Re: LibMindReader

How about making tabcompletion work on tables

/print Prat.<tab through fields>

That'd be spiffy.
sylvanaar is offline   Reply With Quote
Old 11-06-2008   #7
Wintrow2
Full Member
 
Wintrow2's Avatar
 
Join Date: Oct 2008
Location: Wevelgem, BE
Posts: 136
Default Re: LibMindReader

Quote:
Originally Posted by Phanx View Post
So... this is basically something you expect addon authors to spend extra time and effort writing extra code to support only to avoid having to remember what other functions they wrote and what those do? That's what I'm getting from your description and the example on your project page...
Phanx, your worry is understandable, but anticipated:
1. you don't HAVE to do function tips. They just ease the debugging process by helping the addon dev remember what parameters a certain function/method needs.
2. The accompanying MindBrowser addon which I will write once BeneCast 10 is done will have the posibility of you pasting your whole source file in an editbox and MindBrowser will add function tips FOR YOU and spit it out in another editbox. How's that for convenience?

Quote:
Originally Posted by Arrowmaster View Post
Is that the purpose of this? That's nothing like what the post or description describe it as from what I could tell.
Arrowmaster, I don't understand this sentence. But I can tell you this, as OrionShock mentioned, this is a developers tool (which is why it's in the "Development Tools" category.

It lets the developer inspect a variable without awkward slash commands.

I find it hard to believe ANY developer NOT wanting this library (still, it could happen ).

Quote:
Originally Posted by sylvanaar View Post
How about making tabcompletion work on tables

/print Prat.<tab through fields>

That'd be spiffy.
That'd be a great addon as well. Sounds more like a suggestion for chatframe addons though. My backlog of "addons I'd like to code" is already clogged with:
- Finishing BeneCast 10
- Making MindBrowser (manage MindReader-builds and aid in generating function tips)
- Making BreadCrumbs (same lib+addon style development tool to be able to go back in a callstack and see the value of certain variables, using MindReader off course to visualize it)
- Maybe make a RDBMS-library for WoW. Reception in the "Addon Ideas" forum wasn't great though.
- Adding a "table printer' (name needs work ) with tab-completion will either be at the end or after MindBrowser depending on how I feel my knowledge of the chatframe is.
__________________
The end of BeneCast
Or is it?
Loving SVN

Last edited by Wintrow2; 11-06-2008 at 09:07 AM.
Wintrow2 is offline   Reply With Quote
Old 11-06-2008   #8
Xinhuan
Asian Sheep Lover
 
Xinhuan's Avatar
 
Join Date: Aug 2007
Location: Singapore
Posts: 3,556
Default Re: LibMindReader

Quote:
Originally Posted by Wintrow2 View Post
Arrowmaster, I don't understand this sentence. But I can tell you this, as OrionShock mentioned, this is a developers tool (which is why it's in the "Development Tools" category.

It lets the developer inspect a variable without awkward slash commands.

I find it hard to believe ANY developer NOT wanting this library (still, it could happen ).
While I am not opposed to developer tools, I personally find this library unneeded for any of the 12 or so addons in my development. /print and /run are more than enough sufficient tools for me.
__________________
Author/Maintainer of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, Routes, HandyNotes and some others.
Xinhuan is offline   Reply With Quote
Old 11-06-2008   #9
Phanx
Seal Cub Clubbing Club
 
Phanx's Avatar
 
Join Date: May 2005
Posts: 5,576
Send a message via AIM to Phanx Send a message via MSN to Phanx Send a message via Yahoo to Phanx
Default Re: LibMindReader

Quote:
Originally Posted by Wintrow2 View Post
I find it hard to believe ANY developer NOT wanting this library (still, it could happen ).
Consider the following code:

Code:
local link
local function filter(msg)
	link = msg:match("|Hitem:(%d+):") or msg:match("|H(%a+):") -- msg:match("|H([sqe][pun][ec][lsh][lta]n?t?):")
	if link and db.item[link] or db[link] then
		return true
	end
end

ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", filter)
ChatFrame_AddMessageEventFilter("CHAT_MSG_SAY", filter)
ChatFrame_AddMessageEventFilter("CHAT_MSG_YELL", filter)
ChatFrame_AddMessageEventFilter("CHAT_MSG_TEXT_EMOTE", filter)
That is the functional core of my addon Unlinked; the remainder of its 4kb code centers around a few simple toggle configuration options. Do you honestly find it so impossible to believe that I see no use for your debugging library here? If so, I suggest you work on broadening your horizons of belief. Even in my larger addons, I can tell you with complete certainty that I have never had any difficulty remembering, or ascertaining very quickly from reading my code, what the functions I wrote do, what functions they call, or what functions call them. There are already much simpler tools to accomplish what you're doing here. If it helps you, great, but don't expect that everyone else shares your narrow view of possibility.
Phanx is offline   Reply With Quote
Old 11-06-2008   #10
Wintrow2
Full Member
 
Wintrow2's Avatar
 
Join Date: Oct 2008
Location: Wevelgem, BE
Posts: 136
Default Re: LibMindReader

I would blame my narrow view of disbelief upon the, apparently incorrect, assumption that people were blessed with the same faulty memory my brain is equipped with. As such I assumed (another nono of course) that this Lib would be widely accepted, praised and I would be welcomed into the WoWAce pantheon of dev-gods.

Now, with my dreams shattered, I am alone instead of many. Cast down from my fantasy into the barren truth of reality. I suppose I have to thank you, Arrowmaster and Phanx, for this.

Yet, this is not the first time this has happened. And according to Battlestar Galactica (reimagined series of course) lore 'all this has happened before, and it will happen again'. See you in the official thread of my next crackpott idea.

All kidding aside:
Okay, so not ALL devs will use this. Even if only one other than me uses it it will have been worth posting it here. Please don't slag an idea because you personally don't see yourself using it.

Adding to that:
I am a pretty verbose developer. I write my code with the intention that I may forget what I wrote where or what a certain var meant. So I put it in places I expect myself to look and I name my variables very descriptive. Regex-expressions have always been very 'chinese' to me (although I do comprehend their power I do not master it).

With that I invite anyone to overview my code and point out:
- glaring mistakes
- extreme inefficiencies
- things that can be done by using a certain, pre-existing, library
advice like 'write t instead of tablevar' won't help though.
__________________
The end of BeneCast
Or is it?
Loving SVN

Last edited by Wintrow2; 11-06-2008 at 01:45 PM.
Wintrow2 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:04 PM.