Page 2 of 6 FirstFirst 1234 ... LastLast
Results 26 to 50 of 126

Thread: THE big form tutorial ~ by MK

  1. #26
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very nice now if only you knew how to reduce all that code by about 300% using with do for do and arrays

    SCAR Code:
    {*******************************************************************************
      Form variables
    *******************************************************************************}


    var
      ComboBoxes: array[0..1] of TComboBox;
      CheckBoxes: array[0..4] of TCheckBox;
      Buttons: array[0..4] of TButton;
      Labels: array[0..13] of TLabel;
      Edits: array[0..5] of TEdit;
      BackgroundPicture: LongInt;
      CharsFileString: string;
      StartScript: Boolean;
      Form: TForm;

    SCAR Code:
    {*******************************************************************************
    procedure DeclareFormFromPlayers(I: LongInt);
    By: IceFire908.
    Description: Declares the settings from the SRL player array into the form.
    *******************************************************************************}


    procedure DeclareFormFromPlayers(I: LongInt);
    var
      II: Byte;
    begin
      try
        if (Players[I].Name <> '') then
          Edits[0].Text := Players[I].Name
        else
          Edits[0].Text := 'New Username';
        if (Players[I].Pass <> '') then
          Edits[1].Text := Players[I].Pass
        else
          Edits[1].Text := 'New Password';
        if (Players[I].Nick <> '') then
          Edits[2].Text := Players[I].Nick
        else
          Edits[2].Text := 'New Nickname';
        if (Players[I].Skill <> '') then
          ComboBoxes[1].Text := Players[I].Skill
        else
          ComboBoxes[1].Text := 'Agility';
        CheckBoxes[0].Checked := Players[I].Active;
        if (Players[I].Strings[0] <> '') then
          Edits[3].Text := Players[I].Strings[0]
        else
          Edits[3].Text := '0000';
        if (Players[I].Strings[1] <> '') then
          ComboBoxes[0].Text := Players[I].Strings[1]
        else
          ComboBoxes[0].Text := '[Air] (FEB)';
        Edits[4].Text := IntToStr(Players[I].Integers[0]);
        Edits[5].Text := IntToStr(Players[I].Integers[1]);
        for II := 1 to 4 do
          CheckBoxes[II].Checked := Players[I].Booleans[II - 1];
      except
      end;
    end;

    SCAR Code:
    {*******************************************************************************
    procedure InitForm;
    By: IceFire908.
    Description: Initializes the form.
    *******************************************************************************}


    procedure InitForm;
    var
      FormInfo: TStringArray;
      I, II: Byte;
    begin
      LoadPlayersFromFile;
      FormInfo := ['go to the previous player', '<<', 'create a new player', 'Create Player', 'delete a player', 'Delete Player', 'go to the next player', '>>', 'start Rune Crafter ReBorn', 'Start RCrB', 'player is going to be used', '68', '214', 'you are using a small pouch', '336', '205', 'you are using a medium pouch', '412', '205', 'you are using a large pouch', '336', '225', 'you are using a gaint pouch', '412', '225', 'rune to craft at a location', 'skill to chose in the genie random event', '[Air] (FEB)', '[Mind] (FWB)', '[Water] (DB)', '[Earth] (VEB)', '[Fire] (AKB)', '[Body] (EB)', 'Agility', 'Attack', 'Construction', 'Cooking', 'Crafting', 'Defence',
           'Farming', 'Firemaking', 'Fishing', 'Fletching', 'Herblore', 'Hitpoints', 'Hunting', 'Magic', 'Mining', 'Prayer', 'Ranged', 'Runecrafting', 'Slayer', 'Smithing', 'Strength', 'Thieving', 'Woodcutting', 'Current player # being viewed', '14', '51', 'Player # 0.', 'Check if player is going to be used', '84', '216', 'Player Active.', 'Type in your username here', '13', '90', 'Username:', 'Type in your password here', '216', '90', 'Password:', 'Type in the 2nd, 3rd, and 4th letters of your username here', '15', '120', 'Nickname:', 'Type in your bank pin here', '223', '120', 'Bank Pin:', 'Type in the amount of loads to do per a round here',
           '38', '150', 'Loads:', 'Type in the amount of essence to craft', '217', '150', 'Essences:', 'Select a rune to craft at a location', '19', '180', 'Runecraft:', 'Select a skill to chose in the genie random event', '216', '180', 'Lamp Skill:', 'Check if you are using a small pouch', '352', '207', 'S Pouch.', 'Check if you are using a medium pouch', '428', '207', 'M Pouch.', 'Check if you are using a large pouch', '353', '227', 'L Pouch.', 'Check if you are using a gaint pouch', '428', '227', 'G Pouch.', '83', '88', '283', '88', '83', '118', '283', '118', '83', '148', '283', '148'];
      Form := CreateForm;
      with Form do
      begin
        Caption := 'Rune Crafter ReBorn v' + VersionNumber + ' by IceFire908. Powered by SRL.';
        SetBounds(162, 102, 497, 268);
        BorderStyle := BSToolWindow;
        OnPaint := @LoadBackground;
        OnCloseQuery := @FormClosed;
        ShowHint := True;
      end;
      for I := 0 to 4 do
      begin
        Buttons[I] := TButton.Create(Form);
        with Buttons[I] do
        begin
          Parent := Form;
          Hint := 'Click to ' + FormInfo[(2 * I)] + '.';
          SetBounds((69 + (88 * I)), 61, 85, 19);
          if (I = 4) then
            SetBounds(176, 208, 136, 29);
          Caption := FormInfo[(1 + (2 * I))];
          OnClick := @ButtonClick;
        end;
      end;
      for I := 0 to 4 do
      begin
        CheckBoxes[I] := TCheckBox.Create(Form);
        with CheckBoxes[I] do
        begin
          Parent := Form;
          Hint := 'Check if ' + FormInfo[(10 + (3 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(11 + (3 * I))]), StrToInt(FormInfo[(12 + (3 * I))]), 17, 17);
        end;
      end;
      for I := 0 to 1 do
      begin
        ComboBoxes[I] := TComboBox.Create(Form);
        with ComboBoxes[I] do
        begin
          Parent := Form;
          Hint := 'Select a ' + FormInfo[25 + I] + '.';
          SetBounds((83 + (200 * I)), 178, 121, 21);
          OnKeyPress := @OnKeyPress;
          for II := 0 to (5 + (17 * I)) do
            Items.Add(FormInfo[(27 + (6 * I) + II)]);
        end;
      end;
      for I := 0 to 13 do
      begin
        Labels[I] := TLabel.Create(Form);
        with Labels[I] do
        begin
          Parent := Form;
          Font.Color := CLWhite;
          Hint := FormInfo[(56 + (4 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(57 + (4 * I))]), StrToInt(FormInfo[(58 + (4 * I))]), 16, 66);
          Font.Height := -13;
          case I of
            0, 1, 10, 11, 12, 13: Font.Height := -11;
          end;
          Caption := FormInfo[(59 + (4 * I))];
        end;
      end;
      for I := 0 to 5 do
      begin
        Edits[I] := TEdit.Create(Form);
        with Edits[I] do
        begin
          Parent := Form;
          Hint := FormInfo[(64 + (4 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(112 + (2 * I))]), StrToInt(FormInfo[(113 + (2 * I))]), 121, 21);
          case I of
            1, 3: PasswordChar := '*';
          end;
        end;
      end;
      DeclareFormFromPlayers(0);
    end;

    Just some spoilers from RCrB v2.00

  2. #27
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Omg, Ice-fire you always take any oppertunity to advertise it . Also how far are you done with it?

  3. #28
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Very nice now if only you knew how to reduce all that code by about 300% using with do for do and arrays

    SCAR Code:
    {*******************************************************************************
      Form variables
    *******************************************************************************}


    var
      ComboBoxes: array[0..1] of TComboBox;
      CheckBoxes: array[0..4] of TCheckBox;
      Buttons: array[0..4] of TButton;
      Labels: array[0..13] of TLabel;
      Edits: array[0..5] of TEdit;
      BackgroundPicture: LongInt;
      CharsFileString: string;
      StartScript: Boolean;
      Form: TForm;

    SCAR Code:
    {*******************************************************************************
    procedure DeclareFormFromPlayers(I: LongInt);
    By: IceFire908.
    Description: Declares the settings from the SRL player array into the form.
    *******************************************************************************}


    procedure DeclareFormFromPlayers(I: LongInt);
    var
      II: Byte;
    begin
      try
        if (Players[I].Name <> '') then
          Edits[0].Text := Players[I].Name
        else
          Edits[0].Text := 'New Username';
        if (Players[I].Pass <> '') then
          Edits[1].Text := Players[I].Pass
        else
          Edits[1].Text := 'New Password';
        if (Players[I].Nick <> '') then
          Edits[2].Text := Players[I].Nick
        else
          Edits[2].Text := 'New Nickname';
        if (Players[I].Skill <> '') then
          ComboBoxes[1].Text := Players[I].Skill
        else
          ComboBoxes[1].Text := 'Agility';
        CheckBoxes[0].Checked := Players[I].Active;
        if (Players[I].Strings[0] <> '') then
          Edits[3].Text := Players[I].Strings[0]
        else
          Edits[3].Text := '0000';
        if (Players[I].Strings[1] <> '') then
          ComboBoxes[0].Text := Players[I].Strings[1]
        else
          ComboBoxes[0].Text := '[Air] (FEB)';
        Edits[4].Text := IntToStr(Players[I].Integers[0]);
        Edits[5].Text := IntToStr(Players[I].Integers[1]);
        for II := 1 to 4 do
          CheckBoxes[II].Checked := Players[I].Booleans[II - 1];
      except
      end;
    end;

    SCAR Code:
    {*******************************************************************************
    procedure InitForm;
    By: IceFire908.
    Description: Initializes the form.
    *******************************************************************************}


    procedure InitForm;
    var
      FormInfo: TStringArray;
      I, II: Byte;
    begin
      LoadPlayersFromFile;
      FormInfo := ['go to the previous player', '<<', 'create a new player', 'Create Player', 'delete a player', 'Delete Player', 'go to the next player', '>>', 'start Rune Crafter ReBorn', 'Start RCrB', 'player is going to be used', '68', '214', 'you are using a small pouch', '336', '205', 'you are using a medium pouch', '412', '205', 'you are using a large pouch', '336', '225', 'you are using a gaint pouch', '412', '225', 'rune to craft at a location', 'skill to chose in the genie random event', '[Air] (FEB)', '[Mind] (FWB)', '[Water] (DB)', '[Earth] (VEB)', '[Fire] (AKB)', '[Body] (EB)', 'Agility', 'Attack', 'Construction', 'Cooking', 'Crafting', 'Defence',
           'Farming', 'Firemaking', 'Fishing', 'Fletching', 'Herblore', 'Hitpoints', 'Hunting', 'Magic', 'Mining', 'Prayer', 'Ranged', 'Runecrafting', 'Slayer', 'Smithing', 'Strength', 'Thieving', 'Woodcutting', 'Current player # being viewed', '14', '51', 'Player # 0.', 'Check if player is going to be used', '84', '216', 'Player Active.', 'Type in your username here', '13', '90', 'Username:', 'Type in your password here', '216', '90', 'Password:', 'Type in the 2nd, 3rd, and 4th letters of your username here', '15', '120', 'Nickname:', 'Type in your bank pin here', '223', '120', 'Bank Pin:', 'Type in the amount of loads to do per a round here',
           '38', '150', 'Loads:', 'Type in the amount of essence to craft', '217', '150', 'Essences:', 'Select a rune to craft at a location', '19', '180', 'Runecraft:', 'Select a skill to chose in the genie random event', '216', '180', 'Lamp Skill:', 'Check if you are using a small pouch', '352', '207', 'S Pouch.', 'Check if you are using a medium pouch', '428', '207', 'M Pouch.', 'Check if you are using a large pouch', '353', '227', 'L Pouch.', 'Check if you are using a gaint pouch', '428', '227', 'G Pouch.', '83', '88', '283', '88', '83', '118', '283', '118', '83', '148', '283', '148'];
      Form := CreateForm;
      with Form do
      begin
        Caption := 'Rune Crafter ReBorn v' + VersionNumber + ' by IceFire908. Powered by SRL.';
        SetBounds(162, 102, 497, 268);
        BorderStyle := BSToolWindow;
        OnPaint := @LoadBackground;
        OnCloseQuery := @FormClosed;
        ShowHint := True;
      end;
      for I := 0 to 4 do
      begin
        Buttons[I] := TButton.Create(Form);
        with Buttons[I] do
        begin
          Parent := Form;
          Hint := 'Click to ' + FormInfo[(2 * I)] + '.';
          SetBounds((69 + (88 * I)), 61, 85, 19);
          if (I = 4) then
            SetBounds(176, 208, 136, 29);
          Caption := FormInfo[(1 + (2 * I))];
          OnClick := @ButtonClick;
        end;
      end;
      for I := 0 to 4 do
      begin
        CheckBoxes[I] := TCheckBox.Create(Form);
        with CheckBoxes[I] do
        begin
          Parent := Form;
          Hint := 'Check if ' + FormInfo[(10 + (3 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(11 + (3 * I))]), StrToInt(FormInfo[(12 + (3 * I))]), 17, 17);
        end;
      end;
      for I := 0 to 1 do
      begin
        ComboBoxes[I] := TComboBox.Create(Form);
        with ComboBoxes[I] do
        begin
          Parent := Form;
          Hint := 'Select a ' + FormInfo[25 + I] + '.';
          SetBounds((83 + (200 * I)), 178, 121, 21);
          OnKeyPress := @OnKeyPress;
          for II := 0 to (5 + (17 * I)) do
            Items.Add(FormInfo[(27 + (6 * I) + II)]);
        end;
      end;
      for I := 0 to 13 do
      begin
        Labels[I] := TLabel.Create(Form);
        with Labels[I] do
        begin
          Parent := Form;
          Font.Color := CLWhite;
          Hint := FormInfo[(56 + (4 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(57 + (4 * I))]), StrToInt(FormInfo[(58 + (4 * I))]), 16, 66);
          Font.Height := -13;
          case I of
            0, 1, 10, 11, 12, 13: Font.Height := -11;
          end;
          Caption := FormInfo[(59 + (4 * I))];
        end;
      end;
      for I := 0 to 5 do
      begin
        Edits[I] := TEdit.Create(Form);
        with Edits[I] do
        begin
          Parent := Form;
          Hint := FormInfo[(64 + (4 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(112 + (2 * I))]), StrToInt(FormInfo[(113 + (2 * I))]), 121, 21);
          case I of
            1, 3: PasswordChar := '*';
          end;
        end;
      end;
      DeclareFormFromPlayers(0);
    end;

    Just some spoilers from RCrB v2.00
    RCrB?

    ~shut

  4. #29
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Omg, Ice-fire you always take any oppertunity to advertise it . Also how far are you done with it?
    What haha I'm not gonna discuss that here I'm not trying to advertise it I'm trying to show you people the advantages of reducing the code and showing an example

    SCAR Code:
    for I := 0 to 4 do
      begin
        CheckBoxes[i] := TCheckBox.Create(Form);
        with CheckBoxes[i] do
        begin
          Parent := Form;
          Hint := 'Check if ' + FormInfo[(10 + (3 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(11 + (3 * I))]), StrToInt(FormInfo[(12 + (3 * I))]), 17, 17);
        end;
      end;

    Now tell me I didn't just open up a whole new world of possibilities for you? That would of normally taken forever to compile and probably like 150 lines, not to mention typing all that repetitive form code junk... cool thing is you can do this sort of thing with coding for anything not just forms... like color functions, splines, DDTMs ect. ect..

    SCAR Code:
    var
      FormInfo: TStringArray;
      I, II: Byte;
    begin
      LoadPlayersFromFile;
      FormInfo := ['go to the previous player', '<<', 'create a new player', 'Create Player', 'delete a player', 'Delete Player', 'go to the next player', '>>', 'start Rune Crafter ReBorn', 'Start RCrB', 'player is going to be used', '68', '214', 'you are using a small pouch', '336', '205', 'you are using a medium pouch', '412', '205', 'you are using a large pouch', '336', '225', 'you are using a gaint pouch', '412', '225', 'rune to craft at a location', 'skill to chose in the genie random event', '[Air] (FEB)', '[Mind] (FWB)', '[Water] (DB)', '[Earth] (VEB)', '[Fire] (AKB)', '[Body] (EB)', 'Agility', 'Attack', 'Construction', 'Cooking', 'Crafting', 'Defence',
           'Farming', 'Firemaking', 'Fishing', 'Fletching', 'Herblore', 'Hitpoints', 'Hunting', 'Magic', 'Mining', 'Prayer', 'Ranged', 'Runecrafting', 'Slayer', 'Smithing', 'Strength', 'Thieving', 'Woodcutting', 'Current player # being viewed', '14', '51', 'Player # 0.', 'Check if player is going to be used', '84', '216', 'Player Active.', 'Type in your username here', '13', '90', 'Username:', 'Type in your password here', '216', '90', 'Password:', 'Type in the 2nd, 3rd, and 4th letters of your username here', '15', '120', 'Nickname:', 'Type in your bank pin here', '223', '120', 'Bank Pin:', 'Type in the amount of loads to do per a round here',
           '38', '150', 'Loads:', 'Type in the amount of essence to craft', '217', '150', 'Essences:', 'Select a rune to craft at a location', '19', '180', 'Runecraft:', 'Select a skill to chose in the genie random event', '216', '180', 'Lamp Skill:', 'Check if you are using a small pouch', '352', '207', 'S Pouch.', 'Check if you are using a medium pouch', '428', '207', 'M Pouch.', 'Check if you are using a large pouch', '353', '227', 'L Pouch.', 'Check if you are using a gaint pouch', '428', '227', 'G Pouch.', '83', '88', '283', '88', '83', '118', '283', '118', '83', '148', '283', '148'];
      Form := CreateForm;
      with Form do
      begin
        Caption := 'Rune Crafter ReBorn v' + VersionNumber + ' by IceFire908. Powered by SRL.';
        SetBounds(162, 102, 497, 268);
        BorderStyle := BSToolWindow;
        OnPaint := @LoadBackground;
        OnCloseQuery := @FormClosed;
        ShowHint := True;
      end;
      for I := 0 to 4 do
      begin
        Buttons[I] := TButton.Create(Form);
        with Buttons[I] do
        begin
          Parent := Form;
          Hint := 'Click to ' + FormInfo[(2 * I)] + '.';
          SetBounds((69 + (88 * I)), 61, 85, 19);
          if (I = 4) then
            SetBounds(176, 208, 136, 29);
          Caption := FormInfo[(1 + (2 * I))];
          OnClick := @ButtonClick;
        end;
      end;
      for I := 0 to 4 do
      begin
        CheckBoxes[I] := TCheckBox.Create(Form);
        with CheckBoxes[I] do
        begin
          Parent := Form;
          Hint := 'Check if ' + FormInfo[(10 + (3 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(11 + (3 * I))]), StrToInt(FormInfo[(12 + (3 * I))]), 17, 17);
        end;
      end;
      for I := 0 to 1 do
      begin
        ComboBoxes[I] := TComboBox.Create(Form);
        with ComboBoxes[I] do
        begin
          Parent := Form;
          Hint := 'Select a ' + FormInfo[25 + I] + '.';
          SetBounds((83 + (200 * I)), 178, 121, 21);
          OnKeyPress := @OnKeyPress;
          for II := 0 to (5 + (17 * I)) do
            Items.Add(FormInfo[(27 + (6 * I) + II)]);
        end;
      end;
      for I := 0 to 13 do
      begin
        Labels[I] := TLabel.Create(Form);
        with Labels[I] do
        begin
          Parent := Form;
          Font.Color := CLWhite;
          Hint := FormInfo[(56 + (4 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(57 + (4 * I))]), StrToInt(FormInfo[(58 + (4 * I))]), 16, 66);
          Font.Height := -13;
          case I of
            0, 1, 10, 11, 12, 13: Font.Height := -11;
          end;
          Caption := FormInfo[(59 + (4 * I))];
        end;
      end;
      for I := 0 to 5 do
      begin
        Edits[I] := TEdit.Create(Form);
        with Edits[I] do
        begin
          Parent := Form;
          Hint := FormInfo[(64 + (4 * I))] + '.';
          SetBounds(StrToInt(FormInfo[(112 + (2 * I))]), StrToInt(FormInfo[(113 + (2 * I))]), 121, 21);
          case I of
            1, 3: PasswordChar := '*';
          end;
        end;
      end;
      DeclareFormFromPlayers(0);
    end;

  5. #30
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    RcrB = Rune Crafter ReBorn

  6. #31
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Awesome Tut!

    Btw, is your ultimate PCER actually coming back?!

  7. #32
    Join Date
    Mar 2008
    Location
    The Netherlands
    Posts
    1,395
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Wow.


  8. #33
    Join Date
    Jan 2009
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great Tut, But When I add the BackGround, it makes the labels blank, i think it might be because the images are .png instead of .bmp

  9. #34
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by superbatman View Post
    Great Tut, But When I add the BackGround, it makes the labels blank, i think it might be because the images are .png instead of .bmp
    You have to call your TImage, before all other form components like labels. Else you will create a TImage overlaying the labels

    SCAR Code:
    FrmDesign := TForm;
    Image1 := TImage.Create(FrmDesign);
    // all other stuff

    GL

  10. #35
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very nice tutorial I learnt a lot. Goodjob

  11. #36
    Join Date
    Dec 2007
    Location
    Los Angeles, California
    Posts
    606
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is AWESOME. I'm at TEdit right now and so far this tutorial is sweet. I've always wondered how people make their forms look so awesome (Like you) and it's way easier than I thought so far.

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

    Default

    when are you going to finish? so far its been helping me a LOT, and its kind of disapointing that its not finished =D so far, i made my form and every thing, but im not for sure on how to make the usename and such actually do something (like saving what you type into the box thing, and using it in the script itself)

    iv been looking in other tuts, and so far i cant find any scripts to use as an example

    thanks =D
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  13. #38
    Join Date
    Dec 2007
    Location
    Los Angeles, California
    Posts
    606
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Arrays can be used for TEdit and the other things too right?

    EDIT:

    Line 92: [Error] (92:11): Unknown identifier 'PASSWORDCHAR' in script

    Line 92 is: ComboBox1.PasswordChar := '*';
    Are you sure you can use PasswordChar in that? The char limit works fine, and I've checked over this thing to make sure it's right, but I can't figure out anything wrong.
    Last edited by XRaye; 03-27-2009 at 05:20 AM.

  14. #39
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    FEditB[1].PasswordChar := '*';

    That comes right out of one of my scripts. It should work. At what scar version are you?

  15. #40
    Join Date
    Dec 2007
    Location
    Los Angeles, California
    Posts
    606
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR 3.15b, but it doesn't matter that much, I wouldn't want to use it.

    And I'm getting the error "Identifier Expected" on the line of the SafeInitForm procedure. How to fix?

    EDIT: I was missing a end;...
    Last edited by XRaye; 03-29-2009 at 06:54 PM.

  16. #41
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Finish!!!!!!!!!!!
    I do visit every 2-6 months

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

    Default

    Agreed!!!

  18. #43
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    um about tform, how can we make the window un-resizable, un-minimizable, un-maxamazible if that makes any sense.

  19. #44
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You can remove the "outline" of the form with this code:
    SCAR Code:
    frmDesign.BorderStyle := bsNone;
    That will remove the minisize, hide, and close button. Don't forget to make a new close button yourself though

  20. #45
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    roflcopter, when i made my form, i was wondering why it wudnt close ever sine i popped in the code. ^^

    k ill look into ur guide more ^^ hope u finished this. because my mining script wont be realeased until i get this awesome form finished.

  21. #46
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Deathscytex View Post
    roflcopter, when i made my form, i was wondering why it wudnt close ever sine i popped in the code. ^^

    k ill look into ur guide more ^^ hope u finished this. because my mining script wont be realeased until i get this awesome form finished.
    3 more weeks of school for me, after that I'll finnish it. I've had some real positive comments on this tutorial already, so it would be a waste if I didn't finnish it.


  22. #47
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    and i finished school (well the school gave us an early holiday, but we have to use the first 2 weeks to study for the exams on July which is a QQ).

    anyways i finished reading your guide, decided to dive onto developing my form. than i decided, hey why not make it neater like MK did.

    And now i made my form, neat and still "working" (you know, still doesnt have buttons and stuff ready..) but hey! atleast it pops up with nice text boxes, a kick ass background and a kick ass banner ^^ ill upload it to you so you can see what you've taught me.

    rest assured though, you taught me well. and these 4 boobless hours of my life was no waste when reading your guide ^^ it was worth it.

    EDIT

    This time i didnt forget to add the close function thingy! ^^

    So please comment on my Form, would really love to know what you think of my 0wesomness 1337ness

  23. #48
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Deathscytex View Post
    and i finished school (well the school gave us an early holiday, but we have to use the first 2 weeks to study for the exams on July which is a QQ).

    anyways i finished reading your guide, decided to dive onto developing my form. than i decided, hey why not make it neater like MK did.

    And now i made my form, neat and still "working" (you know, still doesnt have buttons and stuff ready..) but hey! atleast it pops up with nice text boxes, a kick ass background and a kick ass banner ^^ ill upload it to you so you can see what you've taught me.

    rest assured though, you taught me well. and these 4 boobless hours of my life was no waste when reading your guide ^^ it was worth it.

    EDIT

    This time i didnt forget to add the close function thingy! ^^

    So please comment on my Form, would really love to know what you think of my 0wesomness 1337ness
    Wow that really looks nice! Good job!

  24. #49
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Deathsyntax, you can make your form move. PM me if you want to know how

  25. #50
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    so for load fp, will it basically do this

    SCAR Code:
    procedure loadfp(c: integer; saveCurrentInfo: boolean);
    begin
      inc(howManyPlayers);
      players[c].name := edits[0].text;
      //etc...
    end;

    i dont really understand what loadfp means. shouldnt it be called savefp because you putting the .text on the player info. not really loading it at all :/

    EDIT:

    so i did this

    SCAR Code:
    try
      howmanyplayers := howmanyplayers+1;
      numberofplayers(howmanyplayers);
      players[c].name := edits[0].text;
      //etc..
    except
      showmessage('roflcopter away!!!!!');
      exit;
    end;
    c:=howmanyplayers;

    so now how do i make it reveal to the player list?

Page 2 of 6 FirstFirst 1234 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Complete Form Tutorial
    By BobboHobbo in forum OSR Advanced Scripting Tutorials
    Replies: 10
    Last Post: 05-29-2012, 01:36 PM
  2. The Form Tutorial
    By Dan Cardin in forum OSR Advanced Scripting Tutorials
    Replies: 28
    Last Post: 03-03-2011, 04:42 AM
  3. Newbie Form Tutorial
    By Da 0wner in forum OSR Advanced Scripting Tutorials
    Replies: 45
    Last Post: 12-15-2009, 05:48 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
  •