/Tools/PathMaker.simba
http://github.com/Drags111/Reflection_Dev · Unknown · 206 lines · 190 code · 16 blank · 0 comment · 0 complexity · b3f06055e62550a25eddde31ad9f50ca MD5 · raw file
- {
- The Reflection Include Path Maker - v0.1 ALPHA
- -by Drags111
- This is a simple and easy to use Path Maker that
- will record the tiles you choose and print them
- out when you are done. Just run this script,
- login to your character, and start recording! It's
- that easy. Please let me know if you find any
- errors!
- }
- program PathMaker;
- {$DEFINE SMART}
- {$i srl\srl.scar}
- {$i Reflection\Reflection.simba}
- const
- {---SMART Setup Constants---}
- WORLD = 35;
- MEMBERS = false;
- SIGNED = true;
- {---------------------------}
- var
- pathMakerForm : TForm;
- TabControl1 : TPageControl;
- Label1 : TLabel;
- TileList : TListBox;
- DeleteButton, PrintButton: TButton;
- RecordButton : TButton;
- PathTab, PrintTab: TTabSheet;
- MyTile: TTile;
- TileCount: integer;
- procedure CreatePath(List: TListBox);
- var
- Temp: string;
- i, t: integer;
- begin
- Writeln('Creating path....');
- writeln('function LoadPath : TTileArray;');
- Writeln('begin');
- writeln(' SetLength(Result, '+ToStr(TileCount)+');');
- writeln(' Result := [');
- for i := 1 to TileCount-1 do
- begin
- Temp := Temp + List.Items[i-1]+', ';
- if((i mod 3) = 0)then
- begin
- Writeln(' '+Temp);
- Temp := '';
- end;
- end;
- Temp := Temp +List.Items[TileCount-1];
- writeln(' '+Temp);
- writeln(' ];');
- writeln('end;');
- end;
- procedure OnClick(Sender : TObject);
- var
- MyTile: TTile;
- ToAdd: String;
- begin
- SmartSetupEx(Smart_Server, Smart_Members, Smart_Signed, Smart_SuperDetail);
- case sender of
- RecordButton: begin
- MyTile := R_GetMyPos;
- ToAdd := 'Point('+ToStr(MyTile.x)+', '+ToStr(MyTile.y)+')';
- TileList.Items.Append(ToAdd);
- Inc(TileCount);
- end;
- DeleteButton: begin
- TileList.Items.Delete(TileList.ItemIndex);
- Dec(TileCount);
- end;
- PrintButton:begin
- CreatePath(TileList);
- end;
- end;
- end;
- procedure OpenForm;
- begin
- pathMakerForm := CreateForm;
- with pathMakerForm do
- begin
- Left := 423;
- Top := 185;
- Width := 381;
- Height := 342;
- BorderIcons := [biSystemMenu, biMinimize];
- Caption := 'Reflection Path Maker';
- Color := clBtnFace;
- Font.Color := clWindowText;
- Font.Height := -11;
- Font.Name := 'MS Sans Serif';
- PixelsPerInch := 96;
- BorderStyle := bsSingle;
- end;
- TabControl1 := TPageControl.Create(pathMakerForm);
- with TabControl1 do
- begin
- Parent := pathMakerForm;
- Left := 24;
- Top := 16;
- Width := 333;
- Height := 305;
- end;
- PathTab := TTabSheet.Create(pathMakerForm);
- with PathTab do
- begin
- PageControl := TabControl1;
- Caption := 'Path Maker';
- end;
- {PathTab}
- Label1 := TLabel.Create(TabControl1);
- with Label1 do
- begin
- Parent := PathTab;
- Left := 16;
- Top := 12;
- Width := 50;
- Height := 18;
- Caption := '[Tiles]';
- Font.Color := clMaroon;
- Font.Height := -15;
- Font.Name := 'Tahoma';
- Font.Style := [fsBold];
- ParentFont := False;
- end;
- TileList := TListBox.Create(TabControl1);
- with TileList do
- begin
- Parent := PathTab;
- Left := 16;
- Top := 36;
- Width := 293;
- Height := 201;
- Font.Color := clBlack;
- Font.Height := -15;
- Font.Name := 'Tahoma';
- Font.Style := [];
- ItemHeight := 18;
- ParentFont := False;
- TabOrder := 0;
- end;
- DeleteButton := TButton.Create(TabControl1);
- with DeleteButton do
- begin
- Parent := PathTab;
- Left := 220;
- Top := 244;
- Width := 91;
- Height := 25;
- OnClick := @OnClick;
- Caption := 'Delete Selected';
- TabOrder := 1;
- end;
- RecordButton := TButton.Create(TabControl1);
- with RecordButton do
- begin
- Parent := PathTab;
- Left := 140;
- Top := 244;
- Width := 75;
- Height := 25;
- Caption := 'Record!';
- OnClick := @OnClick;
- TabOrder := 2;
- end;
- PrintButton := TButton.Create(TabControl1);
- with PrintButton do
- begin
- Parent := PathTab;
- Left := 60;
- Top := 244;
- Width := 75;
- Height := 25;
- Caption := 'Print!';
- OnClick := @OnClick;
- TabOrder := 2;
- end;
- pathMakerForm.ShowModal;
- pathMakerForm.Free;
- end;
- var
- v : TVariantArray;
- begin
- Smart_Members := MEMBERS;
- Smart_Server := WORLD;
- Smart_Signed := SIGNED;
- SetupReflection;
- Writeln(R_GetMyPos);
- ThreadSafeCall('OpenForm',v);
- end.