Results 1 to 17 of 17

Thread: Invalid parameters help.

  1. #1
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Invalid parameters help.

    Failed when compiling
    Line 95: [Error] (16065:11): Invalid number of parameters in script


    That's what i get. This is line 95:

    Code:
    NextPlayer;
    Yes i have SRL included all that jazz.

  2. #2
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    show the whole procedure or whatever. i might be able to help

  3. #3
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    procedure NoBan;
    begin
    AntiBan;
    BoredHuman;
    RandomMovement;
    FindMod;
    RotateEvery(10);
    FindNormalRandoms;
    if (not loggedin) then begin;
    NextPlayer;
    end;

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    {************************************************* ******************************
    procedure NextPlayerOrder(Active : Boolean);
    By: WT-Fakawi
    Description: Logs in CurrentPlayer. If Player[CurrentPlayer].Active = False,
    then next Player attempts to login.
    ************************************************** *****************************}

  5. #5
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    try putting this:

    procedure NoBan;
    begin
    AntiBan;
    BoredHuman;
    RandomMovement;
    FindMod;
    RotateEvery(10);
    FindNormalRandoms;
    if (not (loggedin)) then begin;
    NextPlayer(true);
    end;

    one difference...you didnt put (true) after nextplayer. see if that works.

  6. #6
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, thanks canadaman now i'm getting identifier expected :P never knew it was so hard to do multiplayers .

  7. #7
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmmmm....ill have to see the script.

  8. #8
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    PM-ed you it :P.

  9. #9
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Replace

    if (not (loggedin)) then begin;
    NextPlayer(true);

    with
    if (not (loggedin)) then NextPlayer(true);

    or

    if (not (loggedin)) then
    begin
    NextPlayer(true);
    end;

  10. #10
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, boreas i did that fixed that problem if you read above i'm now having problems with identifiers being expected. I'll post script to see if you can find whats wrong.

    Code:
    program Hey321sNoobFighter;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/Skill/Fighting.scar}
    {.include SRL/SRL/extended/xAntiRandoms.scar}
    
    var
    MColor1, MColor2, MColor3: Integer;
    
    var
    MonsterName:string;
    
    var
    MonstersFought: Integer;
    
    {Edit lines 17-19 with name/pass for login}
    
    Const
    Tolerance=5;
    fightmode=0;
    NumLoops=5;
    waittime=1000;
    procedure Colours;
    begin
    MonsterName:='Cow';//name of monster to fight.
    MColor1:=000000;//first colour on the monster.
    MColor2:=000000;//second colour.
    MColor3:=000000;//self explanotory.
    end;
    
    Procedure DeclarePlayers;
    begin
    
    HowManyPlayers:=4;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0;
    
    Players[0].Name :='';
    Players[0].Pass :='';
    Players[0].Nick :='';
    Players[0].Active :=True;
    
    Players[1].Name :='';
    Players[1].Pass :='';
    Players[1].Nick :='';
    Players[1].Active :=True;
    
    Players[2].Name :='';
    Players[2].Pass :='';
    Players[2].Nick :='';
    Players[2].Active :=True;
    
    Players[3].Name :='';
    Players[3].Pass :='';
    Players[3].Nick :='';
    Players[3].Active :=True;
    end;
    
    
    procedure Login;
    begin
    if(not loggedin)then
    loginplayer
    end;
    
    procedure NoBan;
    begin
    AntiBan;
    BoredHuman;
    RandomMovement;
    FindMod;
    RotateEvery(10);
    FindNormalRandoms;
    if (not (loggedin)) then
    begin
    NextPlayer(true);
    end;
    
    procedure Setup;
    begin
    SetupSRL;
    SetUpDemon;
    SetupSandWich;
    declareplayers;
    Login;
    SetFightMode(FightMode);
    end;
    
    
    procedure ProgressReport;
    begin
    Writeln('[]---////////////////////\\\\\\\\\\\\\\\---[]');
    Writeln(' Thanks for using Hey321s');
    Writeln(' Auto-Fighter ');
    Writeln(' Worked for:' +ScriptTime2(2));
    Writeln(' Monsters Fought: '+IntToStr(MonstersFought)+'');
    Writeln('[]---////////////////////\\\\\\\\\\\\\\\---[]');
    end;
    
    Procedure Fighting;
    begin if not InFight then begin
    FindMonster(MColor1, MColor2, MColor3,tolerance, MonsterName);
    KAttackMonster(MColor1,MColor2,MColor3,tolerance, MonsterName);
    end; while InFight do
    wait(waittime);
    end;
    
    
    begin
    Setup;
    Colours;
    repeat
    NoBan;
    Fighting;
    NoBan;
    ProgressReport;
    if (MonstersFought=NumLoops) then
    NextPlayer(true);
    end.

  11. #11
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok...

    invalid number of parameters means you are putting the wrong number of arguments into a function or a procedure. i.e. "random(590,234,True,1.2)" becuase random only accepts ONE argument, that is an integer. different procedures/functions need different amounts of arguments.

    identifyer expected means that there are too many "end"s or "begin"s. look through and keep track of how many begins are "open" (if you see a end, then that means one of the begins has been "closed") when you go through your script, there should be 0 open Begins at the end. this is because every begin needs one end.

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  12. #12
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by hey321 View Post
    Yes, boreas i did that fixed that problem if you read above i'm now having problems with identifiers being expected. I'll post script to see if you can find whats wrong.
    Yes what I posted fixes the identifiers. Your begins and ends dont match up.

  13. #13
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, wierd? I just counted them and i have 8 begin; 7 end; and 1 end. Is there something wrong with that? Either i did one or two things wrong or i suck at scripting :P.

  14. #14
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    you shouldn't have ; after begin

    the main loop is

    begin
    end.

    everything else is
    begin
    end;


    Ex:

    Code:
    if condtion then
    begin
      action1
      action2
    end;
    
    if condidtion then action1;
    
    case variable of
    outcome1: action1;
    outcome2: action2;
    end;
    
    case variable of
    outcome1: 
      begin
        action1a;
        action1b; 
      end;
    outcome2:
      begin
        action2a;
        action2b;
      end;
    end;
    
    procedure blah;
    var 
    a :integer;
    begin
      writeln(inttostr(a));
    end;
    
    function blah(a:integer):boolean;
    begin
    if a=1 then result:=true;
    end;
    
    //Main loop
    begin
      stuff;
    end.
    grr scar tags still screwed

  15. #15
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    :P Oops i forgot that haha i didnt put it in script accidently did here though :P.

  16. #16
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i like your blah function. i think i might use it in my script!

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  17. #17
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    lol

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

Posting Permissions

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