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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Zugg
MASTER


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

PostPosted: Thu Jul 26, 2007 5:08 pm   

Changes to #SEND command in v2.0
 
To better mirror the "send" and "sendraw" functions that I have added to Lua, I have made some changes to the #SEND command in CMUD v2.0, and I have added the #SENDRAW command.

In the past, #SEND would either send the contents of the specified filename to the MUD, or it would send the specified text to the MUD. The text was not processed and was not echoed.

In v2.0, the #SEND command will send the text to the MUD as if it were entered on the command line. A newline will be added to the end, and it will be echoed, and #oninput triggers will apply. (If you specify a filename, it will still be sent exactly as it worked before). To send data to the MUD without any processing, use the #SENDPROMPT or the new #SENDRAW command. The #SENDRAW command does the same thing as #SENDPROMPT, but it is better named to match the Lua "sendraw" command.

So, use #SENDRAW to send control characters and other special text to the MUD. #SENDRAW also no longer doubles the chr(255) character, allowing you to use it to send telnet option and IAC responses (within the new Telnet Option triggers, for example).

In most cases, this change should not effect your scripts. The difference will be that you will see #SEND text echoed to the screen. Only if you were using #SEND to send raw control characters to the MUD should you need to change your script, but since the old #SEND command still appended a newline, you should have already been using #SENDPROMPT for this in the past anyway.

I'm hoping that people will start using #SEND more, instead of the old workaround of using #EXEC. The main difference between #SEND and #EXEC is that #SEND does not process aliases, while #EXEC does. This is as it should be, since "#EXEC AliasName" reflects what you are really doing, whereas "#SEND AliasName" doesn't make much sense, since you are executing an alias, not sending text to the MUD. If you want #SEND to process aliases, then you should probably be using an #ONINPUT trigger instead of an alias.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Jul 26, 2007 7:22 pm   
 
I know this isn't really the place... but since you already modifying the #SEND code.

Can you also update it to make sure it resets the anti-spam counter if the text is different.

This problem was recently identified by Vitae in zMUD and I have confirmed it for CMUD as well.
_________________
Asati di tempari!
Reply with quote
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Fri Jul 27, 2007 2:01 am   
 
any chance you can make a send that sends to the mapper along with the mud but doesn't try to reparse for aliases?

I over-ride the normal north/south/east/west stuff so that I can do some checks on it before I move, but have to use #send so it doesnt do a recursive loop... the problem with this is that it is asynchronous with the mapper because it never sees the commands thru a #SEND... I tried pushing stuff directly to the mapper queue but it never was quite right.

I use it pretty much the way you're designing the new send, I echo to the screen and send, so that's nice.
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Jul 27, 2007 4:34 pm   
 
Yes, the new #SEND definitely goes through the spam-protection code, so it should reset the counter. Also, it should also be seen by the mapper.
Reply with quote
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Fri Jul 27, 2007 10:01 pm   
 
how would you do this using the new #SEND

#ALIAS north {
#IF (@balance) {#SEND {north}}
}

If I use #SENDRAW the mapper probably doesn't see it, but if I use send it sounds like theres a recursion loop

(sorry for asking... )
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Jul 27, 2007 10:12 pm   
 
The new send doesn't process aliases, so no loop.

Zugg wrote:
The main difference between #SEND and #EXEC is that #SEND does not process aliases
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Arlie
Wanderer


Joined: 09 Jun 2006
Posts: 62
Location: Florida

PostPosted: Fri Jul 27, 2007 10:50 pm   
 
Besides, you could also do...

#ALIAS north {
#IF (@balance) {~north}
}

:)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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