ID:154407
 
I don't know how to do this, and I don't want it badly enough to learn. But, It'd be great if someone could put together a little proc that takes a single text input and checks to see if it starts with a "(", and if it does, copy anything from after the "(" until it reaches ")". Then take the text from between the "(" and ")" signs and place it in a new variable, and trip the whole "(Stuff in between)" information from the original text message.

Ideally, something like this could be used to put more meaning into, for example, a say command.

instead of, "say This is boring":

You say, "This is boring"

you could do input this, "say (dully) This is, um, more interesting." and get this:

You say dully, "This is, um, more interesting."

Anyone interested in doing that? It'd make a great little library.
Anyone interested in doing that? It'd make a great little library.

It would be neat, and I *could* do it, but for the most part, anything I make I also use... and I can't think of a case where I'd want to use that. =P
that would be really easy actually, there are also easier ways of doing it if you use deadron's text handling lib.
Foomer wrote:
Ideally, something like this could be used to put more meaning into, for example, a say command.

instead of, "say This is boring":

You say, "This is boring"

you could do input this, "say (dully) This is, um, more interesting." and get this:

You say dully, "This is, um, more interesting."

Anyone interested in doing that? It'd make a great little library.

Well, to be honest I've always hated the "You say" form of chat. It's wordy and hard to read, so I've always preferred a more dialogue-oriented form:

Foomer: (dully) This is, um, more interesting.

Boldface or colored text can highlight the speaker's name, which helps make speech more readable. Other commands like whisper can be done and combined with "moods" too:

Foomer: (whispering, cautiously) Send me your dice game.
Lummox JR: (whining) I don't have your e-mail address.

The text handling behind this wouldn't be too difficult. I haven't looked too closely at Deadron's library but it should be doable.

Lummox JR
Foomer wrote:
I don't know how to do this, and I don't want it badly enough to learn. But, It'd be great if someone could put together a little proc that takes a single text input and checks to see if it starts with a "(", and if it does, copy anything from after the "(" until it reaches ")". Then take the text from between the "(" and ")" signs and place it in a new variable, and trip the whole "(Stuff in between)" information from the original text message.

As EbonShadow mentions, the TextHandling library should help, but the full answer would be a regular expression library.

I still haven't learned much about regular expressions, but might play with it sometime, though I can guarantee I will never provide everything available in Perl.