Janilabo

Untitled

Aug 6th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.89 KB | None | 0 0
  1. {$I MSSL\[0.5-1b]\MSSL.scar}
  2.  
  3. var
  4.   h, i, f: Integer;
  5.   s: string;
  6.   TSA: TStrArray;
  7.  
  8. begin
  9.   ClearDebug;
  10.   s := Between('<ItemDef-array>', '</ItemDef-array>', MSSL_GrabFileData(ScriptPath + 'ItemDef.xml'));
  11.   TSA := MSSL_TSAMultiBetween(s, '<ItemDef>', '</ItemDef>');
  12.   s := '';
  13.   h := High(TSA);
  14.   for i := 0 to h do
  15.   begin            
  16.     s := (s + '[Item(' + IntToStr(i) + ')]' + #13#10 +
  17.               'name=' + Between('<name>', '</name>', TSA[i]) + #13#10 +
  18.               'description=' + Between('<description>', '</description>', TSA[i]) + #13#10 +
  19.               'wieldable=' + Between('<wieldable>', '</wieldable>', TSA[i]) + #13#10 +
  20.               'stackable=' + Between('<stackable>', '</stackable>', TSA[i]) + #13#10);
  21.   end;            
  22.   f := RewriteFile(ScriptPath + 'test.ini', False);
  23.   WriteFileString(f, s);
  24.   CloseFile(f);
  25.   s := '';
  26.   SetLength(TSA, 0);
  27. end.
Advertisement
Add Comment
Please, Sign In to add comment