|
04/23/15, 07:25 PM | #1 | |
Join Date: Apr 2015
Posts: 20
|
Manipulate the Chat
I'm looking at the chat functions and I was wondering what the extra chat channels are for and how do you access/use them? http://wiki.esoui.com/Globals#MsgChannelType
CHAT_CHANNEL_USER_CHANNEL_1 CHAT_CHANNEL_USER_CHANNEL_2 CHAT_CHANNEL_USER_CHANNEL_3 etc Is there a way for an add on to BLOCK a message from appearing? (I know there is probably a in game IGNORE) but for design purposes, what would blocking a message from a particular player look like in an add on? |
|
04/23/15, 07:59 PM | #2 |
They're for GM's when they talk to you (sometimes).
You cannot use them, because nobody listens on them.. except gm's. And no, you can't use them to send messages, because we can't "join" "users channels". -- If you want to block messages, you can use a library that I wrote, libChat2 Here you can register library with the parameter you're interested in. ex : Lua Code:
Last edited by Ayantir : 04/23/15 at 08:03 PM. |
|
04/23/15, 09:16 PM | #3 | |
Join Date: Apr 2015
Posts: 20
|
Your pChat add on is amazing!!
Also, thanks for the information! |
|
04/24/15, 01:16 PM | #4 | ||
Join Date: Apr 2015
Posts: 20
|
I got the library and example function registered and working but how do I specify that the effect should only take place in one type of chat window /zone /say /guild etc. ? Currently (the block function example) works for every chat window. What I'm trying to do is detect certain words in a /whisper message and stop them from being displayed. |
||
04/23/15, 09:58 PM | #5 | |
Join Date: Apr 2015
Posts: 20
|
Why do the CHAT_SYSTEM functions not work? I can get CHAT_SYSTEM:AddMessage() to work but things like CHAT_SYSTEM:Clear() and CHAT_SYSTEM:GetMaxHistoryLines() throw an error.
Also, I thought I was crazy but am I right in that there are a **** ton of functions, specifically ZO_ functions that have no documentation? I'm finding threads and a bunch of code using or referencing these functions but I have no idea how people are figuring out how to use them. |
|
04/23/15, 11:23 PM | #6 |
CHAT_SYSTEM:Clear() doesn't exists. :GetMaxHistoryLines() neither.
And yes, 99% of ZO functions are undocumented, each addon author after some releases get it's own expertise on its domain of coding, so we do like that, it's maybe not really good but making docs is not the favorite task of an unpaid developper. |
|
04/24/15, 09:56 AM | #7 | |
|
One thing to keep in mind is some of the stuff people utilize isn't so much API anymore as hooking into the ingame UI code. The main difference is (theoretically) using the API would be more stable and less likely to break. [1] - Online at http://esodata.uesp.net/current/src/luadir.html . Also some links to ZIPs on these forums. |
|
04/24/15, 01:19 PM | #8 | ||
Join Date: Apr 2015
Posts: 20
|
|
||
04/24/15, 03:57 PM | #9 |
yes we do.
|
|
04/25/15, 08:11 PM | #10 | |
|
Lua Code:
As for the functions, like they said we find them by reading the games lua files or using /zgoo. This addon has a feature to search the games global table for global functions. I use it to find functions I might want to use or to just look up a function when I forget its name. As for figuring out how to use the function, once I find a function that sounds like what I want then I go to the lua files and search for it to see how they use it, what the parameters are, and what values it returns if any. Click4Info |
|
04/25/15, 10:46 PM | #11 | ||
Join Date: Apr 2015
Posts: 20
|
You're right those are what I was looking for but from the documentation (or rather the list of functions) I couldn't tell that I needed to dig down to currentBuffer. I loaded up zgoo and my god, I don't see how you can derive anything from that. I did /zgoo mouse over the chat window and I see the currentBuffer and the methods under it but I still am at a loss. I was reading through the source to pchat and X4D_CHAT and I still can't make heads or tails of what's going on in them. My coding skills must be hella weak... When you say you 'go to the lua files and search for it', if you meant the ESO client where are those stored? Mine might be different since I'm using the beta client. |
||
04/25/15, 11:55 PM | #12 | |||
|
It is near the top, look for the link: ESOUI 2.0.4 CURRENT Live It is a link to a zip file that contains the lua files for the game.
That list of functions you were looking at on the wiki API page are global functions that reside directly in the main area of the global table (not inside of another table). You can call them directly without needing to have any other object. No other function in the same "area/table" can have the same name. I think of them like addresses to a location, no two objects (variables, functions, tables, exc..) can have the same address: When I repeatedly use the word objects below, if it helps to understand, they are all tables in this example. Lua Code:
In order to clear the chat buffer, you have to have the currentBuffer object and you call "it's" Clear() function, which is contained in the buffer object. If you just called Clear() the game would look for it directly in the global table and if found it would call that one, but it would NOT look inside of any other tables so it would not see the one inside of the CHAT_SYSTEM.primaryContainer.currentBuffer table. If we want to call that clear function we need to...give it that address/location so it knows which Clear() function we are wanting to call. Using: Lua Code:
So in short it tells the game to call the Clear() function that belongs to the CHAT_SYSTEM.primaryContainer.currentBuffer object. It also passes that current buffer object to the Clear() function as the first parameter (thats what the : means before the function name).
When you do /zgoo mouse it just shows all of the tables that belong to the "object" you had your mouse over, often with more & more tables nested inside of it. You just have to search around and try to find what your looking for sometimes. Last edited by circonian : 04/25/15 at 11:58 PM. |
|||
04/27/15, 01:05 PM | #13 | |
Join Date: Apr 2015
Posts: 20
|
I read up on Lua's scoping and I'm pretty sure I understand it. I see the function that allowed us to send chat messages is now protected, is that what all the bot spammers were using? It kind of seems silly to block it, writing a spam bot to send keypresses to the client as a 3rd party tool is still an option.
I'm currently reading through sharedchatsystem.lua, thanks for linking me to the files. I'm trying to figure out how to read the contents of the chat buffer so I can look for specific strings but I'm not seeing where its stored or how to access it. Can someone explain what the "..." us all about? I'm seeing it a lot, mostly as new(...). Also "#", what does this do? |
|
ESOUI » Developer Discussions » Lua/XML Help » Manipulate the Chat |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|