SRL Archive - Other Scripts

Dynamic DTM Editer By Sky Scripter


SKy Scripter

2007-06-09 01:01:17

Dynamic DTM Editer

By Sky Scripter


Features:


1: Able to Print out Dynamice DTM, Kind of like making a normal DTM.

2: You can save the DTM into a SCAR File.

3: Able to Edit The Tolerance and Ect. by clicking on the SubPoint in the list box then change it.
Make sure you click main point before closing or printing it :p.

4: Will Auto Detect RS…

5: if not making a DDTM for Runescape then make sure you drag client on whatever your Making a DDTM on….


[ATTACH]4392[/ATTACH]

Sorry For The Bad Pic. :p




program Dynamic_DTM_Editer;
/////////////////////////////////////////////////////////
// //
// Dynamic DTM Editer by Sky Scripter //
// //
// A Thanks To : WT-Fakawi For Giving me the Idea //
// And Wizzup? //
// //
// //
// //
/////////////////////////////////////////////////////////





var
MainForm, AboutForm : TForm;
MainImage, Preview, TextImage: TImage;
Image : Array[1..2] of TIMAGE;
MainMenu : TMAINMENU;
SubMenu : Array [1..4] of TMENUITEM;
AddMenu : Array [1..10] of TMENUITEM;
ListBox : TLISTBOX;
Shap : TCOMBOBOX;
SaveDTM : TSaveDialog;
MainMemo : TMEMO;
EditList : array [1..5] of TEdit;
OldCanvas : TCanvas;
Coords : TEdit;
PrintDTM : TDTM;
ScrollBox, ScrollBoxEdit: TSCROLLBOX;
Panel : Array [1..5] of TPANEL;
i, Point, CurrentSub, OldBitmap, LastP, W, H, SCAR_Icon : Integer;
FlashLight : TTIMER;
Pixel : TPointArray;
AboutButton : TBITBTN;

function FindRsClient : boolean;
begin
Result := FindWindowBySize(766,504);
end;


Procedure PrintTDTM;
begin
Writeln('***********************************************');
Writeln('');
Writeln('');
Writeln('DTM.MainPoint.Areashape := ' + Inttostr(PrintDTM.MainPoint.Areashape)+';');
Writeln('DTM.MainPoint.Areasize := ' + Inttostr(PrintDTM.MainPoint.Areasize)+';');
Writeln('DTM.MainPoint.Color := ' + Inttostr(PrintDTM.MainPoint.Color)+';');
Writeln('DTM.MainPoint.Tolerance := ' + Inttostr(PrintDTM.MainPoint.Tolerance)+';');
Writeln('DTM.MainPoint.x := ' + Inttostr(PrintDTM.MainPoint.x)+';');
Writeln('DTM.MainPoint.y := ' + Inttostr(PrintDTM.MainPoint.y)+';');
Writeln('');
Writeln('SetArrayLength(DTM.SubPoints, ' + Inttostr(GetArrayLength(PrintDTM.SubPoints))+');');
Writeln('');
For i := 0 to GetArrayLength(PrintDTM.SubPoints)-1 do
begin
Writeln('DTM.SubPoints['+Inttostr(i)+'].Areashape := ' + Inttostr(PrintDTM.SubPoints[i].Areashape)+';');
Writeln('DTM.SubPoints['+Inttostr(i)+'].Areasize := ' + Inttostr(PrintDTM.SubPoints[i].Areasize)+';');
Writeln('DTM.SubPoints['+Inttostr(i)+'].Color := ' + Inttostr(PrintDTM.SubPoints[i].Color)+';');
Writeln('DTM.SubPoints['+Inttostr(i)+'].Tolerance := ' + Inttostr(PrintDTM.SubPoints[i].Tolerance)+';');
Writeln('DTM.SubPoints['+Inttostr(i)+'].x := ' + Inttostr(PrintDTM.SubPoints[i].x)+';');
Writeln('DTM.SubPoints['+Inttostr(i)+'].y := ' + Inttostr(PrintDTM.SubPoints[i].y)+';');
Writeln('');
end;

end;


Procedure LoadEm;
begin
Try
EditList[1].Text := inttostr(PrintDTM.SubPoints[CurrentSub].AreaSize);
EditList[2].Text := inttostr(PrintDTM.SubPoints[CurrentSub].Tolerance);
EditList[3].Text := inttostr(PrintDTM.SubPoints[CurrentSub].Color);
EditList[4].Text := inttostr(PrintDTM.SubPoints[CurrentSub].x);
EditList[5].Text := inttostr(PrintDTM.SubPoints[CurrentSub].y);
Case PrintDTM.SubPoints[CurrentSub].AreaShape of
0 : Shap.Text := 'Rectangle';
1 : Shap.Text := 'Cross';
2 : Shap.Text := 'Diagonal Cross';
end;
Except
end;
end;

Procedure SaveEm;
begin
Try
PrintDTM.SubPoints[CurrentSub].AreaSize := StrToInt(EditList[1].Text);
PrintDTM.SubPoints[CurrentSub].Tolerance := StrToInt(EditList[2].Text);
PrintDTM.SubPoints[CurrentSub].Color := StrToInt(EditList[3].Text);
Case Trim(LowerCase(Shap.Text)) of
'cross': PrintDTM.SubPoints[CurrentSub].AreaShape := 1;
'diagonal cross': PrintDTM.SubPoints[CurrentSub].AreaShape := 2;
end;
Except
end;
end;

Procedure Restart;
Begin
SetArrayLength(PrintDTM.SubPoints, 0);
Point := 1;
CurrentSub := 0;
FlashLight.Enabled := False;
CopyCanvas(OldCanvas, MainImage.Canvas, 0, 0, W, H, 0, 0, W, H);
For i := 1 to 5 do
EditList[i].Text := '0';
Shap.Text := 'Rectangle';
ListBox.Items.Clear;
end;

Procedure SaveTDTM(Path : String);
var
i, PathFile: Integer;
begin
PathFile := RewriteFile(Path + '.Scar', False);
WriteFileString(PathFile, '{ Dynamic DTM Editer By Sky Scripter }' + Chr(13) + Chr(13));
WriteFileString(PathFile, 'Var' + Chr(13));
WriteFileString(PathFile, ' DTM : TDTM;'+Chr(13));
WriteFileString(PathFile, Chr(13)+Chr(13));
WriteFileString(PathFile,'DTM.MainPoint.Areashape := ' + Inttostr(PrintDTM.MainPoint.Areashape)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.MainPoint.Areasize := ' + Inttostr(PrintDTM.MainPoint.Areasize)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.MainPoint.Color := ' + Inttostr(PrintDTM.MainPoint.Color)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.MainPoint.Tolerance := ' + Inttostr(PrintDTM.MainPoint.Tolerance)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.MainPoint.x := ' + Inttostr(PrintDTM.MainPoint.x)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.MainPoint.y := ' + Inttostr(PrintDTM.MainPoint.y)+';'+ Chr(13));
WriteFileString(PathFile, Chr(13));
WriteFileString(PathFile,'SetArrayLength(DTM.SubPoints, ' + Inttostr(GetArrayLength(PrintDTM.SubPoints))+');'+ Chr(13));
WriteFileString(PathFile, Chr(13));
For i := 0 to GetArrayLength(PrintDTM.SubPoints)-1 do
begin
WriteFileString(PathFile,'DTM.SubPoints['+Inttostr(i)+'].Areashape := ' + Inttostr(PrintDTM.SubPoints[i].Areashape)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.SubPoints['+Inttostr(i)+'].Areasize := ' + Inttostr(PrintDTM.SubPoints[i].Areasize)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.SubPoints['+Inttostr(i)+'].Color := ' + Inttostr(PrintDTM.SubPoints[i].Color)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.SubPoints['+Inttostr(i)+'].Tolerance := ' + Inttostr(PrintDTM.SubPoints[i].Tolerance)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.SubPoints['+Inttostr(i)+'].x := ' + Inttostr(PrintDTM.SubPoints[i].x)+';'+ Chr(13));
WriteFileString(PathFile,'DTM.SubPoints['+Inttostr(i)+'].y := ' + Inttostr(PrintDTM.SubPoints[i].y)+';'+ Chr(13));
WriteFileString(PathFile, Chr(13));
end;
CloseFile(PathFile);
end;

Function ReFindClient : Boolean;
begin
Result := FindRsClient;
If Result then
begin
MainForm.HIDE;
Wait(200);
ActivateClient;
GetClientDimensions(W, H);
Point := 1;
CopyCanvas(GetClientCanvas, MainImage.Canvas, 0, 0, W, H, 0, 0, W, H);
CopyCanvas(MainImage.Canvas, OldCanvas, 0, 0, W, H, 0, 0, W, H);
Restart;
MainForm.SHOW;
MainForm.BringToFront;
end;
end;

Procedure AllSenders(Sender : TObject);
begin
If (Sender = MainForm) then
begin
Try
If ((MainForm.Width) < 400) then MainForm.Width := 400;

If ((MainForm.Height) < 258) then MainForm.Height := 258;
except
end;
end;

If (Sender = ListBox) then
begin
Try
If (LastP = -1) then
begin
Try
PrintDTM.MainPoint.AreaSize := StrToInt(EditList[1].Text);
PrintDTM.MainPoint.Tolerance := StrToInt(EditList[2].Text);
PrintDTM.MainPoint.Color := StrToInt(EditList[3].Text);
Case Trim(LowerCase(Shap.Text)) of
'cross': PrintDTM.MainPoint.AreaShape := 1;
'diagonal cross': PrintDTM.MainPoint.AreaShape := 2;
end;

Except
end;
end else
begin
CurrentSub:= LastP;
SaveEm;
end;

Except
end;

If (ListBox.ITEMINDEX = 0) then
begin
try
EditList[1].Text := inttostr(PrintDTM.MainPoint.AreaSize);
EditList[2].Text := inttostr(PrintDTM.MainPoint.Tolerance);
EditList[3].Text := inttostr(PrintDTM.MainPoint.Color);
EditList[4].Text := inttostr(PrintDTM.MainPoint.x);
EditList[5].Text := inttostr(PrintDTM.MainPoint.y);
Case PrintDTM.MainPoint.AreaShape of
0 : Shap.Text := 'Rectangle';
1 : Shap.Text := 'Cross';
2 : Shap.Text := 'Diagonal Cross';
end;
except
end;
CurrentSub := -1;
end else
begin
CurrentSub:= ListBox.ITEMINDEX-1;
LoadEm;
end;
LastP := CurrentSub;
end;


If (Sender = AddMenu[1]) Then Restart;
If (Sender = AddMenu[4]) Then ReFindClient;
If (Sender = AddMenu[2]) then
If (SaveDTM.Execute) then
begin
SaveTDTM(SaveDTM.FileName);
end;

If (Sender = AddMenu[5]) then
begin
MainMemo.Lines.Add('Finding RS...');
if (ReFindClient) then
MainMemo.Lines.Add('Found Client!')
else
MainMemo.Lines.Add('RS Was Not Found :(');
end;

if (Sender = AddMenu[7]) then MainMemo.Clear;
if (Sender = AddMenu[10]) Then AboutForm.SHOW;
If (Sender = AddMenu[4]) Then
begin
Try
MainMemo.Clear;
MainMemo.Lines.Add('');
MainMemo.Lines.Add('DTM.MainPoint.Areashape := ' + Inttostr(PrintDTM.MainPoint.Areashape)+';');
MainMemo.Lines.Add('DTM.MainPoint.Areasize := ' + Inttostr(PrintDTM.MainPoint.Areasize)+';');
MainMemo.Lines.Add('DTM.MainPoint.Color := ' + Inttostr(PrintDTM.MainPoint.Color)+';');
MainMemo.Lines.Add('DTM.MainPoint.Tolerance := ' + Inttostr(PrintDTM.MainPoint.Tolerance)+';');
MainMemo.Lines.Add('DTM.MainPoint.x := ' + Inttostr(PrintDTM.MainPoint.x)+';');
MainMemo.Lines.Add('DTM.MainPoint.y := ' + Inttostr(PrintDTM.MainPoint.y)+';');
MainMemo.Lines.Add('');
MainMemo.Lines.Add('SetArrayLength(DTM.SubPoints, ' + Inttostr(GetArrayLength(PrintDTM.SubPoints))+');');
MainMemo.Lines.Add('');
For i := 0 to GetArrayLength(PrintDTM.SubPoints)-1 do
begin
MainMemo.Lines.Add('DTM.SubPoints['+Inttostr(i)+'].Areashape := ' + Inttostr(PrintDTM.SubPoints[i].Areashape)+';');
MainMemo.Lines.Add('DTM.SubPoints['+Inttostr(i)+'].Areasize := ' + Inttostr(PrintDTM.SubPoints[i].Areasize)+';');
MainMemo.Lines.Add('DTM.SubPoints['+Inttostr(i)+'].Color := ' + Inttostr(PrintDTM.SubPoints[i].Color)+';');
MainMemo.Lines.Add('DTM.SubPoints['+Inttostr(i)+'].Tolerance := ' + Inttostr(PrintDTM.SubPoints[i].Tolerance)+';');
MainMemo.Lines.Add('DTM.SubPoints['+Inttostr(i)+'].x := ' + Inttostr(PrintDTM.SubPoints[i].x)+';');
MainMemo.Lines.Add('DTM.SubPoints['+Inttostr(i)+'].y := ' + Inttostr(PrintDTM.SubPoints[i].y)+';');
MainMemo.Lines.Add('');
end;
except
end;
PrintTDTM;
end;

if (Sender = AboutButton) then
AboutForm.HIDE;

end;

Procedure TakeSnape(Sender : TObject);
begin
Try
GetClientDimensions(W, H);
Point := 1;
MainForm.BringToFront;
CopyCanvas(GetClientCanvas, MainImage.Canvas, 0, 0, W, H, 0, 0, W, H);
CopyCanvas(GetClientCanvas, OldCanvas, 0, 0, W, H, 0, 0, W, H);
except
end;
end;

Procedure OnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
CopyCanvas(OldCanvas, Preview.Canvas, x - 2, y - 2, x + 3, y + 3, 2, 2, 88, 88);
Preview.Canvas.MoveTo(35, 35);
Preview.Canvas.LineTo(54, 35);
Preview.Canvas.MoveTo(35, 54);
Preview.Canvas.LineTo(54, 54);
Coords.Text := 'Coords : ' + Inttostr(x) +', ' + Inttostr(y);
end;


Procedure OnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
px, py, i, Color : Integer;
begin

If (Point = 1) then
begin
PrintDTM.MainPoint.x := x;
PrintDTM.MainPoint.y := y;
Try
PrintDTM.MainPoint.areasize := StrToInt(EditList[1].Text);
PrintDTM.MainPoint.tolerance := StrToInt(EditList[2].Text);
Case Trim(LowerCase(Shap.Text)) of
'cross': PrintDTM.MainPoint.AreaShape := 1;
'diagonal cross': PrintDTM.MainPoint.AreaShape := 2;
end;
Except
end;
PrintDTM.MainPoint.color := MainImage.Canvas.Pixels[x, y];
MainImage.Canvas.Pixels[x, y] := 0;
FlashLight.Enabled := True;
Point := 2;
EditList[3].Text := inttostr(PrintDTM.MainPoint.Color);
EditList[4].Text := inttostr(PrintDTM.MainPoint.x);
EditList[5].Text := inttostr(PrintDTM.MainPoint.y);
ListBox.Items.Add('Main Point');
Exit;
end;

If (Point = 2) then
begin
SetArrayLength(PrintDTM.SubPoints, GetArrayLength(PrintDTM.SubPoints)+1);
px := PrintDTM.MainPoint.x;
py := PrintDTM.MainPoint.y;
Color := MainImage.Canvas.Pixels[px, py];
MainImage.Canvas.MoveTo(px, py);
MainImage.Canvas.LineTo(x, y);
MainImage.Canvas.Pixels[px, py] := Color;
i := GetArrayLength(PrintDTM.SubPoints)-1;
PrintDTM.SubPoints[i].x := x;
PrintDTM.SubPoints[i].y := y;
PrintDTM.SubPoints[i].color := OldCanvas.Pixels[x, y];
Try
PrintDTM.SubPoints[i].areasize := StrToInt(EditList[1].Text);
PrintDTM.SubPoints[i].tolerance := StrToInt(EditList[2].Text);
Case Trim(LowerCase(Shap.Text)) of
'cross': PrintDTM.SubPoints[i].AreaShape := 1;
'diagonal cross': PrintDTM.SubPoints[i].AreaShape := 2;
end;
Except
end;
EditList[3].Text := inttostr(PrintDTM.SubPoints[i].Color);
EditList[4].Text := inttostr(PrintDTM.SubPoints[i].x);
EditList[5].Text := inttostr(PrintDTM.SubPoints[i].y);
ListBox.Items.Add('Sub Point '+ IntToStr(GetArrayLength(PrintDTM.SubPoints)));
end;


end;



Procedure Timeit(Sender : Tobject);
Var
x, y : Integer;
begin
Try


x := PrintDTM.MainPoint.x;
y := PrintDTM.MainPoint.y;

If (ListBox.ITEMINDEX > 0) then
begin
x := PrintDTM.SubPoints[ListBox.ITEMINDEX-1].x;
y := PrintDTM.SubPoints[ListBox.ITEMINDEX-1].y;
end;
if(MainImage.Canvas.Pixels[x, y] <> 0)and(MainImage.Canvas.Pixels[x, y] <> $FFFFFF) then
MainImage.Canvas.Pixels[x, y]:= 0;

if(MainImage.Canvas.Pixels[x, y] = 0) then
begin
MainImage.Canvas.Pixels[x, y] := $FFFFFF;
exit;
end;

if(MainImage.Canvas.Pixels[x, y] = $FFFFFF) then
begin
MainImage.Canvas.Pixels[x, y] := 0
exit;
end;
Except
end;

end;

Procedure PainAboutForm(Sender: TObject);
Var
Canvas : TCanvas;
i : Integer;
begin
Canvas := GetBitmapCanvas(SCAR_Icon);
For i := 0 to GetArrayLength(Pixel)-1 do
Canvas.Pixels[Pixel[i].x, Pixel[i].y] := 14933984;
CopyCanvas(Canvas, AboutForm.Canvas, 0, 0, 34, 27, 10, 20, 43, 47);
AboutForm.Canvas.Font.Name := 'Arial';
AboutForm.Canvas.Font.Style := [FSBold];
AboutForm.Canvas.Font.Size := 12;
AboutForm.Canvas.TextOut(55, 20, 'SCAR Cheat Development');
AboutForm.Canvas.Font.Size := 10;
AboutForm.Canvas.TextOut(55, 45, 'Created By: Sky Scripter');
AboutForm.Canvas.Font.Style := [];
AboutForm.Canvas.TextOut(55, 70, 'Credits: WT-Fakawi For The Idea!');
AboutForm.Canvas.TextOut(55, 90, 'And Wizzup?');
end;




procedure InitForm;
var
W, H, y : Integer;
Handle : Integer;
begin
MainForm := CreateForm;
MainForm.SetBounds(0, 0, 750, 600);
MainForm.POSITION:= poDesktopCenter;
MainForm.BORDERSTYLE:= bsSizeable;
MainForm.Caption := 'Dynamic DTM Editer By Sky Scripter';
MainForm.Color := 0;
MainForm.Onshow := @Takesnape;
MainForm.Onresize := @AllSenders;

Handle := GetClientWindowHandle;
SetTargetBitmap(SCAR_Icon);
FindColorsTolerance(Pixel, $FFFFFF, 0, 0, 34, 27, 0);
SetClientWindowHandle(Handle);


For i := 1 to 4 do
begin
Panel[i] := TPanel.Create(MainForm);
Panel[i].parent:=MainForm;
Case i of
1: Panel[i].Align := alTop;
2: Panel[i].Align := alRight;
3: Panel[i].Align := alBottom;
4: Panel[i].Align := alClient;
end;
end;
ScrollBoxEdit := TScrollBox.Create(MainForm);
ScrollBoxEdit.Parent:= Panel[2];
ScrollBoxEdit.Align := alClient;
ScrollBoxEdit.Color := 0;


TextImage:= TImage.Create(MainForm);
TextImage.parent:= ScrollBoxEdit;
TextImage.SetBounds(5, 5, 155, 400);

For i := 0 to 400 do
begin
If (i > 300) then
y := y - 1
else
y := y + 1;

If (y >300) and (y < 400) then
begin
If (y Mod 2) = 0 then
TextImage.Canvas.Pen.Color := 13150869 + (66050 * 300)
else
TextImage.Canvas.Pen.Color := 8083520 + (131329 * 300)-1;
end else
begin
If (y >80) then
If (y Mod 2) = 0 then
TextImage.Canvas.Pen.Color := 13150869 + (66050 * y)
else
TextImage.Canvas.Pen.Color := 8083520 + (131329 * y)-1;
end;
TextImage.Canvas.MoveTo(0, i);
TextImage.Canvas.Lineto(700, i);
end;
y:=0;
TextImage.Canvas.Brush.Style:= bsClear;
TextImage.Canvas.Font.Color := 255;
TextImage.Canvas.Font.Size := 4;
For i := 1 to 2 do
begin
Image[i]:= TImage.Create(MainForm);
Case i of
1: Image[i].parent:= Panel[1];
2: Image[i].parent:= Panel[3];
end;
Image[i].SetBounds(0, 0, 1050, 40);
Image[i].Canvas.LineTo(0, 0);
end;

For i:= 0 to 51 do
begin
y := y + 9;
If (y >0)then
begin
If (y Mod 2) = 0 then
Image[1].Canvas.Pen.Color := 13150869 + (66050 * y)
else
Image[1].Canvas.Pen.Color := 8083520 + (131329 * y)-1;
end;
Image[1].Canvas.MoveTo(0, i);
Image[1].Canvas.Lineto(1050, i);
end;

y:=0
For i:= 0 to 51 do
begin
y := y + 9;
If (y >0)then
begin
If (y Mod 2) = 0 then
Image[2].Canvas.Pen.Color := 13150869 + (66050 * y)
else
Image[2].Canvas.Pen.Color := 8083520 + (131329 * y)-1;
end;
Image[2].Canvas.MoveTo(0, i);
Image[2].Canvas.Lineto(1050, i);
end;


MainMenu :=TMainMenu.Create(MainForm);

For i := 1 to 3 do
begin

SubMenu[i]:= TMENUITEM.Create(MainForm);
Case i of
1 : SubMenu[i].Caption := 'File';
2 : SubMenu[i].Caption := 'Misc';
3 : SubMenu[i].Caption := 'Help';
end;
end;

For i := 1 to 4 do
begin

AddMenu[i]:= TMENUITEM.Create(MainForm);
Case i of
1 : AddMenu[i].Caption := 'New';
2 : AddMenu[i].Caption := 'Save as';
3 : AddMenu[i].Caption := '-';
4 : AddMenu[i].Caption := 'Print';
end;
AddMenu[i].OnClick := @AllSenders;
SubMenu[1].ADD(AddMenu[i]);
end;

For i := 5 to 7 do
begin

AddMenu[i]:= TMENUITEM.Create(MainForm);
Case i of
5 : AddMenu[i].Caption := 'Find Rs Client';
6 : AddMenu[i].Caption := '-';
7 : AddMenu[i].Caption := 'Clear Debug (Erase Memo)';
end;
AddMenu[i].OnClick := @AllSenders;
SubMenu[2].ADD(AddMenu[i]);
end;

For i := 8 to 10 do
begin

AddMenu[i]:= TMENUITEM.Create(MainForm);
Case i of
8 : AddMenu[i].Caption := 'How To Use...';
9 : AddMenu[i].Caption := '-';
10 : AddMenu[i].Caption := 'About...';
end;
AddMenu[i].OnClick := @AllSenders;
SubMenu[3].ADD(AddMenu[i]);
end;

SaveDTM := TSaveDialog.Create(MainForm);
SaveDTM.Filter := 'SCAR Files';
SaveDTM.InitialDir := ScriptPath;
SaveDTM.Options := [ofHideReadOnly, ofEnableSizing];


for i:= 1 to 3 do
MainMenu.ITEMS.ADD(SubMenu[i]);

For i := 1 to 5 do
begin
EditList[i]:= TEdit.Create(MainForm);
EditList[i].Parent:= ScrollBoxEdit;

EditList[i].SetBounds(10, 120 + (i * 30), 40, 25);
If (i > 2) then
EditList[i].SetBounds(10, 120 + (i * 30), 60, 25);
EditList[i].Text := '0';
Case i of
1: TextImage.Canvas.TextOut(50, 120 + (i * 30), ': Area Size');
2: TextImage.Canvas.TextOut(50, 120 + (i * 30), ': Tolerance');
3: TextImage.Canvas.TextOut(70, 120 + (i * 30), ': Color');
4: TextImage.Canvas.TextOut(70, 120 + (i * 30), ': X Coord');
5: TextImage.Canvas.TextOut(70, 120 + (i * 30), ': Y Coord');
end;
end;



Panel[5] := TPanel.Create(MainForm);
Panel[5].parent:= Panel[2];
Panel[5].Align := AlTop;
Panel[5].Height := 100;

ListBox:= TLISTBOX.Create(MainForm);
ListBox.parent:= ScrollBoxEdit;
ListBox.SetBounds(30, 10, 120, 130);
ListBox.Font.Color := 255;
ListBox.Font.Size := 7;
ListBox.Onclick := @AllSenders;

GetClientDimensions(W, H);

ScrollBox := TScrollBox.Create(MainForm);
ScrollBox.Parent:= Panel[4];
ScrollBox.Align := alClient;

MainMemo := TMemo.Create(MainForm);
MainMemo.Parent := Panel[4];
MainMemo.Align := alBottom;
MainMemo.Height := 100;
MainMemo.Scrollbars := ssVertical;


MainImage:= TImage.Create(MainForm);
MainImage.parent:= ScrollBox;
MainImage.Onmousemove := @OnMouseMove;
MainImage.Onmousedown := @OnMouseDown;
MainImage.SetBounds(0, 0, W, H);
MainImage.Canvas.Pen.Color := 255;

OldBitmap := BitmapFromString(W, H, '');
OldCanvas := GetBitmapCanvas(OldBitmap);

FlashLight:= TTimer.Create(MainForm);
FlashLight.Interval:= 250;
FlashLight.Enabled := False;
FlashLight.Ontimer := @TimeIt;

Coords:= TEdit.Create(MainForm);
Coords.parent:= Panel[2];
Coords.Align := albottom;
Coords.Font.Color := 255;
Coords.Color := 0;
Coords.Text := 'Coords : 0, 0';


Shap:= TCOMBOBOX.Create(MainForm);
Shap.parent:= ScrollBoxEdit;
Shap.SetBounds(10, 300, 80, 20);
Shap.Items.Add('Rectangle');
Shap.Items.Add('Cross');
Shap.Items.Add('Diagonal Cross');
Shap.Text := 'Rectangle';
TextImage.Canvas.TextOut(90, 300, ': Area Shape');


Preview:= TImage.Create(MainForm);
Preview.parent:= Panel[5];
Preview.SetBounds(50, 5, 90, 90);
Preview.Canvas.LineTo(0, 0);
Preview.Canvas.Pen.Color := 255;


AboutForm := CreateForm;
AboutForm.SetBounds(0, 0, 300, 250);
AboutForm.POSITION:= poDesktopCenter;
AboutForm.BORDERSTYLE:= bsSingle;
AboutForm.Bordericons := [biSystemMenu];
AboutForm.Caption := 'About Dynamic DTM Editer';
AboutForm.Color := 14933984;
AboutForm.Onpaint := @PainAboutForm;

AboutButton:= TBITBTN.Create(MainForm);
AboutButton.parent:= AboutForm;
AboutButton.SetBounds(100, 160, 80, 25);
AboutButton.Kind := bkOK;
AboutButton.Onclick := @AllSenders;
MainForm.ShowModal;
end;

procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;

Procedure LoadBitmaps;
begin
SCAR_Icon := BitmapFromString(34, 27, 'z78DAED98D10E83200C457F6999C6' +
'CDC7858CFFFFA46534C6ABA5D882222EBB0F3C188DF7E4B650F5F' +
'EAFB86EA0EBFB1F8669BD0A97E45F5A5BE3B2FA6F998BDEEE5CD7' +
'95B178EF5C1B2C4864E1FAFA478A16EA8DFCEBB8E2FE5BA040E75' +
'4F7BCFE27A2B5FF67D03BE82C16DEEF980B5D211EA4C23B918E88' +
'6AA693DEAF90659D8ACC885C9894862B8F9AD73FEF05DE2F120B4' +
'ACA2E9DD7B2066C14F846BE2EB9C6715A352CBA7D6FBD571CC7A2' +
'E78AF58BE47F7E563A837825E8591E4C76AED4892FFB4F4F08DA1' +
'316FB9144147D502E577CC7B0F8CF9916E89E1EB42F579AC532E9' +
'6D1321CB2BE8082E6967D8F28F35A94DE71E449E39513957AEFF9' +
'9C29A8E445492976EC64EFBCFAF37E42ACF4B66B1F98FE59B33CF' +
'58F3C274622C35FCEF95175D97D3A9EDBF242F5D3AE7F8B7E6855' +
'DC36736FC0E6AF38F8D3C39FFDA9FB4A3F501DD2D25B8');
end;

begin
try
GetSelf.WindowState := wsMinimized;
LoadBitmaps;
Wait(800);
If (FindRsClient) then
ActivateClient;
SafeInitForm;
finally
FreeForm(MainForm);
FreeForm(AboutForm);
FreeBitMap(OldBitmap);
FreeBitMap(SCAR_Icon);
PrintTDTM;
GetSelf.WindowState := wsNormal;
except
Writeln('ERROR: With Loading');
end;

end.

Smartzkid

2007-06-09 01:07:46

Nice work

I'll test it out tomorrow when I'm on a computer that can play RS :D

SKy Scripter

2007-06-09 01:10:16

Nice work

I'll test it out tomorrow when I'm on a computer that can actually handle RS

Thanks, very Much.
i hope it works good.

Jason2gs

2007-06-09 01:22:49

Oooh, looks very cool :)

I'll try it out sometime. (After I learn more about DDTMs.)

SKy Scripter

2007-06-09 01:27:34

Oooh, looks very cool

I'll try it out sometime. (After I learn more about DDTMs.)


If i have time to write a tut i may :p

Jason2gs

2007-06-09 01:53:23

You should try building this same thing over in Delphi ;)

SKy Scripter

2007-06-09 02:01:54

You should try building this same thing over in Delphi


Oh i would, if i knew it :p

Santa_Clause

2007-06-09 02:34:30

Very nice SKy, this'll help tonnes of people!

SKy Scripter

2007-06-09 02:47:40

Very nice SKy, this'll help tonnes of people!


Yes… i Hope :)


Im going to possibly make a Path maker… For DDTM's… too :p
i have already started..

Santa_Clause

2007-06-09 02:52:00

You spelt Fakawi wrong in credits…

SKy Scripter

2007-06-09 03:02:01

You spelt Fakawi wrong in credits…
'


Yup, But Not In The Form :p

WT-Fakawi

2007-06-09 03:55:45

Can I add this to SRL? It needs IMHO a couple of small adjustments, but then it would be one hell of a tool!

Pentti

2007-06-09 04:00:32

Wow this looks cool!
I was just needing something like this.

Thanks and Good job!

Markus

2007-06-09 04:38:47

OMG! This is almost owns the built in DTM editor in SCAR. It looks twice as good as the one SCAR has. It is very easy to use
Few suggestions:
The flashing white/black dot, make it as big as the area size, just like SCARs DTM editor has.
Maybe a "show matching pixels" function? For the tolerance you can use similarcolors.
Under the color a small box that shows the color of the selected DTM point, just like SCAR has.

Other then that, this owns!

ronny.m.p

2007-06-09 07:51:27

It's good…looking for bugs ASAP.

SKy Scripter

2007-06-09 15:04:39

Can I add this to SRL? It needs IMHO a couple of small adjustments, but then it would be one hell of a tool!


Yes.. of course but
if its going to be in SRL, ill update…..


OMG! This is almost owns the built in DTM editor in SCAR. It looks twice as good as the one SCAR has. It is very easy to use
Few suggestions:
The flashing white/black dot, make it as big as the area size, just like SCARs DTM editor has.
Maybe a "show matching pixels" function? For the tolerance you can use similarcolors.
Under the color a small box that shows the color of the selected DTM point, just like SCAR has.

Other then that, this owns!


i can make show matching pixels…….. but making the pixel get bigger while the area size is high, will be a problem…

Infantry001

2007-07-06 10:39:30

This DDTM editer doesnt save the colors i input into the box… :(

SKy Scripter

2007-07-08 02:35:59

hmmm well i made a better one awhile back. it was kinda like mine and nielsie Dtm editer put together. but dont think ill release it..