Results 1 to 5 of 5

Thread: Declare Players, form info...

  1. #1
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default Declare Players, form info...

    Hi, I need help with this :

    I made a form where the macroer puts in the name of the Account and the Password.

    Now :

    In DeclarePlayers, how do you put the input text into DeclarePlayers ?

    For example :

    I put in Zezima as username.

    How do i make "zezima" get into DeclarePlayers ?
    Here's the script :

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var
      frmDesign : TForm;
      Label1 : TLabel;
      Edit1 : TEdit;
      Edit2 : TEdit;
      Edit3 : TEdit;
      Button1 : TButton;
     
    procedure ButtonClick(sender: TObject);
    begin
      frmDesign.Caption:= frmDesign.Caption + '.';
      frmDesign.ModalResult:=mrOk;
    end;

    procedure InitForm;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 250;
      frmDesign.Top := 114;
      frmDesign.Width := 696;
      frmDesign.Height := 209;
      frmDesign.Caption := 'frmDesign';
      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 := 8;
      Label1.Top := 8;
      Label1.Width := 153;
      Label1.Height := 13;
      Label1.Caption := 'Tut Runner Script by Dervish =)';
      Edit1 := TEdit.Create(frmDesign);
      Edit1.Parent := frmDesign;
      Edit1.Left := 8;
      Edit1.Top := 80;
      Edit1.Width := 209;
      Edit1.Height := 21;
      Edit1.TabOrder := 8;
      Edit1.Text := 'Username';
      Edit2 := TEdit.Create(frmDesign);
      Edit2.Parent := frmDesign;
      Edit2.Left := 8;
      Edit2.Top := 112;
      Edit2.Width := 209;
      Edit2.Height := 21;
      Edit2.TabOrder := 9;
      Edit2.Text := 'Password';
      Button1 := TButton.Create(frmDesign);
      Button1.OnClick := @ButtonClick;
      Button1.Parent := frmDesign;
      Button1.Left := 224;
      Button1.Top := 8;
      Button1.Width := 449;
      Button1.Height := 153;
      Button1.Caption := 'Start Script';
      Button1.Default := True;
      Button1.TabOrder := 10;
      Edit3 := TEdit.Create(frmDesign);
      Edit3.Parent := frmDesign;
      Edit3.Left := 8;
      Edit3.Top := 144;
      Edit3.Width := 209;
      Edit3.Height := 21;
      Edit3.TabOrder := 11;
      Edit3.Text := 'NickName (3-4 letters of your name)';
    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 FormShowing;
    begin
      SafeInitForm;
      SafeShowFormModal;
    end;

    procedure DeclarePlayers;
    begin

         HowManyPlayers := 1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:= 0

         Players[0].Name   := (Edit1);
         Players[0].Pass   := (Edit2);
         Players[0].Nick   := (Edit3);
         Players[0].Active := True;

    end;







    begin
      FormShowing;
      DeclarePlayers;
    end.

    And Here's the error i get :

    Failed when compiling
    Line 110: [Error] (16329:29): Type mismatch in script C:\Program Files\SCAR 3.15b\Scripts\Tut Runner.scar

    Please help meeeeeeee..eeeeee

  2. #2
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    If the username was Edit1, then this is what it would look like:

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var
      frmDesign : TForm;
      Label1 : TLabel;
      Edit1, Edit2, Edit3 : TEdit;
      Button1 : TButton;
      Username, Password, Nickname : string;  //Added these
     
    procedure ButtonClick(sender: TObject);
    begin
      frmDesign.Caption:= frmDesign.Caption + '.';
      frmDesign.ModalResult:=mrOk;
    end;
     
    procedure InitForm;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 250;
      frmDesign.Top := 114;
      frmDesign.Width := 696;
      frmDesign.Height := 209;
      frmDesign.Caption := 'frmDesign';
      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 := 8;
      Label1.Top := 8;
      Label1.Width := 153;
      Label1.Height := 13;
      Label1.Caption := 'Tut Runner Script by Dervish =)';
      Edit1 := TEdit.Create(frmDesign);
      Edit1.Parent := frmDesign;
      Edit1.Left := 8;
      Edit1.Top := 80;
      Edit1.Width := 209;
      Edit1.Height := 21;
      Edit1.TabOrder := 8;
      Edit1.Text := 'Username';
      Edit2 := TEdit.Create(frmDesign);
      Edit2.Parent := frmDesign;
      Edit2.Left := 8;
      Edit2.Top := 112;
      Edit2.Width := 209;
      Edit2.Height := 21;
      Edit2.TabOrder := 9;
      Edit2.Text := 'Password';
      Button1 := TButton.Create(frmDesign);
      Button1.OnClick := @ButtonClick;
      Button1.Parent := frmDesign;
      Button1.Left := 224;
      Button1.Top := 8;
      Button1.Width := 449;
      Button1.Height := 153;
      Button1.Caption := 'Start Script';
      Button1.Default := True;
      Button1.TabOrder := 10;
      Edit3 := TEdit.Create(frmDesign);
      Edit3.Parent := frmDesign;
      Edit3.Left := 8;
      Edit3.Top := 144;
      Edit3.Width := 209;
      Edit3.Height := 21;
      Edit3.TabOrder := 11;
      Edit3.Text := 'NickName (3-4 letters of your name)';
    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 FormShowing;
    begin
      SafeInitForm;
      SafeShowFormModal;
    end;
     
    procedure DeclarePlayers;
    begin
         Username:= Edit1.text;
         Password:= Edit2.text;   //Added these three
         Nickname:= Edit3.text;  
         HowManyPlayers := 1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:= 0
     
         Players[0].Name   := (Username);  
         Players[0].Pass   := (Password);  //Changed these
         Players[0].Nick   := (Nickname);
         Players[0].Active := True;
    end;
     
    begin
      FormShowing;
      DeclarePlayers;
    end.

    That's assuming that Edit1 is the username, Edit2 is the password, and Edit3 is the nick.

    Hope I helped!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  3. #3
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    OMFGOGFOMGFOMGFMFFGOGFMGOGFMOFOMFGOMFGOMFOMGFOMFOG MfMOGOMGF....

    I LOVE YOOOUUUUU!!!!! ++Reppped =))=)=)=)=)= (not gay)

    Thanks so much d00d =) !

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Lol no problem. If you need anymore help with forms, just ask me.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    You can use the SRLPlayerForm procedure also to load a player form that's already made for you and supports quite a few features. You only need to incude Users.scar (which is in the misc folder I believe) and you can use the player form.
    :-)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. declare players
    By i 69 ur nan in forum OSR Help
    Replies: 3
    Last Post: 01-06-2009, 07:14 PM
  2. declare players
    By i 69 ur nan in forum OSR Help
    Replies: 3
    Last Post: 11-19-2008, 04:12 PM
  3. Need Help on declare players.
    By Raskolnikov in forum OSR Help
    Replies: 2
    Last Post: 11-16-2007, 11:02 PM
  4. Declare players?
    By ironlarreh in forum OSR Help
    Replies: 3
    Last Post: 11-12-2007, 09:55 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
  •