Results 1 to 5 of 5

Thread: Need a little help... noob at SRL programming...

  1. #1
    Join Date
    May 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need a little help... noob at SRL programming...

    Code:
    program New;
    begin
         HowManyPlayers :=6;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:=0;
    
         Players[0].Name :='yourname';
         Players[0].Pass :='yourpass';
         Players[0].Nick :='urna';
         Players[0].Loc :='falador';
         Players[0].Skill:='yourskill';
         Players[0].Active:=True;
         if Players[CurrentPlayer].loc='falador' then
       begin
           WalkToMine;
       end;
    end
    at the bottom it says:
    Line 4: [Error] (4:1): Unknown identifier 'HowManyPlayers' in script

    why isn't this working?? I took it all from the SRL manual except I added the word "Falador" in 2 times... what could the problem be?

  2. #2
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    put {.include srl/srl.scar} below program new;

    If you still get errors make sure you have latest SCAR and SRL

  3. #3
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    also you have to include setupsrl; in your main loop at the beginning.

  4. #4
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I usually put it in as a procedure like
    SCAR Code:
    program New;
    {.include SRL/SRl.scar}

    Procedure DeclarePlayers;
    begin
         HowManyPlayers :=1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:=0;

         Players[0].Name :='yourname';
         Players[0].Pass :='yourpass';
         Players[0].Nick :='urna';
         Players[0].Loc :='falador';
         Players[0].Skill:='yourskill';
         Players[0].Active:=True;
    end;

    Begin
      SetupSRL;
      DeclarePlayers;
      if (not(loggedin)) then
      Loginplayer; //etc etc
      if Players[CurrentPlayer].loc='falador' then
       begin
         WalkToMine;
       end;
    end.

    That way it's easier to include in your main loop, instead of being your main loop.

  5. #5
    Join Date
    Oct 2006
    Location
    MI USA
    Posts
    3,166
    Mentioned
    6 Post(s)
    Quoted
    11 Post(s)

    Default

    HowManyPlayers :=6;
    and be sure to make sure your number of players matches the amount of....Number Of Players ...you are using


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Programming
    By aciid phreek in forum Who Are You ? Who ? Who ?
    Replies: 3
    Last Post: 02-15-2008, 04:18 PM
  2. Programming Help
    By mat_de_b in forum News and General
    Replies: 8
    Last Post: 11-07-2007, 12:35 AM
  3. Noob script ideas for a noob scripter
    By 13lacknova in forum First Scripts
    Replies: 7
    Last Post: 09-30-2007, 01:01 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
  •