Results 1 to 21 of 21

Thread: Working on a form.

  1. #1
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default Working on a form.

    Trying to get back into Srl through re-writing scripts I used and loved back then...

    I am though having trouble with forms receiving error's such as Error in InitForm! and Error: Out Of Range at line 1548 and was wondering if someone could help me get back into the groove.

    I plan on Applying for srl very soon .


    Here is how I do the form...Error lines will be commented...

    Simba Code:
    Procedure SafeInitForm; //How I start the form
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end; //Out of range here

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;


    The actual form itself; it says there's a error in it, I can't figure out what it is...:

    Simba Code:
    Procedure InitForm;
    Begin
    LoadUs2;
    frmDesign := CreateForm;
    frmDesign.Position := poDesktopCenter;
    frmDesign.Width := 313;
    frmDesign.Height := 285;
    frmDesign.Caption := 'Caption';
    frmDesign.Color := clInactiveCaption;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    frmDesign.OnCloseQuery := @FormClose2;

    TitleLabel := TLabel.Create(frmDesign);
    TitleLabel.Parent := frmDesign;
    TitleLabel.Left := 28;
    TitleLabel.Top := 10;
    TitleLabel.Width := 277;
    TitleLabel.Height := 20;
    TitleLabel.Caption := 'Caption';
    TitleLabel.Font.Color := clWindowText;
    TitleLabel.Font.Height := -17;
    TitleLabel.Font.Name := 'MS Sans Serif';
    TitleLabel.Font.Style := [fsBold, fsUnderline];
    TitleLabel.ParentFont := False;

    CreatePlayerButton := TButton.Create(frmDesign);
    CreatePlayerButton.Parent := frmDesign;
    CreatePlayerButton.Left := 60;
    CreatePlayerButton.Top := 35;
    CreatePlayerButton.Width := 83;
    CreatePlayerButton.Height := 29;
    CreatePlayerButton.Hint := 'Click to Create a New Player';
    CreatePlayerButton.Caption := 'Create Player';
    CreatePlayerButton.ParentShowHint := False;
    CreatePlayerButton.ShowHint := True;
    CreatePlayerButton.TabOrder := 13;
    CreatePlayerButton.OnClick := @CreateNewUser;

    DeletePlayerButton := TButton.Create(frmDesign);
    DeletePlayerButton.Parent := frmDesign;
    DeletePlayerButton.Left := 150;
    DeletePlayerButton.Top := 35;
    DeletePlayerButton.Width := 83;
    DeletePlayerButton.Height := 29;
    DeletePlayerButton.Hint := 'Click to Delete the Current Player';
    DeletePlayerButton.Caption := 'Delete Player';
    DeletePlayerButton.ParentShowHint := False;
    DeletePlayerButton.ShowHint := True;
    DeletePlayerButton.TabOrder := 13;
    DeletePlayerButton.OnClick := @DeleteAPlayer;

    LeftButton := TButton.Create(frmDesign);
    LeftButton.Parent := frmDesign;
    LeftButton.Left := 15;
    LeftButton.Top := 35;
    LeftButton.Width := 38;
    LeftButton.Height := 29;
    LeftButton.Hint := 'Click to go to the Previous Player';
    LeftButton.Caption := '<---';
    LeftButton.ParentShowHint := False;
    LeftButton.ShowHint := True;
    LeftButton.TabOrder := 13;
    LeftButton.OnClick := @PressBackButton;

    RightButton := TButton.Create(frmDesign);
    RightButton.Parent := frmDesign;
    RightButton.Left := 239;
    RightButton.Top := 35;
    RightButton.Width := 38;
    RightButton.Height := 29;
    RightButton.Hint := 'Click to go to the Next Player';
    RightButton.Caption := '--->';
    RightButton.ParentShowHint := False;
    RightButton.ShowHint := True;
    RightButton.TabOrder := 14;
    RightButton.OnClick := @PressNextButton;

    UsernameLabel := TLabel.Create(frmDesign);
    UsernameLabel.Parent := frmDesign;
    UsernameLabel.Left := 16;
    UsernameLabel.Top := 73;
    UsernameLabel.Width := 63;
    UsernameLabel.Height := 16;
    UsernameLabel.Font.Color := clWindowText;
    UsernameLabel.Font.Height := -15;
    UsernameLabel.Font.Name := 'MS Sans Serif';
    UsernameLabel.Font.Style := [];
    UsernameLabel.ParentFont := False;
    UsernameLabel.Caption := '0. Username';

    PasswordLabel := TLabel.Create(frmDesign);
    PasswordLabel.Parent := frmDesign;
    PasswordLabel.Left := 16;
    PasswordLabel.Top := 96;
    PasswordLabel.Width := 60;
    PasswordLabel.Height := 16;
    PasswordLabel.Font.Color := clWindowText;
    PasswordLabel.Font.Height := -15;
    PasswordLabel.Font.Name := 'MS Sans Serif';
    PasswordLabel.Font.Style := [];
    PasswordLabel.ParentFont := False;
    PasswordLabel.Caption := '0. Password';

    LampSkillLabel := TLabel.Create(frmDesign);
    LampSkillLabel.Parent := frmDesign;
    LampSkillLabel.Left := 16;
    LampSkillLabel.Top := 120;
    LampSkillLabel.Width := 62;
    LampSkillLabel.Height := 16;
    LampSkillLabel.Font.Color := clWindowText;
    LampSkillLabel.Font.Height := -15;
    LampSkillLabel.Font.Name := 'MS Sans Serif';
    LampSkillLabel.Font.Style := [];
    LampSkillLabel.ParentFont := False;
    LampSkillLabel.Caption := '0. Lamp Skill';

    TripsLabel := TLabel.Create(frmDesign);
    TripsLabel.Parent := frmDesign;
    TripsLabel.Left := 16;
    TripsLabel.Top := 144;
    TripsLabel.Width := 62;
    TripsLabel.Height := 16;
    TripsLabel.Font.Color := clWindowText;
    TripsLabel.Font.Height := -15;
    TripsLabel.Font.Name := 'MS Sans Serif';
    TripsLabel.Font.Style := [];
    TripsLabel.ParentFont := False;
    TripsLabel.Caption := '0. Loads';

    UsernameEdit := TEdit.Create(frmDesign);
    UsernameEdit.Parent := frmDesign;
    UsernameEdit.Left := 100;
    UsernameEdit.Top := 71;
    UsernameEdit.Width := 121;
    UsernameEdit.Height := 21;
    UsernameEdit.Hint := 'Type in your Username here';
    UsernameEdit.ParentShowHint := False;
    UsernameEdit.ShowHint := True;
    UsernameEdit.TabOrder := 8;
    UsernameEdit.Text := Players[0].Name;

    PasswordEdit := TEdit.Create(frmDesign);
    PasswordEdit.Parent := frmDesign;
    PasswordEdit.Left := 100;
    PasswordEdit.Top := 94;
    PasswordEdit.Width := 121;
    PasswordEdit.Height := 21;
    PasswordEdit.Hint := 'Type in your Password here';
    PasswordEdit.ParentShowHint := False;
    PasswordEdit.PasswordChar := '*';
    PasswordEdit.ShowHint := True;
    PasswordEdit.TabOrder := 9;
    PasswordEdit.Text := Players[0].Pass;

    LampSkillComboBox := TComboBox.Create(frmDesign);
    LampSkillComboBox.Parent := frmDesign;
    LampSkillComboBox.Left := 100;
    LampSkillComboBox.Top := 117;
    LampSkillComboBox.Width := 121;
    LampSkillComboBox.Height := 21;
    LampSkillComboBox.Hint := 'Type in the Skill you want to use a Lamp on if Found';
    LampSkillComboBox.ItemHeight := 13;
    LampSkillComboBox.ParentShowHint := False;
    LampSkillComboBox.ShowHint := True;
    LampSkillComboBox.TabOrder := 10;
    LampSkillComboBox.Text := Players[0].Skill;
    LampSkillComboBox.Items.Add('Strength');
    LampSkillComboBox.Items.Add('Attack');
    LampSkillComboBox.Items.Add('Ranged');
    LampSkillComboBox.Items.Add('Magic');
    LampSkillComboBox.Items.Add('Defence');
    LampSkillComboBox.Items.Add('Hitpoints');
    LampSkillComboBox.Items.Add('Prayer');
    LampSkillComboBox.Items.Add('Agility');
    LampSkillComboBox.Items.Add('Herblore');
    LampSkillComboBox.Items.Add('Thieving');
    LampSkillComboBox.Items.Add('Crafting');
    LampSkillComboBox.Items.Add('Runecrafting');
    LampSkillComboBox.Items.Add('Slayer');
    LampSkillComboBox.Items.Add('Farming');
    LampSkillComboBox.Items.Add('Mining');
    LampSkillComboBox.Items.Add('Smithing');
    LampSkillComboBox.Items.Add('Fishing');
    LampSkillComboBox.Items.Add('Cooking');
    LampSkillComboBox.Items.Add('Firemaking');
    LampSkillComboBox.Items.Add('Woodcutting');
    LampSkillComboBox.Items.Add('Fletching');
    LampSkillComboBox.Items.Add('Construction');
    LampSkillComboBox.Items.Add('Hunting');

    LoadsEdit := TEdit.Create(frmDesign);
    LoadsEdit.Parent := frmDesign;
    LoadsEdit.Left := 100;
    LoadsEdit.Top := 140;
    LoadsEdit.Width := 121;
    LoadsEdit.Height := 21;
    LoadsEdit.Hint := 'Loads/player.';
    LoadsEdit.ParentShowHint := False;
    LoadsEdit.ShowHint := True;
    LoadsEdit.TabOrder := 10;
    LoadsEdit.Text := IntToStr(Players[0].{Integer2}Integers[1]);

    IsActive := TCheckBox.Create(frmDesign);
    IsActive.Parent := frmDesign;
    IsActive.Left := 225;
    IsActive.Top := 71;
    IsActive.Width := 53;
    IsActive.Height := 20;
    IsActive.Caption := 'Active?';
    IsActive.ParentShowHint := False;
    IsActive.ShowHint := True;
    IsActive.Hint := 'Should this Player be Active?';
    IsActive.Checked := Players[0].Active;

    ColorCheckBox := TCheckBox.Create(frmDesign);
    ColorCheckBox.Parent := frmDesign;
    ColorCheckBox.Left := 225;
    ColorCheckBox.Top := 94;
    ColorCheckBox.Width := 53;
    ColorCheckBox.Height := 20;
    ColorCheckBox.Caption := 'Colors?';
    ColorCheckBox.ParentShowHint := False;
    ColorCheckBox.ShowHint := True;
    ColorCheckBox.Hint := 'Do you want to pick Your Own Colors?';
    ColorCheckBox.Checked := Players[0].{Boolean1}Booleans[0];
    ColorCheckBox.OnClick := @ChangeLabels;

    String1ComboBox := TComboBox.Create(frmDesign);
    String1ComboBox.Parent := frmDesign;
    String1ComboBox.Left := 10;
    String1ComboBox.Top := 165;
    String1ComboBox.Width := 80;
    String1ComboBox.Height := 21;
    String1ComboBox.Hint := 'Select the Skill to Power Auto';
    String1ComboBox.ItemHeight := 13;
    String1ComboBox.ParentShowHint := False;
    String1ComboBox.ShowHint := True;
    String1ComboBox.TabOrder := 11;
    String1ComboBox.Text := Players[0].{String1}Strings[0];
    String1ComboBox.Items.Add('Woodcutting');
    String1ComboBox.Items.Add('Mining');
    String1ComboBox.Items.Add('Fishing');
    String1ComboBox.Items.Add('Bone Burying');
    String1ComboBox.Items.Add('Fletching');
    String1ComboBox.OnChange := @String1Change;

    String2ComboBox := TComboBox.Create(frmDesign);
    String2ComboBox.Parent := frmDesign;
    String2ComboBox.Left := 95;
    String2ComboBox.Top := 165;
    String2ComboBox.Width := 120;
    String2ComboBox.Height := 21;
    String2ComboBox.Hint := 'Select the Specific thing to Power Auto';
    String2ComboBox.ItemHeight := 13;
    String2ComboBox.ParentShowHint := False;
    String2ComboBox.ShowHint := True;
    String2ComboBox.TabOrder := 12;
    String2ComboBox.Text := Players[0].{String2}Strings[1];
    String2ComboBox.OnDropDown := @String1Change;

    String3ComboBox := TComboBox.Create(frmDesign);
    String3ComboBox.Parent := frmDesign;
    String3ComboBox.Left := 220;
    String3ComboBox.Top := 165;
    String3ComboBox.Width := 70;
    String3ComboBox.Height := 21;
    String3ComboBox.Hint := 'Select the Direction to Run in if we are Attacked';
    String3ComboBox.ItemHeight := 13;
    String3ComboBox.ParentShowHint := False;
    String3ComboBox.ShowHint := True;
    String3ComboBox.TabOrder := 12;
    String3ComboBox.Items.Add('N');
    String3ComboBox.Items.Add('E');
    String3ComboBox.Items.Add('S');
    String3ComboBox.Items.Add('W');
    String3ComboBox.Text := Players[0].{String3}Strings[2];

    GemsCheckBox := TCheckBox.Create(frmDesign);
    GemsCheckBox.Parent := frmDesign;
    GemsCheckBox.Left := 225;
    GemsCheckBox.Top := 117;
    GemsCheckBox.Width := 78;
    GemsCheckBox.Height := 20;
    GemsCheckBox.Caption := 'Save Gems?';
    GemsCheckBox.ParentShowHint := False;
    GemsCheckBox.ShowHint := True;
    GemsCheckBox.Hint := 'Do you want to save the Gems you Mine?';
    GemsCheckBox.Checked := Players[0].{Boolean3}Booleans[2];
    If (String1ComboBox.Text = 'Mining') then
      GemsCheckBox.Visible := True
    else
      GemsCheckBox.Visible := False;

    FletchComboBox := TComboBox.Create(frmDesign);
    FletchComboBox.Parent := frmDesign;
    FletchComboBox.Left := 182;
    FletchComboBox.Top := 193;
    FletchComboBox.Width := 100;
    FletchComboBox.Height := 21;
    FletchComboBox.Hint := 'Select What Type of Log the Item is';
    FletchComboBox.ItemHeight := 13;
    FletchComboBox.ParentShowHint := False;
    FletchComboBox.ShowHint := True;
    FletchComboBox.TabOrder := 12;
    FletchComboBox.Items.Add('Normal');
    FletchComboBox.Items.Add('Oak');
    FletchComboBox.Items.Add('Willow');
    FletchComboBox.Items.Add('Maple');
    FletchComboBox.Items.Add('Yew');
    FletchComboBox.Items.Add('Magic');
    FletchComboBox.Text := FletchString[0];
    If (String1ComboBox.Text = 'Fletching') then
      FletchComboBox.Visible := True
    else
      FletchComboBox.Visible := False;

    ColorsLabel := TLabel.Create(frmDesign);
    ColorsLabel.Parent := frmDesign;
    ColorsLabel.Left := 10;
    ColorsLabel.Top := 194;
    ColorsLabel.Width := 80;
    ColorsLabel.Height := 12;
    ColorsLabel.Font.Color := clWindowText;
    ColorsLabel.Font.Height := -12;
    ColorsLabel.Font.Name := 'MS Sans Serif';
    ColorsLabel.Font.Style := [];
    ColorsLabel.ParentFont := False;
    ColorsLabel.Caption := 'Picked Color:';
    If (ColorCheckBox.Checked) then
      ColorsLabel.Visible := True
    else
      ColorsLabel.Visible := False;

    ColorsEdit := TEdit.Create(frmDesign);
    ColorsEdit.Parent := frmDesign;
    ColorsEdit.Left := 77;
    ColorsEdit.Top := 191;
    ColorsEdit.Width := 80;
    ColorsEdit.Height := 21;
    ColorsEdit.Hint := 'Put in the Color of the Item you are Autoing.  Leave as 0 for AutoPick';
    ColorsEdit.ParentShowHint := False;
    ColorsEdit.ShowHint := True;
    ColorsEdit.TabOrder := 8;
    ColorsEdit.Text := IntToStr(Players[0].{Integer1}Integers[0]);
    If (ColorCheckBox.Checked) then
      ColorsEdit.Visible := True
    else
      ColorsEdit.Visible := False;

    MiningSecsLabel := TLabel.Create(frmDesign);
    MiningSecsLabel.Parent := frmDesign;
    MiningSecsLabel.Left := 162;
    MiningSecsLabel.Top := 194;
    MiningSecsLabel.Width := 80;
    MiningSecsLabel.Height := 12;
    MiningSecsLabel.Font.Color := clWindowText;
    MiningSecsLabel.Font.Height := -12;
    MiningSecsLabel.Font.Name := 'MS Sans Serif';
    MiningSecsLabel.Font.Style := [];
    MiningSecsLabel.ParentFont := False;
    MiningSecsLabel.Caption := 'Seconds:';
    If (String1ComboBox.Text = 'Mining') then
      MiningSecsLabel.Visible := True
    else
      MiningSecsLabel.Visible := False;

    MiningSecsEdit := TEdit.Create(frmDesign);
    MiningSecsEdit.Parent := frmDesign;
    MiningSecsEdit.Left := 210;
    MiningSecsEdit.Top := 191;
    MiningSecsEdit.Width := 80;
    MiningSecsEdit.Height := 21;
    MiningSecsEdit.Hint := 'Number of Seconds you are willing to Wait for a rock to Mine before Clicking Again';
    MiningSecsEdit.ParentShowHint := False;
    MiningSecsEdit.ShowHint := True;
    MiningSecsEdit.TabOrder := 8;
    MiningSecsEdit.Text := IntToStr(Players[0].{Integer3}Integers[2]);
    If (String1ComboBox.Text = 'Mining') then
      MiningSecsEdit.Visible := True
    else
      MiningSecsEdit.Visible := False;

    BankCheckBox := TCheckBox.Create(frmDesign);
    BankCheckBox.Parent := frmDesign;
    BankCheckBox.Left := 164;
    BankCheckBox.Top := 192;
    BankCheckBox.Width := 125;
    BankCheckBox.Height := 20;
    BankCheckBox.Caption := 'Withdraw From Bank?';
    BankCheckBox.ParentShowHint := False;
    BankCheckBox.ShowHint := True;
    BankCheckBox.Hint := 'Click to Withdraw Bones from Bank and Bury. Otherwise it will pick up from Floor';
    BankCheckBox.Checked := Players[0].{Boolean2}Booleans[1];
    If (String1ComboBox.Text = 'Bone Burying') then
      BankCheckBox.Visible := True
    else
      BankCheckBox.Visible := False;

    StartButton := TButton.Create(frmDesign);
    StartButton.Parent := frmDesign;
    StartButton.Left := 60;
    StartButton.Top := 220;
    StartButton.Width := 75;
    StartButton.Height := 25;
    StartButton.Hint := 'Click to Start the Script';
    StartButton.Caption := 'Start Script';
    StartButton.ParentShowHint := False;
    StartButton.ShowHint := True;
    StartButton.TabOrder := 15;
    StartButton.OnClick := @StartClicked;

    DonateButton := TButton.Create(frmDesign);
    DonateButton.Parent := frmDesign;
    DonateButton.Left := 150;
    DonateButton.Top := 220;
    DonateButton.Width := 75;
    DonateButton.Height := 25;
    DonateButton.Hint := 'Donations are always Appreciated!';
    DonateButton.Caption := 'Donate!';
    DonateButton.ParentShowHint := False;
    DonateButton.ShowHint := True;
    DonateButton.TabOrder := 15;
    DonateButton.OnClick := @DonateClicked;
    end;

    In my Main loop:

    Simba Code:
    try
        SafeInitForm;
        SafeShowFormModal;
      except
        Writeln('Error in InitForm!');
      finally
        FreeForm(frmDesign);
      end;
    Last edited by Wyn; 11-05-2011 at 04:32 AM.

  2. #2
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Try calling them without 'Safe' I had to do this to see where the real error was in the InitForm.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  3. #3
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Try calling them without 'Safe' I had to do this to see where the real error was in the InitForm.
    I'm not sure what you mean. Threadcall in unknown.

    Removing Safe from the procedure name wouldn't fix it..

    I forgot to add what I did in my loop for the Gui...

    Simba Code:
    try
        SafeInitForm;
        SafeShowFormModal;
      except
        Writeln('Error in InitForm!');
      finally
        FreeForm(frmDesign);
      end;

  4. #4
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Instead of calling
    SafeInitForm;
    Just call
    InitForm;
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  5. #5
    Join Date
    Mar 2011
    Location
    Oklahoma
    Posts
    98
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Removing all of the button setup and action set up; this initform works implying that the error is a button/action setup.

    Simba Code:
    Procedure InitForm;
    Begin
      //This is where you build your form
        frmDesign := CreateForm;          // This will create your form. MUST be called first.
        frmDesign.Left := 100;            // How many pixels from the left must the form be vissible?
        frmDesign.Top := 100;             // How many pixels from the top must the form be vissible?
        frmDesign.Width := 500;           // The width of you form in pixels
        frmDesign.Height := 500;          // The height of you form in pixels
        frmDesign.Caption := 'Test!';     // The name of your form? This will be shown in the upper left balk
        frmDesign.Color := ClWhite;       // The background color of your form ("ClWhite", "ClBlack" ect, or just an color like: 123456)



    (*LoadUs2;

    frmDesign := CreateForm;
    frmDesign.Position := poDesktopCenter;
    frmDesign.Width := 313;
    frmDesign.Height := 285;
    frmDesign.Caption := 'TITLE';
    frmDesign.Color := clInactiveCaption;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    frmDesign.OnCloseQuery := @FormClose2;

    TitleLabel := TLabel.Create(frmDesign);
    TitleLabel.Parent := frmDesign;
    TitleLabel.Left := 28;
    TitleLabel.Top := 10;
    TitleLabel.Width := 277;
    TitleLabel.Height := 20;
    TitleLabel.Caption := 'Title';
    TitleLabel.Font.Color := clWindowText;
    TitleLabel.Font.Height := -17;
    TitleLabel.Font.Name := 'MS Sans Serif';
    TitleLabel.Font.Style := [fsBold, fsUnderline];
    TitleLabel.ParentFont := False;

    CreatePlayerButton := TButton.Create(frmDesign);
    CreatePlayerButton.Parent := frmDesign;
    CreatePlayerButton.Left := 60;
    CreatePlayerButton.Top := 35;
    CreatePlayerButton.Width := 83;
    CreatePlayerButton.Height := 29;
    CreatePlayerButton.Hint := 'Click to Create a New Player';
    CreatePlayerButton.Caption := 'Create Player';
    CreatePlayerButton.ParentShowHint := False;
    CreatePlayerButton.ShowHint := True;
    CreatePlayerButton.TabOrder := 13;
    CreatePlayerButton.OnClick := @CreateNewUser;

    DeletePlayerButton := TButton.Create(frmDesign);
    DeletePlayerButton.Parent := frmDesign;
    DeletePlayerButton.Left := 150;
    DeletePlayerButton.Top := 35;
    DeletePlayerButton.Width := 83;
    DeletePlayerButton.Height := 29;
    DeletePlayerButton.Hint := 'Click to Delete the Current Player';
    DeletePlayerButton.Caption := 'Delete Player';
    DeletePlayerButton.ParentShowHint := False;
    DeletePlayerButton.ShowHint := True;
    DeletePlayerButton.TabOrder := 13;
    DeletePlayerButton.OnClick := @DeleteAPlayer;

    LeftButton := TButton.Create(frmDesign);
    LeftButton.Parent := frmDesign;
    LeftButton.Left := 15;
    LeftButton.Top := 35;
    LeftButton.Width := 38;
    LeftButton.Height := 29;
    LeftButton.Hint := 'Click to go to the Previous Player';
    LeftButton.Caption := '<---';
    LeftButton.ParentShowHint := False;
    LeftButton.ShowHint := True;
    LeftButton.TabOrder := 13;
    LeftButton.OnClick := @PressBackButton;

    RightButton := TButton.Create(frmDesign);
    RightButton.Parent := frmDesign;
    RightButton.Left := 239;
    RightButton.Top := 35;
    RightButton.Width := 38;
    RightButton.Height := 29;
    RightButton.Hint := 'Click to go to the Next Player';
    RightButton.Caption := '--->';
    RightButton.ParentShowHint := False;
    RightButton.ShowHint := True;
    RightButton.TabOrder := 14;
    RightButton.OnClick := @PressNextButton;

    UsernameLabel := TLabel.Create(frmDesign);
    UsernameLabel.Parent := frmDesign;
    UsernameLabel.Left := 16;
    UsernameLabel.Top := 73;
    UsernameLabel.Width := 63;
    UsernameLabel.Height := 16;
    UsernameLabel.Font.Color := clWindowText;
    UsernameLabel.Font.Height := -15;
    UsernameLabel.Font.Name := 'MS Sans Serif';
    UsernameLabel.Font.Style := [];
    UsernameLabel.ParentFont := False;
    UsernameLabel.Caption := '0. Username';

    PasswordLabel := TLabel.Create(frmDesign);
    PasswordLabel.Parent := frmDesign;
    PasswordLabel.Left := 16;
    PasswordLabel.Top := 96;
    PasswordLabel.Width := 60;
    PasswordLabel.Height := 16;
    PasswordLabel.Font.Color := clWindowText;
    PasswordLabel.Font.Height := -15;
    PasswordLabel.Font.Name := 'MS Sans Serif';
    PasswordLabel.Font.Style := [];
    PasswordLabel.ParentFont := False;
    PasswordLabel.Caption := '0. Password';

    LampSkillLabel := TLabel.Create(frmDesign);
    LampSkillLabel.Parent := frmDesign;
    LampSkillLabel.Left := 16;
    LampSkillLabel.Top := 120;
    LampSkillLabel.Width := 62;
    LampSkillLabel.Height := 16;
    LampSkillLabel.Font.Color := clWindowText;
    LampSkillLabel.Font.Height := -15;
    LampSkillLabel.Font.Name := 'MS Sans Serif';
    LampSkillLabel.Font.Style := [];
    LampSkillLabel.ParentFont := False;
    LampSkillLabel.Caption := '0. Lamp Skill';

    TripsLabel := TLabel.Create(frmDesign);
    TripsLabel.Parent := frmDesign;
    TripsLabel.Left := 16;
    TripsLabel.Top := 144;
    TripsLabel.Width := 62;
    TripsLabel.Height := 16;
    TripsLabel.Font.Color := clWindowText;
    TripsLabel.Font.Height := -15;
    TripsLabel.Font.Name := 'MS Sans Serif';
    TripsLabel.Font.Style := [];
    TripsLabel.ParentFont := False;
    TripsLabel.Caption := '0. Loads';

    UsernameEdit := TEdit.Create(frmDesign);
    UsernameEdit.Parent := frmDesign;
    UsernameEdit.Left := 100;
    UsernameEdit.Top := 71;
    UsernameEdit.Width := 121;
    UsernameEdit.Height := 21;
    UsernameEdit.Hint := 'Type in your Username here';
    UsernameEdit.ParentShowHint := False;
    UsernameEdit.ShowHint := True;
    UsernameEdit.TabOrder := 8;
    UsernameEdit.Text := Players[0].Name;

    PasswordEdit := TEdit.Create(frmDesign);
    PasswordEdit.Parent := frmDesign;
    PasswordEdit.Left := 100;
    PasswordEdit.Top := 94;
    PasswordEdit.Width := 121;
    PasswordEdit.Height := 21;
    PasswordEdit.Hint := 'Type in your Password here';
    PasswordEdit.ParentShowHint := False;
    PasswordEdit.PasswordChar := '*';
    PasswordEdit.ShowHint := True;
    PasswordEdit.TabOrder := 9;
    PasswordEdit.Text := Players[0].Pass;

    LampSkillComboBox := TComboBox.Create(frmDesign);
    LampSkillComboBox.Parent := frmDesign;
    LampSkillComboBox.Left := 100;
    LampSkillComboBox.Top := 117;
    LampSkillComboBox.Width := 121;
    LampSkillComboBox.Height := 21;
    LampSkillComboBox.Hint := 'Type in the Skill you want to use a Lamp on if Found';
    LampSkillComboBox.ItemHeight := 13;
    LampSkillComboBox.ParentShowHint := False;
    LampSkillComboBox.ShowHint := True;
    LampSkillComboBox.TabOrder := 10;
    LampSkillComboBox.Text := Players[0].Skill;
    LampSkillComboBox.Items.Add('Strength');
    LampSkillComboBox.Items.Add('Attack');
    LampSkillComboBox.Items.Add('Ranged');
    LampSkillComboBox.Items.Add('Magic');
    LampSkillComboBox.Items.Add('Defence');
    LampSkillComboBox.Items.Add('Hitpoints');
    LampSkillComboBox.Items.Add('Prayer');
    LampSkillComboBox.Items.Add('Agility');
    LampSkillComboBox.Items.Add('Herblore');
    LampSkillComboBox.Items.Add('Thieving');
    LampSkillComboBox.Items.Add('Crafting');
    LampSkillComboBox.Items.Add('Runecrafting');
    LampSkillComboBox.Items.Add('Slayer');
    LampSkillComboBox.Items.Add('Farming');
    LampSkillComboBox.Items.Add('Mining');
    LampSkillComboBox.Items.Add('Smithing');
    LampSkillComboBox.Items.Add('Fishing');
    LampSkillComboBox.Items.Add('Cooking');
    LampSkillComboBox.Items.Add('Firemaking');
    LampSkillComboBox.Items.Add('Woodcutting');
    LampSkillComboBox.Items.Add('Fletching');
    LampSkillComboBox.Items.Add('Construction');
    LampSkillComboBox.Items.Add('Hunting');

    LoadsEdit := TEdit.Create(frmDesign);
    LoadsEdit.Parent := frmDesign;
    LoadsEdit.Left := 100;
    LoadsEdit.Top := 140;
    LoadsEdit.Width := 121;
    LoadsEdit.Height := 21;
    LoadsEdit.Hint := 'Type in how many Loads before Switching Char.';
    LoadsEdit.ParentShowHint := False;
    LoadsEdit.ShowHint := True;
    LoadsEdit.TabOrder := 10;
    LoadsEdit.Text := IntToStr(Players[0].{Integer2}Integers[1]);

    IsActive := TCheckBox.Create(frmDesign);
    IsActive.Parent := frmDesign;
    IsActive.Left := 225;
    IsActive.Top := 71;
    IsActive.Width := 53;
    IsActive.Height := 20;
    IsActive.Caption := 'Active?';
    IsActive.ParentShowHint := False;
    IsActive.ShowHint := True;
    IsActive.Hint := 'Should this Player be Active?';
    IsActive.Checked := Players[0].Active;

    ColorCheckBox := TCheckBox.Create(frmDesign);
    ColorCheckBox.Parent := frmDesign;
    ColorCheckBox.Left := 225;
    ColorCheckBox.Top := 94;
    ColorCheckBox.Width := 53;
    ColorCheckBox.Height := 20;
    ColorCheckBox.Caption := 'Colors?';
    ColorCheckBox.ParentShowHint := False;
    ColorCheckBox.ShowHint := True;
    ColorCheckBox.Hint := 'Do you want to pick Your Own Colors?';
    ColorCheckBox.Checked := Players[0].{Boolean1}Booleans[0];
    ColorCheckBox.OnClick := @ChangeLabels;

    String1ComboBox := TComboBox.Create(frmDesign);
    String1ComboBox.Parent := frmDesign;
    String1ComboBox.Left := 10;
    String1ComboBox.Top := 165;
    String1ComboBox.Width := 80;
    String1ComboBox.Height := 21;
    String1ComboBox.Hint := 'Select the Skill ';
    String1ComboBox.ItemHeight := 13;
    String1ComboBox.ParentShowHint := False;
    String1ComboBox.ShowHint := True;
    String1ComboBox.TabOrder := 11;
    String1ComboBox.Text := Players[0].{String1}Strings[0];
    String1ComboBox.Items.Add('Woodcutting');
    String1ComboBox.Items.Add('Mining');
    String1ComboBox.Items.Add('Fishing');
    String1ComboBox.Items.Add('Bone Burying');
    String1ComboBox.Items.Add('Fletching');
    String1ComboBox.OnChange := @String1Change;

    String2ComboBox := TComboBox.Create(frmDesign);
    String2ComboBox.Parent := frmDesign;
    String2ComboBox.Left := 95;
    String2ComboBox.Top := 165;
    String2ComboBox.Width := 120;
    String2ComboBox.Height := 21;
    String2ComboBox.Hint := 'Select';
    String2ComboBox.ItemHeight := 13;
    String2ComboBox.ParentShowHint := False;
    String2ComboBox.ShowHint := True;
    String2ComboBox.TabOrder := 12;
    String2ComboBox.Text := Players[0].{String2}Strings[1];
    String2ComboBox.OnDropDown := @String1Change;

    String3ComboBox := TComboBox.Create(frmDesign);
    String3ComboBox.Parent := frmDesign;
    String3ComboBox.Left := 220;
    String3ComboBox.Top := 165;
    String3ComboBox.Width := 70;
    String3ComboBox.Height := 21;
    String3ComboBox.Hint := 'Select the Direction to Run in if we are Attacked';
    String3ComboBox.ItemHeight := 13;
    String3ComboBox.ParentShowHint := False;
    String3ComboBox.ShowHint := True;
    String3ComboBox.TabOrder := 12;
    String3ComboBox.Items.Add('N');
    String3ComboBox.Items.Add('E');
    String3ComboBox.Items.Add('S');
    String3ComboBox.Items.Add('W');
    String3ComboBox.Text := Players[0].{String3}Strings[2];

    GemsCheckBox := TCheckBox.Create(frmDesign);
    GemsCheckBox.Parent := frmDesign;
    GemsCheckBox.Left := 225;
    GemsCheckBox.Top := 117;
    GemsCheckBox.Width := 78;
    GemsCheckBox.Height := 20;
    GemsCheckBox.Caption := 'Save Gems?';
    GemsCheckBox.ParentShowHint := False;
    GemsCheckBox.ShowHint := True;
    GemsCheckBox.Hint := 'Do you want to save the Gems you Mine?';
    GemsCheckBox.Checked := Players[0].{Boolean3}Booleans[2];
    If (String1ComboBox.Text = 'Mining') then
      GemsCheckBox.Visible := True
    else
      GemsCheckBox.Visible := False;

    FletchComboBox := TComboBox.Create(frmDesign);
    FletchComboBox.Parent := frmDesign;
    FletchComboBox.Left := 182;
    FletchComboBox.Top := 193;
    FletchComboBox.Width := 100;
    FletchComboBox.Height := 21;
    FletchComboBox.Hint := 'Select What Type of Log the Item is';
    FletchComboBox.ItemHeight := 13;
    FletchComboBox.ParentShowHint := False;
    FletchComboBox.ShowHint := True;
    FletchComboBox.TabOrder := 12;
    FletchComboBox.Items.Add('Normal');
    FletchComboBox.Items.Add('Oak');
    FletchComboBox.Items.Add('Willow');
    FletchComboBox.Items.Add('Maple');
    FletchComboBox.Items.Add('Yew');
    FletchComboBox.Items.Add('Magic');
    FletchComboBox.Text := FletchString[0];
    If (String1ComboBox.Text = 'Fletching') then
      FletchComboBox.Visible := True
    else
      FletchComboBox.Visible := False;

    ColorsLabel := TLabel.Create(frmDesign);
    ColorsLabel.Parent := frmDesign;
    ColorsLabel.Left := 10;
    ColorsLabel.Top := 194;
    ColorsLabel.Width := 80;
    ColorsLabel.Height := 12;
    ColorsLabel.Font.Color := clWindowText;
    ColorsLabel.Font.Height := -12;
    ColorsLabel.Font.Name := 'MS Sans Serif';
    ColorsLabel.Font.Style := [];
    ColorsLabel.ParentFont := False;
    ColorsLabel.Caption := 'Picked Color:';
    If (ColorCheckBox.Checked) then
      ColorsLabel.Visible := True
    else
      ColorsLabel.Visible := False;

    ColorsEdit := TEdit.Create(frmDesign);
    ColorsEdit.Parent := frmDesign;
    ColorsEdit.Left := 77;
    ColorsEdit.Top := 191;
    ColorsEdit.Width := 80;
    ColorsEdit.Height := 21;
    ColorsEdit.Hint := 'Put in the Color of the Item you are Autoing.  Leave as 0 for AutoPick';
    ColorsEdit.ParentShowHint := False;
    ColorsEdit.ShowHint := True;
    ColorsEdit.TabOrder := 8;
    ColorsEdit.Text := IntToStr(Players[0].{Integer1}Integers[0]);
    If (ColorCheckBox.Checked) then
      ColorsEdit.Visible := True
    else
      ColorsEdit.Visible := False;

    MiningSecsLabel := TLabel.Create(frmDesign);
    MiningSecsLabel.Parent := frmDesign;
    MiningSecsLabel.Left := 162;
    MiningSecsLabel.Top := 194;
    MiningSecsLabel.Width := 80;
    MiningSecsLabel.Height := 12;
    MiningSecsLabel.Font.Color := clWindowText;
    MiningSecsLabel.Font.Height := -12;
    MiningSecsLabel.Font.Name := 'MS Sans Serif';
    MiningSecsLabel.Font.Style := [];
    MiningSecsLabel.ParentFont := False;
    MiningSecsLabel.Caption := 'Seconds:';
    If (String1ComboBox.Text = 'Mining') then
      MiningSecsLabel.Visible := True
    else
      MiningSecsLabel.Visible := False;

    MiningSecsEdit := TEdit.Create(frmDesign);
    MiningSecsEdit.Parent := frmDesign;
    MiningSecsEdit.Left := 210;
    MiningSecsEdit.Top := 191;
    MiningSecsEdit.Width := 80;
    MiningSecsEdit.Height := 21;
    MiningSecsEdit.Hint := 'Number of Seconds you are willing to Wait for a rock to Mine before Clicking Again';
    MiningSecsEdit.ParentShowHint := False;
    MiningSecsEdit.ShowHint := True;
    MiningSecsEdit.TabOrder := 8;
    MiningSecsEdit.Text := IntToStr(Players[0].{Integer3}Integers[2]);
    If (String1ComboBox.Text = 'Mining') then
      MiningSecsEdit.Visible := True
    else
      MiningSecsEdit.Visible := False;

    BankCheckBox := TCheckBox.Create(frmDesign);
    BankCheckBox.Parent := frmDesign;
    BankCheckBox.Left := 164;
    BankCheckBox.Top := 192;
    BankCheckBox.Width := 125;
    BankCheckBox.Height := 20;
    BankCheckBox.Caption := 'Withdraw From Bank?';
    BankCheckBox.ParentShowHint := False;
    BankCheckBox.ShowHint := True;
    BankCheckBox.Hint := 'Click to Withdraw Bones from Bank and Bury. Otherwise it will pick up from Floor';
    BankCheckBox.Checked := Players[0].{Boolean2}Booleans[1];
    If (String1ComboBox.Text = 'Bone Burying') then
      BankCheckBox.Visible := True
    else
      BankCheckBox.Visible := False;

    StartButton := TButton.Create(frmDesign);
    StartButton.Parent := frmDesign;
    StartButton.Left := 60;
    StartButton.Top := 220;
    StartButton.Width := 75;
    StartButton.Height := 25;
    StartButton.Hint := 'Click to Start the Script';
    StartButton.Caption := 'Start Script';
    StartButton.ParentShowHint := False;
    StartButton.ShowHint := True;
    StartButton.TabOrder := 15;
    StartButton.OnClick := @StartClicked;

    DonateButton := TButton.Create(frmDesign);
    DonateButton.Parent := frmDesign;
    DonateButton.Left := 150;
    DonateButton.Top := 220;
    DonateButton.Width := 75;
    DonateButton.Height := 25;
    DonateButton.Hint := 'Donations are always Appreciated!';
    DonateButton.Caption := 'Donate!';
    DonateButton.ParentShowHint := False;
    DonateButton.ShowHint := True;
    DonateButton.TabOrder := 15;
    DonateButton.OnClick := @DonateClicked; *)

    end;
    Last edited by kanah; 11-05-2011 at 05:03 AM.

  6. #6
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Instead of calling
    SafeInitForm;
    Just call
    InitForm;
    Managed to crash Simba. That didn't tell me much. lolol

    Oh well small re-write

  7. #7
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Here's a template that I use for creating forms now, thanks to Coh3ns help. Hope this points you in the right direction.

    Simba Code:
    program formTemplate;

    var
      form: TForm;
      txtBox: TEdit;
      button: TButton;
      check: TCheckBox;
      lbl: TLabel;

    procedure onButtonClick(Sender: TObject);
    begin
      writeln('Clicked a button!');
    end;

    procedure onCheckClicked(Sender: TObject);
    begin
      if check.CHECKED then
        WriteLn('Checkbox is checked!')
      else
        WriteLn('Checkbox is unchecked!');
    end;

    procedure formInit;
    begin
      form := TForm.create(nil);
      with form do
      begin
        caption := 'Form Template';
        setBounds(100, 100, 500, 300);
      end;

      txtBox := TEdit.Create(form);
      with txtBox do
      begin
        parent := form;
        setBounds(10, 10, 100, 25);
      end;

      button := TButton.Create(form);
      with button do
      begin
        parent := form; // need this line or the button won't show up
        width := 100;
        height := 25;
        top := 100;
        left := 150;
        caption := 'Example';
        onClick := @onButtonClick;
      end;

      check := TCheckBox.Create(form);
      with check do
      begin
        parent := form;
        top := 100;
        left := 75;
        caption := 'Test';
        onClick := @onCheckClicked;
      end;

      lbl := TLabel.Create(form);
      with lbl do
      begin
        parent := form;
        caption := 'Test Label';
        top := 75;
        left := 100;
      end;

      form.showModal;
    end;

    procedure formSafeCall(proc: string);
    var
      v: TVariantArray;
    begin
      setLength(v, 0);
      threadSafeCall(proc, v);
    end;

    procedure formFree();
    begin
      form.free();
    end;

    begin
      clearDebug();

      try
        formSafeCall('formInit');
      except
        writeln(exceptionToString(exceptionType, exceptionParam));
      finally
        formSafeCall('formFree');
      end;
    end.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  8. #8
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Use the form editor in scar, make the form, save it as a dfm, use Ron's dfm parser, copy the resultant code and modify it a little bit and past in simba. Voila! A fully working form that takes like a fraction of the time to create!

  9. #9
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by KingKong View Post
    Use the form editor in scar, make the form, save it as a dfm, use Ron's dfm parser, copy the resultant code and modify it a little bit and past in simba. Voila! A fully working form that takes like a fraction of the time to create!
    Simba needs a form editor.

    An wyn, try the template Camo posted. I was having a similar issue to yours, and when Dgby714 and I created the new template, it worked.

  10. #10
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Yea i was gonna say, you don't need
    tab order
    frmDesign.Color := clInactiveCaption;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    any of that,

    setbounds will save you 4 lines per object.
    People waste so much space in their forms because they set things that are already defaulted.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  11. #11
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Well after some extensive work that Kanah as helped with I got my Form to load up properly.

    The only problems with the form now are...

    Pressing any buttons on the gui cause Simba to crash
    My loading of a data file doesn't want to work.

    Hmmm...I should to start ripping through srl before making my own methods more. :/

    Camo I'm gonna take a look into that template...

  12. #12
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by wyn10 View Post
    Well after some extensive work that Kanah as helped with I got my Form to load up properly.

    The only problems with the form now are...

    Pressing any buttons on the gui cause Simba to crash
    My loading of a data file doesn't want to work.

    Hmmm...I should to start ripping through srl before making my own methods more. :/

    Camo I'm gonna take a look into that template...
    All your problems will be solved if you just use that template.

  13. #13
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    All your problems will be solved if you just use that template.
    It's gonna take me a little bit to redo the gui under that.

  14. #14
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Shouldn't. All you need to do is copy your init procedure over an any clicking, etc. methods. This template may be easier as there aren't any examples.
    Simba Code:
    program formTemplate;

    var
      form: TForm;

    procedure formInit;
    begin
      form := TForm.create(nil);
      with form do
      begin
        caption := 'Form Template';
        setBounds(100, 100, 500, 300);
      end;

      form.showModal;
    end;

    procedure formSafeCall(proc: string);
    var
      v: TVariantArray;
    begin
      setLength(v, 0);
      threadSafeCall(proc, v);
    end;

    procedure formFree();
    begin
      form.free();
    end;

    begin
      clearDebug();

      try
        formSafeCall('formInit');
      except
        writeln(exceptionToString(exceptionType, exceptionParam));
      finally
        formSafeCall('formFree');
      end;
    end.

  15. #15
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Shouldn't. All you need to do is copy your init procedure over an any clicking, etc. methods. This template may be easier as there aren't any examples.
    Simba Code:
    code was here
    Now trying to solve...

    Exception: "" is not a valid boolean.
    Error: Out Of Range at line 2502

    Error is commented...

    Simba Code:
    procedure formSafeCall(proc: string);
    var
      v: TVariantArray;
    begin
      setLength(v, 0);
      threadSafeCall(proc, v);
    end;  <<-- On this line

  16. #16
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Are you calling it like this?

    Simba Code:
    formSafeCall('formInit');
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  17. #17
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by wyn10 View Post
    Now trying to solve...

    Exception: "" is not a valid boolean.
    Error: Out Of Range at line 2502

    Error is commented...

    Simba Code:
    procedure formSafeCall(proc: string);
    var
      v: TVariantArray;
    begin
      setLength(v, 0);
      threadSafeCall(proc, v);
    end;  <<-- On this line
    That's basically useless since that doesn't actually tell you the real line. You have to call just the init procedure. Like:
    Simba Code:
    // mainloop
    begin
      formInit();
    end.

  18. #18
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    I don't see why you guys just dont use the form editor from scar and follow my method. Its a lot easier and faster. I never had any troubles with it.

  19. #19
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I personally don't like using the editor. I like writing the code myself. Not to mention the code generated by the editor extremely ugly.

  20. #20
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    ^ This. I've always written the code myself, for any kind of form, in any language. Editor code that is made from a GUI is always messy.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  21. #21
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Not so much that its ugly as much as it probably more than triples the length of defining everything because it puts in all the unnecessary and default values anyway.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


Thread Information

Users Browsing this Thread

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

Posting Permissions

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