Janilabo

object color scan [RS07]

Apr 2nd, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.27 KB | None | 0 0
  1. {$DEFINE RS07}
  2. {$I MSSL\MSSL.scar}
  3.  
  4. var
  5.   obj: MSSL_TObjectData; // This type is used for storing information of our object
  6.              
  7. procedure ObjectSetupment;
  8. begin
  9.   obj := MSSL_ToObjectData([MSSL_ColorData(MSSL_ColorSettings(2, 0, 0.14, 0.46), 5796480, 6)], // Here you can have multiple color data styles (array of em), 5796480 is color and 6 is the tolerance.
  10.                            bm_Split, // This can be either bm_Split or bm_Group (means SCAR uses SplitTPA() OR TPAGroup() to break the TPA to ATPA
  11.                            10); // This here is the distance for breaking the TPA with SplitTPA() or TPAGroup(), play around with it ;)
  12. end;
  13.  
  14. procedure ScriptTerminate;
  15. begin
  16.   MSSL_Unsetup;
  17. end;  
  18.  
  19. var
  20.   bmp: TSCARBitmap;
  21.   ATPA: T2DPointArray;
  22.   h, i: Integer;              
  23.  
  24. begin
  25.   MSSL_Setup;
  26.   ObjectSetupment;
  27.   bmp := GetClient.Capture;    
  28.   if MSSL_FindObjectData(ATPA, obj, RS07_GameActionBx) then
  29.   begin        
  30.     h := High(ATPA);
  31.     WriteLn('Found ' + IntToStr(h + 1) + ' matching objects with settings!');  
  32.     for i := 0 to h do
  33.       bmp.SetPixels(MSSL_TPAFromBoxEdge(TPABounds(ATPA[i])), clRed);
  34.     SetLength(ATPA, 0);
  35.   end else
  36.     WriteLn('No matches found with settings...');  
  37.   DebugBitmap(bmp);
  38.   bmp.Free;
  39. end.
Advertisement
Add Comment
Please, Sign In to add comment