Doom989 Posted January 4, 2014 Share Posted January 4, 2014 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. Quote Link to comment Share on other sites More sharing options...
slacky Posted January 4, 2014 Share Posted January 4, 2014 (edited) 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 January 4, 2014 by slacky Quote Link to comment Share on other sites More sharing options...
Doom989 Posted January 4, 2014 Author Share Posted January 4, 2014 (edited) 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 January 4, 2014 by Doom989 Error Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 4, 2014 Share Posted January 4, 2014 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?). Quote Link to comment Share on other sites More sharing options...
Doom989 Posted January 4, 2014 Author Share Posted January 4, 2014 Doh! It always seems to be the most obvious things with me. I was even reading the changelog and still neglected to update. Thanks man ;p Quote Link to comment Share on other sites More sharing options...