Ok...But don't just be all smart alec and think you know more than me because like you said i have no idea how good you are and you know how good i am.
Ok...But don't just be all smart alec and think you know more than me because like you said i have no idea how good you are and you know how good i am.
Can you teach me how to use CheckBoxes and RadioButtons pl0x?
I will <3 you 4 ever!!!
Yes
SCAR Code:If RadioButton1.Checked then writeln('checked');
If CheckBox1.Checked then writeln('checked');
If you need more explained add me on msn
kylewollaston@hotmail.com
very nice, this tut along with the adding tab to forms helped me make this one all i gotta do is figure out ini files now ^_^ and nevermind all the hints, i have it setup so i can copy/paste it in my script with all the vars because i dunno .ini yet
SCAR Code:program New;
{.include srl/srl.scar}
var
Logs, Knife, Axe, CboxDTM, LC, SC, LB, TD, TA, Tree, Tinderbox, Longbow: integer;
frmDesign : TForm;
PageControl1 : TPageControl;
Tabs : Array of TTabSheet;
Label1 : array of TLabel;
Edit1, Edit2, Edit3, Edit4 : array of TEdit;
Edit5, Edit6: TEdit;
RadioButton1 : array of TRadioButton;
ComboBox1, ComboBox2 : array of TComboBox;
Button1, Button2, Button3 : TButton;
Const
Rundirection = 'n';
Procedure FormStuff; forward;
Procedure DeclarePlayers; forward;
Procedure AddPlayer(sender : Tobject);
var t: integer;
begin
inc(howmanyplayers);
SetArrayLength(Tabs, Howmanyplayers);
SetArrayLength(Label1, Howmanyplayers);
SetArraylength(Edit1, Howmanyplayers);
SetArraylength(Edit2, Howmanyplayers);
SetArraylength(Edit3, Howmanyplayers);
SetArraylength(Edit4, Howmanyplayers);
SetArraylength(RadioButton1, Howmanyplayers);
SetArrayLength(ComboBox1, Howmanyplayers);
SetArraylength(ComboBox2, Howmanyplayers);
t := howmanyplayers - 1;
Tabs[t] := TTabSheet.Create(frmDesign);
Tabs[t].PageControl := PageControl1;
Tabs[t].Caption := 'Player ' + inttostr(howmanyplayers);
Label1[t] := TLabel.Create(frmdesign);
Label1[t].Parent := Tabs[t];
Label1[t].Left := 128;
Label1[t].Top := 133;
Label1[t].Width := 105;
Label1[t].Height := 17;
Label1[t].Caption := 'Before Logging Out';
Edit1[t] := TEdit.Create(frmdesign);
Edit1[t].Parent := tabs[t];
Edit1[t].Left := 64;
Edit1[t].Top := 21;
Edit1[t].Width := 137;
Edit1[t].Height := 21;
Edit1[t].TabOrder := 0;
Edit1[t].Text := 'Name';
Edit2[t] := TEdit.Create(frmdesign);
Edit2[t].Parent := tabs[t];
Edit2[t].Left := 64;
Edit2[t].Top := 61;
Edit2[t].Width := 137;
Edit2[t].Height := 21;
Edit2[t].TabOrder := 1;
Edit2[t].Text := 'Password';
Edit3[t] := TEdit.Create(frmdesign);
Edit3[t].Parent := tabs[t];
Edit3[t].Left := 64;
Edit3[t].Top := 101;
Edit3[t].Width := 57;
Edit3[t].Height := 21;
Edit3[t].TabOrder := 2;
Edit3[t].Text := 'Nick';
RadioButton1[t] := TRadioButton.Create(frmdesign);
RadioButton1[t].Parent := tabs[t];
RadioButton1[t].Left := 64;
RadioButton1[t].Top := 229;
RadioButton1[t].Width := 81;
RadioButton1[t].Height := 25;
RadioButton1[t].Caption := ' Active?';
RadioButton1[t].Checked := True;
RadioButton1[t].TabOrder := 3;
RadioButton1[t].TabStop := True;
Edit4[t] := TEdit.Create(frmdesign);
Edit4[t].Parent := tabs[t];
Edit4[t].Left := 64;
Edit4[t].Top := 133;
Edit4[t].Width := 57;
Edit4[t].Height := 21;
Edit4[t].TabOrder := 4;
Edit4[t].Text := 'Loads';
ComboBox1[t] := TComboBox.Create(frmdesign);
ComboBox1[t].Parent := tabs[t];
ComboBox1[t].Left := 64;
ComboBox1[t].Top := 165;
ComboBox1[t].Width := 145;
ComboBox1[t].Height := 21;
ComboBox1[t].ItemHeight := 13;
ComboBox1[t].TabOrder := 5;
ComboBox1[t].Text := 'Type of Tree';
ComboBox1[t].Items.Add('Tree');
ComboBox1[t].Items.Add('Oak');
ComboBox1[t].Items.Add('Willow');
ComboBox1[t].Items.Add('Yew');
ComboBox2[t] := TComboBox.Create(frmdesign);
ComboBox2[t].Parent := tabs[t];
ComboBox2[t].Left := 64;
ComboBox2[t].Top := 197;
ComboBox2[t].Width := 145;
ComboBox2[t].Height := 21;
ComboBox2[t].ItemHeight := 13;
ComboBox2[t].TabOrder := 6;
ComboBox2[t].Text := 'Action on Logs';
ComboBox2[t].Items.Add('Fletch');
ComboBox2[t].Items.Add('Burn');
ComboBox2[t].Items.Add('Drop');
PageControl1.ActivePageIndex := t;
end;
Procedure StartButton(sender : Tobject);
begin
FrmDesign.modalresult := mrOk;
end;
Procedure Form;
var t: integer;
begin
frmDesign := CreateForm;
frmDesign.Left := 296;
frmDesign.Top := 164;
frmDesign.Width := 439;
frmDesign.Height := 325;
frmDesign.Caption := 'Power! by Drizzt';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
PageControl1 := TPageControl.Create(frmDesign);
PageControl1.Parent := frmDesign;
PageControl1.Left := 0;
PageControl1.Top := 0;
PageControl1.Width := 273;
PageControl1.Height := 289;
PageControl1.TabOrder := 0;
SetArrayLength(Tabs, 1);
SetArrayLength(Label1, 1);
SetArraylength(Edit1, 1);
SetArraylength(Edit2, 1);
SetArraylength(Edit3, 1);
SetArraylength(Edit4, 1);
SetArraylength(RadioButton1, 1);
SetArrayLength(ComboBox1, 1);
SetArraylength(ComboBox2, 1);
Howmanyplayers := 1;
Tabs[0] := TTabSheet.Create(frmDesign);
Tabs[0].PageControl := PageControl1;
Tabs[0].Caption := 'Player ' + inttostr(howmanyplayers);
Label1[0] := TLabel.Create(frmdesign);
Label1[0].Parent := Tabs[0];
Label1[0].Left := 128;
Label1[0].Top := 133;
Label1[0].Width := 105;
Label1[0].Height := 17;
Label1[0].Caption := 'Before Logging Out';
Edit1[0] := TEdit.Create(frmdesign);
Edit1[0].Parent := tabs[0];
Edit1[0].Left := 64;
Edit1[0].Top := 21;
Edit1[0].Width := 137;
Edit1[0].Height := 21;
Edit1[0].TabOrder := 0;
Edit1[0].Text := 'Name';
Edit2[0] := TEdit.Create(frmdesign);
Edit2[0].Parent := tabs[0];
Edit2[0].Left := 64;
Edit2[0].Top := 61;
Edit2[0].Width := 137;
Edit2[0].Height := 21;
Edit2[0].TabOrder := 1;
Edit2[0].Text := 'Password';
Edit3[0] := TEdit.Create(frmdesign);
Edit3[0].Parent := tabs[0];
Edit3[0].Left := 64;
Edit3[0].Top := 101;
Edit3[0].Width := 57;
Edit3[0].Height := 21;
Edit3[0].TabOrder := 2;
Edit3[0].Text := 'Nick';
RadioButton1[0] := TRadioButton.Create(frmdesign);
RadioButton1[0].Parent := tabs[0];
RadioButton1[0].Left := 64;
RadioButton1[0].Top := 229;
RadioButton1[0].Width := 81;
RadioButton1[0].Height := 25;
RadioButton1[0].Caption := ' Active?';
RadioButton1[0].Checked := True;
RadioButton1[0].TabOrder := 3;
RadioButton1[0].TabStop := True;
Edit4[0] := TEdit.Create(frmdesign);
Edit4[0].Parent := tabs[0];
Edit4[0].Left := 64;
Edit4[0].Top := 133;
Edit4[0].Width := 57;
Edit4[0].Height := 21;
Edit4[0].TabOrder := 4;
Edit4[0].Text := 'Loads';
ComboBox1[0] := TComboBox.Create(frmdesign);
ComboBox1[0].Parent := tabs[0];
ComboBox1[0].Left := 64;
ComboBox1[0].Top := 165;
ComboBox1[0].Width := 145;
ComboBox1[0].Height := 21;
ComboBox1[0].ItemHeight := 13;
ComboBox1[0].TabOrder := 5;
ComboBox1[0].Text := 'Type of Tree';
ComboBox1[0].Items.Add('Tree');
ComboBox1[0].Items.Add('Oak');
ComboBox1[0].Items.Add('Willow');
ComboBox1[0].Items.Add('Yew');
ComboBox2[0] := TComboBox.Create(frmdesign);
ComboBox2[0].Parent := tabs[0];
ComboBox2[0].Left := 64;
ComboBox2[0].Top := 197;
ComboBox2[0].Width := 145;
ComboBox2[0].Height := 21;
ComboBox2[0].ItemHeight := 13;
ComboBox2[0].TabOrder := 6;
ComboBox2[0].Text := 'Action on Logs';
ComboBox2[0].Items.Add('Fletch');
ComboBox2[0].Items.Add('Burn');
ComboBox2[0].Items.Add('Drop');
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 288;
Button1.Top := 216;
Button1.Width := 121;
Button1.Height := 33;
Button1.Caption := 'Start';
Button1.TabOrder := 9;
Button1.onclick := @StartButton;
Button2 := TButton.Create(frmDesign);
Button2.Parent := frmDesign;
Button2.Left := 288;
Button2.Top := 128;
Button2.Width := 121;
Button2.Height := 33;
Button2.Caption := 'Add Player';
Button2.TabOrder := 10;
Button2.OnClick := @Addplayer;
Edit5 := TEdit.Create(frmDesign);
Edit5.Parent := frmDesign;
Edit5.Left := 288;
Edit5.Top := 72;
Edit5.Width := 121;
Edit5.Height := 21;
Edit5.Font.Color := clWindowText;
Edit5.Font.Height := -11;
Edit5.TabOrder := 3;
Edit5.Text := 'SRL ID';
Edit6 := TEdit.Create(frmDesign);
Edit6.Parent := frmDesign;
Edit6.Left := 288;
Edit6.Top := 32;
Edit6.Width := 121;
Edit6.Height := 21;
Edit6.TabOrder := 4;
Edit6.Text := 'SRL Password';
Pagecontrol1.Activepageindex := 0;
end;
Procedure DeclarePlayers;
var p : integer;
begin
NumberOfplayers(howmanyplayers);
Currentplayer := 0
for p := 0 to Howmanyplayers - 1 do
begin
Players[p].Name := Edit1[p].text; //username
Players[p].Pass := Edit2[p].text; //password
Players[p].Nick := Edit3[p].text; //3-4 letters from your username
Players[p].Integers[0] := StrToInt(Edit4[p].text); //loads per logout
Players[p].Strings[1] := Combobox1[p].text; //Tree, Willow, Yew, Etc.
Players[p].Strings[0] := Combobox2[p].text; //What to do? Ex.'Fletch','Burn','Drop'
Players[p].Active := Radiobutton1[p].checked;
end;
end;
Procedure SafeInitForm;
Var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('Form', v);
end;
Procedure ShowFormModal;
Begin
frmDesign.ShowModal;
end;
Procedure SafeShowFormModal;
Var
v: TVariantArray;
Begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
Procedure FormStuff;
begin
safeinitform;
SafeShowFormModal;
end;
begin
SetupSRL;
FormStuff;
end.
Originally Posted by That guy that wrote forefeathers
Nice tut, I'll be trying this out soon.
http://www.fenjer.com/adnan/SRLStats/4738.png
Hy71194's Fight Cave Runner is OWNS!!!!!!!!!
Drizzt's FallyCowCruncher is ownage too! <3<3<3
it would be easier..but, not as fr34k1n sw33t?
also, i have nothing better to do..so..
Originally Posted by That guy that wrote forefeathers
Hmm drizzt we both could work on something like that. I already know ini files see the player manager i made in public test corner. Add me on msn
kylewollaston@hotmail.com
added, haha i had just sent you a pm asking for your MSN, or maybe i said AIM but i meant MSN
Originally Posted by That guy that wrote forefeathers
Nice thx it help alot
MUST REP AND 5 STAR!!!!!
dude thanks so much!
Very nice. I'll definitely be using this Rep++
lol sup kyle ty for letting me come here (i no him in irl) it looks nice but im noob and can't understand i will later. you own at form stuff lol rep+ wanna tutor me some more?
sorry can someone tell me were the edit button is? i saw on other forums but where here? after that i will delete this
hey at kickball tomarrow its me. u, greg, vs all. and if this is spam delte?
your awesome.. haha great tut
... never happened? Thanks for this, I just decided to learn how to make a form! :headbang: I did not know that there was a form editor... I feel very, very, very, very, very nooby.Originally Posted by Da 0wner
Er, yea I quit SRL for a few months after this .
I don't feel like finishing it right now though. Lol.
I used your code, with your example, a form did not apear the script did run but nothing happened, didnt even get the errormessage you sad. really nice tut.
Why do i keep getting unknown identifier on the procedure witch is supose to perform the action chosed when you click on the button???
Post everything you have.
Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
Originally Posted by #srl"A programmer is just a tool which converts caffeine into code"
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
There are currently 1 users browsing this thread. (0 members and 1 guests)