Results 1 to 2 of 2

Thread: More help please :D

  1. #1
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default More help please :D

    What it's supposed to do is open the door to the altar room then light the right burner, then the left, then it's supposed to use the d bones on the altar and click "sacrifice all"(the option in the chatbox) that's it.



    error:
    Simba Code:
    [Error] (364:14): Invalid number of parameters at line 363
    Compiling failed.

    Line 363 is bold ( not far from the bottom)

    Code:

    Simba Code:
    program Gilded_Altar;
    {$i srl/srl/misc/smart.simba}
    {$DEFINE CRASHSMART}
    {$i SRL\SRL.simba}
    {$i SPS\SPS.simba}

     var
      x, y: Integer;


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; // Number of Players to use
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0; // Player to start with, first one is 0
      Players[0].Name := ''; // Username
      Players[0].Pass := ''; // Password
      Players[0].Active := True; // TruiBox := InvBox;
      Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
      Players[0].Integers[1] := 10000; // Number of loads
    end;


     procedure AntiRandoms;
    begin
      FindNormalRandoms;
      LevelUp;
    end;


    function UseBankNPC: Boolean;
    var
      bx, by, Speed, ColFace, ColGrey, ColBlue, ColHair, t: Integer;
    begin
      Result := (LoggedIn) and (BankScreen or PinScreen);
      if (Result) then exit;
      Speed := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);
      ColFace := 7513036;
      ColGrey := 4995649;
      ColBlue := 4336690;
      ColHair := 2506053;
      if (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey, ColHair], [5, 5, 5, 5],
        ['ounter', 'se Co', 'anke', 'to B', 'Banker', 'nker'], 2, 2)) then
      begin
        Mouse(bx, by, 0, 0, False);
        if (WaitOptionMulti(['kly Co', 'se-qu', 'ank B', 'Bank Banker', 'ank', 'nker'], 750)) then
        begin
          t := (GetSystemTime + 5000);
          repeat
            if (BankScreen) or (PinScreen) then
            begin
              Result := true;
              Break;
            end;
            Wait(50);
          until(GetSystemTime > t);
          if (Length(Players) > 0) then
            if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
              InPin(Players[CurrentPlayer].Pin);
          Result := (BankScreen) or (PinScreen);
        end;
      end;
      ColorToleranceSpeed(Speed);
    end;


    procedure TeleToBank;
    var
      x, y, N: Integer;
    begin
      if (N > 3) then
        begin
          Exit;
        end;
      ClickNorth(SRL_Angle_High);
      AntiRandoms;
      begin
        repeat
        Inc(N);
        //if FindObjTPA(x, y, 6982558, 10, 2, 25, 20, w, ['mulet']) then
        if FindObjCustom(X, Y, ['mulet','et Gl','lory'], [7114144,6982558], 3) then
          GetMousePos(X, Y);
        Mouse(x, y, 0, 0, false);
        AntiRandoms;
        until ChooseOption('Rub') or (N > 5);
      end;
      if (N > 5) then
        begin
          Exit;
        end;
      FFlag(0);
      N:=0;
      repeat
      Inc(N);
      Wait(500);
      until FindNpcChatText('dgev', ClickLeft);
      Wait(4912 + Random(957));
      begin
        SPS_Setup(RUNESCAPE_SURFACE, ['10_6']);
        SPS_Continue := true;
        SPS_WalkPath([Point(4214, 2686)]);
        FFlag(0);
        Wait(2500 + Random(200));
        AntiRandoms;
        N:=0;
      end;
    end;


    Procedure OpenDoor;
    var
    x, y : integer;

    begin
      KeyUp(VK_F1);
      Wait(5500 + Random(200));
      begin
        repeat
        if FindObjCustom(X, Y, ['oor','Doo'], [4542809,3883076,9873837], 3) then
          GetMousePos(X, Y);
        Mouse(x, y, 10, 10, false);
        AntiRandoms;
        until ChooseOption('Open');
      end;
    end;


    function LightR(var fx, fy: Integer): Boolean;
    var
      arP, arAP: TPointArray;
      arC, arUC: TIntegerArray;
      ararP: T2DPointArray;
      tmpCTS, i, j, arL, arL2: Integer;
      P: TPoint;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.07, 0.13);

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

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

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 5.03) and (X <= 8.15) and (Y >= 4.72) and (Y <= 7.59) and (Z >= 2.55) and (Z <= 3.96) then
        begin
          for j := 0 to arL2 do
          begin
            if (arUC[i] = arC[j]) then
            begin
              SetLength(arAP, Length(arAP) + 1);
              arAP[High(arAP)] := arP[j];
            end;
          end;
        end;
      end;

      SortTPAFrom(arAP, Point(MSCX, MSCY));
      ararP := SplitTPAEx(arAP, 25, 25);
      arL := High(ararP);

      for i := 0 to arL do
      begin
        if (Length(ararP[i]) < 10) then Continue;
        P := MiddleTPA(ararP[i]);
        MMouse(P.x, P.y, 5, 5);
        Wait(100 + Random(100));
        if (IsUpText('Light')) 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.');
        Exit;
      end;

      GetMousePos(fx, fy);
    end;


    function LightL(var fx, fy: Integer): Boolean;
    var
      arP, arAP: TPointArray;
      arC, arUC: TIntegerArray;
      ararP: T2DPointArray;
      tmpCTS, i, j, arL, arL2: Integer;
      P: TPoint;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.09, 0.29);

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

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

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 3.86) and (X <= 6.76) and (Y >= 3.64) and (Y <= 6.33) and (Z >= 2.00) and (Z <= 3.37) then
        begin
          for j := 0 to arL2 do
          begin
            if (arUC[i] = arC[j]) then
            begin
              SetLength(arAP, Length(arAP) + 1);
              arAP[High(arAP)] := arP[j];
            end;
          end;
        end;
      end;

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

      for i := 0 to arL do
      begin
        if (Length(ararP[i]) < 10) then Continue;
        P := MiddleTPA(ararP[i]);
        MMouse(P.x, P.y, 5, 5);
        Wait(100 + Random(100));
        if (IsUpText('Light')) 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.');
        Exit;
      end;

      GetMousePos(fx, fy);
    end;


    function Sacrifice(var fx, fy: Integer): Boolean;
    var
      arP, arAP: TPointArray;
      arC, arUC: TIntegerArray;
      ararP: T2DPointArray;
      tmpCTS, i, j, arL, arL2: Integer;
      P: TPoint;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.10, 0.85);

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

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

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 32.95) and (X <= 67.77) and (Y >= 35.37) and (Y <= 75.71) and (Z >= 5.49) and (Z <= 11.77) then
        begin
          for j := 0 to arL2 do
          begin
            if (arUC[i] = arC[j]) then
            begin
              SetLength(arAP, Length(arAP) + 1);
              arAP[High(arAP)] := arP[j];
            end;
          end;
        end;
      end;

      SortTPAFrom(arAP, Point(MSCX, MSCY));
      ararP := SplitTPAEx(arAP, 5, 5);
      arL := High(ararP);

      for i := 0 to arL do
      begin
        if (Length(ararP[i]) < 10) then Continue;
        P := MiddleTPA(ararP[i]);
        MMouse(P.x, P.y, 5, 5);
        Wait(100 + Random(100));
        if (IsUpText('Use')) 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.');
        Exit;
      end;

      GetMousePos(fx, fy);
       begin
       ClickMouse2(False);
       end;
    end;


    procedure Useing;

    begin
    InvMouse(5, 2);
    if isuptext('Bury') then
    ChooseOption('Use');
      FFlag(0);
      Wait(600 + Random(250));
    [B]if Sacrifice then[/B]
      MouseBox(227, 405, 284, 435, 3);
    end;

    begin
      SetupSRL;
      //DeclarePlayers;
      OpenDoor;
      Wait(1500 + random(75));
     if LightR(x,y) then
      ClickMouse(x, y, 1);
      Wait(3000 + random(75));
     if LightL(x,y) then
      ClickMouse(x, y, 1);
      Wait(3000 + random(75));
      Useing;
      Wait(45000);
    end.

  2. #2
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Well
    if isuptext('Bury') then
    isuptext is supposed to be IsUpText
    Then maybe put it in parenthesis like you did with other ones
    (IsUpText('Use'))

    Your structuring is so wacky, make your code more friendly to read use tabnation

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
  •