PDA

View Full Version : [SPS]Real-Time Path creator



tls
12-07-2011, 05:37 AM
Modded drags reflection path maker to use sps. All you have to do is set the SPSAreas and then run it. When SPS v2.0 comes out you won't have to do that.

{
The SPS 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 sps\sps.simba}
{$i srl\srl\misc\paintsmart.scar}

var
SPSAreas: TStringArray;

procedure Areas;
begin
SPSAreas := ['10_6'];
end;

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: TTabSheet;
TileCount: integer;

procedure CreatePath(List: TListBox);
var
Temp: string;
i: integer;
begin
Writeln('Creating path....');
writeln('function LoadPath : TPointArray;');
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: TPoint;
ToAdd: String;
begin
SmartSetupEx(Smart_Server, Smart_Members, Smart_Signed, Smart_SuperDetail);
case sender of
RecordButton: begin
MyTile := SPS_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 := 'SPS 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;
Areas;
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE, SPSAreas);
Writeln(SPS_GetMyPos);
ThreadSafeCall('OpenForm',v);
end.

Kyle Undefined
12-07-2011, 05:42 AM
Nice! Definitely need to give this a try, great work :)

Hero
12-15-2011, 06:00 AM
I copy pasta'd the script then plugged in the SPSareas and when I hit record it just says -1,-1 before it actually put coords but then once record was pressed again it just posted the same coords. Am I doing something wrong? Lol

gamer716
12-15-2011, 08:38 AM
Thanks for sharing! I was looking for something like this.

bg5
12-20-2011, 11:06 PM
I just started with SPS and this tool is exceedingly usefull!


but then once record was pressed again it just posted the same coords. Am I doing something wrong? Lol

Propably you didn't enable SMART after you moved your character. It can only record if smart is enabled ,else it will show last coords.


I just started with SPS and this tool is exceedingly usefull!

Gaston7eze
12-22-2011, 11:43 PM
Could someone make it to .simba for download as i cant copy and past as it is copy as hell.

Coh3n
12-31-2011, 03:38 AM
Could someone make it to .simba for download as i cant copy and past as it is copy as hell.Don't use IE.