Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$I MSSL\[0.5-1b]\MSSL.scar}
- var
- h, i, f: Integer;
- s: string;
- TSA: TStrArray;
- begin
- ClearDebug;
- s := Between('<ItemDef-array>', '</ItemDef-array>', MSSL_GrabFileData(ScriptPath + 'ItemDef.xml'));
- TSA := MSSL_TSAMultiBetween(s, '<ItemDef>', '</ItemDef>');
- s := '';
- h := High(TSA);
- for i := 0 to h do
- begin
- s := (s + '[Item(' + IntToStr(i) + ')]' + #13#10 +
- 'name=' + Between('<name>', '</name>', TSA[i]) + #13#10 +
- 'description=' + Between('<description>', '</description>', TSA[i]) + #13#10 +
- 'wieldable=' + Between('<wieldable>', '</wieldable>', TSA[i]) + #13#10 +
- 'stackable=' + Between('<stackable>', '</stackable>', TSA[i]) + #13#10);
- end;
- f := RewriteFile(ScriptPath + 'test.ini', False);
- WriteFileString(f, s);
- CloseFile(f);
- s := '';
- SetLength(TSA, 0);
- end.
Advertisement
Add Comment
Please, Sign In to add comment