lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO Stand-Alone Plugins > Other


Post A Reply
Author Comments Comment Options
Unread 09-14-2021, 08:07 PM  
CareyO
The Wary

Forum posts: 0
File comments: 10
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 09-15-2021, 08:13 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 346
File comments: 990
Uploads: 21
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 12-01-2021, 02:37 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 346
File comments: 990
Uploads: 21
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 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: 3
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 02-11-2022, 09:17 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 346
File comments: 990
Uploads: 21
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-13-2022, 02:24 PM  
Egarthur
The Wary
 
Egarthur's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 4
Uploads: 3
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 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: 3
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 05-16-2022, 10:11 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 346
File comments: 990
Uploads: 21
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 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 06-18-2022, 09:24 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 346
File comments: 990
Uploads: 21
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, 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-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-19-2022, 12:03 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 346
File comments: 990
Uploads: 21
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-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
Post A Reply

 
Category Jump:
Search this Category:
 

All times are GMT -5. The time now is 11:58 AM.


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