Jump to content
username9384

Canvas does not allow drawing, Trying to make SCAR Click on A Color

Recommended Posts

Hey Everyone,

 

Thanks for being here to help.

 

Using SCAR Divi 3.13

 

I'm trying to make a script that will search the screen for a color, and then click it. I know the color is always there no matter what. The color moves around the screen.

 

Here's what I have:

 

program Automage;
var c, i, x, y, w, h:integer;
begin
i :=  1;
c := 0;
findwindowtitlepart('game',false);
activateclient;
wait(700);
keydown(115);
GetClientDimensions(w, h);
while (i = 1) do
     begin
     while (c < 60) do
           begin
           findColor(x, y, 1638350, 0, 0, w - 1, h - 1);
           clickmouse(x, y, true);
           wait(1000);
           c := c + 1;
     end;
     wait(10000);
     c := 0;
end;

end.

 

After targeting the window, and hitting play, the mouse clicks but it keeps pointing at 1 location. At about 30, 50.

If I try changing the paramaters of findColor:

findColor(x, y, 1638350, 0, 0, w - 1, h - 1);

I get "Canvas does not allow drawing"

 

If I try using findColorCircle, I get the same error.

 

Thanks,

 

-username

Link to comment
Share on other sites

Sorry, I completely forgot that for some reason the script only worked inside virtual box. Well I ran it inside and it works perfect! :) (The mouse click ones always only worked inside virtualbox.)

 

But hey, last time I downloaded the newest SCAR I couldn't figure out how to make it press keys. That's why I reverted back to 3.13

 

 

I appreciate your devotion to helping SCAR users all these years Freddy! :)

 

This thread can be closed.

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...