as a start i did this -
SCAR Code:
program New;
var
frmDesign : TForm;
PageControl : TPageControl;
TabPages: array[1..5]of TTabSheet;
i: integer;
Labels : array [0..7] of TLabel;
NameBox : TEdit;
PasswordBox : TEdit;
NicknameBox : TEdit;
HoverskillBox : TEdit;
BreakBox : TEdit;
LoadsBox : TEdit;
PinBox : TEdit;
Memo1 : TMemo;
AxeBox : TCheckBox;
ActiveBox : TCheckBox;
NameBox2 : TEdit;
PasswordBox2 : TEdit;
NicknameBox2 : TEdit;
HoverskillBox2 : TEdit;
BreakBox2 : TEdit;
LoadsBox2 : TEdit;
PinBox2 : TEdit;
AxeBox2 : TCheckBox;
ActiveBox2 : TCheckBox;
NameBox3 : TEdit;
PasswordBox3 : TEdit;
NicknameBox3 : TEdit;
HoverskillBox3 : TEdit;
BreakBox3 : TEdit;
LoadsBox3 : TEdit;
PinBox3 : TEdit;
AxeBox3 : TCheckBox;
ActiveBox3 : TCheckBox;
NameBox4 : TEdit;
PasswordBox4 : TEdit;
NicknameBox4 : TEdit;
HoverskillBox4 : TEdit;
BreakBox4 : TEdit;
LoadsBox4 : TEdit;
PinBox4 : TEdit;
AxeBox4 : TCheckBox;
ActiveBox4 : TCheckBox;
NameBox5 : TEdit;
PasswordBox5 : TEdit;
NicknameBox5 : TEdit;
HoverskillBox5 : TEdit;
BreakBox5 : TEdit;
LoadsBox5 : TEdit;
PinBox5 : TEdit;
AxeBox5 : TCheckBox;
ActiveBox5 : TCheckBox;
StartButton : TButton;
Procedure ButtonClick(Sender: TObject);
Begin
Writeln('Script started');
FrmDesign.ModalResult := mrOk;
End;
Procedure Initform;
var str: TStringArray;
e: integer;
begin
FrmDesign := CreateForm;
frmdesign.SetBounds(333,199,386,446);
FrmDesign.Caption := 'FrmDesign';
PageControl := TPageControl.Create(FrmDesign);
PageControl.Parent := FrmDesign;
PageControl.Align := alClient;
for i:= 1 to 5 do
begin
TabPages[i] := TTabSheet.create(frmdesign);
TabPages[i].pagecontrol := PageControl;
TabPages[i].Caption := 'Player ' + inttostr(i);
str := ['Name', 'Password','Nickname','HoverSkill','Time before break','Loads to cut','Pin','Bbri06'#39's Catherby Yew Cutter and Banker'];
for e := 0 to 7 do
begin
Labels[e] := TLabel.Create(PageControl);
Labels[e].Parent := TabPages[i];
Labels[e].Left := 144;
Labels[e].Top := 40 + e * 24;
Labels[e].Width := 28;
Labels[e].Height := 13;
Labels[e].Caption := str[e];
end;
Memo1 := TMemo.Create(PageControl);
Memo1.Parent := TabPages[i];
memo1.SetBounds(16,224,337,137;
memo1.WordWrap := true;
Memo1.Lines.Add(' This script will cut and bank yew logs from the trees to the' +
' west of Catherby. It should be started amongst the grouping of trees. Yo' +
'ur nickname should be 3-4 letters of your character'#39's name, HoverSk' +
'ill should be one other than woodcutting as woodcutting is hovered o' +
'ver already, and Time before break should be in minutes. If you don'#39 +
't have a pin then leave that box blank.');
Memo1.Lines.Add('');
Memo1.Lines.Add(' Please post progress reports and errors on the scripts threa' +
'd at ');
Memo1.Lines.Add('www.villavu.com/forum.');
Memo1.ReadOnly := True;
end;
NameBox := TEdit.Create(PageControl);
NameBox.Parent := TabPages[1];
NameBox.Left := 16;
NameBox.Top := 40;
NameBox.Width := 121;
NameBox.Height := 21;
NameBox.TabOrder := 8;
PasswordBox := TEdit.Create(PageControl);
PasswordBox.Parent := TabPages[1];
PasswordBox.Left := 16;
PasswordBox.Top := 64;
PasswordBox.Width := 121;
PasswordBox.Height := 21;
PasswordBox.TabOrder := 9;
NicknameBox := TEdit.Create(PageControl);
NicknameBox.Parent := TabPages[1];
NicknameBox.Left := 16;
NicknameBox.Top := 88;
NicknameBox.Width := 121;
NicknameBox.Height := 21;
NicknameBox.TabOrder := 10;
HoverskillBox := TEdit.Create(PageControl);
HoverskillBox.Parent := TabPages[1];
HoverskillBox.Left := 16;
HoverskillBox.Top := 112;
HoverskillBox.Width := 121;
HoverskillBox.Height := 21;
HoverskillBox.TabOrder := 11;
BreakBox := TEdit.Create(PageControl);
BreakBox.Parent := TabPages[1];
BreakBox.Left := 16;
BreakBox.Top := 136;
BreakBox.Width := 121;
BreakBox.Height := 21;
BreakBox.TabOrder := 12;
LoadsBox := TEdit.Create(PageControl);
LoadsBox.Parent := TabPages[1];
LoadsBox.Left := 16;
LoadsBox.Top := 160;
LoadsBox.Width := 121;
LoadsBox.Height := 21;
LoadsBox.TabOrder := 13;
PinBox := TEdit.Create(PageControl);
PinBox.Parent := TabPages[1];
PinBox.Left := 16;
PinBox.Top := 184;
PinBox.Width := 121;
PinBox.Height := 21;
PinBox.TabOrder := 14;
ActiveBox := TCheckBox.Create(PageControl);
ActiveBox.Parent := TabPages[1];
ActiveBox.Left := 240;
ActiveBox.Top := 40;
ActiveBox.Width := 97;
ActiveBox.Height := 60;
ActiveBox.Caption := 'Active?';
ActiveBox.TabOrder := 17;
AxeBox := TCheckBox.Create(PageControl);
AxeBox.Parent := TabPages[1];
AxeBox.Left := 240;
AxeBox.Top := 40;
AxeBox.Width := 97;
AxeBox.Height := 20;
AxeBox.Caption := 'Wielding axe?';
AxeBox.TabOrder := 17;
NameBox2 := TEdit.Create(PageControl);
NameBox2.Parent := TabPages[2];
NameBox2.Left := 16;
NameBox2.Top := 40;
NameBox2.Width := 121;
NameBox2.Height := 21;
NameBox2.TabOrder := 8;
PasswordBox2 := TEdit.Create(PageControl);
PasswordBox2.Parent := TabPages[2];
PasswordBox2.Left := 16;
PasswordBox2.Top := 64;
PasswordBox2.Width := 121;
PasswordBox2.Height := 21;
PasswordBox2.TabOrder := 9;
NicknameBox2 := TEdit.Create(PageControl);
NicknameBox2.Parent := TabPages[2];
NicknameBox2.Left := 16;
NicknameBox2.Top := 88;
NicknameBox2.Width := 121;
NicknameBox2.Height := 21;
NicknameBox2.TabOrder := 10;
HoverskillBox2 := TEdit.Create(PageControl);
HoverskillBox2.Parent := TabPages[2];
HoverskillBox2.Left := 16;
HoverskillBox2.Top := 112;
HoverskillBox2.Width := 121;
HoverskillBox2.Height := 21;
HoverskillBox2.TabOrder := 11;
BreakBox2 := TEdit.Create(PageControl);
BreakBox2.Parent := TabPages[2];
BreakBox2.Left := 16;
BreakBox2.Top := 136;
BreakBox2.Width := 121;
BreakBox2.Height := 21;
BreakBox2.TabOrder := 12;
LoadsBox2 := TEdit.Create(PageControl);
LoadsBox2.Parent := TabPages[2];
LoadsBox2.Left := 16;
LoadsBox2.Top := 160;
LoadsBox2.Width := 121;
LoadsBox2.Height := 21;
LoadsBox2.TabOrder := 13;
PinBox2 := TEdit.Create(PageControl);
PinBox2.Parent := TabPages[2];
PinBox2.Left := 16;
PinBox2.Top := 184;
PinBox2.Width := 121;
PinBox2.Height := 21;
PinBox2.TabOrder := 14;
ActiveBox2 := TCheckBox.Create(PageControl);
ActiveBox2.Parent := TabPages[2];
ActiveBox2.Left := 240;
ActiveBox2.Top := 40;
ActiveBox2.Width := 97;
ActiveBox2.Height := 60;
ActiveBox2.Caption := 'Active?';
ActiveBox2.TabOrder := 17;
AxeBox2 := TCheckBox.Create(PageControl);
AxeBox2.Parent := TabPages[2];
AxeBox2.Left := 240;
AxeBox2.Top := 40;
AxeBox2.Width := 97;
AxeBox2.Height := 20;
AxeBox2.Caption := 'Wielding axe?';
AxeBox2.TabOrder := 17;
NameBox3 := TEdit.Create(PageControl);
NameBox3.Parent := TabPages[3];
NameBox3.Left := 16;
NameBox3.Top := 40;
NameBox3.Width := 121;
NameBox3.Height := 21;
NameBox3.TabOrder := 8;
PasswordBox3 := TEdit.Create(PageControl);
PasswordBox3.Parent := TabPages[3];
PasswordBox3.Left := 16;
PasswordBox3.Top := 64;
PasswordBox3.Width := 121;
PasswordBox3.Height := 21;
PasswordBox3.TabOrder := 9;
NicknameBox3 := TEdit.Create(PageControl);
NicknameBox3.Parent := TabPages[3];
NicknameBox3.Left := 16;
NicknameBox3.Top := 88;
NicknameBox3.Width := 121;
NicknameBox3.Height := 21;
NicknameBox3.TabOrder := 10;
HoverskillBox3 := TEdit.Create(PageControl);
HoverskillBox3.Parent := TabPages[3];
HoverskillBox3.Left := 16;
HoverskillBox3.Top := 112;
HoverskillBox3.Width := 121;
HoverskillBox3.Height := 21;
HoverskillBox3.TabOrder := 11;
BreakBox3 := TEdit.Create(PageControl);
BreakBox3.Parent := TabPages[3];
BreakBox3.Left := 16;
BreakBox3.Top := 136;
BreakBox3.Width := 121;
BreakBox3.Height := 21;
BreakBox3.TabOrder := 12;
LoadsBox3 := TEdit.Create(PageControl);
LoadsBox3.Parent := TabPages[3];
LoadsBox3.Left := 16;
LoadsBox3.Top := 160;
LoadsBox3.Width := 121;
LoadsBox3.Height := 21;
LoadsBox3.TabOrder := 13;
PinBox3 := TEdit.Create(PageControl);
PinBox3.Parent := TabPages[3];
PinBox3.Left := 16;
PinBox3.Top := 184;
PinBox3.Width := 121;
PinBox3.Height := 21;
PinBox3.TabOrder := 14;
ActiveBox3 := TCheckBox.Create(PageControl);
ActiveBox3.Parent := TabPages[3];
ActiveBox3.Left := 240;
ActiveBox3.Top := 40;
ActiveBox3.Width := 97;
ActiveBox3.Height := 60;
ActiveBox3.Caption := 'Active?';
ActiveBox3.TabOrder := 17;
AxeBox3 := TCheckBox.Create(PageControl);
AxeBox3.Parent := TabPages[3];
AxeBox3.Left := 240;
AxeBox3.Top := 40;
AxeBox3.Width := 97;
AxeBox3.Height := 20;
AxeBox3.Caption := 'Wielding axe?';
AxeBox3.TabOrder := 17;
NameBox4 := TEdit.Create(PageControl);
NameBox4.Parent := TabPages[4];
NameBox4.Left := 16;
NameBox4.Top := 40;
NameBox4.Width := 121;
NameBox4.Height := 21;
NameBox4.TabOrder := 8;
PasswordBox4 := TEdit.Create(PageControl);
PasswordBox4.Parent := TabPages[4];
PasswordBox4.Left := 16;
PasswordBox4.Top := 64;
PasswordBox4.Width := 121;
PasswordBox4.Height := 21;
PasswordBox4.TabOrder := 9;
NicknameBox4 := TEdit.Create(PageControl);
NicknameBox4.Parent := TabPages[4];
NicknameBox4.Left := 16;
NicknameBox4.Top := 88;
NicknameBox4.Width := 121;
NicknameBox4.Height := 21;
NicknameBox4.TabOrder := 10;
HoverskillBox4 := TEdit.Create(PageControl);
HoverskillBox4.Parent := TabPages[4];
HoverskillBox4.Left := 16;
HoverskillBox4.Top := 112;
HoverskillBox4.Width := 121;
HoverskillBox4.Height := 21;
HoverskillBox4.TabOrder := 11;
BreakBox4 := TEdit.Create(PageControl);
BreakBox4.Parent := TabPages[4];
BreakBox4.Left := 16;
BreakBox4.Top := 136;
BreakBox4.Width := 121;
BreakBox4.Height := 21;
BreakBox4.TabOrder := 12;
LoadsBox4 := TEdit.Create(PageControl);
LoadsBox4.Parent := TabPages[4];
LoadsBox4.Left := 16;
LoadsBox4.Top := 160;
LoadsBox4.Width := 121;
LoadsBox4.Height := 21;
LoadsBox4.TabOrder := 13;
PinBox4 := TEdit.Create(PageControl);
PinBox4.Parent := TabPages[4];
PinBox4.Left := 16;
PinBox4.Top := 184;
PinBox4.Width := 121;
PinBox4.Height := 21;
PinBox4.TabOrder := 14;
ActiveBox4 := TCheckBox.Create(PageControl);
ActiveBox4.Parent := TabPages[4];
ActiveBox4.Left := 240;
ActiveBox4.Top := 40;
ActiveBox4.Width := 97;
ActiveBox4.Height := 60;
ActiveBox4.Caption := 'Active?';
ActiveBox4.TabOrder := 17;
AxeBox4 := TCheckBox.Create(PageControl);
AxeBox4.Parent := TabPages[4];
AxeBox4.Left := 240;
AxeBox4.Top := 40;
AxeBox4.Width := 97;
AxeBox4.Height := 20;
AxeBox4.Caption := 'Wielding axe?';
AxeBox4.TabOrder := 17;
NameBox5 := TEdit.Create(PageControl);
NameBox5.Parent := TabPages[5];
NameBox5.Left := 16;
NameBox5.Top := 40;
NameBox5.Width := 121;
NameBox5.Height := 21;
NameBox5.TabOrder := 8;
PasswordBox5 := TEdit.Create(PageControl);
PasswordBox5.Parent := TabPages[5];
PasswordBox5.Left := 16;
PasswordBox5.Top := 64;
PasswordBox5.Width := 121;
PasswordBox5.Height := 21;
PasswordBox5.TabOrder := 9;
NicknameBox5 := TEdit.Create(PageControl);
NicknameBox5.Parent := TabPages[5];
NicknameBox5.Left := 16;
NicknameBox5.Top := 88;
NicknameBox5.Width := 121;
NicknameBox5.Height := 21;
NicknameBox5.TabOrder := 10;
HoverskillBox5 := TEdit.Create(PageControl);
HoverskillBox5.Parent := TabPages[5];
HoverskillBox5.Left := 16;
HoverskillBox5.Top := 112;
HoverskillBox5.Width := 121;
HoverskillBox5.Height := 21;
HoverskillBox5.TabOrder := 11;
BreakBox5 := TEdit.Create(PageControl);
BreakBox5.Parent := TabPages[5];
BreakBox5.Left := 16;
BreakBox5.Top := 136;
BreakBox5.Width := 121;
BreakBox5.Height := 21;
BreakBox5.TabOrder := 12;
LoadsBox5 := TEdit.Create(PageControl);
LoadsBox5.Parent := TabPages[5];
LoadsBox5.Left := 16;
LoadsBox5.Top := 160;
LoadsBox5.Width := 121;
LoadsBox5.Height := 21;
LoadsBox5.TabOrder := 13;
PinBox5 := TEdit.Create(PageControl);
PinBox5.Parent := TabPages[5];
PinBox5.Left := 16;
PinBox5.Top := 184;
PinBox5.Width := 121;
PinBox5.Height := 21;
PinBox5.TabOrder := 14;
ActiveBox5 := TCheckBox.Create(PageControl);
ActiveBox5.Parent := TabPages[5];
ActiveBox5.Left := 240;
ActiveBox5.Top := 40;
ActiveBox5.Width := 97;
ActiveBox5.Height := 60;
ActiveBox5.Caption := 'Active?';
ActiveBox5.TabOrder := 17;
AxeBox5 := TCheckBox.Create(PageControl);
AxeBox5.Parent := TabPages[5];
AxeBox5.Left := 240;
AxeBox5.Top := 40;
AxeBox5.Width := 97;
AxeBox5.Height := 20;
AxeBox5.Caption := 'Wielding axe?';
AxeBox5.TabOrder := 17;
StartButton := TButton.Create(PageControl);
StartButton.Parent := TabPages[1];
StartButton.Left := 240;
StartButton.Top := 184;
StartButton.Width := 75;
StartButton.Height := 25;
StartButton.Caption := 'Start';
StartButton.TabOrder := 18;
StartButton.OnClick := @ButtonClick;
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; // those 2 function are the action form setup. Thise one creates your form
SafeShowFormModal; // and this one makes it visible
end.
Procedure DeclarePlayers;
var
Active1, Active2, Active3, Active4, Active5: boolean;
Axe1, Axe2, Axe3, Axe4, Axe5: boolean;
begin
NumberOfPlayers(5);
CurrentPlayer := 0;
if(ActiveBox.checked)then
begin
Active1 := true;
end else
Active1 := false;
if(ActiveBox2.checked)then
begin
Active2 := true;
end else
Active2 := false;
if(ActiveBox3.checked)then
begin
Active3 := true;
end else
Active3 := false;
if(ActiveBox4.checked)then
begin
Active4 := true;
end else
Active4 := false;
if(ActiveBox5.checked)then
begin
Active5 := true;
end else
Active5 := false;
if(AxeBox.checked)then
begin
Axe1 := true;
end else
Axe1 := false;
if(AxeBox2.checked)then
begin
Axe2 := true;
end else
Axe2 := false;
if(AxeBox3.checked)then
begin
Axe3 := true;
end else
Axe3 := false;
if(AxeBox4.checked)then
begin
Axe4 := true;
end else
Axe4 := false;
if(AxeBox5.checked)then
begin
Axe5 := true;
end else
Axe5 := false;
Players[0].Name := NameBox.text;
Players[0].Pass := PasswordBox.text;
Players[0].Nick := NickNameBox.text; // 3 or four letters form your character's name
Players[0].Active := Active1;
Players[0].Booleans[0] := Axe1; //true for wielding axe, false for in inventory
Players[0].Strings[0] := HoverSkillBox.text; // second skill to hover over
Players[0].Integers[0] := StrToInt(BreakBox.text); //time in minutes before breaking, will have random time added
Players[0].Integers[1] := StrToInt(LoadsBox.text); //Loads to cut before terminating
Players[0].Strings[1] := PinBox.text; //Pin if you have one, leave blank if you don't have a pin
Players[1].Name := NameBox2.text;
Players[1].Pass := PasswordBox2.text;
Players[1].Nick := NicknameBox2.text; // 3 or four letters form your character's name
Players[1].Active := Active2;
Players[1].Booleans[0] := Axe2; //true for wielding axe, false for in inventory
Players[1].Strings[0] := HoverSkillBox.text; // second skill to hover over
Players[1].Integers[0] := StrToInt(BreakBox2.text); //time in minutes before breaking, will have random time added
Players[1].Integers[1] := StrToInt(LoadsBox2.text); //Loads to cut before terminating
Players[1].Strings[1] := PinBox2.text; //Pin if you have one, leave blank if you don't have a pin
Players[2].Name := NameBox3.text;
Players[2].Pass := PasswordBox3.text;
Players[2].Nick := NickNameBox3.text; // 3 or four letters form your character's name
Players[2].Active := Active3;
Players[2].Booleans[0] := Axe3; //true for wielding axe, false for in inventory
Players[2].Strings[0] := HoverSkillBox3.text; // second skill to hover over
Players[2].Integers[0] := StrToInt(BreakBox3.text); //time in minutes before breaking, will have random time added
Players[2].Integers[1] := StrToInt(LoadsBox3.text); //Loads to cut before terminating
Players[2].Strings[1] := PinBox3.text; //Pin if you have one, leave blank if you don't have a pin
Players[3].Name := NameBox4.text;
Players[3].Pass := PasswordBox4.text;
Players[3].Nick := NickNamebox4.text; // 3 or four letters form your character's name
Players[3].Active := Active4;
Players[3].Booleans[0] := Axe4; //true for wielding axe, false for in inventory
Players[3].Strings[0] := HoverSkillBox4.text; // second skill to hover over
Players[3].Integers[0] := StrToInt(BreakBox4.text); //time in minutes before breaking, will have random time added
Players[3].Integers[1] := StrToInt(LoadsBox4.text); //Loads to cut before terminating
Players[3].Strings[1] := PinBox4.text; //Pin if you have one, leave blank if you don't have a pin
Players[4].Name := NameBox5.text;
Players[4].Pass := PasswordBox5.text;
Players[4].Nick := NickNameBox5.text; // 3 or four letters form your character's name
Players[4].Active := Active5;
Players[4].Booleans[0] := Axe5; //true for wielding axe, false for in inventory
Players[4].Strings[0] := HoverSkillBox5.text; // second skill to hover over
Players[4].Integers[0] := StrToInt(BreakBox5.text); //time in minutes before breaking, will have random time added
Players[4].Integers[1] := StrToInt(LoadsBox5.text); //Loads to cut before terminating
Players[4].Strings[1] := PinBox5.text; //Pin if you have one, leave blank if you don't have a pin
end;
thats only changing a few things. It can indeed be much more efficient than this.
EDIT: did more -
SCAR Code:
program New;
var
frmDesign : TForm;
PageControl : TTabControl;
Labels : array of TLabel;
edits: array of TEdit;
Memo1 : TMemo;
AxeBox : TCheckBox;
ActiveBox : TCheckBox;
StartButton : TButton;
fullArr: Array of TStringArray;
Procedure ButtonClick(Sender: TObject);
Begin
Writeln('Script started');
FrmDesign.ModalResult := mrOk;
End;
procedure ChangeEdits(Sender: Tobject);
var i : integer;
begin
for i := 0 to high(edits) do
edits[i].text := fullArr[pagecontrol.TabIndex][i];
ActiveBox.Checked := strtobool(fullArr[pagecontrol.TabIndex][high(fullArr[pagecontrol.TabIndex]) - 1]);
AxeBox.Checked := strtobool(fullArr[pagecontrol.TabIndex][high(fullArr[pagecontrol.TabIndex])]);
end;
procedure Changing(Sender: TObject; var AllowChange: Boolean);
var i : integer;
begin
for i := 0 to high(edits) do
fullArr[pagecontrol.TabIndex][i] := edits[i].text;
fullArr[pagecontrol.TabIndex][high(fullArr[0]) - 1] := booltostr(ActiveBox.Checked);
fullArr[pagecontrol.TabIndex][high(fullArr[0])] := booltostr(AxeBox.Checked);
end;
Procedure Initform;
var str: TStringArray;
i,e: integer;
begin
str := ['Name', 'Password','Nickname','HoverSkill','Time before break','Loads to cut','Pin'];
FrmDesign := CreateForm;
frmdesign.SetBounds(333,199,386,446);
FrmDesign.Caption := 'Bbri06'#39's Catherby Yew Cutter and Banker';
frmdesign.AutoScroll := false;
PageControl := TTabControl.Create(FrmDesign);
PageControl.Parent := FrmDesign;
PageControl.SetBounds(0, 0, frmDesign.Width, 21);
PageControl.OnChange := @ChangeEdits;
PageControl.OnChanging := @Changing;
SetArrayLength(fullarr, 6);
for i := 0 to high(fullarr) do
begin
SetArrayLength(fullarr[i], GetArrayLength(str) + 2);
PageControl.tabs.Append('Player' + inttostr(i + 1));
fullarr[i][7] := 'False';
fullarr[i][8] := 'False';
end;
SetArrayLength(Labels, GetArrayLength(str));
for e := 0 to high(str) do
begin
Labels[e] := TLabel.Create(PageControl);
Labels[e].Parent := frmdesign;
Labels[e].Left := 144;
Labels[e].Top := 40 + e * 24;
Labels[e].Width := 28;
Labels[e].Height := 13;
Labels[e].Caption := str[e];
end;
Memo1 := TMemo.Create(PageControl);
Memo1.Parent := frmdesign;
memo1.SetBounds(16,224,337,137);
memo1.WordWrap := true;
Memo1.Lines.Add(' This script will cut and bank yew logs from the trees to the' +
' west of Catherby. It should be started amongst the grouping of trees. Yo' +
'ur nickname should be 3-4 letters of your character'#39's name, HoverSk' +
'ill should be one other than woodcutting as woodcutting is hovered o' +
'ver already, and Time before break should be in minutes. If you don'#39 +
't have a pin then leave that box blank.' + #13#10+ #13#10 + ' Please post progress reports and errors on the scripts threa' +
'd at ' + #13#10 + 'www.villavu.com/forum.');
Memo1.ReadOnly := True;
SetArrayLength(edits, 7);
for i := 0 to high(edits) do
begin
edits[i] := TEdit.Create(PageControl);
edits[i].Parent := frmdesign;
edits[i].SetBounds(16,40 + 24 * i,121,21);
end;
ActiveBox := TCheckBox.Create(PageControl);
ActiveBox.Parent := frmdesign;
ActiveBox.SetBounds(240,40,97,60);
ActiveBox.Caption := 'Active?';
AxeBox := TCheckBox.Create(PageControl);
AxeBox.Parent := frmdesign;
AxeBox.SetBounds(240,40,97,20);
AxeBox.Caption := 'Wielding axe?';
StartButton := TButton.Create(PageControl);
StartButton.Parent := frmdesign;
StartButton.SetBounds(240,184,75,25);
StartButton.Caption := 'Start';
StartButton.OnClick := @ButtonClick;
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; // those 2 function are the action form setup. Thise one creates your form
SafeShowFormModal; // and this one makes it visible
end.
Procedure DeclarePlayers;
var i: integer;
begin
NumberOfPlayers(GetArrayLength(fullarr));
CurrentPlayer := 0;
for i := 0 to high(fullArr) do
begin
Players[i].Name := fullarr[i][0].text;
Players[i].Pass := fullarr[i][1].text;
Players[i].Nick := fullarr[i][2].text; // 3 or four letters form your character's name
Players[i].Active := fullarr[i][9]
Players[i].Booleans[0] := fullarr[i][8]; //true for wielding axe, false for in inventory
Players[i].Strings[0] := fullarr[i][3].text; // second skill to hover over
Players[i].Integers[0] := StrToInt(fullarr[i][4].text); //time in minutes before breaking, will have random time added
Players[i].Integers[1] := StrToInt(fullarr[i][5].text); //Loads to cut before terminating
Players[i].Strings[1] := fullarr[i][6].text; //Pin if you have one, leave blank if you don't have a pin
end;
end;