Lol, sorry for making another thread on this form help (In members section)
Well i made 2 of those Radio Button things, but how do i make it, if it selected to make run a percific procedure in the script.
SCAR Code:
program new;
var
LLoad: integer;
frmDesign: TForm;
TitleLabel: TLabel;
CutLogsLable: TLabel;
RunWhereLabel: TLabel;
Edit1: TEdit;
PlayersBtn: TButton;
StartBtn: TButton;
Edit2: TEdit;
InstructionBtn: TButton;
CreditBtn: TButton;
Panel1: TPanel;
GroupBox1: TGroupBox;
SAntiban: TRadioButton;
WAntiban: TRadioButton;
ClickBox: TCheckBox;
CutR, DirrectionR: string;
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 ClickButton(sender: TObject);
begin
frmDesign.Caption := frmDesign.Caption + '.';
frmDesign.ModalResult := mrOk;
end;
procedure WriteInstructions;
begin
ShowMessage('INSTRUCTION LINE 1' + Chr(13) +
'INSTRUCTION LINE 2' + Chr(13) +
'INSTRUCTION LINE 3' + Chr(13) +
'INSTRUCTION LINE 4');
end;
procedure WriteCredits;
begin
ShowMessage('CREDIT LINE 1' + Chr(13) +
'CREDIT LINE 2' + Chr(13) +
'CREDIT LINE 3' + Chr(13) +
'CREDIT LINE 4');
end;
procedure HandleButtons(Sender: TObject);
begin
case Sender of
CreditBtn: WriteCredits;
StartBtn:
begin
frmDesign.ModalResult := mrOk;
end;
InstructionBtn: WriteInstructions;
CreditBtn: WriteCredits;
end;
end;
procedure StartClick(sender: TObject);
begin
if ( ClickBox.State = cbUnchecked ) then
begin
writeln('NOOB - READ what the box says!');
frmDesign.ModalResult := mrOk;
TerminateScript;
end else
begin
SaveSetting('Intform', 'Edit1', Edit1.Text);
SaveSetting('Intform', 'Edit2', Edit2.Text);
Writeln('Settings saved succesfully!');
CutR := Edit1.Text;
DirrectionR := Edit2.Text;
LLoad := StrToint(Edit1.Text);
Writeln('Run Dirrection = ' + DirrectionR);
Writeln('How many loads? = ' + Edit1.text);
frmDesign.ModalResult := mrOk;
end;
end;
procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 413;
frmDesign.Height := 334;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clWhite;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
TitleLabel := TLabel.Create(frmDesign);
TitleLabel.Parent := frmDesign;
TitleLabel.Left := 40;
TitleLabel.Top := 19;
TitleLabel.Width := 184;
TitleLabel.Height := 18;
TitleLabel.Caption := 'TITLE ***EDIT THIS';
TitleLabel.Color := clAqua;
TitleLabel.Font.Color := 4227327;
TitleLabel.Font.Height := -16;
TitleLabel.Font.Name := 'Verdana';
TitleLabel.Font.Style := [fsBold];
TitleLabel.ParentColor := False;
TitleLabel.ParentFont := False;
CutLogsLable := TLabel.Create(frmDesign);
CutLogsLable.Parent := frmDesign;
CutLogsLable.Left := 9;
CutLogsLable.Top := 63;
CutLogsLable.Width := 95;
CutLogsLable.Height := 13;
CutLogsLable.Caption := 'Cut how many logs?';
RunWhereLabel := TLabel.Create(frmDesign);
RunWhereLabel.Parent := frmDesign;
RunWhereLabel.Left := 11;
RunWhereLabel.Top := 95;
RunWhereLabel.Width := 89;
RunWhereLabel.Height := 13;
RunWhereLabel.Caption := 'Which way to run?';
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 117;
Edit1.Top := 59;
Edit1.Width := 121;
Edit1.Height := 21;
Edit1.TabOrder := 8;
Edit1.Text := '10';
PlayersBtn := TButton.Create(frmDesign);
PlayersBtn.Parent := frmDesign;
PlayersBtn.Left := 265;
PlayersBtn.Top := 54;
PlayersBtn.Width := 75;
PlayersBtn.Height := 25;
PlayersBtn.Caption := 'Players';
PlayersBtn.TabOrder := 9;
StartBtn := TButton.Create(frmDesign);
StartBtn.OnClick := @StartClick;
StartBtn.Parent := frmDesign;
StartBtn.Left := 190;
StartBtn.Top := 246;
StartBtn.Width := 75;
StartBtn.Height := 25;
StartBtn.Caption := 'Startz!';
StartBtn.TabOrder := 10;
Edit2 := TEdit.Create(frmDesign);
Edit2.Parent := frmDesign;
Edit2.Left := 117;
Edit2.Top := 88;
Edit2.Width := 121;
Edit2.Height := 21;
Edit2.TabOrder := 11;
Edit2.Text := 'North ? West ? South?';
InstructionBtn := TButton.Create(frmDesign);
InstructionBtn.OnClick := @HandleButtons;
InstructionBtn.Parent := frmDesign;
InstructionBtn.Left := 265;
InstructionBtn.Top := 93;
InstructionBtn.Width := 75;
InstructionBtn.Height := 25;
InstructionBtn.Caption := 'Instructions';
InstructionBtn.TabOrder := 12;
CreditBtn := TButton.Create(frmDesign);
CreditBtn.OnClick := @HandleButtons;
CreditBtn.Parent := frmDesign;
CreditBtn.Left := 265;
CreditBtn.Top := 129;
CreditBtn.Width := 75;
CreditBtn.Height := 25;
CreditBtn.Caption := 'Credits/Extra';
CreditBtn.TabOrder := 13;
SAntiban := TRadioButton.Create(frmDesign);
SAntiban.Parent := frmDesign;
SAntiban.Left := 15;
SAntiban.Top := 126;
SAntiban.Width := 185;
SAntiban.Height := 17;
SAntiban.Caption := 'Strong Antiban(Members Only)';
SAntiban.TabOrder := 16;
WAntiban := TRadioButton.Create(frmDesign);
WAntiban.Parent := frmDesign;
WAntiban.Left := 15;
WAntiban.Top := 146;
WAntiban.Width := 113;
WAntiban.Height := 17;
WAntiban.Caption := 'Weaker Antiban';
WAntiban.TabOrder := 17;
ClickBox := TCheckBox.Create(frmDesign);
ClickBox.Parent := frmDesign;
ClickBox.Left := 15;
ClickBox.Top := 171;
ClickBox.Width := 97;
ClickBox.Height := 17;
ClickBox.Caption := 'Click this box!';
ClickBox.TabOrder := 18;
end;
begin
SafeInitForm;
SafeShowFormModal;
end.
Example of what im saying
[Key]
() = the radio box thing
(o) = selected box.
[Example]
() For Members only
(o) For Non Members - If this is selected how to make it run the procedure called blah.
Sorry if i didnt explain properly, i aint good at explaining.