Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Sign in to follow this  
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

Share this post


Link to post
Share on other sites

After trying to use another script where I had mouse controls, it also doesnt work and the mouse is clicking in the same spot no matter what coords I provide.

Share this post


Link to post
Share on other sites

SCAR Divi 3.13 is outdated and no longer supported. It has a lot of bugs which were later resolved. Please update to the latest version 3.41. And use the edit button instead of double posting.

Share this post


Link to post
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.

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...