Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ General ➜ TriggerStyleRuns without send_to_script_after_omit?

TriggerStyleRuns without send_to_script_after_omit?

Posting of new messages is disabled at present.

Refresh page


Posted by AdInfinitum   (74 posts)  Bio
Date Thu 28 Jul 2022 01:05 PM (UTC)
Message
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>
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #1 on Thu 28 Jul 2022 01:42 PM (UTC)

Amended on Thu 28 Jul 2022 01:46 PM (UTC) by Fiendish

Message
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.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by AdInfinitum   (74 posts)  Bio
Date Reply #2 on Thu 28 Jul 2022 02:09 PM (UTC)

Amended on Thu 28 Jul 2022 02:37 PM (UTC) by AdInfinitum

Message
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.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #3 on Thu 28 Jul 2022 02:40 PM (UTC)

Amended on Thu 28 Jul 2022 02:44 PM (UTC) by Fiendish

Message
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.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by AdInfinitum   (74 posts)  Bio
Date Reply #4 on Thu 28 Jul 2022 02:44 PM (UTC)
Message
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.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #5 on Thu 28 Jul 2022 02:46 PM (UTC)
Message
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

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by AdInfinitum   (74 posts)  Bio
Date Reply #6 on Thu 28 Jul 2022 03:28 PM (UTC)
Message
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?
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #7 on Fri 29 Jul 2022 01:44 PM (UTC)
Message
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.

https://github.com/fiendish/aardwolfclientpackage
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,641 views.

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.