Page 2 of 2 FirstFirst 12
Results 26 to 46 of 46

Thread: Newbie Form Tutorial

  1. #26
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.

  2. #27
    Join Date
    Sep 2007
    Posts
    501
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Can you teach me how to use CheckBoxes and RadioButtons pl0x?

    I will <3 you 4 ever!!!

  3. #28
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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

  4. #29
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  5. #30
    Join Date
    Sep 2007
    Posts
    501
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by drizzt View Post
    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.
    SRLPlayerForm?

    I didn't really look at the form but wouldnt it be easier to just implement SRLPlayerForm then use another form for the other things like runaway direction and SRL Stat stuff

  6. #31
    Join Date
    Mar 2008
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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

  7. #32
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it would be easier..but, not as fr34k1n sw33t?

    also, i have nothing better to do..so..
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  8. #33
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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

  9. #34
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    added, haha i had just sent you a pm asking for your MSN, or maybe i said AIM but i meant MSN
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  10. #35
    Join Date
    Mar 2008
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice thx it help alot

  11. #36
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    MUST REP AND 5 STAR!!!!!

    dude thanks so much!

  12. #37
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very nice. I'll definitely be using this Rep++

  13. #38
    Join Date
    Apr 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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?

  14. #39
    Join Date
    Apr 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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?

  15. #40
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    your awesome.. haha great tut

  16. #41
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by Da 0wner
    ***This tutorial is not complete yet. I will show you examples of all the types. I have to go to sleep now so I will finish this tomarrow ***
    ... 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.

  17. #42
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Er, yea I quit SRL for a few months after this .
    I don't feel like finishing it right now though. Lol.

  18. #43
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    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.

  19. #44
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Why do i keep getting unknown identifier on the procedure witch is supose to perform the action chosed when you click on the button???

  20. #45
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Post everything you have.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  21. #46
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by tom99 View Post
    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.
    Quote Originally Posted by tom99 View Post
    Why do i keep getting unknown identifier on the procedure witch is supose to perform the action chosed when you click on the button???
    Copying the code won't get you any where. This tutorial was designed so you have to read through it, as the final output is currently in fragments in this tutorial.
    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 |

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. THE big form tutorial ~ by MK
    By MasterKill in forum OSR Advanced Scripting Tutorials
    Replies: 125
    Last Post: 08-04-2013, 07:32 PM
  2. Complete Form Tutorial
    By BobboHobbo in forum OSR Advanced Scripting Tutorials
    Replies: 10
    Last Post: 05-29-2012, 01:36 PM
  3. The Form Tutorial
    By Dan Cardin in forum OSR Advanced Scripting Tutorials
    Replies: 28
    Last Post: 03-03-2011, 04:42 AM
  4. Form TPopupMenu tutorial
    By Freddy1990 in forum OSR Advanced Scripting Tutorials
    Replies: 13
    Last Post: 12-14-2009, 07:25 PM
  5. Ultimate form tutorial
    By jhildy in forum OSR Advanced Scripting Tutorials
    Replies: 9
    Last Post: 02-21-2008, 05:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •