Hey guys I've been looking in to forms for the heck of it, and I can make the basics of a good form. But I've never attempted to implant runescape stuff into it. If that doesn't make since it will in a second. So I wrote up this real quick.
SCAR Code:
program Form;
{.include srl/srl.scar}
var
Form: TForm;
UsernameLb, PasswordLb: TLabel;
UsernameE, PasswordE: TEdit;
LoginBtn, ResetBtn: TButton;
procedure ButtonClick(tob: TObject);
begin
case tob of
LoginBtn: begin
Form.ModalResult:= mrOk;
Players[0].Name := UsernameE.text;
Players[0].Pass := PasswordE.text;
Players[0].Nick := 'null';
LoginPlayer;
end;
ResetBtn: begin
UsernameE.Text := '';
PasswordE.Text := '';
end;
end;
end;
procedure InitForm;
begin
Form := CreateForm;
UsernameLb := TLabel.create(form);
PasswordLb := TLabel.create(form);
UsernameE := TEdit.create(form);
PasswordE := TEdit.create(form);
LoginBtn := TButton.create(form);
ResetBtn := TButton.create(form);
with Form do
begin
Left := 500;
Top := 250;
Height := 140;
Width := 200;
Caption := 'Auto Login';
Color := clWhite;
end;
//LABELS
with UsernameLb do
begin
Parent := Form;
Left := 10;
Top := 10;
Caption := 'Username:';
end;
with PasswordLb do
begin
Parent := Form;
Left := 10;
Top := 50;
Caption := 'Password:';
end;
//EDITBOXS
with UsernameE do
begin
Parent := Form;
Left := 75;
Top := 10;
Width := 100;
end;
with PasswordE do
begin
Parent := Form;
Left := 75;
Top := 50;
Width := 100;
PasswordChar := '*';
end;
//BUTTONS
with LoginBtn do
begin
Parent := Form;
Left := 10;
Top := 80;
Width := 75;
Height := 20;
Caption := 'Login';
OnClick := @ButtonClick;
end;
with ResetBtn do
begin
Parent := Form;
Left := 100;
Top := 80;
Width := 75;
Height := 20;
Caption := 'Reset';
OnClick := @ButtonClick;
end;
end;
procedure SafeInitForm;
var
V: Tvariantarray;
begin
setarraylength(v, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFModal;
begin
Form.ShowModal;
end;
procedure SafeShowFModal;
var
V: Tvariantarray;
begin
setarraylength(v, 0);
ThreadSafeCall('ShowFModal', v);
end;
begin
SafeInitForm;
SafeShowFModal;
end.
But, after typing in my username and password and clicking on the "Login" button creates this error:
SCAR Code:
[Runtime Error] : Out Of Range in line 106 in script
Thats the "end;" on:
SCAR Code:
procedure ShowFModal;
begin
Form.ShowModal;
end;

Anyone know?