kimi18 Posted April 11, 2012 Share Posted April 11, 2012 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 ) Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted April 12, 2012 Share Posted April 12, 2012 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] Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 (edited) 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 April 12, 2012 by kimi18 Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 try the new beta because i cant use the function too in the 331 and bevore i use functions like countcolor Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 "version divi (3.33.00)" Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 12, 2012 Share Posted April 12, 2012 "version divi (3.33.00)" Yes, this tutorial shows you how to get it: http://forums.scar-divi.com/showthread.php?505-Downloading-SCAR-Divi-Prerelease Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 Yes, this tutorial shows you how to get it: http://forums.scar-divi.com/showthread.php?505-Downloading-SCAR-Divi-Prerelease Yes, I use this verison Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 12, 2012 Share Posted April 12, 2012 That resolves your problem? Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 No Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 (edited) 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 April 12, 2012 by opiumhautopium1 Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 try this may be it solve your problem I tried, works well for some time, then runtime error (canvas dose not allow drawing), similarly the previous version Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 at the line from if FindColorCircleTolerance(xx, yy, 61179, x, y, i, 24)? then try if FindColorCircle(xx, yy, 61179, x, y, i) or in witch line is the problem? Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 Yes, that line in the wrong. I tried this: if FindColorCircle(xx, yy, 61179, x, y, i), but the same error. Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 what about if FindColor(xx, yy, 61179, skx1,sky1,skx2,sky2) i think it will not find the color but the first question is tdo you get the error ? Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 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) Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 i got the same problem but cince the alpha i can use the findcolorSPIRALtolerance without a problem that is not working is to use countcolor funtion they give you the needet glizi coordinates too ^^ Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 Sorry but I dont understand Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 try function color spiral tollerance..... Quote Link to comment Share on other sites More sharing options...
kimi18 Posted April 12, 2012 Author Share Posted April 12, 2012 okay, I'll try ---------- Post added at 07:19 PM ---------- Previous post was at 06:33 PM ---------- It seems that this is a good. Thank you very much! But I still don't know, what the problem with "FindColorCircle" Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 i think this function has a little bug may be ^^ ........ glad to hear that the other function work ^^ Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 12, 2012 Share Posted April 12, 2012 I've looked into it and I found a rather stupid bug in those functions, changing 1 letter fixed it. I'll upload a fixed copy of the beta soon. Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted April 12, 2012 Share Posted April 12, 2012 ;-P Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 13, 2012 Share Posted April 13, 2012 I've uploaded a new beta with a fix for the issue, please update your copy and try FindColorCircleTolerance again. Quote Link to comment Share on other sites More sharing options...