SRL Archive - OSR Advanced Scripting Tutorials

Creating a Form Tutorial by Starblaster100


Starblaster100

2006-05-13 14:28:35

Form Tutorial by Starblaster100


What is a Form?

A form is a graphical way of setting up a script. It is a friendly and easy way for a user to fill in specific details to make a script work properly.

How do i create a form?

Using the Form Editor in Scar. Hit tools and then Form Editor.

When are they best Used?

Whenever you want them to be used. Usually if you are going to use forms, they appear at the start of the script.

The Tutorial Link:

Try this Link First
Otherwise this one

Extra Information you should know:
  • Obviously this Tutorial only Covers the basics of creating a form, and there are infinite possibilities when creating them.
  • This Tutorial is Interactive, so if it says 'Click Tools' it is going to wait until you click tools!
  • On the first page where you select which part of the tutorial you want to see, wait a couple of seconds before pressing a button otherwise it starts half way throught he tutorial - I have no idea why
  • I suggest looking at other scripts to see how the forms are designed there. I've attached one of my scripts which uses a form, and you can see how it is made. It has a few extra things in it not shown in the tutorial, such as saving options, openning links and openning a new form from the current one. Its also quite a nice working script ;)

If you need anymore help in making forms, dont hesitate to ask me

Enjoy

Starblaster100

Languine

2006-05-13 14:43:20

Nice im definitly going to download this! Good job.

Avaphi

2006-05-13 15:05:53

I am downloading right now, Seems promising :) BTW Congrats on your 100th post starblaster !

Starblaster100

2006-05-13 15:11:18

o, lol, thanks :P

ub3r |<1||3r*1337*

2006-05-13 16:01:56

Wow! another great tutorial by Star!! woW!!!!!!!

i'm trying to download captivate with bittorrent. if i ever get it, i'll post the link for the straight download.

Mjordan

2007-01-29 20:57:03

thanks star. i know this is an old tut, but still very useful.

macromacro123

2007-03-03 23:38:58

omg cant u just post the tut here?so much noobs nowadays..

Mjordan

2007-03-04 09:44:38

From: macromacro123
omg cant u just post the tut here?so much noobs nowadays..


ROFLMAO are you calling star a noob? and he cant post its here it a video, retard

eddie

2007-03-04 10:19:16

It has to be said macromacro123.. You are a n00b. Anyhoo.. Thanks star for the tut, now im going to make all my personal ones have bigger and better forms :)

robeike

2007-03-07 15:49:19

k thanks STAR i'm just downloaded it going to take a look!

SonOfSheep

2007-03-09 16:57:45

Thank you! This teaches things you don't learn by just messing around (my main method of learning). I also learn by reading other's scripts but reading form code is torture!.

I am going to use forms in the upcoming version of my Oak Annihilator script.

Rune Hacker

2007-04-06 01:42:11

How can i watch this tut since it is a "Shockwave Flash Object". What can read it? (i use windows xp)

stein3

2007-04-07 08:58:58

open it with IE or Firefox i believe.

If you've ever been to YouTube you should have FLV plugins.

stein3

2007-04-07 09:28:39

k this didn't help me at all :(…

It only showed me what I already knew. You arrange the buttons and name them. How do I get the code thats like:

button1.***
button1.***
button1.***
edit2.***
and so on? where does that come from and how do I find it for my form?

stein3

2007-04-07 09:30:14

so far all I can get is:
object frmDesign: TfrmDesign
Left = 312
Top = 120
Width = 242
Height = 258
Caption = 'frmDesign'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
ShowHint = True
Visible = True
OnActivate = FormActivate
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 5
Top = 60
Width = 67
Height = 16
Caption = 'Message 1'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
end
object Label2: TLabel
Left = 5
Top = 89
Width = 67
Height = 16
Caption = 'Message 2'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
end
object Label3: TLabel
Left = 5
Top = 122
Width = 67
Height = 16
Caption = 'Message 3'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
end
object Label4: TLabel
Left = 5
Top = 149
Width = 67
Height = 16
Align = alCustom
Caption = 'Message 4'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
end
object Label5: TLabel
Left = 4
Top = 23
Width = 132
Height = 16
Caption = 'Number of Messages:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
end
object startbut: TButton
Left = 83
Top = 184
Width = 75
Height = 25
Hint = 'starts script'
Caption = 'Start'
ParentShowHint = False
ShowHint = True
TabOrder = 8
end
object message1edit: TEdit
Left = 80
Top = 57
Width = 121
Height = 21
Hint = 'enter message'
ParentShowHint = False
ShowHint = True
TabOrder = 9
Text = 'message1edit'
end
object message2edit: TEdit
Left = 80
Top = 87
Width = 121
Height = 21
Hint = 'enter message'
ParentShowHint = False
ShowHint = True
TabOrder = 10
Text = 'message2edit'
end
object message3edit: TEdit
Left = 80
Top = 117
Width = 121
Height = 21
Hint = 'enter message'
ParentShowHint = False
ShowHint = True
TabOrder = 11
Text = 'message3edit'
end
object message4edit: TEdit
Left = 80
Top = 147
Width = 121
Height = 21
TabOrder = 12
Text = 'message4edit'
end
object Edit5: TEdit
Left = 141
Top = 21
Width = 35
Height = 21
Hint = '#'
ParentShowHint = False
ShowHint = True
TabOrder = 13
Text = 'Edit5'
end
end
but it really doesn't help me at all :(

the flea

2007-04-08 10:28:23

Star the tutorial is down can somebody re upload it for me ;)

rkroxpunk

2007-04-10 20:19:24

it's up……..use the 2nd link

Post 300 :D yay

gsquare567

2007-04-12 18:23:19

when i open it in captivate it says its file type is not supported or its corrupted…

SKy Scripter

2007-04-12 18:28:15

Creating a Form Tutorial by Starblaster100 - 05-13-2006, 11:28 AM

uhmm a little old heh… ;)

gsquare567

2007-04-12 21:37:55

From: SKy Scripter
Creating a Form Tutorial by Starblaster100 - 05-13-2006, 11:28 AM

uhmm a little old heh… ;)


so? this guy's the king of kings u think his work will ever be outdated? he's like a shakespeare to SCAR/SRL… btw, got it workin thanks to a great post before me; opened with firefox. incredible tut, but still didnt really explain the 4 procedures u need to use. guess star expects us to be almost half as smart as him ^^

Starblaster100

2007-04-13 04:25:33

Sorry, ill try updating the tut when i get a bit of time.

the scar noob

2007-04-13 09:49:00

uhm it's up, the second link but i can't open the tut itself :(

gsquare567

2007-04-13 14:06:05

open in mozilla

SKy Scripter

2007-04-13 17:27:41

i never said Starblaster100 was a bad scripter i just said this script isn't
going to last very long..

so? this guy's the king of kings u think his work will ever be outdated? he's like a shakespeare to SCAR/SRL… btw, got it workin thanks to a great post before me; opened with firefox. incredible tut, but still didnt really explain the 4 procedures u need to use. guess star expects us to be almost half as smart as him ^^


lol wow,
StarBlaster100 is kool and all but… Nevermind (not saying anthing)

the scar noob

2007-04-14 15:31:57

no i mean that i can't open the file taht we download…

the scar noob

2007-04-14 17:58:36

problem solved, opened with Internet Explorer, great tut!! :p
EDIT: sorry for double post…

Lalaji

2007-05-07 16:18:24

Nice downloading it right now.

han941306

2007-08-15 10:29:53

cool Form TuT!
It can help some who are lazy and wants to auto's lol..
I think it just like VB? :duh:

The Element

2007-08-15 11:25:23

More like Delphi. Atleast for me. Only because I know Delphi though.

Anyways, great job starblaster. I had this saved on my friends computer and whatched itbut I could never find the thread to post about it. This and a fw form tutorials in the so called "advanced" section have tought me how to make some pretty cool forms.

han941306

2007-08-28 08:45:14

Cool TuT!
Thanks for it..
I can make a form so it can easier to setup..
Thanks!

Tootoot222

2007-08-31 04:35:08

nice tut thanks, but i can't get it to work,
when i make my form, then try to run it i get this error:

Successfully compiled
[Runtime Error] : Exception: Cannot make a visible window modal in line 28 in script


here's the code that i used
program New;


var
frmDesign : TForm;
UsernameLabel : TLabel;
Button1 : TButton;
TextBox1 : TEdit;
CheckBox1 : TCheckBox;
procedure SafeInitForm; // Default Code
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowFormModal; // Default Code
begin
frmDesign.ShowModal;
end;

procedure SafeShowFormModal; // Default Code
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v); // <--- this is line 28
end;

procedure ClickButton(sender: TObject); // Adding Buttons and Interactivity
begin
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

Procedure AddPic; // Loading a Picture
var
Picture : integer;
Canvas : TCanvas;
begin
{Picture := LoadBitmap()}
Canvas:= GetBitmapCanvas(Picture);
CopyCanvas(Canvas, frmDesign.Canvas, 1, -1, 300, 520, 0, 0, 315, 520);
end;

Procedure FormPaintStar(Sender : TObject); // Adding a picture
begin
AddPic;
end;

Procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 230;
frmDesign.Height := 157;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := True;
frmDesign.PixelsPerInch := 96;
UsernameLabel := TLabel.Create(frmDesign);
UsernameLabel.Parent := frmDesign;
UsernameLabel.Left := 9;
UsernameLabel.Top := 23;
UsernameLabel.Width := 74;
UsernameLabel.Height := 20;
UsernameLabel.Hint := 'Username';
UsernameLabel.Caption := 'Username';
UsernameLabel.Font.Color := clWindowText;
UsernameLabel.Font.Height := -16;
UsernameLabel.Font.Name := 'MS Sans Serif';
UsernameLabel.Font.Style := [];
UsernameLabel.ParentFont := False;
UsernameLabel.ParentShowHint := False;
UsernameLabel.ShowHint := True;
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 117;
Button1.Top := 61;
Button1.Width := 75;
Button1.Height := 25;
Button1.Hint := 'Click here to start the script';
Button1.Caption := 'Start';
Button1.Font.Color := clWindowText;
Button1.Font.Height := -12;
Button1.Font.Name := 'MS Sans Serif';
Button1.Font.Style := [];
Button1.ParentFont := False;
Button1.ParentShowHint := False;
Button1.ShowHint := True;
Button1.TabOrder := 8;
TextBox1 := TEdit.Create(frmDesign);
TextBox1.Parent := frmDesign;
TextBox1.Left := 87;
TextBox1.Top := 24;
TextBox1.Width := 121;
TextBox1.Height := 21;
TextBox1.Hint := 'Type your username here';
TextBox1.ParentShowHint := False;
TextBox1.ShowHint := True;
TextBox1.TabOrder := 9;
CheckBox1 := TCheckBox.Create(frmDesign);
CheckBox1.Parent := frmDesign;
CheckBox1.Left := 37;
CheckBox1.Top := 67;
CheckBox1.Width := 74;
CheckBox1.Height := 17;
CheckBox1.Hint := 'Do you want antirandoms?';
CheckBox1.Caption := 'Antirandom';
CheckBox1.ParentShowHint := False;
CheckBox1.ShowHint := True;
CheckBox1.TabOrder := 11;
end;

begin
SafeInitForm; // Load and Show Forms
SafeShowFormModal;
// Main loop here
end.


Starblaster100

2007-08-31 05:47:42

[php]
frmDesign.Visible := True;
[/php]

In every script that must be set to false.

Tootoot222

2007-08-31 06:24:29

:duh: lol i guess i should've read the tut again lol :duh:

killermage69

2008-09-18 03:36:15

Thank for another wonderful tut!