Any alternative to d()?
Is there a similar command that works like d()?
|
If you mean a command that add some text to chat window, then there is CHAT_SYSTEM:AddMessage()
|
Yep, thanks!
|
A handy way for formatted print to screen with a default color; sort of C "printf()" style.
Lua Code:
With the pcall() to the wrapper it will catch string.format() errors and point to the exact "p()" call where it happened (like accidentally passing a "nil" value for example). With out this setup it you'll only see the context on/inside the "p()" call it's self. Example usage: Lua Code:
You could add more variations of course. Like pass a color argument instead of a default color "local function p(color, ...)", etc. |
Every time you call your P() function, you create a new instance of your w() function.
|
Quote:
|
Quote:
CHAT_SYSTEM["containers"][1]["currentBuffer"]:AddMessage('message here') It, of course, won't work until after PLAYER_ACTIVATED is fired off, so that won't work if you are just trying to get debug info but is great for outputting stuff for the user. ~Zolan |
Or just
Lua Code:
|
Just in case this might help someone else out.. If you know the container and tab that you want to output to you can do this:
By default there is only one container, though I think there may be addons that make other containers: Lua Code:
And the tabs seem to be numbered from left to right so the second tab would be 2: Lua Code:
Using those you can output 'Ta daaaaaaa' to the first container on the 2nd tab using the following: Lua Code:
I'd be glad to know if someone comes up with a better solution than this. :) ~Zolan |
Quote:
|
But Zolan's second post is for if you want to write to a tab other than the default/1st.
|
Quote:
|
Quote:
|
Quote:
|
So, another question about d() then.
I looked around but wasn't able to find that post again, which kinda explained how d() works. Which is faster? Adding a message through CHAT_SYSTEM directly, or d() is just a shortcut for it (no difference in between, so to speak)? Even 1 nano-second win is important for me :P |
It depends on what you want printed to chat.
This is the d() function: Lua Code:
If all you want to print is simple text, then just use CHAT_SYSTEM:AddMessage("text"). Granted, you shouldn't be looking for 1 nanosecond optimizations. :p Good coding practices aside, only worry about optimizing when doing heavy calculations or frequent updates. |
True, true, but still :)
|
Quote:
Edit: I Added the whole "how do I output to the chat" thing to the quick questions: http://wiki.esoui.com/AddOn_Quick_Qu...to_the_chat.3F |
Quote:
as in implementing buffers - I'm planning to write distinct debugging methods with filters next (as suggested). Edit: Fixed it in 1.0 - R9- thanks Seerah for the provided info. Cheers! |
All times are GMT -6. The time now is 02:07 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI