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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Sat Sep 01, 2007 2:06 pm   

Feature Request: predefined variable for telnet data
 
E.g. %telnetdata

Or whatever you want to call it. Something that automatically stores the data (including newlines) from the most recent telnet suboption thingy sent. Specifically, this would be useful for pulling data into the editor from ATCP but if people ever find other suboption using games out there it would probably come in handy for them, too.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Sep 01, 2007 5:14 pm   
 
I agree that this is something for the wishlist, but have you tried a regex like (.+(?:\012.+)*) (or maybe ([^\012]+(?:\012[^\012]+)*)) already for the editor specifically? I haven't tested this, but it's something to look at.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Sat Sep 01, 2007 6:39 pm   
 
I tried things like that (for different purposes) back in ZMud, with bad, bad results. I haven't tried it in CMud yet, since a) I really remember the pain, and b) I'm still fixing other stuff. If you want to try in CMud, be sure to let me know how it goes.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Sep 01, 2007 7:00 pm   
 
Trouble is that I don't have a way of reliably producing something like "IAC SB 200 text test LF text text LF text text IAC SE" to test it on. My hope is that the telnet triggers don't fire until the IAC SE is received, and so they'll fire on all the text and not cause the problems that the normal buffer's line-by-line approach does.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


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

PostPosted: Sun Sep 02, 2007 5:06 pm   
 
If you create a telnet option trigger with a pattern of (*), then %1 will contain all of the text sent by the MUD in the suboption command (including newlines). So, I think you can already do this.

And yes, the telnet triggers only fire when the IAC SE is received at the end.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Sun Sep 02, 2007 7:44 pm   
 
OK, so I tried this, and it didn't work.

Code:
<trigger type="Telnet" param="200" priority="10530" id="1053">
  <pattern>(*)</pattern>
  <value>#if %begins(%1, "Client.Compose") {temp = %1}</value>
</trigger>


Then I enter "write scroll" which does/should cause the composer block of text to be sent from the game. The raw file/Wireshark says I'm getting:

<200>Client.Compose Composer<LF>
This is a test scroll.<LF><LF>

but the variable is set to just

Client.Compose Composer
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Sep 02, 2007 8:44 pm   
 
Perhaps the LFs are causing the problem when it's stored - have you tried using %replace to remove them first?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Sep 03, 2007 5:08 pm   
 
How are you viewing the variable? Since variables are not expected to normally contain control characters, you might not be able to display the variable on the screen. Maybe you can do something like

#SHOW %len(@temp)

to see what CMUD thinks the length of the variable is.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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