/Tools/PathMaker.simba

http://github.com/Drags111/Reflection_Dev · Unknown · 206 lines · 190 code · 16 blank · 0 comment · 0 complexity · b3f06055e62550a25eddde31ad9f50ca MD5 · raw file

  1. {
  2. The Reflection Include Path Maker - v0.1 ALPHA
  3. -by Drags111
  4. This is a simple and easy to use Path Maker that
  5. will record the tiles you choose and print them
  6. out when you are done. Just run this script,
  7. login to your character, and start recording! It's
  8. that easy. Please let me know if you find any
  9. errors!
  10. }
  11. program PathMaker;
  12. {$DEFINE SMART}
  13. {$i srl\srl.scar}
  14. {$i Reflection\Reflection.simba}
  15. const
  16. {---SMART Setup Constants---}
  17. WORLD = 35;
  18. MEMBERS = false;
  19. SIGNED = true;
  20. {---------------------------}
  21. var
  22. pathMakerForm : TForm;
  23. TabControl1 : TPageControl;
  24. Label1 : TLabel;
  25. TileList : TListBox;
  26. DeleteButton, PrintButton: TButton;
  27. RecordButton : TButton;
  28. PathTab, PrintTab: TTabSheet;
  29. MyTile: TTile;
  30. TileCount: integer;
  31. procedure CreatePath(List: TListBox);
  32. var
  33. Temp: string;
  34. i, t: integer;
  35. begin
  36. Writeln('Creating path....');
  37. writeln('function LoadPath : TTileArray;');
  38. Writeln('begin');
  39. writeln(' SetLength(Result, '+ToStr(TileCount)+');');
  40. writeln(' Result := [');
  41. for i := 1 to TileCount-1 do
  42. begin
  43. Temp := Temp + List.Items[i-1]+', ';
  44. if((i mod 3) = 0)then
  45. begin
  46. Writeln(' '+Temp);
  47. Temp := '';
  48. end;
  49. end;
  50. Temp := Temp +List.Items[TileCount-1];
  51. writeln(' '+Temp);
  52. writeln(' ];');
  53. writeln('end;');
  54. end;
  55. procedure OnClick(Sender : TObject);
  56. var
  57. MyTile: TTile;
  58. ToAdd: String;
  59. begin
  60. SmartSetupEx(Smart_Server, Smart_Members, Smart_Signed, Smart_SuperDetail);
  61. case sender of
  62. RecordButton: begin
  63. MyTile := R_GetMyPos;
  64. ToAdd := 'Point('+ToStr(MyTile.x)+', '+ToStr(MyTile.y)+')';
  65. TileList.Items.Append(ToAdd);
  66. Inc(TileCount);
  67. end;
  68. DeleteButton: begin
  69. TileList.Items.Delete(TileList.ItemIndex);
  70. Dec(TileCount);
  71. end;
  72. PrintButton:begin
  73. CreatePath(TileList);
  74. end;
  75. end;
  76. end;
  77. procedure OpenForm;
  78. begin
  79. pathMakerForm := CreateForm;
  80. with pathMakerForm do
  81. begin
  82. Left := 423;
  83. Top := 185;
  84. Width := 381;
  85. Height := 342;
  86. BorderIcons := [biSystemMenu, biMinimize];
  87. Caption := 'Reflection Path Maker';
  88. Color := clBtnFace;
  89. Font.Color := clWindowText;
  90. Font.Height := -11;
  91. Font.Name := 'MS Sans Serif';
  92. PixelsPerInch := 96;
  93. BorderStyle := bsSingle;
  94. end;
  95. TabControl1 := TPageControl.Create(pathMakerForm);
  96. with TabControl1 do
  97. begin
  98. Parent := pathMakerForm;
  99. Left := 24;
  100. Top := 16;
  101. Width := 333;
  102. Height := 305;
  103. end;
  104. PathTab := TTabSheet.Create(pathMakerForm);
  105. with PathTab do
  106. begin
  107. PageControl := TabControl1;
  108. Caption := 'Path Maker';
  109. end;
  110. {PathTab}
  111. Label1 := TLabel.Create(TabControl1);
  112. with Label1 do
  113. begin
  114. Parent := PathTab;
  115. Left := 16;
  116. Top := 12;
  117. Width := 50;
  118. Height := 18;
  119. Caption := '[Tiles]';
  120. Font.Color := clMaroon;
  121. Font.Height := -15;
  122. Font.Name := 'Tahoma';
  123. Font.Style := [fsBold];
  124. ParentFont := False;
  125. end;
  126. TileList := TListBox.Create(TabControl1);
  127. with TileList do
  128. begin
  129. Parent := PathTab;
  130. Left := 16;
  131. Top := 36;
  132. Width := 293;
  133. Height := 201;
  134. Font.Color := clBlack;
  135. Font.Height := -15;
  136. Font.Name := 'Tahoma';
  137. Font.Style := [];
  138. ItemHeight := 18;
  139. ParentFont := False;
  140. TabOrder := 0;
  141. end;
  142. DeleteButton := TButton.Create(TabControl1);
  143. with DeleteButton do
  144. begin
  145. Parent := PathTab;
  146. Left := 220;
  147. Top := 244;
  148. Width := 91;
  149. Height := 25;
  150. OnClick := @OnClick;
  151. Caption := 'Delete Selected';
  152. TabOrder := 1;
  153. end;
  154. RecordButton := TButton.Create(TabControl1);
  155. with RecordButton do
  156. begin
  157. Parent := PathTab;
  158. Left := 140;
  159. Top := 244;
  160. Width := 75;
  161. Height := 25;
  162. Caption := 'Record!';
  163. OnClick := @OnClick;
  164. TabOrder := 2;
  165. end;
  166. PrintButton := TButton.Create(TabControl1);
  167. with PrintButton do
  168. begin
  169. Parent := PathTab;
  170. Left := 60;
  171. Top := 244;
  172. Width := 75;
  173. Height := 25;
  174. Caption := 'Print!';
  175. OnClick := @OnClick;
  176. TabOrder := 2;
  177. end;
  178. pathMakerForm.ShowModal;
  179. pathMakerForm.Free;
  180. end;
  181. var
  182. v : TVariantArray;
  183. begin
  184. Smart_Members := MEMBERS;
  185. Smart_Server := WORLD;
  186. Smart_Signed := SIGNED;
  187. SetupReflection;
  188. Writeln(R_GetMyPos);
  189. ThreadSafeCall('OpenForm',v);
  190. end.