Quantcast
lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO Stand-Alone Plugins > Other

Category: OtherLoTRO Alerts
Interface Information
Download
Garan's Portal Bug Reports Feature Requests
How do I install this? (FAQ)
Name: LoTRO Alerts   Popular!
Author:
Date: 03-10-2016 06:47 PM
Size: 57.19 Kb
Version: 1.08
Rate File: 5 out of 5 with 13 votes  
Pictures
Click to enlarge 

Views: 0
Size: 48.48 Kb
Dimensions: 990 x 468
Sample Lm stun break alert
 
Click to enlarge 

Views: 0
Size: 55.60 Kb
Dimensions: 822 x 478
The Trigger settings for the 'Tracked' alert.
 
Click to enlarge 

Views: 0
Size: 51.70 Kb
Dimensions: 820 x 474
The Response settings for the 'Tracked' alert.
 
Description
Ever get blown-up while wandering in stealth just to realize you missed the tracking warning? Ever have some stray arrow break your stun/daze/mez on a critical NPC and not know who to rant at, er I mean provide constructive criticism too?

Well, never miss an important message just because it's burried in a rapidly scrolling mountain of chat. Welcome to Alerter.

This plugin allows you to set specific phrases to watch for in specific chat channels and if any match occurs in a specified channel, a message is displayed prominantly on your screen. You can control the position, size, text, color and duration of the message as well as whether it flashes and how quickly.

See samples of alert setups at http://www.lotrointerface.com/portal.php?id=35&a=faq

You can use the Chat Log Window to determine the channel and text you are trying to match. Click the "Show Log" button or use the "/Alerter Log Show" command to display the Chat Log Window. The chat log will have three columns, the first is the channel (text if recognized, numeric if unknown), the second is the "Sender" which currently seems to always show the current player and the third is the message Text with all hidden XML tags exposed. You can start/stop logging and clear the log from the window. You can also start/stop loggin with the "/Alerter Log Start" and "/Alerter Log Stop" chat commands. The chat log will retain up to 1000 messages before it starts automatically recycling space by dropping the oldest entries.

To install, simply download the file and unzip it into your /Plugins folder. There are no dependancies on 3rd party files, everything you need is in the zip.

To load it, use /Plugins load Alerter.

The "/Alerter setup" command will display the setup/configuration screen. By default the plugin loads hidden, you will have to display the setup screen at least once to define one or more alerts. There is no practical limit to the number of alerts you can set, but you will eventually start to notice a performance hit if you define a hundred or so

To define an Alert, select "New" from the Alert selection list. Then enter a label for the alert (this is what will display in the Alert selection list so you can modify the alert later if you wish. Then enter the text that you want to display - note, if you leave the message text blank, the entire message that triggers the alert will be used for the message (see the stun break example). Enter a Duration in seconds. You can use decimal values to get partial seconds. Select a Color and Font for the message text. Select the flash interval in seconds - by entering 0, the message will not flash but will display for the entire Duration. Select the Chat channel(s) where you wish to trap a message - note in the LM example, the stun break message occurs in the Death channel, not the Combat channel which you might expect, so some experimentation may be required to get the proper channel. Lastly, enter the portion of the message that should trigger the alert - the larger the section of text the better - and click Save. If you want to see how the alert will look, click Test.

Version 1.08
Added custom Lua code snippets for Trigger and Response. The Trigger snippet can be used to provide custom filtering of alerts while the Response snippet can be used to define additional response capabilities or alter the existing responses.
To learn more about the code snippets and their capabilites, read the ReadMe.txt file.
Changed "Show Log" Button to "Show Chat Log" to reflect that it is a log of incomming Chat messages
Changed "Add to Custom Log" Checkbox to "Add to Alert Log" and added "Show Alert Log" Button to view the log of alerts.
Added Log Viewer window. This window will display the history of alerts that had the "Add to Alert Log" check box checked during a specific session. I recommend not logging alerts unless you are trying to debug something as the log viewer doesn't handle large tables very well. However, it does have a couple of handy features:
You can left drag column headings to reorder the columns, you can left drag the header separators to resize columns and you can right click the header to check/uncheck columns to be displayed
You can control the size of the text in the grid by selecting a font and size by clicking the font select button in the upper right corner. You can also increase/decrease the font by simply holding Ctrl and scrolling your mouse wheel while over the grid - note, the font change can take a second or two for large tables so it is best to select a font while reviewing a session with fewer alerts to find a font that is comfortable.
The Response column is the actual text displayed by the Alert while the Message column is the original text from the incomming Chat message that triggered the alert.

Version 1.07
Restored Shared alerts and Custom Logs that were accidentally removed in 1.06
Added "message" to Custom Logs.
Note, Custom Logs are log files per client session that are stored at the account level, in the AllServers folder, as "Alerter_Log_YYYYMMDD_HHMMSS.plugindata" where YYYYMMDD is Year, Month and Day and HHMMSS is Hours, Minutes and Seconds. A log viewer is planned for a future version.

Version 1.06
Added "World" chat channel
Added support for Emote, Pet and Hobby quickslots in Responses
Changed default behavior of quickslots to display for Duration and added option to "Hide after Clicked"

Version 1.05
Fixed alert position bug for alerts using Mouse Position and a Delay time.
Fixed bug that could generate an error when displaying the "Alert Saved" or "Alert Deleted" message.
Fixed bug in language selection not immediately updating State radio button labels and selection list labels.

Version 1.04
Added separate tabs for Trigger settings and Result settings to help group settings and clean up the cluttered interface
Updated the DE and FR support. The whole interface should now support both German and French (although some translations may still be a bit literal).
Changed channel select boxes to automatically reorder alphabetically when language changes.
Added the new channels from Update 6 (Combat - Player and Combat - Enemy).
Changed Item quickslots to accept item instance IDs instead of generic IDs (the first part of the ID should not be 0). Use drag & drop to generate the ID. Note, for items with more than one stack, only the stack that is actually dragged to the control will work.
Implemented permanent fix for the version 1.03 infinite loop bug caused by ExaminationItemID tags containing byte data.
Added Delay setting for alerts - you can now trigger an alert to go off x number of seconds after the chat message which is great for knowing when to refresh certain skills, etc.
Added States (currently only "In Combat" and "Out of Combat") for triggers. You can choose to delay an alert until the state is no longer true or suppress he alert all together. This way you won't be bothered by social alerts while in combat (but you can choose to have them pop up once combat ends), etc.
Fixed a bug that could allow an alert Quickslot to continue to display even after the alert duration had expired.

Version 1.03
Modified Alerts so that more than one alert can be active simultaneously - alerts no longer override each other.
Added limits to the alert template when resizing with the mouse - you can still override the limits by manually entering lower values.
Re-added the Opacity slider
Added tinting to areas of the setup panel to indicate related fields and help a little with the clutter
Added Quickslot controls to alerts - these let you click on the alert to execute an alias, perform a skill or use an item
Added an option to display alert at the mouse position, overriding the Top and Left coordinates (mostly useful for Quickslot alerts)
Added an option to scroll the text vertically upwards within the defined alert box - the scroll rate is controlled by the duration

Version 1.02
Added Cooldown setting to alerts - allows setting a minimum time between alerts for the same trigger.
Added a graphical frame which is visible when the setup window is visible for graphically moving/resizing the alert panel in addition to left, top, width and height fields that can be manually entered.
Added the ability to use a graphic image with alerts. Save the image in the GaranStuff/Alerter/Resources folder and then just enter the image file name (without path). Alternately, you can use any of the built in resource IDs.
Added a chat log which displays the chat channel, sender and message arguments for the last 1000 incomming chat messages.
Altered the way that channels are selected - you will need to redefine any previously created alerts by reselecting the channels and resaving.
Added a "Custom" channel to allow users to match agains any previously undefined channel that they find in the log. Undefined channels will show up as a number, enter that number in the Custom Channel field. Note, undefined channels will still be matched by the "Any" channel category.
Added the ability to use "captures" in the Pattern which can be reproduced in the alert Message by inserting a %number where "number" is the iteration of the capture.
note that the captures do not need to be reproduced in the order in which they were captured, that is %2 can preceed %1 in the Message.
When creating patterns, note that the incomming message may not be quite what you expect, the built in chat window processes some of the text before adding it to the chat display. For instance, "Tells" do not include the sender's name or the words "tells you," in the message, those are added by the chat window.
The Message field can contain three special fields, %C for the Channel and %S for the Sender and %M for the original Message.
Added a chat command to Start, Stop and Show the Chat Log - "/Alerter Log Start","/Alerter Log Stop","/Alerter Log Show"
Added an "Enabled" checkbox. Clear this to temporarily disable an alert without having to delete the alert definition.

Version 1.01
Added a Delete button
Added French and German translations for most of the interface, Chat channels are not yet translated
Fixed incorrect label for the Font selection list
Fixed the mouse click-though bug (reported by Eldarian on LoTROInterface).
Archive List (Old Versions)
File Name
Version
Size
Author
Date
1.07
40.33 Kb
Garan
02-19-2016 11:23 AM
1.06
38.09 Kb
Garan
02-15-2016 10:25 PM
1.05
34.49 Kb
Garan
09-25-2012 02:19 PM
1.04
32.82 Kb
Garan
03-30-2012 10:42 AM
1.03a
28.21 Kb
Garan
02-29-2012 05:17 PM
1.02
21.70 Kb
Garan
02-22-2012 01:51 AM
1.01
13.12 Kb
Garan
10-01-2011 12:30 PM
1.0
11.79 Kb
Garan
09-30-2011 10:07 PM
File Statistics
User Rating:
5 out of 5 with 13 votes
Downloads: 73886
Views: 216089
Favorites: 67
Uploaded By:
 
Last Modified: N/A

View Pictures. Download Now! Post A Comment


Post A Reply
Author Comments Comment Options
Unread 06-22-2022, 01:48 PM  
Zachaos
The Wary

Forum posts: 0
File comments: 4
Uploads: 0
Re: Re: Re: Re: I've hit the stupid tree....

Quote:
Originally Posted by Garan
Actually, the ".*" at the end is not necessary (it's been a few years since I played with Alerter) the trigger will match any message that includes the pattern, so there is an implicit .* before and after the pattern. I was able to fire an alert for my bog guardian using the pattern "scored.*with.*Flank". That works for both the "Ranged Flanking" and "Flanking" versions of the bog guardian message. I haven't checked the other pets, but the method does still work, it's just a matter of checking the actual current text.

One thing that had me pulling my hair out for a few minutes is I accidentally clicked off the "Enabled" checkbox and couldn't figure out what I broke and why it tested fine but wouldn't actually fire, so you might want to double check that.
Ahaa I seem to have it working now..checked everything you said and it does seem to be notifying me for most of them now, thanks for your advice.
Zachaos is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 06-19-2022, 12:03 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 326
File comments: 922
Uploads: 20
Re: Re: Re: I've hit the stupid tree....

Quote:
Originally Posted by Zachaos
Aaah, I wonder if the full stop & extra star at the end of your alteration might help.
(Plus maybe the text in my log saying Flanking Manoeuvre might mean the text has changed? I have no clue though haha
Actually, the ".*" at the end is not necessary (it's been a few years since I played with Alerter) the trigger will match any message that includes the pattern, so there is an implicit .* before and after the pattern. I was able to fire an alert for my bog guardian using the pattern "scored.*with.*Flank". That works for both the "Ranged Flanking" and "Flanking" versions of the bog guardian message. I haven't checked the other pets, but the method does still work, it's just a matter of checking the actual current text.

One thing that had me pulling my hair out for a few minutes is I accidentally clicked off the "Enabled" checkbox and couldn't figure out what I broke and why it tested fine but wouldn't actually fire, so you might want to double check that.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 06-19-2022, 12:15 AM  
Zachaos
The Wary

Forum posts: 0
File comments: 4
Uploads: 0
Re: Re: I've hit the stupid tree....

Quote:
Originally Posted by Garan
This is one of the more popular uses for Alerter. There is a thread on the regular lotro forums from back in 2013 that discusses this:
https://forums.lotro.com/forums/show...flanking-alert
Note that there are three different patterns that can indicate a flank so you will have to use three alerts, one for each pattern:

EDIT: fwiw, it looks like cases 1 & 2 can use the pattern:
"scored a .* with .*Flank.*"
that way it only requires 2 alerts. I haven't used my LM in years, so if the text has changed any, it might need slight adjustments
Aaah, I wonder if the full stop & extra star at the end of your alteration might help.
(Plus maybe the text in my log saying Flanking Manoeuvre might mean the text has changed? I have no clue though haha
Zachaos is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 06-18-2022, 11:59 PM  
Zachaos
The Wary

Forum posts: 0
File comments: 4
Uploads: 0
Re: Re: I've hit the stupid tree....

Ah yes I found that yeah, I typed the exact lines into the pattern section (minus the " and saved them separately but still nothing was popping up,, I couldn't for the life of me get anything to work haha, no worries I'll keep trying, have no idea dhat I must be doing wrong, thanks tho

Last edited by Zachaos : 06-19-2022 at 12:01 AM.
Zachaos is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 06-18-2022, 09:24 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 326
File comments: 922
Uploads: 20
Re: I've hit the stupid tree....

Quote:
Originally Posted by Zachaos
I think I'm getting old fast.....
Trying to make an alert for my lowbie LM for the flanking.

I've looked at the logs and it appears atm in combat - player and says something along the lines of
mypet hits with Flanking Manoeuvre for etc etc

I'm struggling with putting this in the pattern section?
I think I must be doing something very wrong as no alert ever pops up, could you help at all?

thanks in advance.
This is one of the more popular uses for Alerter. There is a thread on the regular lotro forums from back in 2013 that discusses this:
https://forums.lotro.com/forums/show...flanking-alert
Note that there are three different patterns that can indicate a flank so you will have to use three alerts, one for each pattern:
Quote:
1) "scored a .* with .* Flanked" -- This one is for the normal flanked skill, that most LM pets can do (except the healing pet)
2) "scored a .* with Flashing Flank" -- This one is for the healing pets flank skill that it can use.
3) "scored a .*devastating hit.* with Ranged Attack Min" -- This one is for the Bog-guardian's ranged attack that can cause a flank.
EDIT: fwiw, it looks like cases 1 & 2 can use the pattern:
"scored a .* with .*Flank.*"
that way it only requires 2 alerts. I haven't used my LM in years, so if the text has changed any, it might need slight adjustments

Last edited by Garan : 06-18-2022 at 09:29 PM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 06-18-2022, 05:52 PM  
Zachaos
The Wary

Forum posts: 0
File comments: 4
Uploads: 0
I've hit the stupid tree....

I think I'm getting old fast.....
Trying to make an alert for my lowbie LM for the flanking.

I've looked at the logs and it appears atm in combat - player and says something along the lines of
mypet hits with Flanking Manoeuvre for etc etc

I'm struggling with putting this in the pattern section?
I think I must be doing something very wrong as no alert ever pops up, could you help at all?

thanks in advance.
Zachaos is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 05-16-2022, 10:11 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 326
File comments: 922
Uploads: 20
Re: Add-on for Alerter

Quote:
Originally Posted by Egarthur
Hi, it's me again! :-)

I've published an add-on for Alerter. https://www.lotrointerface.com/downl...rksAdd-on.html. Although the title says "Fireworks", it's actually grown since my initial concept, and now it incorporates
  • Fireworks Launcher Assist (for the Bree Fireworks quest in the recently-concluded Anniversary Festival)
  • Reforge Reminder (as discussed here, but with a suggestion to put up a graphic which represents reforging), and
  • Wine-tasting Overlay, for the upcoming Midsummer Festival "To the Last Drop" quest. This one puts up a flashing graphic over the wine-tasting table, to guide the user as to which wine to pick.
The most maintainable versions of the Fireworks and Reforge setups consist of only 1 alert each, but this only works with the one-line fix provided in a previous comment in this forum (Main.lua, line 2317), so that Trigger LUA code can function.
The graphical variant of the 1-alert version of Fireworks also requires a new capability: positional parameters in the pathname for Image (e.g. Egarthur/fireworks_%1_%2.tga, example substituted version Egarthur/fireworks_isnot_blue.tga). This is accomplished with a 7-line addition to Main.lua, essentially a copy-pasta from the main positional-parameter-substitution code.

One downside of allowing parameter substitution in the pathname, is that it would break any paths that already have the pattern %<digit/digits> embedded in them (where <digit/digits> falls within the range of the captures defined in Pattern).

My questions are:
  1. Would either of both of these changes be appropriate for inclusion in a future patch to Alerter?
  2. To avoid the "embedded pattern" risk mentioned above, would it be a good idea to, say, have a checkbox alongside the Image field for "allow substitutions", to give the user control of this behavior?
Hi. Thanks for your interest and input.

The change to fix Lua triggers is already implemented, just not published as it is a minor fix to a part of Alerter that apparently very few people use. Those that do seem comfortable making the fix locally.

The change to allow variables in the image path is a good idea and will likely make it into a future version if I ever get around to fixing the party stuff I was working on implementing - I may just gut the changes and start over or even abandon that since it's been quite a while since I had time to work on it and there are several other plugins that already handle party info quite well.

As to the need to enable/disable variables in the image path, since the path is relative to the plugin environment (typically the path to the main.lua file), there is no need for concern - there would be no valid system variables that would point to other locations that would be accessible to the plugin. Things like %appdata%, etc. are all well outside the sandbox that the plugin has access to (and that's a good thing).

Fwiw, B4 is enhancing the fireworks stuff in Festival Buddy by Galuhad, you can check it out on twitch.tv/lotrostream at 2 PM today (eastern US time), May 17. https://t.co/uNJcVpVRzQ

Last edited by Garan : 05-17-2022 at 11:26 AM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 05-15-2022, 12:38 PM  
Egarthur
The Wary
 
Egarthur's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 4
Uploads: 2
Add-on for Alerter

Hi, it's me again! :-)

I've published an add-on for Alerter. https://www.lotrointerface.com/downl...rksAdd-on.html. Although the title says "Fireworks", it's actually grown since my initial concept, and now it incorporates
  • Fireworks Launcher Assist (for the Bree Fireworks quest in the recently-concluded Anniversary Festival)
  • Reforge Reminder (as discussed here, but with a suggestion to put up a graphic which represents reforging), and
  • Wine-tasting Overlay, for the upcoming Midsummer Festival "To the Last Drop" quest. This one puts up a flashing graphic over the wine-tasting table, to guide the user as to which wine to pick.
The most maintainable versions of the Fireworks and Reforge setups consist of only 1 alert each, but this only works with the one-line fix provided in a previous comment in this forum (Main.lua, line 2317), so that Trigger LUA code can function.
The graphical variant of the 1-alert version of Fireworks also requires a new capability: positional parameters in the pathname for Image (e.g. Egarthur/fireworks_%1_%2.tga, example substituted version Egarthur/fireworks_isnot_blue.tga). This is accomplished with a 7-line addition to Main.lua, essentially a copy-pasta from the main positional-parameter-substitution code.

One downside of allowing parameter substitution in the pathname, is that it would break any paths that already have the pattern %<digit/digits> embedded in them (where <digit/digits> falls within the range of the captures defined in Pattern).

My questions are:
  1. Would either of both of these changes be appropriate for inclusion in a future patch to Alerter?
  2. To avoid the "embedded pattern" risk mentioned above, would it be a good idea to, say, have a checkbox alongside the Image field for "allow substitutions", to give the user control of this behavior?
Egarthur is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 02-13-2022, 02:24 PM  
Egarthur
The Wary
 
Egarthur's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 4
Uploads: 2
Re: Re: Accessing args.captures from Trigger LUA

That seems to have done the trick. Thanks!

My setup is working now. What I have now (subject to full testing) as the Trigger LUA is:

Code:
local reforge = {
          ["56"] = true,
          ["61"] = true,
          ["66"] = true,
          ["71"] = true,
          ["76"] = true,
          ["81"] = true,
          ["86"] = true,
          ["91"] = true,
          ["96"] = true,
          ["100"] = true,
          ["101"] = true,
          ["105"] = true,
          ["106"] = true,
          ["111"] = true,
          ["116"] = true,
          ["120"] = true,
          ["121"] = true,
          ["126"] = true,
          ["131"] = true,
          ["136"] = true
}
local newlevel = args.captures;
if reforge[newlevel[1]] then return true end
return false
and it seems to be triggering on the levels it should, and not on the ones it shouldn't. (Could also be done with "if ... then ... elseif ...", of course, but I prefer this idiom).
Egarthur is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 02-11-2022, 09:17 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 326
File comments: 922
Uploads: 20
Re: Accessing args.captures from Trigger LUA

Quote:
Originally Posted by Egarthur
Hi,
First-time poster to lotrointerface.com. Awesome plugin, by the way.

I'm trying to configure/program Alerter to provide a "missing feature" of the new LI system, namely, a reminder when the character levels and the level is such that a new reforge is available. There are 20 such reforge levels currently identified, mostly on the 1s and 6s.

Now, I know that LUA "patterns" don't have a true regex (a|b) type alternation capability, and that, because of that, the usual advice, for Alerter, is just to create separate alerts, each one covering a subset of all possible matches.

In this case, these 5 do the trick:
  • Your level has changed to 56
  • Your level has changed to [6-9][16]
  • Your level has changed to 1[0-3][16]
  • Your level has changed to 1[02]0
  • Your level has changed to 105

However, the perfectionist in me, wants to see if a single alert can cover all 20 matches, and that means writing some LUA code. LUA is not, however, among the languages that I know very well. So, it's probably just some newbie mistake, but I can't seem to access the args.captures sub-table (or the args table, for that matter) from Trigger LUA. Even a trivial piece of code like (with a capturing pattern "Your level has changed to (%d+)"):

Code:
t = args.captures;
if t[1] == "56"
then
         return true
else
         return false
end
yields only

Code:
Error executing Trigger Lua:[string "return function(self,args,captures) t = arg..."]:1: attempt to index local 'args' (a nil value)
I notice that the example Response LUA code on this site seems to have no problem accessing the "args" table. Yet, even if I transplant that same code to Trigger, it fails on the first line ("self = args.self"). So, there must be some nuance to the difference between Trigger and Response LUA, that simply eludes me. Again, it's probably just my lack of LUA knowledge/experience.

I looked for example code of Trigger code accessing args or args.captures, but couldn't find any. The only Trigger code I see in these comments accesses AlertMain, not args.

Ideas?
It's been six years and many other projects since I wrote that piece of Lotro Alerts so it's not exactly fresh in my mind. I do recall it being one of the more powerful but complicated aspects of Alerts since it allows dynamically compiling and executing code as messages are received (triggers) as well as when alerts are fired (responses). Unfortunately, the development version that I currently have does not match the published version so I will have to set up a test environment with a copy of the published plugin to fool around with it to see exactly what is happening. I'm a bit busy atm so it may take a few days to get around to it. I'm pretty sure that what you are trying to do will be doable and not too difficult once I dig into it and remember how the mechanism works.

EDIT: I started playing with it and there does indeed seem to be something odd. It was working for me last night but I am now getting the error you got when using the published version and your code. I will have to look into it a bit more, there seems to be a bug in ver. 1.08

EDIT 2: Ah. I found the discrepancy. There is a bug in the released version in the Custom Lua Trigger code.
In main.lua, line 2317 is:
Code:
										success,result=pcall(userFunc,args);
but should be:
Code:
										success,result=pcall(userFunc,Alerts[tmpIndex],args2);
If you make that change in your local copy your trigger Lua code should now work as you were expecting. I will have to do a bit more testing before releasing an update.

Last edited by Garan : 02-12-2022 at 12:15 PM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 02-11-2022, 06:26 PM  
Egarthur
The Wary
 
Egarthur's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 4
Uploads: 2
Accessing args.captures from Trigger LUA

Hi,
First-time poster to lotrointerface.com. Awesome plugin, by the way.

I'm trying to configure/program Alerter to provide a "missing feature" of the new LI system, namely, a reminder when the character levels and the level is such that a new reforge is available. There are 20 such reforge levels currently identified, mostly on the 1s and 6s.

Now, I know that LUA "patterns" don't have a true regex (a|b) type alternation capability, and that, because of that, the usual advice, for Alerter, is just to create separate alerts, each one covering a subset of all possible matches.

In this case, these 5 do the trick:
  • Your level has changed to 56
  • Your level has changed to [6-9][16]
  • Your level has changed to 1[0-3][16]
  • Your level has changed to 1[02]0
  • Your level has changed to 105

However, the perfectionist in me, wants to see if a single alert can cover all 20 matches, and that means writing some LUA code. LUA is not, however, among the languages that I know very well. So, it's probably just some newbie mistake, but I can't seem to access the args.captures sub-table (or the args table, for that matter) from Trigger LUA. Even a trivial piece of code like (with a capturing pattern "Your level has changed to (%d+)"):

Code:
t = args.captures;
if t[1] == "56"
then
         return true
else
         return false
end
yields only

Code:
Error executing Trigger Lua:[string "return function(self,args,captures) t = arg..."]:1: attempt to index local 'args' (a nil value)
I notice that the example Response LUA code on this site seems to have no problem accessing the "args" table. Yet, even if I transplant that same code to Trigger, it fails on the first line ("self = args.self"). So, there must be some nuance to the difference between Trigger and Response LUA, that simply eludes me. Again, it's probably just my lack of LUA knowledge/experience.

I looked for example code of Trigger code accessing args or args.captures, but couldn't find any. The only Trigger code I see in these comments accesses AlertMain, not args.

Ideas?

Last edited by Egarthur : 02-11-2022 at 06:32 PM.
Egarthur is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-01-2021, 02:37 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 326
File comments: 922
Uploads: 20
There was a small issue with the prior trigger code for the Captain's Motivating Speach alert.

If the user has to recast Motivating Speach manually prior to the timer, then there will be multiple alerts. To fix this, change the code to:
Code:
Code:
for k,v in ipairs(alertMain.AlertDisplays) do
if v.Message:GetText()=="Reapply Motivating Speech" then
v:SetVisible(false)
v:SetWantsUpdates(false)
v.Done=true
alertMain:SetWantsUpdates(true)
end
end
The additional lines will not only hide the prior instances, it will be prevented from triggering and allowed to be automatically removed and garbage collected.

Last edited by Garan : 12-01-2021 at 02:38 PM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 09-15-2021, 08:13 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 326
File comments: 922
Uploads: 20
Re: LFF message

Quote:
Originally Posted by CareyO
I'm trying to do a simple alert that when [The 9] appears in the LFF channel it give me a message on my screen. I do get the message but it is anytime anything pops up in the LFF Channel.
That's actually one of the easier scenarios. I'm not sure if you want to include the brackets or if they were just in your post to offset the text you wanted to trigger on. I will assume you do not actually want the brackets. To trigger on the text "The 9", all you have to do is set the Pattern to the text ".*The 9.*" (without the quotes). The period and asterisk characters are special pattern matching characters which in this case mean zero or more of any character. So the entire pattern would be zero or more of any character followed by the characters "The 9" followed by zero or more characters. In other words, any message containing "The 9".

So, to recap, just make the Pattern:
Code:
.*The 9.*
Make sure you have selected the LFF channel and set some value for the Message (the text that is displayed when the trigger fires).

If for some reason you did want the brackets included in the trigger, you would make the Pattern:
Code:
.*[The 9].*
but I don't think that was your intent.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 09-14-2021, 08:07 PM  
CareyO
The Wary

Forum posts: 0
File comments: 5
Uploads: 0
LFF message

I'm trying to do a simple alert that when [The 9] appears in the LFF channel it give me a message on my screen. I do get the message but it is anytime anything pops up in the LFF Channel.
CareyO is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 06-09-2021, 07:22 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 326
File comments: 922
Uploads: 20
Refreshing Motivating Speech

OK. Turns out there IS a good reason to use the Custom Lua code. If you refresh the skill using a client quickslot instead of the alert quickslot, the alert will sit there and continue to cover the screen instead of nicely going away. By using the Custom Lua in the trigger it will clear the alert no matter how you refresh:


So, just edit the existing alert definition (or add this when creating a new one) and it will clear whether you refresh using the quickslot in the alert or a built-in quickslot.

EDIT:
There is a slight issue with the code as shown, if the user has to recast Motivating Speach manually prior to the timer, then there will be multiple alerts. To fix this, change the code to:
Code:
for k,v in ipairs(alertMain.AlertDisplays) do
if v.Message:GetText()=="Reapply Motivating Speech" then
v:SetVisible(false)
v:SetWantsUpdates(false)
v.Done=true
alertMain:SetWantsUpdates(true)
end
end
The additional lines will not only hide the prior instances, it will be prevented from triggering and allowed to be automatically removed and garbage collected.

Last edited by Garan : 12-01-2021 at 02:38 PM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Post A Reply

 
Category Jump:
Search this Category:
 

All times are GMT -5. The time now is 08:05 PM.


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