|
aduan Newbie
Joined: 12 Jul 2008 Posts: 4
|
Posted: 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 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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 & "']") |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
aduan Newbie
Joined: 12 Jul 2008 Posts: 4
|
Posted: Sun Jul 13, 2008 4:02 pm |
i got it to work with zvar after.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jul 14, 2008 5:29 pm |
Yep, my bad...it's "zvar".
|
|
|
|
|
|