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
nojathon
Beginner


Joined: 21 Feb 2011
Posts: 15

PostPosted: Fri Aug 31, 2012 10:09 am   

Sortable Equipment List into different docs? A crazy idea?
 
Is it possible to log the stats of a piece of equipment from an "identify" spell and place it in a particular Word document or notepad based on item type?

For instance, if the item is a weapon, it would go in weapon.txt.
If it was a helmet, it would go in helmet.txt.

Here's the spell:

You feel informed:
Object 'a smartgun', Item type: GUN
Can be worn on: TAKE WIELD
Item is: NOBITS
Can be salvaged into: [Metals] Iron

Weight: 6, Value: 1000, Min. level: 0
Gun Type: CLIP
The number of shots per round: 3
Unloaded Damage: 1d2 for an average per-round damage of 1.5.
Loaded Damage: 20d1 for an average per-round damage of 20.0.
Weapon has a range of: 1
Can affect you as :
Affects: DAMROLL By 9
Affects: HITROLL By 22
Has the following perm affects: NOBITS

Extra description:
It is a customized SMG fitted with a smarklink system to help one's aim.

Since this is a gun, or weapon, could I make this go into gun.txt automatically? or gun.doc? Something like, if item type=gun, then log text into xxx.

Thanks
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Fri Aug 31, 2012 10:20 am   
 
Take a look at the following #HELP files: #FILE #WRITE #CLOSE
_________________
Discord: Shalimarwildcat
Reply with quote
nojathon
Beginner


Joined: 21 Feb 2011
Posts: 15

PostPosted: Sat Sep 01, 2012 1:48 am   
 
Oh cool, thanks. I looked at the commands and I think I'm getting closer. I believe I can set up a trigger based on item type to write to a particular file. The problem comes in that it only logs from the "item type" and on. Since the name of the object is before the item type, how do I get it to go back and log the object name and not just from the item type on down?

Thanks again for your time to answer, I could use another push in the right direction.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Sep 01, 2012 3:04 am   
 
The object name is in the same line as the item type, so you should be able to capture it in the same trigger that you're opening the file in.
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Tue Sep 04, 2012 12:05 am   
 
I would suggest that when you write the data to the file you write it as well-formed XML. That has the great advantage of being portable to other applications including WORD and EXCEL. Simply initialize the file with an XML header and add each item as an XML node.
_________________
Sic itur ad astra.
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