lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 03-08-2021, 06:06 PM
soulos90 soulos90 is offline
The Wary
 
Join Date: Mar 2021
Posts: 4
Shameless solicitation (chat parsing, ui, data passing)

Hi,

I am new to this community so I feel a little bad asking for something before contributing... but I am going to anyway because I guess I am a jerk... sorry. TLDR I am hoping someone who is confident in lua will be interested in consulting/working on this project with me.

I have been working on an idea for a plugin forking off the Songbook plugin, what I want is a background windows app that parses data (songs in list, inputs, etc) to suggest a song that is "recommended" to play next. This is in my wheelhouse.

The part that I am struggling with is the lua in game interface as I have never worked in lua before and while there are many cool products made by this community I am getting a raging headache parsing through these files to try and figure out the pieces of code that I need to emulate.

My main tasks in lua right now are:

Modify the Songbook UI to integrate my functionality; I want a button that changes depending on next expected input from "/play x sync" to reminders to change instruments. I want a interface that represents detected state of band members "player x is waiting to play y".

Send and read data from chat; I want the band leader to be able to send instructions through chat to all members, song and instrument, and band members to be able to send their state.

I also need to send data to the plugindata files and read from them, though because the nature of the app isn't very time sensitive I hope I can just wait the 30 seconds.

I will keep plugging away at making this plugin myself, but would happily take advice, and even more happily work with someone more comfortable in lua than I, side bonus I havn't met someone new during this particular pandemic and friends are nice

Hope you all are doing well, and thank you for your time,

Nathan
Reply With Quote
  #2  
Unread 03-08-2021, 06:36 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
You can read/write data without the 30 second wait on the plugindata files fairly easily by using a second plugin that is loaded from the main plugin - the second one will have full real-time access to plugindata files as it loads and can communicate with the main plugin using custom formatted chat commands (not executing the commands, but rather creating and checking for the existance of certain custom formatted commands). If you are interested, look into how TerrainMap loads annotations on the fly as the user scrolls the map.

The mechanism is a little bulky, but its far more efficient than waiting 30 seconds for every external communication and once you've implemented it once, it's easy to re-implement or expand it's usefulness. I wrote a simple chat translation plugin that communicated via an external app with Google translate and response times were pretty decent (of course, some of the translations left a lot to be desired but heh, Google is better than nothing... usually ).

Lotro Alerts (sometimes just called Alerter) has a lot of examples of chat parsing. MoorMap and TerrainMap share annotations with each other and with other users via chat parsing. There are several other plugins that do quite a bit of sharing of info via chat parsing.

Unfortunately, I don't use songbook or even work with the music aspects of the Lua interface so I wouldn't be of much help with your other issues but welcome to the neighborhood

Garan

Last edited by Garan : 03-08-2021 at 06:38 PM.
Reply With Quote
  #3  
Unread 03-08-2021, 08:36 PM
soulos90 soulos90 is offline
The Wary
 
Join Date: Mar 2021
Posts: 4
would you be willing to sit with me, in a discord call or something, and give me a crash course in how your terrainmap plugin is using some of this tech?
Reply With Quote
  #4  
Unread 03-08-2021, 09:22 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
Quote:
Originally Posted by soulos90
would you be willing to sit with me, in a discord call or something, and give me a crash course in how your terrainmap plugin is using some of this tech?
I'm not sure if we can arrange a good time to talk via discord, my schedule is a bit peculiar these days and my free time is broken up into tiny bits here and there but I don't mind chatting via PMs or if possible via discord.
Reply With Quote
  #5  
Unread 03-09-2021, 07:42 AM
Hyoss's Avatar
Hyoss Hyoss is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Jan 2011
Posts: 150
Note to self: go and read TerrainMap and Lotro Alerts source code ASAP to learn
Reply With Quote
  #6  
Unread 03-16-2021, 06:56 PM
soulos90 soulos90 is offline
The Wary
 
Join Date: Mar 2021
Posts: 4
So Garan,
I know in terrainmap you embed the sending character name in the data because "there is a bug" in the sender parameter of the chat listener callback. what bug is there? and where do you see documentation about that parameter?
Reply With Quote
  #7  
Unread 03-16-2021, 09:39 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
Quote:
Originally Posted by soulos90
So Garan,
I know in terrainmap you embed the sending character name in the data because "there is a bug" in the sender parameter of the chat listener callback. what bug is there? and where do you see documentation about that parameter?
The bug is that the "Sender" parameter will always be the local character no matter who the original sender of the message is. The documentation is the API documentation found here:
https://www.lotrointerface.com/downl...mentation.html
The relevant documentation is for the Received event of the Turbine.Chat object.
Note, there are two sender values, the parameter directly passed to the event handler and the args.Sender value. The one in question is not the sender passed directly as that just references the object that fired the event. The args.Sender value, however, should be the original Sender of the message and is not. The args.ChatType and args.Message work as documented.
Quote:
function Chat:Received(sender, args)
Quote:
This event is fired whenever any chat message is received from the game or other users. The arguments for this event will contain a combination of a Sender, a ChatType, and the Message itself. The ChatType enumeration can be used to determine what kind of message was received.

Last edited by Garan : 03-16-2021 at 09:45 PM.
Reply With Quote
  #8  
Unread 03-16-2021, 10:02 PM
soulos90 soulos90 is offline
The Wary
 
Join Date: Mar 2021
Posts: 4
You are a gentleman and a scholar as usual.
Reply With Quote
Reply


Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading data issues Mandraval Lua Programming Help (L) 2 12-18-2013 07:18 PM
Was data.lotro.com updated? magill Interface Help (L) 2 03-20-2013 10:10 PM
Saving quickslot data to table Marll Lua Programming Help (L) 8 01-07-2011 02:09 PM
Interface into game data Aran Interface Help (D) 1 11-11-2010 12:38 AM


All times are GMT -5. The time now is 01:09 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui