Results 1 to 9 of 9

Thread: Can you guys spot what is wrong with this :D

  1. #1
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Can you guys spot what is wrong with this :D

    Yeya everyone i have actually been really enjoying Simba, and started on this new script; but i get the error: 'Invalid number of parameters at line 175'.. here is the script

    Simba Code:
    program MehScript;

    {$DEFINE Smart}
    {$i srl/srl.simba}
    {$i SRL/SRL/misc/paintsmart.scar}

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      with Players[0] do
        begin
        Name        := '';
        Pass        := '';
        Pin         := '';
        BoxRewards  := ['XP','xp','lamp'];
        LampSkill   := 'Farming';
        Active      := True;
        LoginPlayer
      end;
    end;

    var
    x, y: integer;

    function BankColour: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.19, 0.49);

      if not (FindColorsTolerance(arP, 4664116, MSX1, MSY1, MSX2, MSY2, 11)) then
      begin
        Writeln('Failed to find the color, no result(bankcolour).');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;
      end;
    procedure bankbanker;
    begin
    if findobjcustom(x, y, ['ank'], [BankColour], 2) then
    begin
    Mouse(x, y, 0, 0, false);
    chooseoption ('Bank Banker');
    wait (10000+ random (500));
    depositall;
    if (bankscreen) then
    end;
    end;

    function Vial: boolean;
    var
    x, y, Vial01: Integer;
    begin
    Result := (false);
    Vial01 := DTMFromString('maQEAAHicrcvLCYBADIThqBXY3B6sUVhfK+Kqq9iMZfgf5iB41MAXApkpzWxGwIAeLRp43UGZhBMHdmxYsWBErU6nzoSoXHp0on5BWa+ucxU7/+Qq7PNkP3jNDVIBGo8=');
    begin
    if FindDTM(Vial01, x, y, MSX1, MSY1, MSX2, MSY2) then
    begin
    Writeln ('found vial in bank!');
    Mouse (x, y, 0, 0, false);
    ChooseOption ('ithdraw-ll');
    freeDTM (Vial01);
    Wait(1000+Random(300));
    Closebank;
    end;
    end;
    end;

    function Vial2: boolean;
    var
    x, y, Vial02: Integer;
    begin
    Result := (false);
    Vial02 := DTMFromString('maQEAAHicrcvLCYBADIThqBXY3B6sUVhfK+Kqq9iMZfgf5iB41MAXApkpzWxGwIAeLRp43UGZhBMHdmxYsWBErU6nzoSoXHp0on5BWa+ucxU7/+Qq7PNkP3jNDVIBGo8=');
    begin
    if FindDTM(Vial02, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    Writeln ('found vial in inventory!');
    Mouse (x, y, 0, 0, true);
    freeDTM (Vial02);
    Wait(1000+Random(300));
    end;
    end;
    end;



    function WalkToBank: boolean;
    var
    x, y, Location1: Integer;
    begin
    Result := (false);
    Location1 := DTMFromString('mlwAAAHicY2dgYGhnYmAwg2I7KC4H4iogdgLKBwBxMBCHAHE4EBtC8Uc2JpzYCCiPCzPiwVAAAH0sDJw=');
    begin
    if FindDTM(Location1, x, y, MMX1, MMY1, MMX2, MMY2) then
    begin
    Writeln ('found location!');
    Mouse (x, y, 0, 0, true);
    freeDTM (Location1);
    Wait(1000+Random(300));
    MakeCompass('S');
    end;
    end;
    end;



    function FountC(var fx, fy: Integer): Boolean;
    var
      arP: TPointArray;
      ararP: T2DPointArray;
      tmpCTS, i, arL: Integer;
      P: TPoint;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.02, 3.26);

      if not(FindColorsTolerance(arP, 15574402, MSX1, MSY1, MSX2, MSY2, 6)) then
      begin
        Writeln('Failed to find the color, no object found.(fountain)');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      SortTPAFrom(arP, Point(MSCX, MSCY));
      ararP := SplitTPAEx(arP, 10, 10);
      arL := High(ararP);

      for i := 0 to arL do
      begin
        P := MiddleTPA(ararP[i]);
        MMouse(P.x, P.y, 5, 5);
        Wait(100 + Random(100));
        if (IsUpText('Take')) then
        begin;
          Result := True;
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
      begin
        Writeln('FindObject could not find object.(fountain)');
        Exit;
      end;

      GetMousePos(fx, fy);
    end;

    procedure fountainclick;
    begin
    if findobjcustom (x, y, ['Foun'], [FountC], 2) then
    begin
    Mouse(x, y, 0, 0, true);
    wait (20000+random (1000));
    end;
    end;

    begin
       SetupSRL;
       DeclarePlayers;
       LoginPlayer;
    repeat
       bankbanker;
       Vial;
       Vial2;
       fountainclick;
       WalkToBank;
    until (invcount > 28);
    end.

    i don't understand what has gone wrong does anyone know how I can fix this xD

    thanks!
    note: would it be possible to say wait until (bankscreen)?

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    What line is 175? Also, you could do:

    Simba Code:
    repeat
      Wait({time});
    until(BankScreen);
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes, line 175

    thanks kyle saved hours of searching through tutorials xD

  4. #4
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    i need to bot!

    It compiles for me...
    Although, your standards are killing me! :P

  5. #5
    Join Date
    Jan 2012
    Location
    Minneapolis, Mn
    Posts
    185
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The problem is that you modified FountC (generated by ACA) to return a Boolean when it needs to return an Integer.

    E: Use ggzz's solution.
    Last edited by Inception; 01-24-2012 at 08:59 PM.

  6. #6
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    findobjcustom(X, Y, ['Foun'], [FountC(X, Y)], 2)
    I am Ggzz..
    Hackintosher

  7. #7
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i actually find it much easier to read without standars o.0

    and really? I still get

    '[Error] (176:42): Invalid number of parameters at line 175
    Compiling failed.'


  8. #8
    Join Date
    Jan 2012
    Location
    Minneapolis, Mn
    Posts
    185
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If ggzz's solution doesn't work, then I would change FountC back to the way it was when you generated it. You aren't referencing it any other place then that call so there really is no reason for it to return a Boolean.

  9. #9
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks ggzz :-) such an epic community

    thanks again people

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
  •