Top Qat Posted October 5, 2006 Share Posted October 5, 2006 What I want to do will be simple for you guys 'cos you have large brains I want to open and update an XML like this (part of Ghost Recon data files): expandcollapse popup- <GunFile> <VersionNumber>1.500000</VersionNumber> <ModelFileName>w_mm1.qob</ModelFileName> <NameToken>WPN_MM1</NameToken> <Weight>5.000000</Weight> <MagazineCapacity>12</MagazineCapacity> <MagazineWeight>2</MagazineWeight> <MaxRange>500.000000</MaxRange> <VelocityCoefficient0>1</VelocityCoefficient0> <VelocityCoefficient1>1</VelocityCoefficient1> <VelocityCoefficient2>1</VelocityCoefficient2> <KillCoefficient1>1</KillCoefficient1> <KillCoefficient2>1</KillCoefficient2> <ProjectileCount>1</ProjectileCount> <ProjectileSpread>0</ProjectileSpread> <ReticuleTextureName>reticle_gl.rsb</ReticuleTextureName> <ReticulePipLeft>43</ReticulePipLeft> <ReticulePipTop>0</ReticulePipTop> <ReticulePipRight>53</ReticulePipRight> <ReticulePipBottom>24</ReticulePipBottom> <ReticuleBaseLeft>0</ReticuleBaseLeft> <ReticuleBaseTop>0</ReticuleBaseTop> <ReticuleBaseRight>42</ReticuleBaseRight> <ReticuleBaseBottom>42</ReticuleBaseBottom> <ReticulePipBaseOffset>19</ReticulePipBaseOffset> <ReticulePipMaxOffset>200</ReticulePipMaxOffset> - <Selective> <SelectiveOption RateOfFire="30" RoundsPerPull="1" StartSound="w_140grenadelauncher_ss.wav" /> </Selective> <Recoil>100</Recoil> <RunStandAccuracy>550</RunStandAccuracy> <RunCrouchAccuracy>1000</RunCrouchAccuracy> <RunProneAccuracy>350</RunProneAccuracy> <WalkStandAccuracy>90</WalkStandAccuracy> <WalkCrouchAccuracy>300</WalkCrouchAccuracy> <WalkProneAccuracy>350</WalkProneAccuracy> <ShuffleStandAccuracy>60</ShuffleStandAccuracy> <ShuffleCrouchAccuracy>80</ShuffleCrouchAccuracy> <ShuffleProneAccuracy>50</ShuffleProneAccuracy> <StationaryStandAccuracy>15</StationaryStandAccuracy> <StationaryCrouchAccuracy>10</StationaryCrouchAccuracy> <StationaryProneAccuracy>5</StationaryProneAccuracy> <TurnBandVelocity1>0.75</TurnBandVelocity1> <TurnBandMultiplier1>1</TurnBandMultiplier1> <TurnBandVelocity2>2</TurnBandVelocity2> <TurnBandMultiplier2>5</TurnBandMultiplier2> <TurnBandVelocity3>4</TurnBandVelocity3> <TurnBandMultiplier3>10</TurnBandMultiplier3> <TurnBandVelocity4>10</TurnBandVelocity4> <TurnBandMultiplier4>30</TurnBandMultiplier4> <TurnBandVelocity5>100000</TurnBandVelocity5> <TurnBandMultiplier5>100</TurnBandMultiplier5> <StabilizationTime>0.25</StabilizationTime> <WeaponMotionType>4</WeaponMotionType> <HasUnderbarrelWeapon>0</HasUnderbarrelWeapon> <Silenced>0</Silenced> - <ZoomSettings> <Zoom>1</Zoom> <Zoom>2</Zoom> </ZoomSettings> <ProjectileFileName>40mmglgrenade.prj</ProjectileFileName> <MuzzleFlashScale>1</MuzzleFlashScale> <TracerFrequency>0</TracerFrequency> </GunFile> I want to update 2 values (or possibly more later): GunFile\MagazineCapacity = "1" GunFile\ProjectileFileName = "jammedgrenade.prj" I am thinking of placing the updates in a text file in a similar format to what I have put here. Then I read the text file and use the path and value to replace existing values. I got as far a reading values but have no idea how to update them. Thanks Link to comment Share on other sites More sharing options...
jokke Posted October 5, 2006 Share Posted October 5, 2006 (edited) Search for this inn help "StringReplace" i think that would do the trick. StringReplace ( $input, "<VelocityCoefficient0>1</VelocityCoefficient0> " or start, "<VelocityCoefficient0>2</VelocityCoefficient0> ") now i replaced <VelocityCoefficient0>1</VelocityCoefficient0> with <VelocityCoefficient0>2</VelocityCoefficient0> not 100% sure if it works tho Edited October 5, 2006 by jokke UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt. Link to comment Share on other sites More sharing options...
Top Qat Posted October 10, 2006 Author Share Posted October 10, 2006 Thanks for the idea but I would prefer to use the proper XML methods to change the data. Any suggestion from AutoIT guys please? Link to comment Share on other sites More sharing options...
Bert Posted October 10, 2006 Share Posted October 10, 2006 could you define "proper" methods? No being a jerk, it is a serious question. I've wondered about this myself, but haven't dome much research in the area. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Top Qat Posted October 11, 2006 Author Share Posted October 11, 2006 could you define "proper" methods?Using the XML parser to work on the data, not direct edits. Link to comment Share on other sites More sharing options...
herewasplato Posted October 12, 2006 Share Posted October 12, 2006 Using the XML parser to work on the data, not direct edits.See here: http://www.autoitscript.com/forum/index.ph...showtopic=19848 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now