|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: 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. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: 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.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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?
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
|
|