Guest User

Untitled

a guest
May 20th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.09 KB | None | 0 0
  1. {Multisell logger RaRus (HF5)
  2. 1. Create multisell folder on drive C://.
  3. 2. Open any multisell shop, this programm will save it to your pc.
  4. }
  5.  
  6. var
  7. i,j,list,production_item,production_count,ingredient_item,ingredient_count,size, finished: int64;
  8. product_size, ingredient_size, pro, ing: integer;
  9. Data: TMemo;
  10. Form1: TForm;
  11.  
  12. procedure init;
  13. begin
  14.     Form1 := TForm.Create(nil);
  15.     Form1.Caption := '';
  16.     Form1.BorderStyle := bsSizeable;
  17.     Form1.Width:=1000;
  18.     Form1.Height:=700;
  19.  
  20.     Data:=TMemo.Create(Form1);
  21.     Data.Parent:=Form1;
  22.     Data.Width:=1000;
  23.     Data.Height:=700;
  24.     Data.Left:=0;
  25.     Data.Top:=0;
  26. end;
  27.  
  28. procedure Free;
  29. begin
  30.   Data.Free;
  31.   Form1.Free;
  32. end;
  33.  
  34. procedure CreatureSay(s:string);
  35. begin
  36.     buf:=#$4A;
  37.     WriteD(1);
  38.     WriteD(0);
  39.     WriteS('SYS');
  40.     WriteD(-1);
  41.     WriteS(s);
  42.     SendToClient;
  43. end;
  44.    
  45.  
  46. begin      
  47. if FromServer and (pck[1]=#$D0)then
  48. begin
  49.     i:=2;
  50.     list:=ReadD(i);
  51.     inc(i,4);
  52.     finished:=ReadD(i);
  53.     inc(i,4);
  54.     size:=ReadD(i);
  55.    
  56.     for j:=1 to size do begin
  57.        
  58.     Data.lines.add('   <item>');
  59.     inc(i,31);
  60.     product_size:=ReadH(i);
  61.     ingredient_size:=ReadH(i);
  62.    
  63.     for pro:=1 to product_size do begin
  64.     production_item:=ReadD(i);
  65.     inc(i,6);
  66.     production_count:=ReadQ(i);
  67.     inc(i,26);    
  68.     Data.lines.add('      <production id="'+inttostr(production_item)+'" count="'+inttostr(production_count)+'"/>');
  69.     end;
  70.        
  71.     for ing:=1 to ingredient_size do begin
  72.     ingredient_item:=ReadD(i);  
  73.     inc(i,2);    
  74.     ingredient_count:=ReadQ(i);
  75.     CreatureSay('ingredient_count: '+inttostr(ingredient_count));  
  76.     inc(i,26);          
  77.     Data.lines.add('      <ingredient id="'+inttostr(ingredient_item)+'" count="'+inttostr(ingredient_count)+'"/>');  
  78.     end;
  79.      
  80.     Data.lines.add('   </item>');
  81.    
  82.     end;
  83.    
  84.     if (finished = 1) then begin
  85.     CreatureSay('multisell id: '+inttostr(list)+' saved!');
  86.     Data.lines.savetofile('C:\multisell\'+inttostr(list)+'.xml');
  87.     Data.lines.clear;
  88.     end;
  89. end;
  90.  
  91.  
  92. end.
Add Comment
Please, Sign In to add comment