Results 1 to 4 of 4

Thread: Invalid number of parametres

  1. #1
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default Invalid number of parametres

    Ok in the untilmined function i don't know what to put in the loop no matter how i do the parametres i can't get it right so please help:

    SCAR Code:
    //////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////
    //                  THE NOOBIEST                      //
    //                   POWERMINER                      //
    //                  BY RKROXPUNK                    //
    //                                                 //
    ////////////////////////////////////////////////////
    ///////////////////////////////////////////////////
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include srl\srl\skill\Mining.scar}

    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  LOGIN AND SETUP                     //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////
    var
      Manage: Integer;

    const StartPlayer = 0;
      VersionNumber = '2';
      OreeColor = 1976128; //Put the colour of the ore you want to mine here
      WaitTime = 7000; //How long before it clicks again
      RunDirec = 'N'; //Direction you want to run in if find smoking rock
      PickEquip = True; // Is your pick equipped. true = yes, false =  no

    procedure DeclarePlayers;

    begin
      HowManyPlayers := 1; // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
      CurrentPlayer := StartPlayer;

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Loc := 'Loc1';
      Players[0].Skill := 'Mining';
      Players[0].Active := True;

      writeln(inttostr(HowManyPlayers) + ' Players');
    end;

    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //            RANDOMS AND ANTIBAN                       //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    procedure AntiRandoms;
    begin
      FindTalk;
      FindNormalRandoms;
      if (FindFight = true) then
      begin
        RunAwayDirection(RunDirec);
        Wait(10000 + random(2000));
        RunBack;
      end;
    end;

    procedure Hello;
    begin
      if (FindChatText('hi')) or
        (FindChatText('hello')) or
        (FindChatText('hey')) or
        (FindChatText('sup')) or
        (FindChatText('g''day')) then
        typesend('hey'+chr(13));
    end;

    procedure MiningLvl;
    begin
      if (FindChatText('Minin lvl')) then
        typesend('Not Telling'+chr(13));
    end;

    procedure Bye;
    begin
      if (FindChatText('nite')) or
        (FindChatText('night')) or
        (FindChatText('bye')) then
        typesend('bye'+chr(13));
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  BITMAPS                             //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    procedure LoadBmps;
    begin
      Manage := BitmapFromString(38, 10, 'z78DA33301859C00D09E012' +
        'C1AF0B974A5A98499E4ACA45F0ABA48599C4A8A4968FF0872779E' +
        'EA18599B48EC7815239EAC7C19C56495539FC6A87513F0E75BF60' +
        '8A03006A8FD7E8');
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  MINEING AND DROPPING                //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    function FindOre: Boolean;
    begin
      if FindColorSpiral(x, y, OreeColor, 0, 0, 515, 336) then
      begin
        Result := True;
        Status('Found Ore :D');
      end else
        Status('Did not find Ore :(');
      wait(5 + random(5));
    end;

    function MouseToOre: Boolean;
    begin
      repeat
        if (FindOre) then
        begin
          MMouse(x, y, 0, 0);
          Result := True;
          Wait(20 + random(150));
          Exit;
        end;
      until (false)
    end;

    Function UntilMined(Time : integer) : boolean;
    var timer: integer;
    begin
      status('waiting for pick swing')
      if FindText(x,y,'You swing your',SmallChars,20, 415,152,431)then
        begin
          marktime(Timer);
          status('waiting for ore')
            repeat
              wait(1000+random(1000))
            until FindText(x,y,'You manage',SmallChars,20, 415,152,431)or
              (timefrommark(Timer)>Time);
          writeln('Finished mining')
        end;
    end;


    procedure Drop;
    begin
      if (InvFull) then
        DropTo(2, 28);
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                    MAIN LOOP                         //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////
    begin
      SetupSRL;
      SetupSRLMining;
      DeclarePlayers;
      LoadBmps;
      LoginPlayer;
      activateclient;
      LoginPlayer
        MakeCompass('N');
      HighestAngle;
      SetRun(true);
      repeat
        gametab(4);
        FindOre;
        MouseToOre;
        UntilMined; //insert what i have to put here 'cos i can't get it right lol;
        Drop;
        AntiRandoms;
        Hello;
        Mininglvl;
        bye;
      until (false);
    end.

    EDIT: W00T lesser demon and still uber noob go me!

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK, in this you have:
    function MouseToOre: Boolean;
    begin
    repeat
    if (FindOre) then
    begin
    MMouse(x, y, 0, 0);
    Result := True;
    Wait(20 + random(150));
    Exit;
    end;
    until (false)
    end;
    You should have it until(untilore) or something like that. it shouldn't be in your main loop though.

  3. #3
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    err that's not what i was talking about...that bit's fine it's the function after that i can't get right. what was the other thing you told me to do do?

    Quote Originally Posted by JAD View Post
    OK, in this you have:
    function MouseToOre: Boolean;
    begin
    repeat
    if (FindOre) then
    begin
    MMouse(x, y, 0, 0);
    Result := True;
    Wait(20 + random(150));
    Exit;
    end;
    until (false)
    end;
    You should have it until(untilore) or something like that. it shouldn't be in your main loop though.
    Sleeping...

  4. #4
    Join Date
    Jul 2006
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    invalid parameters means there aren't enough variables in a procedure / function.

    For example:

    This is what Mouse is supposed to have: Mouse(x,y,rx,ry,left);
    If you put it like this Mouse(x,y,rx,ry) then you will get the error.
    If you put it like this mouse(y,rx,ry,true) then you will ge the error.

    In your script, you put "UntilMined" in the main script, but when I look at the "UntilMined" function it is actually "UntilMined(Time)". Time looks like a simple failsafe, so just put in how long you should wait until switching to another rock if you don't mine that one. 3 seconds? 5 seconds?

    I gtg for now, Hope that helped.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Invalid Number Of Parameters
    By decide in forum OSR Help
    Replies: 3
    Last Post: 07-28-2008, 06:11 AM
  2. Invalid number of parameters
    By EL_TYCHO in forum OSR Help
    Replies: 14
    Last Post: 06-29-2007, 03:30 PM
  3. Invalid number of parameters
    By kristahlyn in forum OSR Help
    Replies: 2
    Last Post: 06-16-2007, 02:39 PM
  4. Invalid Number of Parameters
    By richyyrich09 in forum OSR Help
    Replies: 6
    Last Post: 06-12-2007, 10:48 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
  •