Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Sir1l
Wanderer


Joined: 01 Oct 2005
Posts: 54

PostPosted: Thu Apr 06, 2006 4:42 am   

Aliases
 
Is there a way that everything I type, when I hit enter it puts %CR at the end of it?

like....

say I type who it sends
#SENDP {who%cr}

and I also want it to work for sopmething like gt hello, how are you

it will send #SENDP {gt hello, how are you%cr}
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Apr 06, 2006 12:44 pm   
 
If you use #SEND instead of #SENDP, it will put the carriage return in for you. If you want to do a carriage return for other reasons, use #CR to send one to the game. The %crlf function is mostly useful for formatting output with #SAY, #SHOW, and #ECHO.
Reply with quote
Sir1l
Wanderer


Joined: 01 Oct 2005
Posts: 54

PostPosted: Thu Apr 06, 2006 1:21 pm   
 
Well I wanna use it cause without it it does like a blank line right after I type anything, but #SEND doesn't work either...It still needs to be #SENDP {text%CR}....anyone know how to do it?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Apr 06, 2006 4:38 pm   
 
I think maybe you don't understand the purpose of the #SEND and #SENDPROMPT commands. Why are you not just sending "gt Hello. How are you?" to the MUD? Do you want the carriage return to be embedded in your game text as though you were editing a letter and needed a linebreak code without actually seeing a linebreak in your own output? Perhaps if you explain more about what you're trying to do and why...
Reply with quote
Sir1l
Wanderer


Joined: 01 Oct 2005
Posts: 54

PostPosted: Thu Apr 06, 2006 8:49 pm   
 
Okay, here is what is happening...

I type "kill mob"

It sends to the mud kill mob, AND a return...as if I hit enter twice.

so the output is like

kill mob
You hit *
prompt
prompt

What it SHOULD do is
kill mob
you hit *
prompt

Get it? When I hit enter on anything it sends an extra enter, but if I use #SENDP {text%cr} it won't send that extra enter...Is there a way to make EVERYTHING I type from the command line force it to have a #SENDP {text%CR} behavior?
Reply with quote
Iceclaw
Apprentice


Joined: 11 Sep 2005
Posts: 124

PostPosted: Thu Apr 06, 2006 9:41 pm   
 
a catch all #ONINPUT Trigger perhaps?, just an idea to point you in a direction, i've never done anything like this.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Apr 06, 2006 10:08 pm   
 
Sir1l wrote:
Get it? When I hit enter on anything it sends an extra enter, but if I use #SENDP {text%cr} it won't send that extra enter...Is there a way to make EVERYTHING I type from the command line force it to have a #SENDP {text%CR} behavior?

See post 23291

In particular the picture showing the "Character mode" setting.
_________________
Taz :)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Apr 06, 2006 11:18 pm   
 
Also perhaps the MUD you are playing doesn't support the Telnet protocol properly. According to the Telnet spec, all lines should end in a CR and LF (char 13 and char 10). Some MUD coders have gotten lazy and think that a line should only end in a LF (\n in C) and when they see both the CR and LF they end up putting in two lines.

If this is the case, you should contact the MUD you are playing and have them fix it. There is no excuse anymore for a MUD that doesn't properly implement telnet.
Reply with quote
Sir1l
Wanderer


Joined: 01 Oct 2005
Posts: 54

PostPosted: Fri Apr 07, 2006 1:05 am   
 
okay, ill ask them about it, but in the meantime I did:

#ONINPUT {(%*)} {#SENDP {%1%cr}}

This fixes it, but now it's sending two commands...any idaes?

I type who, it sends
who
who
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Apr 07, 2006 1:52 am   
 
that's the fun of #ONINPUT. It can watch and do other things based on what you type, but it doesn't prevent what you type from going to the mud.
_________________
EDIT: I didn't like my old signature
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Fri Apr 07, 2006 6:27 am   
 
Code:
#ONINPUT {(%*)} {#GAG;#SENDPROMPT {%1%cr}}

The #GAG prevents the text from being sent to the mud then uses #SENDPROMPT to send the text so it's not picked up again by the #ONINPUT trigger.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net