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
aduan
Newbie


Joined: 12 Jul 2008
Posts: 4

PostPosted: Sat Jul 12, 2008 1:09 pm   

simple vbscript question
 
I have the following piece of code, and I'd like to add a cmud variable (version 2.30) at one place. How do I pull that off?


Set aff = CreateObject("Msxml2.DOMDocument")
aff.Load("C:\Users\daniel\Documents\My Games\CMUD\Achaea\afflictions.xml")

Set nod = aff.SelectSingleNode("/root/affliction[affname='" & variablehere & "']")
'0=priority
'1=affliction
'2=afflicted
'3=focus
'4=pipe
'5=herb
'6=salve
'7=tree

nod.childnodes(2).text = "x"

aff.Save("C:\Users\daniel\Documents\My Games\CMUD\Achaea\afflictions.xml")

Regards,

Aduan
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Jul 12, 2008 5:01 pm   
 
Use the zsvar object to access a CMUD variable. For example, if your variable name is "myvar", then your line would look like this:

Set nod = aff.SelectSingleNode("/root/affliction[affname='" & zsvar.myvar & "']")
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Jul 12, 2008 5:43 pm   
 
I have an inkling that it might be zvar rather than zsvar, but it's been quite a few versions since I used WSH for anything.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
aduan
Newbie


Joined: 12 Jul 2008
Posts: 4

PostPosted: Sun Jul 13, 2008 4:02 pm   
 
i got it to work with zvar after.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jul 14, 2008 5:29 pm   
 
Yep, my bad...it's "zvar".
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