You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've implemented the arguably more complex MCP 2.1 protocol in Lua just fine. However, a lot of old MOOs don't support MCP 2.1, so I was adding support for the original MCP 1.0 simpleedit, which looks like this:
#$# edit name: Wizard:some_verb upload: @program#2:some_verb
{x, y, z} = args;
player:tell("This is some code.");
return x * y * z;
.
It's easy enough to set up a trigger to capture the title and upload command from the first line. Where I'm having trouble, however, is catching the verb code. Anything between the #$# line and the single period at the end is verb code that needs to be captured.
I'm not sure how to do that, or even what suggestion to make to catch that code. The best I could come up with is creating a catch-all trigger in the first callback (which seems kind of gross) until it gets the single period, but then I can't remove the trigger. I could have a flag that dictates whether or not I'm interested in each line, but having every single line from the server get caught and pass through the callback seems inefficient.
Any ideas?
The text was updated successfully, but these errors were encountered:
Conditional multi line capturing is always tricky. I think your best bet is a catch all trigger and some sort of state machine for now. Once either "removing triggers" or disabling triggers is in it should be easy to solve.
I don't really have a big priority list at the moment so I could take a quick look at disabling and deleting triggers.
Trigger removal worked perfectly! Thanks! Now my MCP package supports both the "modern" MCP 2.1 simpleedit and the ancient LambdaMOO non-MCP local edit. 😁
I've implemented the arguably more complex MCP 2.1 protocol in Lua just fine. However, a lot of old MOOs don't support MCP 2.1, so I was adding support for the original MCP 1.0 simpleedit, which looks like this:
It's easy enough to set up a trigger to capture the title and upload command from the first line. Where I'm having trouble, however, is catching the verb code. Anything between the #$# line and the single period at the end is verb code that needs to be captured.
I'm not sure how to do that, or even what suggestion to make to catch that code. The best I could come up with is creating a catch-all trigger in the first callback (which seems kind of gross) until it gets the single period, but then I can't remove the trigger. I could have a flag that dictates whether or not I'm interested in each line, but having every single line from the server get caught and pass through the callback seems inefficient.
Any ideas?
The text was updated successfully, but these errors were encountered: