TriggerStyleRuns without send_to_script_after_omit?

Posted by AdInfinitum on Thu 28 Jul 2022 01:05 PM — 8 posts, 19,691 views.

#0
I'm trying to suppress the output from another plugin that conflicts with a current plugin. Now, I can suppress the output and grab the styles if I send to script after omit. Or I can not grab the style runs and just grab the plain line and use StopEvaluatingTriggers(true) to suppress the output from other plugins (assuming I understand how that function works).

However, I need both cases to be true. Is there a way that I'm missing that I can suppress the output from outside plugins AND keep the style runs? The code in question so far is this:

   <trigger group="scans"
      regexp="y" match="^\s+ - (.*)$"
      name="scanLine" omit_from_output="y"
      send_to="14" sequence="10"
   ><send>

      local scanned = "%1"

   for _,v in ipairs(checkNames) do
      if scanned:upper():find(v:upper()) then
         if #dirTemp > 0 then
            TSROutput[(#TSROutput+1)] = dirTemp
            dirTemp = {}
         end
         TSROutput[(#TSROutput+1)] = TriggerStyleRuns
      end
   end</send>

   </trigger>
USA Global Moderator #1
I'm having a hard time following what you're trying to do because you keep using overlapping terms.

Quote:
I'm trying to suppress the output...

Ok, so far so good.
Quote:
Now, I can suppress the output and grab the styles if I send to script after omit.

So do that?

Please describe the scenario in more detail, because your current question is very unclear.
Amended on Thu 28 Jul 2022 01:46 PM by Fiendish
#2
Whoops, I was hasty in posting that I did not read to make sure what was said made sense.

Here's a breakdown of what happens.

Plugin A: When scanning, the plugin returns all scan output with modified lines (using style runs and ColourNote). Triggers for scan are always on.

Plugin B: Scans with a different purpose in mind. I supply a list of keywords to scan for, and it returns those lines, only, using style runs and ColourNote.

As an example:

Regular output:
Right here you see:
     - (P)(G)(W) PlayerA
     - (P)(G)(W) (OPK) PlayerB
     - (P)(G) PlayerC
North from here you see:
     - (T)(G)(W) A Benevolent Priestess
3 North from here you see:
     - (T)(G)(W) Mother Mystra
2 East from here you see:
     - (P) (Linkdead) PlayerD
3 East from here you see:
     - (P)(G) PlayerE
3 South from here you see:
     - (R) An Aylorian tax collector
     - (G) A touring dwarf


In Plugin A, those lines are modified with different colors/text depending on various information.

In Plugin B, however, I use the command:

sscan tax priestess


and it would return only:

North from here you see:
     - (T)(G)(W) A Benevolent Priestess
3 South from here you see:
     - (R) An Aylorian tax collector


The problem I'm facing is that instead of the immediate above, I get both combined together, with Plugin B's output beneath Plugin A.

My options, as I currently see it. are as follows:

1. Completely disable Plugin A and then re-enable after the scan from Plugin B is finished.
2. Use StopEvaluatingTriggers(true) and return the line devoid of styles.
3. Live with the dual output.

Is there a way to suppress the output from Plugin A and retain the styles for Plugin B?

I would merge the two together if it were a viable option, but that cuts out those who do not want Plugin A but want Plugin B.
Amended on Thu 28 Jul 2022 02:37 PM by AdInfinitum
USA Global Moderator #3
In my opinion, anything replicating game output should use Simulate, which allows later scripts to alter the display, and not ColourNote. Using ColourNote is both hostile and unnecessary.
Amended on Thu 28 Jul 2022 02:44 PM by Fiendish
#4
Fiendish said:

In my opinion, anything replicating game output should use Simulate and not ColourNote. ColourNote is for notes with color.


If I could incorporate color into Simulate, I would probably go that route. Maybe we need a "SimulateStyles" function that works precisely like Simulate does but takes into account style functions.
USA Global Moderator #5
Quote:
If I could incorporate color into Simulate, I would probably go that route.

You can. Just convert the styles to ANSI codes. Since you're clearly playing Aardwolf, you can use my stylesToANSI function defined in aardwolf_colors.lua.

https://github.com/fiendish/aardwolfclientpackage/wiki/Color-Functions#stylestoansi-styles
#6
Fiendish said:

You can. Just convert the styles to ANSI codes. Since you're clearly playing Aardwolf, you can use my stylesToANSI function defined in aardwolf_colors.lua.

https://github.com/fiendish/aardwolfclientpackage/wiki/Color-Functions#stylestoansi-styles


Ah, well, that's helpful then. I have made the appropriate changes in Plugin B. It works the same as before, except using Simulate instead of ColourNote. Something I can incorporate into many of my plugins.

I suppose I'll need to reimagine my ColourNotes in Plugin A, too, to use Simulate instead and set a higher sequence on the triggers if I want to get this to work properly? Otherwise, as it stands, I run into the same issue, with Plugins A and B combining. Or am I missing some key component?
USA Global Moderator #7
What you do will depend entirely on how your plugins work. If plugin A reads and omits the entire original output first before printing anything, that will have a different downstream effect than if it reads/omits/redisplays each line one at a time as they arrive.