Results 1 to 3 of 3

Thread: Trouble with Forms (invalid parameters)

  1. #1
    Join Date
    Nov 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Trouble with Forms (invalid parameters)

    OK, so for some reason, i keep getting invalid parameters in my main loop.

    Line 172: [Error] (14853:11): Invalid number of parameters

    Which would be
    SCAR Code:
    StartClick;

    Here is the entire script if you need it.

    SCAR Code:
    program AutoAlcherv03;
    {.include SRL/SRL.scar}
    //////////////////////////////////////////////
    //             AutoAlch v0.3                //
    // RECOMMENDED-> SCAR Divi 3.12c & SRL 4.0  //
    //////////////////////////////////////////////
    //               BY MAMBY                   //
    //           SET UP LINES 28-42             //
    //////////////////////////////////////////////
    //             INSTRUCTIONS                 //
    //          -------------------             //
    //////////////////////////////////////////////
    //              Fixes/Changes               //
    //          -------------------             //
    //////////////////////////////////////////////
    var
      frmDesign : TForm;
      Label1 : TLabel;
      Label2 : TLabel;
      Label3 : TLabel;
      author : TLabel;
      Label4 : TLabel;
      UserEdit : TEdit;
      PassEdit : TEdit;
      AlchEdit : TEdit;
      StartButton : TButton;
    //=============================================//
    procedure StartClick(sender: TObject);
      begin
        Writeln('Logging in...');
        frmDesign.ModalResult:= mrOk; // Closes the form
      end;
    //=============================================//
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;
    //=============================================//
    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;
    //=============================================//
    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;
    //=============================================//
    Procedure DeclarePlayers;
      begin
        HowManyPlayers  :=1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer:=0;

        Players[0].Name :='zzzz'; //Username
        Players[0].Pass :='zzzz'; //Password
        Players[0].Nick :='123'; // 3 letters in the middle of your name
        Players[0].Active:=True;
      end;
    //=============================================//
    Procedure InitForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 367;
    frmDesign.Top := 252;
    frmDesign.Width := 260;
    frmDesign.Height := 185;
    frmDesign.Caption := 'Mambys AutoAlcher v.3';
    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;
    Label1 := TLabel.Create(frmDesign);
    Label1.Parent := frmDesign;
    Label1.Left := 48;
    Label1.Top := 16;
    Label1.Width := 51;
    Label1.Height := 13;
    Label1.Alignment := taCenter;
    Label1.Caption := 'Username:';
    Label2 := TLabel.Create(frmDesign);
    Label2.Parent := frmDesign;
    Label2.Left := 48;
    Label2.Top := 40;
    Label2.Width := 49;
    Label2.Height := 13;
    Label2.Alignment := taCenter;
    Label2.Caption := 'Password:';
    Label3 := TLabel.Create(frmDesign);
    Label3.Parent := frmDesign;
    Label3.Left := 24;
    Label3.Top := 64;
    Label3.Width := 76;
    Label3.Height := 13;
    Label3.Alignment := taCenter;
    Label3.Caption := 'Amount To Alch';
    author := TLabel.Create(frmDesign);
    author.Parent := frmDesign;
    author.Left := 8;
    author.Top := 136;
    author.Width := 78;
    author.Height := 13;
    author.Caption := 'Script by Mamby';
    Label4 := TLabel.Create(frmDesign);
    Label4.Parent := frmDesign;
    Label4.Left := 136;
    Label4.Top := 136;
    Label4.Width := 108;
    Label4.Height := 13;
    Label4.Caption := 'www.SRL-Forums.com';
    UserEdit := TEdit.Create(frmDesign);
    UserEdit.Parent := frmDesign;
    UserEdit.Left := 104;
    UserEdit.Top := 16;
    UserEdit.Width := 105;
    UserEdit.Height := 21;
    UserEdit.Hint := 'Username';
    UserEdit.ParentShowHint := False;
    UserEdit.ShowHint := True;
    UserEdit.TabOrder := 8;
    UserEdit.Text := 'UserEdit';
    PassEdit := TEdit.Create(frmDesign);
    PassEdit.Parent := frmDesign;
    PassEdit.Left := 104;
    PassEdit.Top := 40;
    PassEdit.Width := 105;
    PassEdit.Height := 21;
    PassEdit.Hint := 'Password';
    PassEdit.MaxLength := 16;
    PassEdit.ParentShowHint := False;
    PassEdit.PasswordChar := '*';
    PassEdit.ShowHint := True;
    PassEdit.TabOrder := 9;
    PassEdit.Text := 'PassEdit';
    AlchEdit := TEdit.Create(frmDesign);
    AlchEdit.Parent := frmDesign;
    AlchEdit.Left := 104;
    AlchEdit.Top := 64;
    AlchEdit.Width := 41;
    AlchEdit.Height := 21;
    AlchEdit.Hint := 'Alch';
    AlchEdit.MaxLength := 4;
    AlchEdit.ParentShowHint := False;
    AlchEdit.ShowHint := True;
    AlchEdit.TabOrder := 10;
    AlchEdit.Text := 'AlchEdit';
    StartButton := TButton.Create(frmDesign);
    StartButton.Parent := frmDesign;
    StartButton.Left := 72;
    StartButton.Top := 96;
    StartButton.Width := 105;
    StartButton.Height := 33;
    StartButton.Caption := 'Start';
    StartButton.TabOrder := 11;
    StartButton.OnClick := @StartClick;
    end;

      begin
        cleardebug;
        SetupSRL;
        SafeInitForm;
        SafeShowFormModal;
        StartClick;
        DeclarePlayers;
        activateclient;
        wait(1000);
        loginplayer;
      end.

    thanks
    http://i36.photobucket.com/albums/e4...mer/quake1.jpg
    Possible Projects in the Future
    Snape grass collector + banker

  2. #2
    Join Date
    Dec 2006
    Posts
    2,244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just take StartClick; out you dont need it just tested and it works

  3. #3
    Join Date
    Nov 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh awesome, since its called on onClick for the start button you don't it?

    Thanks for the help.
    http://i36.photobucket.com/albums/e4...mer/quake1.jpg
    Possible Projects in the Future
    Snape grass collector + banker

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Why do i keep getting invalid parameters for?
    By Scaper in forum OSR Help
    Replies: 1
    Last Post: 07-15-2008, 10:56 PM
  2. Replies: 3
    Last Post: 04-04-2008, 10:06 PM
  3. Invalid parameters
    By Runaway in forum OSR Help
    Replies: 1
    Last Post: 01-19-2008, 03:23 AM
  4. Invalid parameters help.
    By Hey321 in forum OSR Help
    Replies: 16
    Last Post: 11-13-2006, 02:29 AM

Posting Permissions

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