Jump to content
kimi18

FindColorCircleTolerance ------> Canvas does allow drawing ????

Recommended Posts

Hello

 

Please help me :(.

 

This is my script.

 

program New;

var i,x,y,xx,yy,mmx1,mmy1,mmx2,mmy2:integer;

var bool:boolean;

begin

writeln('start');

mmx1:=286;

mmy1:=286;

mmx2:=376;

mmy2:=376;

i:=1;

bool:=false;

 

if (Findcolortolerance(x,y,65280,mmx1,mmy1,mmx2,mmy2,5)=true)then begin

writeln('A zöld megvan');

repeat

i:=i+1;

writeln(i);

if (FindColorCircleTolerance(xx, yy, 64239, x, y, i, 20) = true) then begin

writeln('A sárga megvan');

writeln(i);

bool:=true;

end;

until bool or (i>14);

end;

 

writeln('finish');

end.

 

I want search 1 color with "Findcolortolerance", this is works well, after this, i want search 1 new color with "FindColorCircleTolerance", but this dont works, scar write:"Canvas does allow drawing", it has a problem with "FindColorCircleTolerance", but why? Sometimes works well with the whole, but sometime not works well with the whole.

(sorry my bed english :) )

Link to comment
Share on other sites

The only place i could see where its throwing that error would be that maybe the radius is going off the clients canvas? That should not cause that problem. Please report bug in the mantis bug tracker. Also formatting makes everything easier to read.

[scar]

program New;

 

var i,x,y,xx,yy:integer;

var bool:boolean;

 

Const

mmx1:=286;

mmy1:=286;

mmx2:=376;

mmy2:=376;

 

begin

writeln('start');

i := 1;

bool:=false;

if Findcolortolerance(x,y,65280,mmx1,mmy1,mmx2,mmy2, 5)then

begin

writeln('A zöld megvan');

repeat

Inc(I);

writeln(i);

Bool := FindColorCircleTolerance(xx, yy, 64239, x, y, i, 20);

if Bool then

begin

writeln('A sárga megvan');

writeln(i);

end;

until bool or (i>14);

end;

 

writeln('finish');

end.

[/scar]

Link to comment
Share on other sites

map.jpg

 

So I dont know what are you think :(.

I attach the full script, not I write this script, but I want use :), but dont work, only sometimes. It is work, and suddenly write: "Runtime error - 444line - Canvas does not allow drawing". I use this script to Seafight online game. The script search in mini map yellow points, and go there with ship (I use the "FindColorCircleTolerance" to this yellow points).

gliter(5).scar

Edited by kimi18
Link to comment
Share on other sites

i look in your script and found

repeat
i:=i+1;
until FindColorCircleTolerance(xx, yy, 61179, x, y, i, 24) or (i>10);
end;

that is not the way to do what u want

because it only add i to 10 .... and your result never become true in this time

try something like

 

repeat
inc(i);                                            // =add i +1
if FindColorCircleTolerance(xx, yy, 61179, x, y, i, 24)
begin
  mouse(xx,yy);
  wait(3000);
  i:= 136768;
end;
wait(10);                                    // wait a little before next round
until i>10

try this may be it solve your problem

Edited by opiumhautopium1
Link to comment
Share on other sites

If I use FindColor or Findcolortolerance the script work well without runtime error, but if I use the FindColorCircle dont work well. And I've seen this problem on others on this board (other script, but the same error, run time error when the script use FindColorCircle function, this is the other script: http://forums.scar-divi.com/showthread.php?566-Release-Ice-floe/page10)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...