SRL Archive - First Scripts

Antibinki Auto Talker (W/Form)


antibinki

2007-04-05 23:55:13

Just an auto talker with effects and a form enjoy!
program ABAT;                                                                
{.include SRL/SRL.Scar}
var
text1,text2,text3,text4,text5:String;
frmDesign : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Label5 : TLabel;
Label6 : TLabel;
Label7 : TLabel;
Label8 : TLabel;
Label9 : TLabel;
Edit1 : TEdit;
Edit2 : TEdit;
Edit3 : TEdit;
Edit4 : TEdit;
Edit5 : TEdit;
ComboBox1 : TComboBox;
ComboBox2 : TComboBox;
ComboBox3 : TComboBox;
ComboBox4 : TComboBox;
ComboBox5 : TComboBox;
Button1 : TButton;
ComboBox6 : TComboBox;
ComboBox7 : TComboBox;
ComboBox8 : TComboBox;
ComboBox9 : TComboBox;
ComboBox10 : TComboBox;

Procedure Talk;
Begin
Text1 := ComboBox6.Text +':'+ ComboBox1.Text +':' + edit1.Text;
SendText(Text1);
wait(2000);
Text2 := ComboBox7.Text +':'+ ComboBox2.Text +':' + edit2.Text;
SendText(Text2);
wait(2000);
Text3 := ComboBox8.Text +':'+ ComboBox3.Text +':' + edit3.Text;
SendText(Text3);
wait(2000);
text4 := ComboBox9.Text +':'+ ComboBox4.Text +':' + edit4.Text;
SendText(Text4);
wait(2000);
Text5 := ComboBox10.Text +':'+ ComboBox5.Text +':' + edit5.Text ;
SendText(Text5);
Wait(2000);
end;

procedure Start(Sender: TObject);
begin
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

Procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 476;
frmDesign.Height := 253;
frmDesign.Caption := 'Antibinki Auto Talker V1.0';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 52;
Label1.Top := 32;
Label1.Width := 61;
Label1.Height := 13;
Label1.Caption := 'Text To Say ';
Label2 := TLabel.Create(frmDesign);
Label2.Parent := frmDesign;
Label2.Left := 27;
Label2.Top := 49;
Label2.Width := 6;
Label2.Height := 13;
Label2.Caption := '1';
Label3 := TLabel.Create(frmDesign);
Label3.Parent := frmDesign;
Label3.Left := 27;
Label3.Top := 74;
Label3.Width := 6;
Label3.Height := 13;
Label3.Caption := '2';
Label4 := TLabel.Create(frmDesign);
Label4.Parent := frmDesign;
Label4.Left := 27;
Label4.Top := 98;
Label4.Width := 6;
Label4.Height := 13;
Label4.Caption := '3';
Label5 := TLabel.Create(frmDesign);
Label5.Parent := frmDesign;
Label5.Left := 27;
Label5.Top := 123;
Label5.Width := 6;
Label5.Height := 13;
Label5.Caption := '4';
Label6 := TLabel.Create(frmDesign);
Label6.Parent := frmDesign;
Label6.Left := 27;
Label6.Top := 148;
Label6.Width := 6;
Label6.Height := 13;
Label6.Caption := '5';
Label7 := TLabel.Create(frmDesign);
Label7.Parent := frmDesign;
Label7.Left := 192;
Label7.Top := 29;
Label7.Width := 28;
Label7.Height := 13;
Label7.Caption := 'Effect';
Label8 := TLabel.Create(frmDesign);
Label8.Parent := frmDesign;
Label8.Left := 215;
Label8.Top := -4;
Label8.Width := 70;
Label8.Height := 32;
Label8.Caption := 'Setup';
Label8.Font.Color := clWindowText;
Label8.Font.Height := -27;
Label8.Font.Name := 'MS Sans Serif';
Label8.Font.Style := [];
Label8.ParentFont := False;
Label9 := TLabel.Create(frmDesign);
Label9.Parent := frmDesign;
Label9.Left := 364;
Label9.Top := 28;
Label9.Width := 24;
Label9.Height := 13;
Label9.Caption := 'Color';
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 37;
Edit1.Top := 46;
Edit1.Width := 121;
Edit1.Height := 21;
Edit1.TabOrder := 8;
Edit1.Text := '';
Edit2 := TEdit.Create(frmDesign);
Edit2.Parent := frmDesign;
Edit2.Left := 37;
Edit2.Top := 71;
Edit2.Width := 121;
Edit2.Height := 21;
Edit2.TabOrder := 9;
Edit2.Text := '';
Edit3 := TEdit.Create(frmDesign);
Edit3.Parent := frmDesign;
Edit3.Left := 37;
Edit3.Top := 95;
Edit3.Width := 121;
Edit3.Height := 21;
Edit3.TabOrder := 10;
Edit3.Text := '';
Edit4 := TEdit.Create(frmDesign);
Edit4.Parent := frmDesign;
Edit4.Left := 37;
Edit4.Top := 119;
Edit4.Width := 121;
Edit4.Height := 21;
Edit4.TabOrder := 11;
Edit4.Text := '';
Edit5 := TEdit.Create(frmDesign);
Edit5.Parent := frmDesign;
Edit5.Left := 37;
Edit5.Top := 143;
Edit5.Width := 121;
Edit5.Height := 21;
Edit5.TabOrder := 12;
Edit5.Text := '';
ComboBox1 := TComboBox.Create(frmDesign);
ComboBox1.Parent := frmDesign;
ComboBox1.Left := 165;
ComboBox1.Top := 46;
ComboBox1.Width := 145;
ComboBox1.Height := 21;
ComboBox1.ItemHeight := 13;
ComboBox1.TabOrder := 13;
ComboBox1.Text := '';
ComboBox1.Items.Add('Flash1');
ComboBox1.Items.Add('Flash2');
ComboBox1.Items.Add('Flash3');
ComboBox1.Items.Add('Scroll');
ComboBox1.Items.Add('Shake');
ComboBox1.Items.Add('Wave');
ComboBox1.Items.Add('Wabe2');
ComboBox1.Items.Add('Slide');
ComboBox1.Items.Add('Glow1');
ComboBox1.Items.Add('Glow2');
ComboBox1.Items.Add('Glow3');
ComboBox2 := TComboBox.Create(frmDesign);
ComboBox2.Parent := frmDesign;
ComboBox2.Left := 166;
ComboBox2.Top := 70;
ComboBox2.Width := 145;
ComboBox2.Height := 21;
ComboBox2.ItemHeight := 13;
ComboBox2.TabOrder := 14;
ComboBox2.Text := '';
ComboBox2.Items.Add('Flash1');
ComboBox2.Items.Add('Flash2');
ComboBox2.Items.Add('Flash3');
ComboBox2.Items.Add('Scroll');
ComboBox2.Items.Add('Shake');
ComboBox2.Items.Add('Wave');
ComboBox2.Items.Add('Wabe2');
ComboBox2.Items.Add('Slide');
ComboBox2.Items.Add('Glow1');
ComboBox2.Items.Add('Glow2');
ComboBox2.Items.Add('Glow3');
ComboBox3 := TComboBox.Create(frmDesign);
ComboBox3.Parent := frmDesign;
ComboBox3.Left := 166;
ComboBox3.Top := 95;
ComboBox3.Width := 145;
ComboBox3.Height := 21;
ComboBox3.ItemHeight := 13;
ComboBox3.TabOrder := 15;
ComboBox3.Text := '';
ComboBox3.Items.Add('Flash1');
ComboBox3.Items.Add('Flash2');
ComboBox3.Items.Add('Flash3');
ComboBox3.Items.Add('Scroll');
ComboBox3.Items.Add('Shake');
ComboBox3.Items.Add('Wave');
ComboBox3.Items.Add('Wabe2');
ComboBox3.Items.Add('Slide');
ComboBox3.Items.Add('Glow1');
ComboBox3.Items.Add('Glow2');
ComboBox3.Items.Add('Glow3');
ComboBox4 := TComboBox.Create(frmDesign);
ComboBox4.Parent := frmDesign;
ComboBox4.Left := 166;
ComboBox4.Top := 120;
ComboBox4.Width := 145;
ComboBox4.Height := 21;
ComboBox4.ItemHeight := 13;
ComboBox4.TabOrder := 16;
ComboBox4.Text := '';
ComboBox4.Items.Add('Flash1');
ComboBox4.Items.Add('Flash2');
ComboBox4.Items.Add('Flash3');
ComboBox4.Items.Add('Scroll');
ComboBox4.Items.Add('Shake');
ComboBox4.Items.Add('Wave');
ComboBox4.Items.Add('Wabe2');
ComboBox4.Items.Add('Slide');
ComboBox4.Items.Add('Glow1');
ComboBox4.Items.Add('Glow2');
ComboBox4.Items.Add('Glow3');
ComboBox5 := TComboBox.Create(frmDesign);
ComboBox5.Parent := frmDesign;
ComboBox5.Left := 166;
ComboBox5.Top := 144;
ComboBox5.Width := 145;
ComboBox5.Height := 21;
ComboBox5.ItemHeight := 13;
ComboBox5.TabOrder := 17;
ComboBox5.Text := '';
ComboBox5.Items.Add('Flash1');
ComboBox5.Items.Add('Flash2');
ComboBox5.Items.Add('Flash3');
ComboBox5.Items.Add('Scroll');
ComboBox5.Items.Add('Shake');
ComboBox5.Items.Add('Wave');
ComboBox5.Items.Add('Wabe2');
ComboBox5.Items.Add('Slide');
ComboBox5.Items.Add('Glow1');
ComboBox5.Items.Add('Glow2');
ComboBox5.Items.Add('Glow3');
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 7;
Button1.Top := 170;
Button1.Width := 456;
Button1.Height := 45;
Button1.Caption := 'Start';
Button1.TabOrder := 18;
Button1.OnClick := @Start
ComboBox6 := TComboBox.Create(frmDesign);
ComboBox6.Parent := frmDesign;
ComboBox6.Left := 317;
ComboBox6.Top := 47;
ComboBox6.Width := 145;
ComboBox6.Height := 21;
ComboBox6.ItemHeight := 13;
ComboBox6.TabOrder := 19;
ComboBox6.Text := '';
ComboBox6.Items.Add('Red');
ComboBox6.Items.Add('Yellow');
ComboBox6.Items.Add('Blue');
ComboBox7 := TComboBox.Create(frmDesign);
ComboBox7.Parent := frmDesign;
ComboBox7.Left := 317;
ComboBox7.Top := 71;
ComboBox7.Width := 145;
ComboBox7.Height := 21;
ComboBox7.ItemHeight := 13;
ComboBox7.TabOrder := 20;
ComboBox7.Text := '';
ComboBox7.Items.Add('Red');
ComboBox7.Items.Add('Yellow');
ComboBox7.Items.Add('Blue');
ComboBox8 := TComboBox.Create(frmDesign);
ComboBox8.Parent := frmDesign;
ComboBox8.Left := 317;
ComboBox8.Top := 96;
ComboBox8.Width := 145;
ComboBox8.Height := 21;
ComboBox8.ItemHeight := 13;
ComboBox8.TabOrder := 21;
ComboBox8.Text := '';
ComboBox8.Items.Add('Red');
ComboBox8.Items.Add('Yellow');
ComboBox8.Items.Add('Blue');
ComboBox9 := TComboBox.Create(frmDesign);
ComboBox9.Parent := frmDesign;
ComboBox9.Left := 317;
ComboBox9.Top := 119;
ComboBox9.Width := 145;
ComboBox9.Height := 21;
ComboBox9.ItemHeight := 13;
ComboBox9.TabOrder := 22;
ComboBox9.Text := '';
ComboBox9.Items.Add('Red');
ComboBox9.Items.Add('Yellow');
ComboBox9.Items.Add('Blue');
ComboBox10 := TComboBox.Create(frmDesign);
ComboBox10.Parent := frmDesign;
ComboBox10.Left := 317;
ComboBox10.Top := 144;
ComboBox10.Width := 145;
ComboBox10.Height := 21;
ComboBox10.ItemHeight := 13;
ComboBox10.TabOrder := 23;
ComboBox10.Text := '';
ComboBox10.Items.Add('Red');
ComboBox10.Items.Add('Yellow');
ComboBox10.Items.Add('Blue');
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;

procedure SetupScript;
begin
SafeInitForm;
SafeShowFormModal;
end;

begin
SetupScript;
Talk;
end.

$PYD3R

2007-04-05 23:56:29

meh, too many autotalkers these days but not bad, not bad…

antibinki

2007-04-05 23:57:56

at least it looks sexy :D (h)

~alex~

2007-04-06 08:19:52

Flash and glow would be better suited in the color box, seeing as they are colors. Also you left out cyan white green and purple. Other than that good job.

stein3

2007-04-06 20:06:09

yeah. Shortage of colors.

antibinki

2007-04-06 20:49:13

i was only going by the stuff on the RS site manual sorry

Widget

2007-04-07 15:43:08

Well aside from the colors, I think you should add a cancel button.
Maybe the onclick for that could be @cancel, which might look like

Procedure Cancel(Sender:TObject);
begin
frmDesign.ModalResult:= mrCancel;
terminatescript;
end;

Right now it still tries to type everything, but it just ends up typing 5 :s if you didnt fill anything out.

Another thing, this only types the strings once. Now it might just be me but that doesnt save much time if you're typing it anyway…

Also, if you want it to look a bit better, try using [SomeObject].color and .font.color

- Widget

Throm

2007-11-06 14:56:35

Yes,this is not one of the bad auto talkers

chip111

2007-11-08 10:47:47

works great thanks i didnt have to type 1million times a day