SCAR Code:
{-----------------------------------------------------------------)
( AutoTalker by )
( )
( _/_/_/_/_/ _/ _/ )
( _/ _/_/_/ _/_/ _/_/_/ _/_/ _/_/_/ )
( _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/ )
( _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/ )
( _/ _/ _/ _/_/ _/ _/ _/ _/ _/_/_/ )
( )
( )
(-----------------------------------------------------------------}
program Thomis_Cool_AutoTalker;
{.include SRL/SRL.scar}
var
frmDesign : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Label5 : TLabel;
Edit1 : TEdit;
Edit2 : TEdit;
Edit3 : TEdit;
Edit4 : TEdit;
Edit5 : TEdit;
Button1 : TButton;
procedure SayTheStuff;
begin
if IsFKeyDown(1) then
TypeSend(Edit1.Text)
if IsFKeyDown(2) then
TypeSend(Edit2.Text)
if IsFKeyDown(3) then
TypeSend(Edit3.Text)
if IsFKeyDown(4) then
TypeSend(Edit4.Text)
if IsFKeyDown(5) then
TypeSend(Edit5.Text)
end;
procedure InitForm;
begin
frmDesign := CreateForm;
with frmDesign do
begin
Position := poScreenCenter;
BorderStyle := bsSingle;
Caption := 'Thomis'#39' AutoTalker Form';
SetBounds(0, 0, 642, 309);
Color := clBlack;
end;
Label1 := TLabel.Create(frmDesign);
with Label1 do
begin
Parent := frmDesign;
SetBounds(62, 46, 52, 16);
Caption := 'F1 Key:';
Font.Color := clWhite;
Font.Height := -13;
Font.Name := 'MS Sans Serif';
Font.Style := [fsBold];
end;
Label2 := TLabel.Create(frmDesign);
with Label2 do
begin
Parent := frmDesign;
SetBounds(336, 45, 52, 16);
Caption := 'F2 Key:';
Font.Color := clWhite;
Font.Height := -13;
Font.Name := 'MS Sans Serif';
Font.Style := [fsBold];
end;
Label3 := TLabel.Create(frmDesign);
with Label3 do
begin
Parent := frmDesign;
SetBounds(62, 105, 52, 16);
Caption := 'F3 Key:';
Font.Color := clWhite;
Font.Height := -13;
Font.Name := 'MS Sans Serif';
Font.Style := [fsBold];
end;
Label4 := TLabel.Create(frmDesign);
with Label4 do
begin
Parent := frmDesign;
SetBounds(336, 105, 52, 16);
Caption := 'F4 Key:';
Font.Color := clWhite;
Font.Height := -13;
Font.Name := 'MS Sans Serif';
Font.Style := [fsBold];
end;
Label5 := TLabel.Create(frmDesign);
with Label5 do
begin
Parent := frmDesign;
SetBounds(295, 165, 52, 16);
Caption := 'F5 Key:';
Font.Color := clWhite;
Font.Height := -13;
Font.Name := 'MS Sans Serif';
Font.Style := [fsBold];
end;
Edit1 := TEdit.Create(frmDesign);
with Edit1 do
begin
Parent := frmDesign;
SetBounds(63, 67, 246, 21);
Color := clGray;
Font.Color := clWhite;
Font.Name := 'MS Sans Serif';
Text := 'Edit1';
end;
Edit2 := TEdit.Create(frmDesign);
with Edit2 do
begin
Parent := frmDesign;
SetBounds(336, 67, 246,21);
Color := clGray;
Font.Color := clWhite;
Font.Name := 'MS Sans Serif';
Text := 'Edit2';
end;
Edit3 := TEdit.Create(frmDesign);
with Edit3 do
begin
Parent := frmDesign;
SetBounds(62, 130, 246, 21);
Color := clGray;
Font.Color := clWhite;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Text := 'Edit3';
end;
Edit4 := TEdit.Create(frmDesign);
with Edit4 do
begin
Parent := frmDesign;
SetBounds(336, 130, 246, 21);
Color := clGray;
Font.Color := clWhite;
Font.Name := 'MS Sans Serif';
Text := 'Edit4';
end;
Edit5 := TEdit.Create(frmDesign);
with Edit5 do
begin
Parent := frmDesign;
SetBounds(199, 190, 246, 21);
Color := clGray;
Font.Color := clWhite;
Font.Name := 'MS Sans Serif';
Edit5.Text := 'Edit5';
end;
Button1 := TButton.Create(frmDesign);
with Button1 do
begin
Parent := frmDesign;
SetBounds(274, 253, 75, 25);
Caption := 'Start';
ModalResult := 1;
end;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.Showmodal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
end.
This is shorter and looks a lot better.
Edit: Damn, sorry for the bump.