|
Fallen.Anvil Novice
Joined: 12 Jul 2012 Posts: 47
|
Posted: Thu Jul 12, 2012 10:25 pm
Easy alias forgotten |
I play on a game where we send large blocks of text to one another broadcast into the room. The commands used are as follows.
@emit Broadcasts text into the room
%r Is a line return
%t Is a tab
%1 Was used by ZMUD, I believe.
I used to have an alias I imported from CMUD that looked similar to this:
^/p (*)
@emit %r%t%1%r
This would format things into neat paragraphs for ease of reading. Unfortunately I lost the original script and my memory is too fuzzy to recreate it. Anyone want to shoot this fish in the barrel?
I'm using ZMUD v3.34 Thanks |
|
|
|
Llohr Apprentice
Joined: 17 May 2005 Posts: 108
|
Posted: Fri Jul 13, 2012 5:35 am |
Could you give an example of what you want to be able to type, and what you want the alias to send to the mud when that is typed? The similar-looking alias you've shown here looks like it would do this:
You type: ^/p Hello world!
It sends: @emit %r%tHello world!%r
Which would, I suppose, send @emit, followed by a carriage return, then the (indented) text "Hello world!" and then another carriage return? I only ask because I'm not sure why any of that would be necessary or helpful. Did your alias have a way to deal with multiple lines of text, indenting only the first and carriage returning after each line? Was there a character-counting feature that separated the entered text into lines of X characters each? Did you have one alias for the first line of a paragraph and another alias for subsequent lines? That would be really simple, something like "#alias /p {~@emit ~%t%-1}" or, if you wanted the exact code you showed us:
Code: |
#alias ^/p {~@emit ~%r~%t%-1~%r} |
|
|
|
|
Fallen.Anvil Novice
Joined: 12 Jul 2012 Posts: 47
|
Posted: Fri Jul 13, 2012 7:24 am |
That's very close to being it.
I think in CMUD the ^ character made the alias act like a command.
I removed the ^ from your code example and all is good again. :)
I used to use /p Hello world!
Thank you very much. |
|
|
|
Fallen.Anvil Novice
Joined: 12 Jul 2012 Posts: 47
|
Posted: Fri Jul 13, 2012 7:30 am |
Fallen.Anvil wrote: |
That's very close to being it.
I removed the ^ from your code example and all is good again. :)
I once used /p Hello world!
Thank you very much.
Let me add to the question:
If I wanted to use a certain case /P instead of /P or /p, how might I accomplish that.
The answer will help me write more simple scripts.
|
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jul 13, 2012 2:09 pm |
Cmud ignore case in commands. /P should act the same as /p. I don't think it is possible to have Cmud treat them differently.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri Jul 13, 2012 6:56 pm |
assuming there is a gameside command difference... you either use a different alias or find a way to poll the user for which form they want (%pick)
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Fallen.Anvil Novice
Joined: 12 Jul 2012 Posts: 47
|
Posted: Sat Jul 14, 2012 11:59 pm |
Thanks for all the great input.
|
|
|
|
|
|