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
Hai-Etlik
Newbie


Joined: 10 Sep 2009
Posts: 3

PostPosted: Thu Sep 10, 2009 1:29 am   

XML parsing or reading Stdout of called program
 
I'm not really a zMUD user but I'm trying to adapt a combination TinyFugue/Ruby script for someone who is but who doesn't know anything about programming.

I have XML files, I need to read one, and execute a series of timed actions based on it. I currently have a Ruby script that can do this and I can load and execute the output in TinyFuge with the /quote command. Is there any way to do this in zMUD? I skimmed the docs but didn't notice anything obvious.

Failing that, is there a way to parse XML in a script?
Reply with quote
Tech
GURU


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

PostPosted: Thu Sep 10, 2009 3:06 pm   
 
Generally speaking, there's nothing in zMUD specifically designed for parsing XML.

That said there are few options. The first (and most likely solution) is the MXP protocol. It allows the user to define their own custom XML tags and how zMUD should respond to them.

If there is a Ruby implementation that is Windows Scripting Host (WSH) compliant, you can use it to write scripts and triggers in Ruby.

Other commands that might be useful to you are #FILE, #READ, #CLOSE, #WRITE, #SEND, #TYPE and #LOG.

I hope that helps.
_________________
Asati di tempari!
Reply with quote
Hai-Etlik
Newbie


Joined: 10 Sep 2009
Posts: 3

PostPosted: Thu Sep 10, 2009 5:34 pm   
 
Hmm, looks like the closest I'll be able to manage is outputting zMUD script to a file and then loading that as a separate step.
Reply with quote
Tech
GURU


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

PostPosted: Thu Sep 10, 2009 8:14 pm   
 
Can you explain in more detail what exactly you're trying to accomplish? the more information you provide the more insight you can receive as to the best approach.
_________________
Asati di tempari!
Reply with quote
Hai-Etlik
Newbie


Joined: 10 Sep 2009
Posts: 3

PostPosted: Fri Sep 11, 2009 1:23 am   
 
The XML files are songs with timing information, indications of chorus/verse structure, spoken words, and actions. The idea is to have the song in a form that can (In theory) be used by any client, on any MUD, by any character, and which can be viewed in a web browser with XSLT.

I'll admit it's overkill but it's overkill that I'm rather proud of.

Right now the Ruby script can produce a simple set of commands appropriate to either Bards or Non-Bards on the MUD I play, (The Bard class gets special commands for singing nicely formatted songs) and it can do so plain, plain but with delays, or as TinyFugue commands to handle the timing. In TF I can call the script and execute the output as if I were loading a saved script using the /quote command.

Code:
/def sing = /quote -S -dexec !ruby ./retro/songs/retrosing.rb -gbard -rchangeling -ctf <./retro/songs/%{1}
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