Jump to content
FHannes

SCAR Divi 3.35 Final

Recommended Posts

The final version of SCAR Divi 3.35 has been released. This version is one of the largest updates as of yet, with numerous changes and some major overhauling of large segments of the scripting API.

 

Downloads: http://www.scar-divi.com/index.php?page=download

 

Changelog:

Bugfixes:
- The study modifier wasn't implemented correctly in the preg functions
- Picture to string tool sometimes shrunk a pasted bitmap
- Internal issue with the preprocessor
- "Update bitmaps" didn't show the script as modified when bitmaps were updated

New:
- function BoxToStr(const Box: TBox): string;
- RESOURCE_MANAGEMENT preprocessor option (can only disable resourcemanagement for TSCARObject subclasses)
- TSCARClient = class(TSCARObject);
- TSCARWindowClient = class(TSCARClient);
- function GetClient: TSCARClient;
- function SetClient(const Client: TSCARClient): TSCARClient;
- procedure KeyDown(const Key: Char);
- procedure KeyUp(const Key: Char);
- procedure MoveMouseExpert(const X, Y, Gravity, Wind, MinWait, MaxWait, MaxStep, TargetArea: Extended);
- procedure MoveMouseEx(const X, Y, RX, RY, MouseSpeed: Integer);
- procedure MoveMouse(const X, Y: Integer); {MouseSpeed = 25}
- procedure ClickMouseEx(const X, Y: Integer; const Btn: TMouseButton; const Interval: Integer);
- procedure MoveMouseBox(const Box: TBox);
- procedure MoveMouseBoxEx(const Box: TBox; const MouseSpeed: Integer);
- procedure PressVKey(const VKey: Byte);
- procedure PressVKeyEx(const VKey: Byte; const Interval: Integer);
- procedure PressKey(const Key: Char);
- procedure PressKeyEx(const Key: Char; const Interval: Integer);
- procedure TypeTextEx(const Str: string; const UseNumpad, UseDelays: Boolean);
- procedure TypeText(const Str: string);
- VK_XBUTTON1, VK_XBUTTON2, VK_CAPITAL, VK_KANA, VK_HANGUL, VK_JUNJA, VK_FINAL, VK_HANJA, VK_KANJI, VK_CONVERT
- VK_NONCONVERT, VK_ACCEPT, VK_MODECHANGE, VK_LWIN, VK_RWIN, VK_APPS, VK_SLEEP, VK_NUMPAD0-VK_NUMPAD9
- VK_F13-VK_F24, VK_NUMLOCK, VK_SCROLL, VK_LSHIFT, VK_RSHIFT, VK_LCONTROL, VK_RCONTROL, VK_LMENU, VK_RMENU
- VK_BROWSER_BACK, VK_BROWSER_FORWARD, VK_BROWSER_REFRESH, VK_BROWSER_STOP, VK_BROWSER_SEARCH, VK_BROWSER_FAVORITES
- VK_BROWSER_HOME, VK_VOLUME_MUTE, VK_VOLUME_DOWN, VK_VOLUME_UP, VK_MEDIA_NEXT_TRACK, VK_MEDIA_PREV_TRACK
- VK_MEDIA_STOP, VK_MEDIA_PLAY_PAUSE, VK_LAUNCH_MAIL, VK_LAUNCH_MEDIA_SELECT, VK_LAUNCH_APP1, VK_LAUNCH_APP2
- function GetKeyState(const VKey: Byte): Boolean;
- function GetCurrentKeyState(const VKey: Byte): Boolean;
- function GetToggleKeyState(const VKey: Byte): Boolean;
- function FindColors(out X, Y: Integer; const Colors: TIntArray; const XS, YS, XE, YE: Integer): Boolean;
- function FindColorsTol(out X, Y: Integer; const Colors: TIntArray; const XS, YS, XE, YE, Tol: Integer): Boolean;
- function FindColorsEx(out Points: TPointArray; const Colors: TIntArray; const XS, YS, XE, YE: Integer): Boolean;
- function FindColorsTolEx(out Points: TPointArray; const Colors: TIntArray; const XS, YS, XE, YE, Tol: Integer): Boolean;
- function FindColorsSpiral(const SX, SY: Integer; out X, Y: Integer; const Colors: TIntArray; const XS, YS, XE, YE: Integer): Boolean;
- function FindColorsSpiralTol(const SX, SY: Integer; out X, Y: Integer; const Colors: TIntArray; const XS, YS, XE, YE, Tol: Integer): Boolean;
- function FindColorsSpiralEx(const SX, SY: Integer; out Points: TPointArray; const Colors: TIntArray; const XS, YS, XE, YE: Integer): Boolean;
- function FindColorsSpiralTolEx(const SX, SY: Integer; out Points: TPointArray; const Colors: TIntArray; const XS, YS, XE, YE, Tol: Integer): Boolean;
- function CountColors(const Colors: TIntArray; const XS, YS, XE, YE: Integer): Integer;
- function CountColorsTol(const Colors: TIntArray; const XS, YS, XE, YE, Tol: Integer): Integer;
- TSCARBitmap = class(TSCARObject);
- procedure FloodFill(const Bmp: TSCARBitmap; const X, Y, Color: Integer);
- procedure FloodFillTol(const Bmp: TSCARBitmap; const X, Y, Color, Tol: Integer);
- function FloodFillEx(const Bmp: TSCARBitmap; const X, Y: Integer): TPointArray;
- function FloodFillTolEx(const Bmp: TSCARBitmap; const X, Y, Tol: Integer): TPointArray;
- procedure TPAFilterTriangle(var TPA: TPointArray; const X1, Y1, X2, Y2, X3, Y3: Integer);
- procedure TPAExtractTriangle(var TPA: TPointArray; const X1, Y1, X2, Y2, X3, Y3: Integer);
- function TPAFromCircle(const Center: TPoint; const Radius: Integer): TPointArray;
- function TPAFromTriangle(const X1, Y1, X2, Y2, X3, Y3: Integer): TPointArray;
- function FindColorTPA(out X, Y: Integer; const Color: Integer; const TPA: TPointArray): Boolean;
- function FindColorTPATol(out X, Y: Integer; const Color: Integer; const TPA: TPointArray; const Tol: Integer): Boolean;
- function FindColorTPAEx(out Points: TPointArray; const Color: Integer; const TPA: TPointArray): Boolean;
- function FindColorTPATolEx(out Points: TPointArray; const Color: Integer; const TPA: TPointArray; const Tol: Integer): Boolean;
- function GetMouseBtnState(const Btn: TMouseButton): Boolean;
- function GetDesktopWindow: Hwnd;
- function GetShellWindow: Hwnd;
- function FindWindows(const Title: string): THwndArray;
- function FindWindowsEx(const ParentWnd: Hwnd; const Title, ClassName: string; const RecursiveSearch, CaseSensitive, PartialMatch: Boolean): THwndArray;
- function FindWindowsPreg(const ParentWnd: Hwnd; const TitlePattern, ClassNamePattern: string; const RecursiveSearch: Boolean): THwndArray;
- function GetParentWindow(const Wnd: Hwnd): Hwnd;
- function WrapText(const Str: string; const MaxColumnSize: Integer): string;
- function GetWindowBoxEx(const Wnd: Hwnd; const ClientArea: Boolean): TBox;
- function GetWindowBox(const Wnd: Hwnd): TBox;
- function GetWindowText(const Wnd: Hwnd): string;
- function GetWindowClass(const Wnd: Hwnd): string;
- procedure GetBoxSize(const Box: TBox; out Width, Height: Integer);
- procedure SetWindowText(const Wnd: Hwnd; const Text: string);
- function GetOuterWindow(const Wnd: Hwnd): Hwnd;
- function IsWindowTopMost(const Wnd: Hwnd): Boolean;
- function IsWindowValid(const Wnd: Hwnd): Boolean;
- function FindWindowsBySize(const ParentWnd: Hwnd; const Width, Height: Integer; const RecursiveSearch: Boolean): THwndArray;
- procedure SetWindowBox(const Wnd: Hwnd; const Box: TBox);
- procedure GetWindowSizeEx(const Wnd: Hwnd; out Width, Height: Integer; const ClientArea: Boolean);
- procedure GetWindowSize(const Wnd: Hwnd; out Width, Height: Integer);
- procedure SetWindowSize(const Wnd: Hwnd; const Width, Height: Integer);
- procedure ActivateWindow(const Wnd: Hwnd);
- TSCARBitmapClient = class(TSCARClient)
- function WrapTextEx(const Str, BreakStr, BreakChars: string; MaxColumnSize: Integer): string;
- TCharArray = array of Char;
- T2DCharArray = array of TCharArray;
- Target Client panel
- Added support for type 2 Simba library architecture (function exports only)
- New library architecture
- TSCARLibraryClient = class(TSCARClient);

Tweaks:
- procedure MouseBtnDown(const X, Y: Integer; const Btn: TMouseButton);
- procedure MouseBtnUp(const X, Y: Integer; const Btn: TMouseButton);
- procedure ClickMouse(const X, Y: Integer; const Btn: TMouseButton);
- Renamed:
    * FindBitmapIn -> FindBitmap
    * FindBitmapToleranceIn -> FindBitmapTol
    * HoldMouse -> MouseBtnDown
    * ReleaseMouse -> MouseBtnUp
    * KeyDown -> VKeyDown
    * KeyUp -> VKeyUp
    * GetKeyCode -> CharToVKey
    * MoveMouse -> SetMousePos
    * FindColorTolerance -> FindColorTol
    * FindColors -> FindColorEx
    * FindColorsTolerance -> FindColorTolEx
    * FindColorSpiralTolerance -> FindColorSpiralTol
    * FindColorsSpiralTolerance -> FindColorSpiralTolEx
    * FindColorsSpiral -> FindColorSpiralEx
    * CountColorTolerance -> CountColorTol
    * BitmapFromString -> BmpFromStrLegacy
    * MakeWindowTransparent -> SetWindowTransp
    * SetOnTop -> SetWindowTopMost
    * FastReplaceColor -> ReplaceColor
    * FastReplaceColorTolerance -> ReplaceColorTol
    * FindBitmaps -> FindBitmapEx
    * FindBitmapsTolerance -> FindBitmapTolEx
    * CountBitmapTolerance -> CountBitmapTol
    * TBooleanArray -> TBoolArray
    * T2DBooleanArray -> T2DBoolArray
    * T2DExtendedArray -> T2DExtArray
    * T2DStringArray -> T2DStrArray
- Performance tweak for GetCursorType
- function FindColorSpiral(const SX, SY: Integer; out X, Y: Integer; const Color, XS, YS, XE, YE: Integer): Boolean;
- function FindColorSpiralTol(const SX, SY: Integer; out X, Y: Integer; const Color, XS, YS, XE, YE, Tol: Integer): Boolean;
- function FindBitmap(out X, Y: Integer; const Bmp: TSCARBitmap; const XS, YS, XE, YE: Integer): Boolean;
- function FindBitmapTol(out X, Y: Integer; const Bmp: TSCARBitmap; const XS, YS, XE, YE, Tol: Integer): Boolean;
- procedure DebugBitmap(const Bmp: TSCARBitmap);
- procedure SafeDrawBitmap(const Source: TSCARBitmap; const Dest: TCanvas; const X, Y: Integer);
- function FindDeformedBitmapToleranceRotationIn(const Bmp: TSCARBitmap; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; var accuracy: Extended; AngleIntervals: Extended; StartAngle, MaxAngle: Extended; var angle: Extended): Boolean;
- function FindDeformedBitmapToleranceIn(const Bmp: TSCARBitmap; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; var accuracy: Extended): Boolean;
- function FindBitmapRotated(const Bmp: TSCARBitmap; var x, y, Angle: Integer; x1, y1, x2, y2: Integer): Boolean;
- function FindBitmapSpiral(const Bmp: TSCARBitmap; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
- function FindBitmapSpiralTolerance(const Bmp: TSCARBitmap; var x, y: Integer; x1, y1, x2, y2: Integer; Tolerance: Integer): Boolean;
- function CreateBitmapMaskFromText(Text: AnsiString; Chars: Integer): TSCARBitmap;
- function CreateBitmapFromText(Text: AnsiString; Chars: Integer; TextColor: Integer): TSCARBitmap;
- function FindBitmapMaskTolerance(const Mask: TSCARBitmap; var x, y: Integer; x1, y1, x2, y2: Integer; Tolerance, ContourTolerance: Integer): Boolean;
- procedure ReplaceColor(const Bmp: TSCARBitmap; const Color, NewColor: Integer);
- procedure ReplaceColorTol(const Bmp: TSCARBitmap; const Color, NewColor, Tol: Integer);
- function FindBitmapEx(out Points: TPointArray; const Bmp: TSCARBitmap; const XS, YS, XE, YE: Integer): Boolean;
- function FindBitmapTolEx(out Points: TPointArray; const Bmp: TSCARBitmap; const XS, YS, XE, YE, Tol: Integer): Boolean;
- function SimilarBitmaps(const Bmp1, Bmp2: TSCARBitmap; const Tol: Integer): Boolean;
- function SimilarBitmapsEx(const Bmp1, Bmp2: TSCARBitmap; const Tol: Integer; out Diff: TPointArray): Boolean;
- function CountBitmap(const Bmp: TSCARBitmap; const XS, YS, XE, YE, Tol: Integer): Integer;
- function CountBitmapTol(const Bmp: TSCARBitmap; const XS, YS, XE, YE, Tol: Integer): Integer;
- SaveScreenshot(Ex) now changes the file extension of teh path to bmp or png depending on the options

Removed:
- procedure ClearDebugLine(const Line: Integer);
- procedure DeleteDebugLine(const Line: Integer);
- function GetDebugLineCount: Integer;
- function GetDebugLine(const Line: Integer): AnsiString;
- procedure ReplaceDebugLine(const Line: Integer; const Str: AnsiString);
- function GetDebugText: AnsiString;
- procedure GetClientDimensions(out Width, Height: Integer);
- function GetClientWindowHandle: Hwnd;
- procedure SetClientWindowHandle(const H: Hwnd);
- function GetTargetDC: HDC;
- procedure SetTargetDC(const DC: HDC);
- procedure ResetDC;
- procedure SetDesktopAsClient;
- procedure ClickMouseMid(x, y: Integer);
- procedure HoldMouseMid(x, y: Integer);
- procedure ReleaseMouseMid(x, y: Integer);
- function FindBitmap(Bitmap: Integer; var x, y: Integer): Boolean;
- function FindBitmapTolerance(Bitmap: Integer; var x, y: Integer; Tolerance: Integer): Boolean;
- procedure SendKeysVB(const Str: AnsiString; const Wait: Boolean);
- procedure SendArrow(const Key: Byte);
- procedure SendArrowWait(const Key: Byte; const WaitTime: Integer);
- procedure MoveMouseCC(x, y, range, segments, pcount, delay: Integer);
- procedure MoveMouseSmoothFrom(x1, y1, x2, y2: Integer);
- procedure MoveMouseSmoothFromEx(x1, y1, x2, y2: Integer; minsleeptime, maxsleeptime, maxdistance, gravity, forces: Integer);
- procedure MoveMouseSmoothEx(const X, Y, MinSleepTime, MaxSleepTime, MaxDistance, Gravity, Forces: Integer);
- procedure MoveMouseSmooth(const X, Y: Integer);
- procedure ClickWindMouse(X, Y, rx, ry: Integer; Btn: TMouseButton);
- procedure ClickMouseBox(x1, y1, x2, y2: Integer; Btn: TMouseButton);
- procedure MouseBox(x1, y1, x2, y2: Integer);
- procedure SendKeys(const Str: AnsiString);
- procedure TypeKeys(const Str: AnsiString);
- procedure SendKeysWait(const Str: AnsiString; const WaitTime, RndTime: Integer);
- function IsNumpadEnabled: Boolean;
- function IsCapsLockEnabled: Boolean;
- function IsArrowDown(const Num: Byte): Boolean;
- function IsNumpadKeyDown(const Key: Byte): Boolean;
- TMusic
- function CreateMusicPlayer: TMusic;
- function FreeMusicPlayer(const Player: TMusic): Boolean;
- function FindColorSpiral2(var X, Y: Integer; const Color, XS, YS, XE, YE: Integer): Boolean;
- function GetBitmapDC(const Bmp: Integer): HDC;
- function BitmapAssigned(const iBmp: Integer): Boolean;
- function CreateBitmap(const Width, Height, Color: Integer): Integer;
- procedure GetBitmapSize(const Bmp: Integer; out Width, Height: Integer);
- function BitmapToString(Bmp: Integer): AnsiString;
- function FindTransparentBitmap(Bitmap: Integer; var x, y: Integer; TranspCol, xs, ys, xe, ye: Integer): Boolean;
- function FindTransparentBitmapTolerance(Bitmap: Integer; var x, y: Integer; TranspCol, xs, ys, xe, ye, Tol: Integer): Boolean;
- function FreeBitmap(const Bmp: Integer): Boolean;
- function CreateMirroredBitmap(const Bmp: Integer): Integer;
- function ResizeBitmap(const Bmp, Width, Height: Integer): Integer;
- function FindColorCircle(out X, Y: Integer; const Color, CX, CY, R: Integer): Boolean;
- function FindColorCircleTolerance(out X, Y: Integer; const Color, CX, CY, R, Tol: Integer): Boolean;
- function FindColorTriangle(out X, Y: Integer; const Color, X1, Y1, X2, Y2, X3, Y3: Integer): Boolean;
- function FindColorTriangleTolerance(out X, Y: Integer; const Color, X1, Y1, X2, Y2, X3, Y3, Tol: Integer): Boolean;
- function FindColorSkipCoords(out X, Y: Integer; const Color, XS, YS, XE, YE: Integer; const TPA: TPointArray): Boolean;
- function FindColorSkipCoordsTolerance(out X, Y: Integer; const Color, XS, YS, XE, YE, Tol: Integer; const TPA: TPointArray): Boolean;
- function FindColorSkipBox(out X, Y: Integer; const Color, XS, YS, XE, YE: Integer; const Box: TBox): Boolean;
- function FindColorSkipBoxTolerance(out X, Y: Integer; const Color, XS, YS, XE, YE, Tol: Integer; const Box: TBox): Boolean;
- function FindColorSkipBoxArray(out X, Y: Integer; const Color, XS, YS, XE, YE: Integer; const TBA: TBoxArray): Boolean;
- function FindColorSkipBoxArrayTolerance(out X, Y: Integer; const Color, XS, YS, XE, YE, Tol: Integer; const TBA: TBoxArray): Boolean;
- function IsMouseButtonDown(LeftButton: Boolean): Boolean;
- function IsFunctionKeyDown(Key: Byte): Boolean;
- function IsFKeyDown(Num: Byte): Boolean;
- function IsKeyDown(C: Char): Boolean;
- function GetBitmapCanvas(bitmap: Integer): TCanvas;
- function LoadBitmap(path: AnsiString): Integer;
- procedure SaveBitmap(bitmap: Integer; path: AnsiString);
- function GetBitmapCanvas(bitmap: Integer): TCanvas;
- function RegexPos(const Subject, Pattern: AnsiString): Integer;
- function FindRegex(const Subject, Pattern: AnsiString): AnsiString;
- function ReplaceRegex(const Subject, Pattern, Replacement: AnsiString): AnsiString;
- function FindWindowTitlePart(Title: AnsiString; CaseSensitive: Boolean): Boolean;
- function TBitmapFromBmp(Bitmap: TBitmap; Bmp: Integer): Boolean;
- function GetBitmapAreaColors(xs, ys, xe, ye: Integer): T2DIntArray;
- procedure CopyClientToBitmap(bitmap: Integer; xs, ys, xe, ye: Integer);
- function FastGetPixel(const Bmp, x, y: Integer): Integer;
- procedure FastSetPixel(const Bmp, x, y, Color: Integer);
- procedure FastDrawClear(bitmap: Integer; Color: TColor);
- procedure SetTargetBitmap(bitmap: Integer);
- function RotateBitmap(bitmap: Integer; angle: Extended): Integer;
- procedure SetWindowText(const Wnd: Hwnd; const Text: string);
- function FindTransparentBitmaps(Bitmap: Integer; var Points: TPointArray; TranspCol, xs, ys, xe, ye: Integer): Boolean;
- function FindTransparentBitmapsTolerance(Bitmap: Integer; var Points: TPointArray; TranspCol, xs, ys, xe, ye, Tol: Integer): Boolean;
- procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer);
- procedure FastDrawSizeTransparent(x1, y1, x2, y2: Integer; sourcebitmap, targetbitmap: Integer);
- procedure SetBitmapFastDrawTarget(bitmap: Integer);
- procedure SetTransparentColor(bitmap, color: Integer);
- procedure SetTransparencyFromBitmap(Bitmap, AlphaMaskBitmap: Integer);
- function CountTransparentBitmap(Bitmap: Integer; TranspCol, xs, ys, xe, ye: Integer): Integer;
- function CountTransparentBitmapTolerance(Bitmap: Integer; TranspCol, xs, ys, xe, ye, Tol: Integer): Integer;
- function FindWindowBySize(Width, Height: Integer): Boolean;
- TIntegerArray (alias)
- T2DIntegerArray (alias)
- TExtendedArray (alias)
- TStringArray (alias)
- function MiddleTPA(const TPA: TPointArray): TPoint; (alias)
- function MiddleTPAEx(const TPA: TPointArray; out x, y: Integer): Boolean; (alias)
- procedure TPARemoveDupl(var TPA: TPointArray); (alias)
- function GetTPABounds(const TPA: TPointArray): TBox; (alias)
- procedure TPAInvert(var TPA: TPointArray); (alias)
- function TPACombine(const TPA1, TPA2: TPointArray): TPointArray; (alias)
- function TPARandom(const Count, XRange, YRange: Integer): TPointArray; (alias)
- procedure TPARemovePointEx(var TPA: TPointArray; const Point: TPoint; const All: Boolean); (alias)
- procedure TPARemovePoint(var TPA: TPointArray; const Point: TPoint); (alias)
- function TPAChain(const TPA: TPointArray; const Dist: Integer): T2DPointArray; (alias)
- function TPAChainEx(const TPA: TPointArray; const XMax, YMax: Integer): T2DPointArray; (alias)
- procedure ATPASortBySize(var ATPA: T2DPointArray); (alias)
- function GroupTPA(const TPA: TPointArray; const Dist: Integer): T2DPointArray; (alias)
- function TPAToATPA(const TPA: TPointArray; const Dist: Integer): T2DPointArray; (alias)
- function TPAGroupEx(const TPA: TPointArray; const XMax, YMax: Integer): T2DPointArray; (alias)
- function TPAToATPAEx(const TPA: TPointArray; const XMax, YMax: Integer): T2DPointArray; (alias)

 

Enjoy!

 

~Freddy

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