[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Escape Characters in Trigger

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Escape Characters in Trigger
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by KaVir   Germany  (114 posts)  [Biography] bio
Date Wed 15 Feb 2012 12:30 PM (UTC)  quote  ]
Message
Gesslar said:
I want to send data to the client to be caught via trigger and update information on the client side. I would prefer to send the text wrapped in a specific escape sequence, sample to follow, and was wondering how to get it caught.

My first post on these forums concerned pretty much exactly the same issue: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=9560

I documented my experiments on a blog, which may be of interest if you're planning to do something similar: http://godwars2.blogspot.com/2010/11/introduction.html
[Go to top] top

Posted by Gesslar   (17 posts)  [Biography] bio
Date Wed 15 Feb 2012 04:37 AM (UTC)  quote  ]
Message
Good Lord. This was a trial and a half. If ANYBODY EVER ASKS, if you're using MudOS, one of the applies that may be undocumented is:


void telnet_suboption(string mess) {
        // put stuff here to handle it
}


This needs to be in one of your inheritable that gets used for your interactive objects.

I'm probably going to make an inheritable strictly for this communication processing.

Whew!
[Go to top] top

Posted by Nick Gammon   Australia  (18,769 posts)  [Biography] bio   Forum Administrator
Date Mon 13 Feb 2012 08:15 AM (UTC)  quote  ]
Message
No, not really.

http://www.youtube.com/watch?v=QvceEH3L4co

http://www.youtube.com/watch?v=KSAmAa_VN6k

Quote:

I want to send data to the client to be caught via trigger and update information on the client side.



I've done a number of posts about that, with supporting code.

http://www.gammon.com.au/forum/?id=10043

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Gesslar   (17 posts)  [Biography] bio
Date Sun 12 Feb 2012 10:43 PM (UTC)  quote  ]
Message
I wonder if implementing this on the server-side is going to be a huge pain in the butt.
[Go to top] top

Posted by Gesslar   (17 posts)  [Biography] bio
Date Sun 12 Feb 2012 10:22 PM (UTC)  quote  ]
Message
Does MUSHclient send (client) IAC DO GMCP or is it the GMCP base plugin send that? Or do I have to put that in all of my plugins?

I'm INCREDIBLY nubbish about this sort of thing (plugin writing) and do really appreciate the help.

If I someone would be available on gtalk (I'm karahd@gmail.com) I would like to pick some brains in real time, if possible.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 12 Feb 2012 08:58 PM (UTC)  quote  ]
Message
I have a bunch of GMCP-based plugins (as well as the one GMCP plugin that makes the data available) on my website: http://jonathan.com/mushclient-achaea-plugins

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Gesslar   (17 posts)  [Biography] bio
Date Sun 12 Feb 2012 08:24 PM (UTC)  quote  ]
Message
I may have found some, don't worry about it.
[Go to top] top

Posted by Gesslar   (17 posts)  [Biography] bio
Date Sun 12 Feb 2012 08:20 PM (UTC)  quote  ]
Message
Is there any sample code that I might look at that uses this? as lua?
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 12 Feb 2012 08:11 PM (UTC)  quote  ]
Message
Triggers only run when a newline is reached. If your line lacks a newline, it's considered a partial line, and triggers won't run until a newline is reached.

Have you looked into Telnet subnegotiations? Protocols like GMCP send data as part of a subnegotiation packet, which is automatically not displayed by a decent client. Example:

(Negotiate the GMCP protocol to be enabled
(client) IAC DO GMCP
(server) IAC WILL GMCP

(Send a hello message to begin)
(client) IAC SB GMCP Core.Hello {"client": "MUSHclient", "version": "4.81"} IAC SE

(Enable the char package)
(client) IAC SB GMCP Core.Supports.Add ["Char 1"] IAC SE

(Later, the server may send a stats message)
(server) IAC SB GMCP Char.Stats {"health": [10, 10], "mana": [10, 10], "stamina": [10, 10]} IAC SE



On MUSHclient's side, you'd want a GMCP plugin (Nick and I both provide versions) in order to make the messages available to other code.


If you prefer a trigger-based approach, I'd recommend using something more similar to Aardwolf's tags. (I may get this wrong, I don't play Aard, but I know the concept's the same):

{stats}10/10;10/10;10/10{/stats}


Here, there'd be a newline after the {/stats} tag. The only reason I recommend against using \e as the escape is because that's already used for ANSI color codes, i.e. "\e[35;43mMagenta on Yellow\e[0m".

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Gesslar   (17 posts)  [Biography] bio
Date Sun 12 Feb 2012 07:17 PM (UTC)  quote  ]
Message
Hi there, I'm an admin for ThresholdRPG and I have a question regarding triggering on escapes.

I want to send data to the client to be caught via trigger and update information on the client side. I would prefer to send the text wrapped in a specific escape sequence, sample to follow, and was wondering how to get it caught.

Second question, in my testing, I set omit_from_output but it doesn't seem to work very well if the line coming in isn't terminated by a \n. Perhaps it's my regex? I'm not sure. Any ideas on that might be helpful as well.

---

Sample Information:
\e|stats:10/10;10/10;10/10\e|

\e = escape character
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,265 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]