SRL Archive - Other Scripts

My first useful form :)


Jason2gs

2007-05-12 15:22:40

Well, I finally learned how to make forms today!

The first working form that I made wasn't useful. Just a button, and when you clicked it, it made the form close. This one isn't very useful either, but it does kinda look impressive :)


program New;

var
frmDesign: TForm;
Edit1: TEdit;
Button1: TButton;
v: TVariantArray;
Text: String;
x: Integer;

procedure ButtonClick(Sender: TObject);
begin
Text := Edit1.Text;
frmDesign.ModalResult := mrOk;
ActivateClient;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 105;
frmDesign.Width := 225;
frmDesign.Height := 124;
frmDesign.Caption := 'Type Text';
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;
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 52;
Edit1.Top := 16;
Edit1.Width := 121;
Edit1.Height := 21;
Edit1.TabOrder := 8;
Edit1.Text := 'Type Text Here';
Button1 := TButton.Create(frmDesign);
Button1.OnClick := @ButtonClick;
Button1.Parent := frmDesign;
Button1.Left := 75;
Button1.Top := 49;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Go!';
Button1.TabOrder := 9;
end;

procedure SafeInitForm;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowFormModal;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowFormModal', v);
end;

procedure AutoType;
begin
for x := 1 to Length(Text) do
begin
SendKeys(Text[x]);
Wait(100 + Random(50));
end;
KeyDown(13);
Wait(Random(50));
KeyUp(13);
end;

begin
SafeInitForm;
SafeShowformModal;
FreeForm(frmDesign);
repeat
AutoType;
Wait(1500 + Random(1000));
until(false);
end.

I'm gonna have a lot of fun with these forms…

Smartzkid

2007-05-12 15:38:56

:D Forms are a lot of fun to play around with

PS: Check this out

Jason2gs

2007-05-12 15:41:38

Oooh, that looks cool :D

Was that your big "secret project"?

Pretty nice ;)

Edit:

*sigh*

My torrent's only 31% done…

IEatJ00erBaybees

2007-05-12 19:42:13

I've seen one form made with SCAR, it was unbelievable. I'm not sure if it was possible w/ SCAR. I showed it to MJordan I think. It was black and green/blue. It was AMAZING.

And yeah, Forms are really fun to play around with. I just like toggling with background colors and font styles/colors etc.. :)

dialeyj2

2007-06-27 19:06:26

in the AutoType procedure is the "keydown(13)" like the enter key?…im making an auto typer form and im not sure how to make it hit enter:confused:

Santa_Clause

2007-06-30 07:36:53

Use TypeSend.

Also: My autofighter, link in signature :p

Pentti

2007-06-30 07:48:19

From: IEatJ00erBaybees
I've seen one form made with SCAR, it was unbelievable. I'm not sure if it was possible w/ SCAR. I showed it to MJordan I think. It was black and green/blue. It was AMAZING.

And yeah, Forms are really fun to play around with. I just like toggling with background colors and font styles/colors etc.. :)

Hehe yea, but guys have you checked out Kaitnieks's bejeweled.scar?

Hugolord

2007-06-30 07:53:19

From: Smartzkid
:D Forms are a lot of fun to play around with

PS: Check this out


lmao i like that! is it out for public ? (SRL Members i mean).

Smartzkid

2007-06-30 11:21:48

From: hugolord
lmao i like that! is it out for public ? (SRL Members i mean).


Not now; I'm still toying with some ideas (script bases, you select what kind of script it'll be, and it gives you some of the most used procedures for that type), and its not very nice editing a script in a non-formatted/colored textarea; unless Freddy makes a textbox with SCAR formatting, I might never release it…