• Log in or sign up for an account here: https://www.sythe.org/login

Making Forms

pker overkil

Forum Addict
Joined
Feb 11, 2007
Sythe Gold
0
Messages
387
Location
behind you...
Ive tried to learn how to make forms and ive probably posted this 20 times but can someone tell me a detailed tutorial that covers how to make forms and use them in your script?
 
Yeah, there are some great tutorials as far as forms go. If you have any specific questions I'd be glad to help out. You can either use the Form Editer (Open Scar ---> Tools) or just write in the code yourself. Looking at other scripts will probably help you the most, besides guides.
 
You could do something like this:

Code:
var
  frmDesign: TForm;
  Label1: TLabel;
  WebsiteURL: TEdit;
  Button1: TButton;
  CheckBox1, CheckBox2: TCheckBox;

procedure TypeURL(Sender: TObject);
begin
  OpenWebPage('http://' + WebsiteURL.text);
end;

procedure ClearURLBox(Sender: TObject);
begin
  if(WebsiteURL.text = 'WebsiteURL <example: www.google.com> (do not include "http://" part)')then
    WebsiteURL.text:= '';
end;

procedure InitForm;
begin
  frmDesign := CreateForm;
  frmDesign.Left := 268;
  frmDesign.Top := 114;
  frmDesign.Width := 386;
  frmDesign.Height := 190;
  frmDesign.Caption := 'Websiter 3000';
  frmDesign.Color := clBtnFace;
  frmDesign.Font.Color := clWindowText;
  frmDesign.Font.Height := -11;
  frmDesign.Font.Name := 'MS Sans Serif';
  frmDesign.Font.Style := [];
  frmDesign.Visible := False;
  frmDesign.Windowstate := wsMinimized
  frmDesign.PixelsPerInch := 96;
  Label1 := TLabel.Create(frmDesign);
  Label1.Parent := frmDesign;
  Label1.Left := 51;
  Label1.Top := 36;
  Label1.Width := 147;
  Label1.Height := 13;
  Label1.Caption := 'What Website you want to visit';
  WebsiteURL := TEdit.Create(frmDesign);
  WebsiteURL.Parent := frmDesign;
  WebsiteURL.Left := 209;
  WebsiteURL.Top := 32;
  WebsiteURL.Width := 152;
  WebsiteURL.Height := 21;
  WebsiteURL.TabOrder := 8;
  WebsiteURL.Text:= 'WebsiteURL <example: www.google.com> (do not include "http://" part)';
  WebsiteURL.OnClick:= @ClearURLBox;
  Button1 := TButton.Create(frmDesign);
  Button1.Parent := frmDesign;
  Button1.Left := 187;
  Button1.Top := 91;
  Button1.Width := 75;
  Button1.Height := 25;
  Button1.Caption := 'Go!';
  Button1.TabOrder := 9;
  Button1.Onclick := @TypeUrl;
  CheckBox1 := TCheckBox.Create(frmDesign);
  CheckBox1.Parent := frmDesign;
  CheckBox1.Left := 52;
  CheckBox1.Top := 104;
  CheckBox1.Width := 97;
  CheckBox1.Height := 17;
  CheckBox1.Caption := 'Internet Explorer';
  CheckBox1.TabOrder := 10;
  CheckBox2 := TCheckBox.Create(frmDesign);
  CheckBox2.Parent := frmDesign;
  CheckBox2.Left := 52;
  CheckBox2.Top := 76;
  CheckBox2.Width := 97;
  CheckBox2.Height := 17;
  CheckBox2.Caption := 'Mozilla Firefox';
  CheckBox2.TabOrder := 11;
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;
  FreeForm(frmDesign);
end.

But that will open the website to your default web browser only.
 
im actually making something that literally clicks on the browser then types in the URL but i fixed it so i dont need your help =)
 
Hmmm, ok... :D

Well, anyways, I still recommend you check out the SCAR Help File, as I am sure it would help you more than a lot. ;)
 
That's good to hear :D
 
Runescape Gamblingrunescape gambling
Back
Top