Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- Export list of records
- }
- unit UserScript;
- var
- slExport: TStringList;
- list : IInterface;
- function Initialize: integer;
- begin
- slExport := TStringList.Create;
- end;
- function Process(e: IInterface): integer;
- begin
- if(GetEditValue(ElementByPath(e,'NAME - Base')) <> '')
- then begin
- slExport.Add(
- ''+ IntToHex(FormID(e), 8) + '||' +
- ''+ GetEditValue(ElementByPath(e,'NAME - Base'))+ '||'
- ''+ GetEditValue(ElementByPath(e,'DATA - Position/Rotation\Position\X'))+ '||'
- ''+ GetEditValue(ElementByPath(e,'DATA - Position/Rotation\Position\Y'))+ '||'
- ''+ GetEditValue(ElementByPath(e,'DATA - Position/Rotation\Position\Z'))+ '||'
- ''+ EditorID(e)+''
- );
- end
- end;
- function Finalize: integer;
- var
- dlgSave: TSaveDialog;
- ExportFileName: string;
- begin
- if slExport.Count <> 0 then begin
- dlgSave := TSaveDialog.Create(nil);
- try
- dlgSave.Options := dlgSave.Options + [ofOverwritePrompt];
- dlgSave.Filter := 'Excel (*.csv)|*.csv';
- dlgSave.InitialDir := 'C:\Users\screa\Desktop\WeaponData';
- dlgSave.FileName := 'wrlds.csv';
- if dlgSave.Execute then begin
- ExportFileName := dlgSave.FileName;
- AddMessage('Saving ' + ExportFileName);
- slExport.SaveToFile(ExportFileName);
- end;
- finally
- dlgSave.Free;
- end;
- end;
- slExport.Free;
- end;
- end.
- AddMessage('Processing: ' + FullPath(e));
- end;
- function Finalize: integer;
- begin
- Result := 0;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement