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
ekhart
Novice


Joined: 28 Aug 2008
Posts: 31

PostPosted: Sun May 12, 2013 11:08 pm   

Importing Large Amounts of Text
 
Does anyone know a way to import large amounts of text (lets say 2 paragraphs worth, maybe 100 words), that is in a standard format, in to CMUD and have it take the information within and assign it all to variables so it can be re-sent to the mud in a slightly different format without spamming the original text to the screen?

I know how to do the variables pretty well and capture the text, it is getting that which I copy/paste to the command line to not get sent to the mud but at the same time capture all the variables I need that I am having difficulties with.

For example:

ALARM
Abjuration
Level: Brd 1, Rgr 1, Sor/Wiz 1
Components: V, S, F/DF
Casting Time: 1 standard action
Range: Close (25 ft. + 5 ft./2 levels)
Area: 20-ft.-radius emanation centered on a point in space
Duration: 2 hours/level (D)
Saving Throw: None
Spell Resistance: No
Alarm sounds a mental or audible alarm each time a
creature of Tiny or larger size enters the warded area or
touches it.
A creature that speaks the password (determined by you at
the time of casting) does not set off the alarm.
You decide at the time of casting whether the alarm will be
mental or audible.
Mental Alarm: A mental alarm alerts you (and only you) so
long as you remain within 1 mile of the warded area.
You note a single mental “ping” that awakens you from
normal sleep but does not otherwise disturb concentration.
A silence spell has no effect on a mental alarm.
Audible Alarm: An audible alarm produces the sound of a
hand bell, and anyone within 60 feet of the warded area can
hear it clearly.
Reduce the distance by 10 feet for each interposing closed
door and by 20 feet for each substantial interposing wall.
In quiet conditions, the ringing can be heard faintly as far
as 180 feet away.
The sound lasts for 1 round.
Creatures within a silence spell cannot hear the ringing.
Ethereal or astral creatures do not trigger the alarm.
Alarm can be made permanent with a permanency spell.
Arcane Focus: A tiny bell and a piece of very fine silver wire.



The above is what I could post to the mud and I want it to pull out some things like the name, level, description and put them in to different places via variables, but I don't want all of that text to spam my window, just the desired output after converting the information to variables.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Mon May 13, 2013 2:37 am   
 
The easiest way would probably be to put it in a text file and import it with the #file and %read commands.
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