While trying to upgrade my script to work with SMART, I got the error..

[Runtime Error] : Exception: Canvas does not allow drawing in line 102 in script ...SCAR 3.15\includes\SRL/SRL/Core/Players.scar
It happens after SMART loads, right before it should start to log in.

Line 102 in Players.scar:
SCAR Code:
Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);

The script worked fine until I added the SMART stuff. That might be the problem?

Searching turned up nothing helpful.

Here is the script, hopefully it helps.

SCAR Code:
program AserPowerCutter;                   {Thanks to Camo Kyle for standards fix}
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/skill/woodcutting.scar}

const
 /////////////////////////////////////////////////////////////
 //                   GENERAL SETUP                         //
  TreeType = 'ree'; // Tree for now, might add other kinds later
  UseMiniMapMove = True; //Will try to move to another tree if it
                        //can't find any near
  WieldAxe = False;       //Are you weilding the axe? False for no
  LoadsToCut = 10;      //False if extra axe in first inventory slot
 //////////////////////////////////////////////////////////////
 //                  COLOR SETUP                             //
  TreeColor   = 3700329; // Color of the Tree you want to cut
  TreeColor2  = 2776404; //Another Color
  TreeColor3  = 3766379; //Another Color
  MiniMapTree = 78895; //Color of the tree on the mini map

var
  Colour: array [0..2] of integer;
  TreeNames: array [0..2] of string;
  LoadCounter, EntsFound, BackupUsed : Integer;

//////////////////////////////////////////////////////////////
//                       PLAYER SETUP                       //
procedure DeclarePlayers;
begin
  HowManyPlayers  := 1;
  NumberOfPlayers(HowManyPlayers);
  CurrentPlayer := 0;

  Players[0].Name :=''; //account name
  Players[0].Pass :=''; //account password
  Players[0].Nick :=''; //3-4 Letters of name
  Players[0].Active:=True; // Active true or false.

  {Players[1].Name :=''; //account name
  Players[1].Pass :=''; //account password
  Players[1].Nick :=''; //3-4 Letters of name
  Players[1].Active:=False; // Active true or false.
   }

end;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////................ END OF SETUP............////////////////////////
//////////////////////////////////////////////////////////////////////

procedure AntiBan;
begin
  if not LoggedIn then
    Exit;
  case (Random(100)) of
    0  : RandomRClick;
    5  : HoverSkill('Woodcutting', False);
    10 : BoredHuman;
    15 : RandomMovement;
    20 : GameTab(Random(15));
    ///////ADD MORE///////////
  end;
end;

procedure AntiRandoms;
{var
  x, y : Integer; }

begin
  if not LoggedIn then
    Exit;
  FindNormalRandoms;
  if FindFight then
    RunAway('N', True, 1, 5000);
  {if FindEnt(x, y, True) then
  Inc(EntsFound); }

end;

procedure Login;
begin
  if not LoggedIn then
  begin
    LoginPlayer;
    Wait(1000+random(1000));
    MakeCompass('N');
    Wait(500+random(1000));
    FindAxe;
  end;

  {if not EquipAxe then
  begin
    WriteLn('No axe was found switching players and setting this one as inactive');
    NextPlayer(False);;
  end;}

end;

procedure LevelCheck;
var
  WCLvL, WcLvlMod : Integer;
begin
  WcLvl:=GetSkillInfo('Woodcutting', False);
  Wait(1000 + Random(2000));
  case WcLvl of
    0..14  : WcLvlMod:= 1;
    15..29 : WcLvlMod:=2;
    30..59 : WcLvlMod:=3;
  end;
  case WcLvlMod of
    1 : begin
          TreeNames[0]:= 'ree';
          TreeNames[1]:= '';
          TreeNames[2]:= '';
        end;
    2 : begin
          TreeNames[0]:= 'ree';
          TreeNames[1]:= 'ak';
          TreeNames[2]:= '';
        end;
    3 : begin
          TreeNames[0]:= 'ree';
          TreeNames[1]:= 'ak';
          TreeNames[2]:= 'illo';
        end;
  end;
end;

procedure MiniMapMove;
var
  x, y : Integer;
begin
  if (not LoggedIn) or InvFull then
    Exit;
  if (UseMiniMapMove = True) then
  begin
    if (FindColorSpiral(x, y, MiniMapTree, MMX1, MMY1, MMX2, MMY2)) then
    begin
      AntiRandoms;
      AntiBan;
      Wait(100 + Random(100));
      Mouse(x, y, 3, 3, True);
      Flag;
    end;
  end;
end;

{procedure BackupCutter;
var
  i, x ,y, BackupFail, Waits : Integer;
  BackupFind  : Boolean;
begin
  if not LoggedIn or InvFull then
    Exit;
  for i:=0 to 2 do
  if FindColorSpiral(x, y, Colour[i], MSX1, MSY1, MSX2, MSY2) then
  begin
    AntiRandoms;
    AntiBan;
    Wait(200 + Random(250));
    Mouse(x, y, 3, 3, True);
    repeat
        Wait(random(500));
        Inc(Waits);
    until (not(IsUpText(TreeNames[0]) or IsUpText(TreeNames[1]) or IsUpText(TreeNames[2]))) or InvFull or (Waits > 20);
    BackupFind:= True;
    Exit;
  end;
  if not (BackupFind = True) then
    Inc(BackupFail);
  if (BackupFail > 2) then
  begin
    WriteLn('BackupFind failed moving if preferences allow');
    MiniMapMove;
  end;
end;}


procedure FindAndCutTree;
var
  i, x, y, MissFind, Waits  : Integer;
  Find : Boolean;
begin
  if not LoggedIn or InvFull then
    Exit;
  Login;
  Colour[0]:= TreeColor;
  Colour[1]:= TreeColor2;
  Colour[2]:= TreeColor3;
  for i:=0 to 2 do
  begin
    if FindObjCustom(x, y, [TreeNames[0], TreeNames[1], TreeNames[2]], [Colour[i]], 5) then
    begin
      Wait(100 + Random(100));
      if IsUpText('hop') then
      Mouse(x, y, 2, 2, True);
      Flag;
      AntiBan;
      AntiRandoms;
      repeat
        Wait(Random(500));
        Inc(Waits);
      until (not(IsUpText(TreeNames[0]) or IsUpText(TreeNames[1]) or IsUpText(TreeNames[2]))) or InvFull or (Waits > 20);
      Find:= True;
    end;
    if not Find then
      begin
        Inc(MissFind);
        WriteLn('Missed FindObjCustom Find ' + IntToStr(MissFind) + ' times.');
      end;
    if (MissFind > 2) then
    begin
      MiniMapMove;
      Inc(BackupUsed);
    end;
  end;
end;

procedure Drops;
var
  i : Integer;
begin
  if not LoggedIn then
    Exit;
  if InvFull then
  begin
    case WieldAxe of
      False : begin
                for i:=2 to 28 do
                DropItem(i);
                AntiRandoms;
              end;
      True  : DropAll;
    end;
  Inc(LoadCounter);
  if (LoadCounter + 1 > LoadsToCut) then
    NextPlayer(True);
  end;
end;

procedure ProgressReport;
begin
  Wait(1000 + Random(250));
  ClearDebug;
  WriteLn('--------------------------');
  WriteLn('      Aser"s Woodcutter   ');
  WriteLn(IntToStr(LoadCounter) + ' loads were dropped.');
  WriteLn(IntToStr(EntsFound) + ' Ents were encountered.');
  WriteLn('Backup was used ' + IntToStr(BackupUsed) + ' time(s).');
  WriteLn('---------------------------');
end;

begin
  SMARTSetUpEX(55, False, True, False);
  SetTargetDC(SMARTGetDC);
  SetupSRL;
  SetupWoodcutting;
  DeclarePlayers;
  repeat
    Login;
    LevelCheck;
    FindAndCutTree;
    Wait(1000 + Random(250));
    Drops;
    ProgressReport;
  until (AllPlayersInactive);
end.


{Progs

--------------------------
      Aser"s Woodcutter
3 loads were dropped.
0 Ents were encountered.
Backup was used 9 time(s).
---------------------------
Successfully executed }


{--------------------------
      Aser"s Woodcutter
10 loads were dropped.
0 Ents were encountered.
Backup was used 3 time(s).
---------------------------}