Results 1 to 5 of 5

Thread: Error Messages

  1. #1
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Error Messages

    I have been getting 1 error message repeatedly, but I hasn't been causing any issues, but now I am getting another. I was getting a pop-up error message, "Couldn't Create Shared Memory!" But now i am getting Line 1: [Error] (1:1): Variable Expected in script C:\Users\admin\Desktop\SCAR pre-release\Scripts\Bad Boys Essense Miner and Water Rune Crafter.scar

    SCAR Code:
    program New;
      {.include SRL/SRL.scar}
      {.include SRL/SRL/Skill/RuneCrafting.scar}
     
    function MiddleATPAOrdered(ATPA:T2DPointArray):TpointArray;
    var
      TPointArray:TpointArray;
      I:integer;
    begin
      SetArrayLength(TPointArray, high(ATPA)+1)
      for i:=0 to high(ATPA) do
        TpointArray[i] := middleTPA(ATPA[i]);
      SortTPAFrom(TPointArray, Point(MSCX, MSCY))
      Result := TPointArray
    end;

    //Repeats the FindColorsTolerance Function a couple of times, combining the
    //Results, which then are used for the Portal Functions
    Function FindColorsToleranceRpt(var TPA:TPointArray; Color, X1, Y1, X2, Y2, Tol, Times:Integer):Boolean;
    var
      I:Integer;
      TPA2:TPointArray;
    begin
      For I := 1 to Times do
      begin
        FindColorsTolerance(TPA2, Color, X1, Y1, X2, Y2, Tol);
        TPA := CombineTPA(TPA, TPA2);
        Wait(25);
      end;
      If Length(TPA) < 0 then
        Result := False else
        Result := True
    end;

    Procedure FindStairs;
    var
      Tpoint:Tpoint;
      TPA:TPointArray;
    begin
      FindColorsTolerance(TPA, 799065, MMX1, MMY1, MMX2, MMY2, 10);
      TPoint := MMToMS(MiddleTPA(TPA));
      Mouse(Tpoint.x, TPoint.y, 5, 5, True);
      Flag;
      Wait(RandomRange(2000, 4000));
    end;
     
    Procedure WalkToAltar;
    var
      TPoint:Tpoint;
      TPA:TPointArray;
      ATPA:T2DPointArray;
    begin
      FindColorsTolerance(TPA, 2455929, MMX1, MMY1, MMX2, MMY2, 20);
      ATPA := SplitTPAEx(TPA, 15, 20);
      SortATPASize(ATPA, True);
      TPoint := MiddleTPA(ATPA[0]);
      Mouse(TPoint.x, TPoint.y+10, 5, 5, True);
      Flag;
    end;

    Procedure WalkFromAltar;
    var
      TPoint:Tpoint;
      TPA:TPointArray;
      ATPA:T2DPointArray;
    begin
      FindColorsTolerance(TPA, 2455929, MMX1, MMY1, MMX2, MMY2, 20);
      ATPA := TPAToATPAEx(TPA, 15, 20);
      TPoint := MiddleTPA(ATPA[0]);
      Mouse(TPoint.x+40, TPoint.y+20, 5, 5, True);
      Flag;
    end;

    Function FindAltar:TPoint;
    var
      I:Integer;
      TPA, TPA2:TPointArray;
      ATPA:T2DPointArray;
    begin
      FindColorsTolerance(TPA, 6448999, MSX1, MSY1, MSX2, MSY2, 10);
      FindColorsTolerance(TPA2, 6054241, MSX1, MSY1, MSX2, MSY2, 10);
      CombineTPA(TPA, TPA2);
      FindColorsTolerance(TPA2, 6380639, MSX1, MSY1, MSX2, MSY2, 10);
      CombineTPA(TPA, TPA2);
      ATPA := SplitTPAEx(TPA, 100, 80);
      TPA := MiddleATPAOrdered(ATPA);
      for I := 0 to High(TPA) do
      begin
        MMouse(TPA[i].x, TPA[i].y, 5, 5)
        if WaitUpText('ltar', 500) then
        begin
          GetMousePos(Result.x, Result.y);
          Exit;
        end;
      end;
    end;

    Procedure MakeRunes;
    var
      RunesCrafted:Integer;
      TPoint:Tpoint;
    begin
      Wait(RandomRange(1000, 2000));
      TPoint := ItemCoords(1);
      RunesCrafted := - GetAmount(Tpoint.x, Tpoint.y);
      TPoint := FindAltar;
      Mouse(Tpoint.x, TPoint.y, 0, 0, True);
      Wait(RandomRange(4000, 7000));
      TPoint := ItemCoords(1);
      IncEx(RunesCrafted, GetAmount(TPoint.x, TPoint.y));
      Writeln(IntToStr(RunesCrafted) + ' Water Runes Crafted');
    end;

    Procedure OpenDoors;
    var
      I:Integer;
      CCount:Array of Integer;
      TPA:TPointArray;
      TPoint:Tpoint;
    begin
      Setlength(CCount, 2);
      CCount[0] := CountColorTolerance(4024458, 313, 166, 333, 186, 20);
      CCount[1] := CountColorTolerance(4024458, 390, 15, 410, 35, 20);
      Writeln(IntToStr(CCount[0]));
      Writeln(IntToStr(CCount[1]));
      if CCount[0] >= 100 then
      begin
        Mouse(325, 175, 5, 5, True);
        Flag;
        Wait(RandomRange(1000, 1500));
        If CCount[1] >= 50 then
        begin
          Mouse(350, 25, 5, 5, true);
          Flag;
          Wait(RandomRange(1000, 1500));
        end;
      end else
      if not(CCount[0] >= 100) and (CCount[1] >= 50) then
      begin
        Mouse(390, 25, 5, 5, True);
        Flag;
        Wait(RandomRange(1000, 1500));
      end else
        Writeln('Doors all Open');
      FindSymbol(Tpoint.x+50, TPoint.y, 'water');
      Mouse(Tpoint.x, Tpoint.y, 5, 5, true);
      Flag;
    end;

    Function EnterAltar:Boolean;
    var
      I:Integer;
      TPoint:Tpoint;
      TPA, TPA2:TPointArray;
      ATPA:T2DPointArray;
    begin
      FindColorsTolerance(TPA, 6448999, MSX1, MSY1, MSX2, MSY2, 10);
      FindColorsTolerance(TPA2, 5396054, MSX1, MSY1, MSX2, MSY2, 10);
      CombineTPA(TPA, TPA2);
      FindColorsTolerance(TPA2, 14859551, MSX1, MSY1, MSX2, MSY2, 10);
      CombineTPA(TPA, TPA2);
      ATPA := SplitTPAEx(TPA, 50, 35);
      for I := 0 to High(TPA)-1 do
      begin
        TPoint := MiddleTPA(ATPA[i]);
        MMouse(TPoint.x, TPoint.y, 5, 5)
        if WaitUpText('ysterious', 1000) then
        begin
          GetMousePos(TPoint.x, Tpoint.y)
          Mouse(TPoint.x, TPoint.y, 0, 0, True);
          Result := True;
          Exit;
        end;
      end;
    end;

    Procedure ExitRCPortal;
    var
      TP:TPoint;
      TPA:TPointArray;
    begin
      FindColorsToleranceRpt(TPA, 11256517, MSX1, MSY1, MSX2, MSY2, 10, 5);
      WriteLn(IntToStr(Length(TPA)));
      TP := MiddleTPA(TPA);
      Mouse(TP.x, TP.y, 5, 5, True)
    end;

    Procedure ExitMinePortal;
    var
      TP:TPoint;
      TPA:TPointArray;
    begin
      FindColorsToleranceRpt(TPA, 12510948, MSX1, MSY1, MSX2, MSY2, 10, 5);
      WriteLn(IntToStr(Length(TPA)));
      TP := MiddleTPA(TPA);
      Mouse(TP.x, TP.y, 5, 5, True)
    end;

    begin
      SetupSRL;
      {EnterAltar;
      Wait(RandomRange(4000, 6000));
      WalkToAltar;
      MakeRunes;
      WalkFromAltar;
      ExitRCPortal;}

      FindStairs;
      OpenDoors;
    end.
    any solutions appreciated. Also, anyone know a good way to mine Essense, and anyone able to give me some help (MSN or Skype) on walking, it is the area I am weak in, and I would love some help.

  2. #2
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

  3. #3
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    FindSymbol(Tpoint.x+50, TPoint.y, 'water');

    Should be,

    SCAR Code:
    FindSymbol(Tpoint.x, TPoint.y, 'water');

    There was a similar tread like this.

  4. #4
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Try removing the

    program New;

    line.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  5. #5
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    SCAR Code:
    FindSymbol(Tpoint.x+50, TPoint.y, 'water');

    Should be,

    SCAR Code:
    FindSymbol(Tpoint.x, TPoint.y, 'water');

    There was a similar tread like this.
    I saw that thread, I just didn't think I would make that mistake...lol

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
  •