Results 1 to 3 of 3

Thread: Line 76: [Error] (27680:47): Invalid number of parameters

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default Line 76: [Error] (27680:47): Invalid number of parameters

    SCAR Code:
    program New;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include srl/srl/reflection/reflection.scar}
    var
     g : integer;

    procedure DeclarePlayers;//add more if needed
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := 'ham';
      Players[0].Active     := True;    // Use this account?
      Players[0].integers[0]:= 3885;
      Players[0].BoxRewards := ['XP', 'ostume', 'mote', 'Gem', 'ithril', 'oal'];
    end;

    procedure antiban;
    begin
      case random(4) of
        1: randommovement;
        2: sleepandmovemouse(100 + random (35));
        3: begin
             hoverskill('Strength', false);
          end;
        4: boredhuman;
      end;
    end;

    procedure writepos;
    var
      myposition: TPoint;
    begin
      MyPosition := GetMyPos;
      writeln('Our tile is: '+inttostr(MyPosition.x)+','+inttostr(MyPosition.y));
    end;


    function pickupcowhides: Boolean;
    var
      Feathers : array of TGroundItem;
      i : integer;
      TP : Tpoint;
    begin
      if FindGroundItems( Feathers, [1739], 10) then
      begin
        for i := 0 to high(Feathers) do
        begin
          TP := TileToMS( Feathers[i].Tile, 0);
          Mouse( tp.x, tp.y, 3, 3, false);
          Wait(385+random(25));
          R_ChooseOption('owhide');
          repeat
            Wait(1);
            r_findrandoms;
          until (not CharacterMoving);
          Wait(650);
        end;
      end;
      Result := True;
    end;

    function Findcow : boolean; // thnx kyle
    var
      Cow : TNPC;
      TP : TPoint;
    begin
      repeat
        if R_InvFull then
          exit;
        If FindFreeNPC('Cow', Cow) then
        begin
          if not TileOnMS(Cow.Tile.x, Cow.Tile.y , 5) then // error line
            WalkToTile(Cow.Tile, 1, 0);
          TP := TileToMS(Cow.Tile, 5);
          Mouse(TP.x, TP.y, 2,3, True);
          if WaitForOption('ttack', 5000) then
            result :=  R_ChooseOption('ttack');
        end;
        //PickupCowhides;
        if result then
          Inc ;
      until (R_InvFull);
    end;


    function Bankpath:TPointArray;
    begin
      setlength(result,5);
      result[0] := point(3031,3312);
      result[1] := point(3020,3319);
      result[2] := point(3009,3327);
      result[3] := point(3007,3342);
      result[4] := point(3012,3356);
    end;

    function Penpath:TPointArray;
    begin
      setlength(result,5);
      result[0] := point(3008,3326);
      result[1] := point(3019,3314);
      result[2] := point(3031,3314);
      result[3] := point(3031,3304);
    end;

    function OpenGate : boolean; // gotta give credits
    var
      x, y : integer;
    Begin
      If FindObjCustom(x, y, ['Gate'], [4808555, 3559518, 1054232, 1053975], 25) Then
        MMouse(x, y, 0, 0);
        Wait(200 + Random(200));
        Result := IsUpText('lose');
      If Result Then Exit;
      If IsUpText('pen') Then
        Mouse(x, y, 0, 0, True);
      Wait(1000 + Random(2000));
      Result := True;
    End;

    procedure walktobank;
    var
      i :integer;
      path : tpointarray;
    begin
      path := bankpath
      if WalkToTile(point(3031,3312), 2, 1) then
        opengate;
      For I := 0 to High(bankPath) do
      Begin
        If (WalkToTile(path[i], 2, 1)) Then
        R_Flag;
        Flag;
        R_FindRandoms;
        FindNormalRandoms;
        Wait(550+Random(300));
      end;
    end;

    procedure Bank;
    begin
       R_OpenBankBooth('falador east');
       R_MouseItemID(1740, 'All');
       closewindow;
    end;


    begin
      smart_server := 86;
      smart_signed := true;
      setupsrl;
      declareplayers;
      loginplayer;
      repeat
        if not loggedin then terminatescript;
        Findcow;
        //walktobank;
      until (G = players[currentplayer].integers[0]);
    end.

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Try changing this:
    SCAR Code:
    if not TileOnMS(Cow.Tile.x, Cow.Tile.y , 5) then // error line
    to this:
    SCAR Code:
    if not TileOnMS(Cow.Tile, 5) then

  3. #3
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    //ah : D.

    And i think the functions requires a tpoint :'D

    And i think you need to get the mainscreen tile first *_*..

    {************************************************* ******************************
    function TileToMS(Tile:TPoint; height: integer): TPoint;
    By: BenLand100
    Description: Converts the tile position tileX,tileY to a mainscreen location
    Height is the distance (in px) above the ground
    ************************************************** *****************************}
    Last edited by caused; 07-27-2009 at 02:19 AM.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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