Replies: 14 comments
-
Awesome! I noticed that there is a message type for addons (CHAT_MSG_ADDON), which should be a good way to communicate between the server and the addon without making the messages annoying. I'm new to addon development so I'm not sure how to communicate between addon and server properly, but I think after some trying it should be fine. Regarding the API, I agree with setting some formats to facilitate parsing. Is there any API design reference like the "wow Inspect API" you mentioned? Which API would you like to start a trial with, maybe a inventory list api? Since I am not very familiar with addon development, if you can provide an unfinished version (for example, with the function of initiating API requests but no need to handle the response), it should be very helpful to the server API development. Likewise, you're welcome to discuss what other addon features you'd like to implement and I'll try to help as much as possible. |
Beta Was this translation helpful? Give feedback.
-
Boss, i am preparing the addon for init repo, and i will setup code and debug tools so you can quickly hop in and start developing.
This function is the cornerstone of inspect https://wowpedia.fandom.com/wiki/API_NotifyInspect
Inventory is the most crucial and a good testbed.
Also bot should just send status updates without queries when
these can be used by addon to trigger queries,
In a day or two (refactor / mocks)
Thank you, it would be great if all bot commands like I plan to make a contextual mini panel where there are Portraits of the owned bots nearby, and buttons appear over each portrait depending on what the bot can do, for example I have many plans for the addon - group templates, strategy builder ui also with templates, i will write all of this on the repo |
Beta Was this translation helpful? Give feedback.
-
I created the repository https://github.com/azcguy/PlayerbotsPanel Issues-
Knowing if the bot is online is crucial for most functionality, and there are many cases where if bot is offline,
Handshake - bot sends addonmsg to player every second, to establish that the player actually uses an addon that uses this channel. If the player has an addon, it reponds and a handshake is complete. If the player doesnt respond after 5 seconds, bot stops and assumes there is no addon. Once handshake is complete, the bot starts sending a stream of reports and opens query and command channel -- broker.lua
PlayerbotsBrokerReportType = {}
local REPORT_TYPE = PlayerbotsBrokerReportType
REPORT_TYPE.STATUS = 0 -- status changed
REPORT_TYPE.CURRENCY = 1 -- currency changed
REPORT_TYPE.GEAR = 2 -- gear changed (item equipped/ unequipped)
REPORT_TYPE.INVENTORY = 3 -- inventory changed (bag changed, item added / removed / destroyed)
REPORT_TYPE.TALENTS = 4 -- talent learned / spec changed / talents reset
REPORT_TYPE.SPELLS = 5 -- spell learned
REPORT_TYPE.QUEST = 6 -- single quest accepted, abandoned, changed, completed
On the addon side - if there is no handshake from bot, the bot is considered offline. This way the addon will always know if the bot is online, even when its not in a group, nearby and so on. About the addon, I tried to cleanup the code as much as i could, and split it into logical files, i move all addon-bot comms to I am considering creating another addon that acts as a server emulator - receives queries and sends responses, run from another account, as if that account was a bot. So a bot-emulator addon I will push this emulator into the same repository and we can both first work out how to structure messages in lua, before moving into cpp. What do you think? |
Beta Was this translation helpful? Give feedback.
-
I've been working on server emulator - https://github.com/azcguy/PlayerbotsPanelEmu |
Beta Was this translation helpful? Give feedback.
-
Thanks for your work, sorry for the late reply as I'm on a trip for about week or so and I'll get back to work as soon as I'm done. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
One of the issues im thinking about is sync of the data when bot is online while player is not. |
Beta Was this translation helpful? Give feedback.
-
Created the wiki page for the protocol https://github.com/azcguy/PlayerbotsPanel/wiki/Addon-Server-Protocol-Docs |
Beta Was this translation helpful? Give feedback.
-
inventory.tab.mp4Made async item data load from server and bag queries and reports work, im going to do bank and keychain next, then commands for this tab, equip/use etc. I have a question about bank, a player can only access bank when player interacts with it, can the bot access bank from anywhere? |
Beta Was this translation helpful? Give feedback.
-
Scratch that, the ITEM_USE command already handles it contextually. May need to revisit it later but adding items to trade works as is atm. |
Beta Was this translation helpful? Give feedback.
-
It took me some time to catch up :D. So now we need to modify the server bots so that they respond to requests of addon, in the same way as PlayerbotsPanelEmu? |
Beta Was this translation helpful? Give feedback.
-
Yes, the protocol is essential. I was thinking about how best to implement it, i think there should be a global switch in mod-config, |
Beta Was this translation helpful? Give feedback.
-
I think we should drop multiple query packing, its overengineering with minimal gain. |
Beta Was this translation helpful? Give feedback.
-
Added If its more convenient to send gold as a single number tell me. |
Beta Was this translation helpful? Give feedback.
-
The ISSUE
I am developing PlayerbotsPanel - an addon that should ideally replace any interactions with bots through chat
So far it goes great, most of the features work - gear, cached data for offline bots, one click add/remove .. etc
However, the problems start when addon needs to query the bot for data in a safe and effective (lol) way.
Things like inspecting gear are done through WOW addon API, but inventory and other "hidden" data is done through chat.
Currently I have a shoddy system of parallel queues that send and catch whispers to and from bots and the way it currently works,
it simply isn't good.
example - we await inventory items, and bot says Hello!, or something similar (see screenshot 2)
there is a start like
=== Inventory ===
but no ends
andc
in them,that is because I didn't even start parsing it properly, hoping this thread will lead to a better way, so i don't have to)
Proposal
Someone, probably liyunfan1223 should implement additional, structured query messages for bots.
Similar to human readable, but structured in a machine friendly way.
I propose the following mechanism for receiving bot info through chat channels
legend:
>
to bot, not part of the queries<
from bot, not part of the queriesq
- query ,9288
- id assigned by addon, used to map request and response ,currency
/stats
string query types, or1
int/enum query types, for less data transferredto which bot responds with
more examples
Above example is doing the same thing wow Inspect API does, but since its a chat message, it is better,
because the API NotifyInspect() is restricted by distance. And has other restrictions,
for example addon can't query gems/talents fast, it needs to wait for server response async and can be subject to throttling (not sure how that works with azerothcore)
so with these queries it would be instant and contain a lot more information
Important - if the server can send messages through
SendAddonMessage
https://web.archive.org/web/20091024082724/http://wowprogramming.com/docs/api/SendAddonMessage
It would also help a lot, because these don't require client side chat filtering, and can be spammed without fear of throttling
Alternatives
Parsing the messages as is, and having a buggy addon
Beta Was this translation helpful? Give feedback.
All reactions