Results 1 to 3 of 3

Thread: Canvas does not allow drawing.. Sometimes it does, sometimes it doesn't. BS.

  1. #1
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Canvas does not allow drawing.. Sometimes it does, sometimes it doesn't. BS.

    [Runtime Error] : Exception: Canvas does not allow drawing in line 405 in script

    SCAR Code:
    arC := GetColors(arP);

    Whole procedure
    SCAR Code:
    function ShieldColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      H, S, L: Extended;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 2329584, MSX1, MSY1, MSX2, MSY2, 17);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the shield color.');
        ColorToleranceSpeed(tmpCTS);
        Exit;
      end;

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

      for i := 0 to arL do
      begin
        ColorToHSL(arC[i], H, S, L);

        if (H >= 8.44) and (H <= 8.56) and (S >= 76.87) and (S <= 98.20) and (L >= 50.76) and (L <= 56.88) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 39.74) and (X <= 51.30) and (Y >= 32.50) and (Y <= 41.91) and (Z >= 5.60) and (Z <= 7.15) then
          begin
            Result := arC[i];
            Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the shield color.');
    end;




    Called using:
    SCAR Code:
    if FindColor(x,y,ShieldColor,MSX1, MSY1, MSX2, MSY2) then
      Mouse(x, y, 1, 1,true);

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

    Default

    No problems here. Did you select your client properly ?

  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Looks like a SCAR bug, if it stops there at least.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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
  •