Jump to content
Doom989

Detecting movement

Recommended Posts

I was wondering if scar was capable of detecting if movement had stopped?

 

For example imagine a ball bouncing and slowly slowing down to stop. Could scar detect when there was no longer any movement? If so could I have an example or a point in the right direction?

 

Thank you for your time.

Link to comment
Share on other sites

SCAR alone does not have anything like that but many includes found for SCAR has such features.

 

RML (something I made a month ago) has the feature you are asking for:

> function RS_IsAnimating(Area:TBox; MinPixelError:Integer): Boolean;

Or the more advanced:

> function RS_GetAvgPixError(Area:TBox; MaxTime, WTime:Integer; Percent:Boolean): Integer;

 

Both functions are calculating very fast, as they use a function in SCARExt (dll by me) to calculate the pixelerror/pixelshift.

 

-> Just add RML to your "SCAR Divi/Includes/"-folder

RML.rar - Speedy Share - upload your files here

 

usage:

program New;
{$include RML/RML.scar}

begin
 SetupRML;      

 //Simple version (area to check | how many pixels must have changed?)
 if RS_IsAnimating(Box(0,0,500,500), 800) then    
 begin
   WriteLn('The area (0,0,500,500) of client is animating');
 end; 

 //Advanced version (area to check | max-time | interval | as_percent)
 if (RS_GetAvgPixError(Box(0,0,500,500), 600, 50, True) < 3) then   // Less then 3% change = no movement?  
 begin
   WriteLn('The area (0,0,500,500) of client is NOT animating');
 end;

 FreeRML;
end.

Both functions are general pourpose, so even tho the library is made for RuneScape(07), much of the functionality is general pourpose.

Edited by slacky
Link to comment
Share on other sites

SCAR alone does not have anything like that but many includes found for SCAR has such features.

 

RML (something I made a month ago) has the feature you are asking for:

> function RS_IsAnimating(Area:TBox; MinPixelError:Integer): Boolean;

Or the more advanced:

> function RS_GetAvgPixError(Area:TBox; MaxTime, WTime:Integer; Percent:Boolean): Integer;

 

Both functions are calculating very fast, as they use a function in SCARExt (dll by me) to calculate the pixelerror/pixelshift.

 

-> Just add RML to your "SCAR Divi/Includes/"-folder

RML.rar - Speedy Share - upload your files here

 

usage:

program New;
{$include RML/RML.scar}

begin
 SetupRML;      

 //Simple version (area to check | how many pixels must have changed?)
 if RS_IsAnimating(Box(0,0,500,500), 800) then    
 begin
   WriteLn('The area (0,0,500,500) of client is animating');
 end; 

 //Advanced version (area to check | max-time | interval | as_percent)
 if (RS_GetAvgPixError(Box(0,0,500,500), 600, 50, True) < 3) then   // Less then 3% change = no movement?  
 begin
   WriteLn('The area (0,0,500,500) of client is NOT animating');
 end;

 FreeRML;
end.

Both functions are general pourpose, so even tho the library is made for RuneScape(07), much of the functionality is general pourpose.

 

Well damn my good sir, this is exactly what I was hoping to see! thank you very much! This will be extremely helpful to me!

 

 

I'm getting an error and not sure what to do about it, after i added this into my script and hit compile its popping up SCARxt.scar, with 'Compile error, line 106, unknown identifier 'SetPixelsEx''

Edited by Doom989
Error
Link to comment
Share on other sites

Well damn my good sir, this is exactly what I was hoping to see! thank you very much! This will be extremely helpful to me!

 

 

I'm getting an error and not sure what to do about it, after i added this into my script and hit compile its popping up SCARxt.scar, with 'Compile error, line 106, unknown identifier 'SetPixelsEx''

Your SCAR Divi is out of date - SetPixelsEx was added to version 3.39 (..or 3.40?).
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...