TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

#pipe

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
Buglord



Joined: 30 Jan 2017
Posts: 1

PostPosted: Sat Feb 04, 2017 1:11 pm    Post subject: #pipe Reply with quote

A command, with two arguments, that takes the output generated (either by the MUD or by the client) in response to the first argument when input as a command, appends it literally (with every character escaped) to the second argument, and submits the second argument as a command.

For example:
Code:
>read tombstone
"Hic iacet Arthurus, rex quondam, rexque futurus"
>#pipe {read tombstone} {tell susie My Latin sucks\; could you translate the words on this tombstone for me? It says, }
You tell susie: My Latin sucks; could you translate the words on this tombstone for me? It says, "Hic iacet Arthurus, rex quondam, rexque futurus"


EDIT: even better, what if there was a command that let you put the final command first, and then inserts the results of any number of successive arguments into that command at the %1, %2, etc argument tags.

For example:
Code:

>look tombstone
This is a marble tombstone, masterfully crafted and situated at the center of the graveyard. Whoever sleeps here must be a very important figure indeed, perhaps royalty.

Some words are engraved on it.
>#pipe {tell susie I found a weird tombstone\; the flavor text says, \"%1\" The inscription says, %2. This is the tombstone mentioned in the quest, right?} {look tombstone} {read tombstone}
You tell Susie: I found a weird tombstone; the flavor text says, "This is a marble tombstone, masterfully crafted and situated at the center of the graveyard. Whoever sleeps here must be a very important figure indeed, perhaps royalty. Some words are engraved on it." The inscription says, "Hic iacet Arthurus, rex quondam, rexque futurus". This is the tombstone mentioned in the quest, right?

_________________
"Ignorance may be cured with education.
Foolishness may be cured with advice.
For stupidity there is no cure."
-- Me, talking out of my ass, just now
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sun Feb 05, 2017 4:54 pm    Post subject: Reply with quote

Actually this could be obtained with a combination of actions and aliases

Something like this (didn't try it, just a proof of concept, so it's limited to the last line):
Code:

#action {>} {#unact {%*}}

#alias {^{read|look}%*} {
    #var text {};
    #send {%1 %2};
    #action {%*} {
        #var text {%0};
    };
}


It works saving in "text" every line from the mud after using look/read, and at the prompt it will stops grabbing.

Then you can use the $text variable to complete your new sentence...

the script could also be changed to get an array of lines
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Mon Feb 06, 2017 1:28 am    Post subject: Reply with quote

The trouble that I see is knowing that the output from the Server is the response from your command and not something unrelated that it just happens to send at the right, err... wrong, time.

Remember that a grab everything #ACTION i.e. one of form "{%*}" will swallow everything that the Server outputs and as only ONE #ACTION will run at a time the priority for the one that does the #UNACTION for it MUST have a higher priority (a lower number) to ensure that it is the one that gets chosen to run in preference to the grab-everything one. At least revise the code to:
Code:
#action {>} {#unact {%*}} {1}

#alias {^{read|look}%*} {
    #var text {};
    #send {%1 %2};
    #action {%*} {
        #var text {%0};
    } {4};
}
Note the priorities now added! They can be between 1 and 9 though checking my old version of the code I note that there was no description of them in the in-game #HELP documentation... (Documentation "Bug" perhaps?) though the on-line "Manual" reports:

"The priority part is optional and determines the priority of the action, it defaults to 5."
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Feb 06, 2017 5:06 am    Post subject: Reply with quote

Yeah, as I said it was just a proof of concept Coffee

Another issue could be that the unaction will kill every other actions if the one named {%*} is not present... so also the unation should be created inside the alias
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group