[Runtime Error] : Exception: Canvas does not allow drawing in line 21 in script
i am working on my first script and when i run it it get the error above
SCAR Code:
program autofighter;
{.include SRL/SRL.scar}
var
mcolor1,mcolor2,kills,nkills,x,y:integer;
procedure setup;
begin
mcolor1:=7239286;
mcolor2:=9344137;
nkills:=5;
end;
procedure fight;
begin
repeat
if FindColorSpiralTolerance(x, y, mcolor1, 1, 1,520,390,15) or FindColorSpiralTolerance(x, y, mcolor2, 1, 1,520,390,15) then
Mouse(x,y,3,3,false);
if FindColorSpiralTolerance(x, y, 65535, x+100, Y+100,x-100, Y-100,1) then
Mouse(x,y,3,3,true);
Kills:= kills + 1
sleep(5000);
until(kills=nkills)
end;
begin
setup;
fight;
end.
any ideas?