SRL Archive - General

SCAR Luna Sneak Peak


Freddy1990

2009-12-17 07:54:31

Since I'm currently preparing for my exams, I don't have much time to work on SCAR. However, I know you're all patiently waiting for SCAR Luna 3.50, so I've decided to give you a little sneak peak. The program is far from complete, if I'd have to stick an arbitrary number onto it, I'd say it's somewhere along the lines of 10% completed. Currently it does not have many tools, neither does it support DTMs or OCR, the first thing to do is to complete as many FindBitmap/Color functions. It does features some nifty new abilities like the Color Picker History. Also, nothing is saved to the registry, neither by the regular or portable version.

Screenshot:

These are the functions currently available in the core aside from system functions like IntToStr and such:
function SimilarColors(const Color1, Color2, Tolerance: Integer): Boolean;
function SimilarBitmaps(const iBitmap1, iBitmap2, Tolerance: Integer): Boolean;
function GetTolerance(const Color1, Color2: Integer): Integer;
function GetClosestColor(const Color: Integer; const Colors: TIntegerArray): Integer;
function SetToleranceMode(const Mode: Byte): Byte;
function GetToleranceMode: Byte;
procedure SetTolMode2Modifiers(const HueChangeBounds, SatChangeBounds: Single);
procedure GetTolMode2Modifiers(out HueChangeBounds, SatChangeBounds: Single);
procedure SetTolMode3Modifiers(const Sensitivity: Integer);
procedure GetTolMode3Modifiers(out Sensitivity: Integer);
function BitmapAssigned(const iBitmap: Integer): Boolean;
function BitmapToString(const iBitmap: Integer): AnsiString;
function BitmapFromString(const Width, Height: Integer; const BitmapString: AnsiString): Integer;
function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer;
function LoadBitmap(const FileName: string): Integer;
function FreeBitmap(const iBitmap: Integer): Boolean;
function SaveBitmap(const iBitmap: Integer; const FileName: string): Boolean;
function CreateBitmap(const Width, Height, Color: Integer): Integer;
procedure GetBitmapSize(const iBitmap: Integer; out Width, Height: Integer);
function GetBitmapPixel(const iBitmap: Integer; const x, y: Integer): Integer;
procedure SetBitmapPixel(const iBitmap: Integer; const x, y, Color: Integer);
procedure ReplaceBitmapColor(const iBitmap: Integer; const OldColor, NewColor: Integer);
procedure ReplaceBitmapColorTolerance(const iBitmap: Integer; const OldColor, NewColor, Tolerance: Integer);
function CountBitmap(const Bmp: Integer; const xs, ys, xe, ye: Integer): Integer;
function CountBitmapTolerance(const Bmp: Integer; const xs, ys, xe, ye, Tol: Integer): Integer;
function FindBitmap(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapTolerance(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindBitmaps(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapsTolerance(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindBitmapSpiral(const iBitmap: Integer; var x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapSpiralTolerance(const iBitmap: Integer; var x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindBitmapsSpiral(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapsSpiralTolerance(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindDeformedBitmap(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; Range: Integer; AllowPartialAccuracy: Boolean; out Accuracy: Extended): Boolean;
function FindDeformedBitmapTolerance(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer; Range: Integer; AllowPartialAcc: Boolean; out Accuracy: Extended): Boolean;
function FindTranspDeformedBitmap(const iBitmap, TranspColor: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; Range: Integer; AllowPartialAcc: Boolean; out Accuracy: Extended): Boolean;
function FindTranspDeformedBitmapTolerance(const iBitmap, TranspColor: Integer; out x, y: Integer; const xs, ys, xe, ye, Tol: Integer; Range: Integer; AllowPartialAcc: Boolean; out Accuracy: Extended): Boolean;
procedure WriteLn(const s: string);
procedure Status(const s: string);
function AppPath: string;
procedure ClearDebug;
procedure TerminateScript;
function ScriptPath: string;
procedure Wait(const ms: Cardinal);
function GetSystemTime: Cardinal;
procedure ConvertTime(const ms: Cardinal; out h, m, s: Cardinal);
function TimeRunning: Cardinal;
procedure GetMousePos(out x, y: Integer);
procedure MoveMouse(x, y: Integer);
procedure ClickMouse(const x, y: Integer; const Button: TMouseButton);
procedure MoveMouseSmooth(const x, y: Integer);
procedure MoveMouseSmoothEx(const x, y, MinSleepTime, MaxSleepTime, MaxDistance, Gravity, Forces: Integer);
procedure HoldMouse(const x, y: Integer; const Button: TMouseButton);
procedure ReleaseMouse(const x, y: Integer; const Button: TMouseButton);
procedure MoveWindMouseEx(x, y, rx, ry, MouseSpeed: Integer);
procedure MoveWindMouse(const x, y, rx, ry: Integer);
procedure ClickWindMouse(const x, y, rx, ry: Integer; const Button: TMouseButton);
procedure MouseBox(const x1, y1, x2, y2: Integer);
procedure ClickMouseBox(const x1, y1, x2, y2: Integer; const Button: TMouseButton);
function GetCursorType: TCursor;
procedure SendKeys(const s: string);
procedure SendKeysHuman(const s: string);
procedure KeyDown(const Key: Byte);
procedure KeyUp(const Key: Byte);
function IsNumpadEnabled: Boolean;
function IsCapsLockEnabled: Boolean;
procedure ColorToRGB(const Color: Integer; out R, G, B: Byte);
function RGBToColor(const R, G, B: Byte): Integer;
function GetColor(const x, y: Integer): Integer;
function GetColors(const Points: TPointArray): TIntegerArray;
function CountColor(const Color: Integer; const xs, ys, xe, ye: Integer): Integer;
function CountColorTolerance(const Color: Integer; const xs, ys, xe, ye, Tol: Integer): Integer;
function FindColor(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindColorTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColors(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindColorsTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorSpiral(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindColorSpiralTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorsSpiral(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindColorsSpiralTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorSkipBox(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; const SkipBox: TBox): Boolean;
function FindColorSkipBoxTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer; const SkipBox: TBox): Boolean;
function FindColorsSkipBox(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer; const SkipBox: TBox): Boolean;
function FindColorsSkipBoxTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer; const SkipBox: TBox): Boolean;
function FindColorSkipBoxes(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorSkipBoxesTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tol: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorsSkipBoxes(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorsSkipBoxesTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tol: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorCircle(const Color: Integer; out x, y: Integer; const mx, my, r: Integer): Boolean;
function FindColorCircleTolerance(const Color: Integer; out x, y: Integer; const mx, my, r, Tolerance: Integer): Boolean;
function FindColorsCircle(const Color: Integer; out Points: TPointArray; const mx, my, r: Integer): Boolean;
function FindColorsCircleTolerance(const Color: Integer; out Points: TPointArray; const mx, my, r, Tolerance: Integer): Boolean;
function Random(const Range: Integer): Integer;
function ArcCos(const X: Extended): Extended;
function ArcSin(const X: Extended): Extended;
function Exp(const X: Extended): Extended;
function Power(const Base, Exponent: Extended): Extended;
function IntPow(const Base: Extended; const Exponent: Integer): Extended;
function MaxI(const A, B: Integer): Integer;
function MaxE(const A, B: Extended): Extended;
function MinI(const A, B: Integer): Integer;
function MinE(const A, B: Extended): Extended;
function SameValue(const A, B: Extended): Boolean;
function Ceil(const X: Extended): Integer;
function Floor(const X: Extended): Integer;
function Sqr(const X: Extended): Extended;
function Rand: Extended;
function Inversus(const X: Extended): Extended;
function InCircle(const x, y, mx, my, r: Integer): Boolean;
function InTriangle(const x, y, x1, y1, x2, y2, x3, y3: Integer): Boolean;
function PolarToCart(Point: PPoint): TPoint;
function CartToPolar(Point: TPoint): PPoint;
function DegToRad(const Degrees: Extended): Extended;
function RadToDeg(const Radians: Extended): Extended;
function IntPower(const Base: Extended; const Exponent: Integer): Extended;
function Tan(const X: Extended): Extended;
function Cotan(const X: Extended): Extended;
function ArcCos(const X: Extended): Extended;
function ArcSin(const X: Extended): Extended;
function ArcTan(const X: Extended): Extended;
function ArcTan2(const X: Extended): Extended;
procedure GetClientSize(out Width, Height: Integer);
function GetClientHandle: Hwnd;
procedure SetClientHandle(const Handle: Hwnd);
function Point(const X, Y: Integer): TPoint;
function Polar(const Radius, Theta: Extended): PPoint;
function IntToBox(const xStart, yStart, xEnd, yEnd: Integer): TBox;
function TPAInTPA(const TPA1, TPA2: TPointArray): Boolean;
function GetTPABounds(const TPA: TPointArray): TBox;
function MiddleTPAEx(const TPA: TPointArray; out x, y: Integer): Boolean;
function MiddleTPA(const TPA: TPointArray): TPoint;
procedure InvertTPA(var TPA: TPointArray);
function CombineTPA(const TPA1, TPA2: TPointArray): TPointArray;
function ReadInterSCARMessage(const Channel: string): string;
function SendInterSCARMessage(const Channel, Message: string): Boolean;
procedure DebugBitmap(const Bmp: Integer);
function ByteToHex(const Value: Byte): AnsiString;
function HexToByte(const Hex: AnsiString): Byte;
function IntToHex(const Value: Cardinal): AnsiString;
function HexToInt(const Hex: AnsiString): Cardinal;

The current version support error reporting. Note that several features in the program are there, but unfinished, like the multiple bitmaps to string converter. It works but is just a preliminary model, it's still going undergo big changes. The program also does not yet have a compatibility mode for SCAR 3.2x, so most 3.2x scripts won't run yet. It does fully support including files, the same way as before, no plugins yet though. You'll find it does feature several new functions that weren't in the previous versions, like FindBitmapsSpiral or IntToHex.

Note that this isn't an invitation for requests and suggestions, I have to stick to my strict plan on how I'm going to build this or it will turn into a mess… Feel free to report any bugs you may encounter though… Most of the functions have been tested, but only to so big of an extend, some may possibly have bugs… All FindX functions are completely new and theoretically faster than all the ones in SCAR 3.2x, also, the Spiral functions are 200-250% faster. Do take in account that the current release has memory leak tracking enabled, though I'm fairly confident it has no memory leaks, the tracking of such will slightly decrease performance, so the FindX functions might be slightly slower than advertised, though the final version will not feature memory leak tracking, only pre-release versions. The impact on the performance should be fairly minimal though.

You can find the sneak peak version here: http://freddy1990.com/svn/scarprerelease/Luna/
It is a portable version of the program and comes with a couple of example and benchmark scripts.

(NOTE: BitmapFromString is completely backwards compatible with all previous strings that were loaded by the function.)

If you have any questions on how to use certain functions, feel free to ask.

Sir R. M8gic1an

2009-12-17 08:03:15

Looking Good!

~RM

Sex

2009-12-17 08:30:01

Wow, looks amazing Freddy, can't wait until it is complete :).
Keep up the good work!

cycrosism

2009-12-17 08:59:11

Yeah looks really good Freddy :D

Gu3st...

2009-12-17 09:01:00

What does function GetCursorType: TCursor; do?

It's looking really good! I'm so excited! :D

Freddy1990

2009-12-17 09:07:26

From: Zyt3x
What does function GetCursorType: TCursor; do?

It's looking really good! I'm so excited! :D


It returns the icon type of your cursor, like crCross, crHand, …

Floor66

2009-12-17 09:32:16

I see that the functions now have consts and outs what exactly are they? :$

Freddy1990

2009-12-17 09:41:22

From: Floor66
I see that the functions now have consts and outs what exactly are they? :$


Consts are parameters that aren't changed by the functions and pass data to the functions, vars pass data and return data to and from the functions, outs only return data from the functions.

Floor66

2009-12-17 09:50:35

Ah I see.

Tim0suprem0

2009-12-17 14:00:13

This looks sexy :)

Bionicle

2009-12-17 15:42:51

Looks really good, can't wait to see the final version :D

Janilabo

2009-12-17 16:17:42

Nice work! :)

Dan Cardin

2009-12-17 17:01:23

nifty. Just what I like to see.

Freddy1990

2009-12-17 18:15:50

Just finished my first FindDeformedBitmap function, with inaccuracy enabled and a range of 0, it benchmarks for a specific test case as twice the speed of SCAR 3.22 in a 500*500 area. With 100% accuracy it almost reaches twice the speed, and with an area of 1 and inaccuracy, it benchmarks at 4 times the speed. I'm guessing that factor will increase with the area.

P1nky

2009-12-18 00:48:49

Your truly a talented person :)

Keep it up brotha

TRiLeZ

2009-12-18 01:23:06

Good work Freddy. Keep it up!
I can't wait til' you finish this.

Freddy1990

2009-12-19 09:53:32

I've uploaded a newer copy of Luna, since the last one was kind of annoying to handle… This newer copy adds additional functions like FindDeformedBitmap, CountBitmap, … Also code completion, etc… Will probably be the last release before the official public pre-release version. (Does not support parameter completion yet though) In addition, all functions with search areas have a little added workload, this is because the search area points are checked and swapped if endpoint < startpoint, also the functions now allow you to search in a search area only as big as your selected client.

Timer

2009-12-19 10:08:04

From: Freddy1990
I've uploaded a newer copy of Luna, since the last one was kind of annoying to handle… This newer copy adds additional functions like FindDeformedBitmap, CountBitmap, … Also code completion, etc… Will probably be the last release before the official public pre-release version. (Does not support parameter completion yet though) In addition, all functions with search areas have a little added workload, this is because the search area points are checked and swapped if endpoint < startpoint, also the functions now allow you to search in a search area only as big as your selected client.


Looks nice, Freddy.

Town

2009-12-19 21:54:06

From: Freddy1990
this is because the search area points are checked and swapped if endpoint < startpoint, also the functions now allow you to search in a search area only as big as your selected client.


That's hilarious.

You seem to be making a lot of progress on several projects as it stands. It's hard to believe you when you say you're low on time.

Freddy1990

2009-12-20 04:39:35

From: Town
That's hilarious.

You seem to be making a lot of progress on several projects as it stands. It's hard to believe you when you say you're low on time.


I work as hard as I can… You'll have to believe it though, sneak peak is proof :)

BobboHobbo

2009-12-21 06:15:02

1 word to describe this: nice.

Nice work freddogz.

Freddy1990

2009-12-21 07:24:50

From: BobboHobbo
1 word to describe this: nice.


Heh, thanks, the sneak peak does have 1 stupid bug, which is basically that the code completion window always pops up regardless of what character you type, lol, I fixed that ages ago though… My last addition yesterday was FindTranspBitmap(s)Spiral(Tolerance), well a lot of other stuff has been added since that sneak peak… I've calculated that 3.50 currently has about 35% of the functions to do what similar functions did in 3.2x, of course it also has loads of new ones that weren't in 3.2x. Don't know if 35% seems a lot, but do take into account that half of the remaining 65% area functions like GetDebugLine, real easy ones to add, I've been focusing on creating the difficult ones first.

Dan Cardin

2009-12-21 16:59:22

35% including all of the formy/drawing stuff and random other functions that i noticed weren't yet added, like RandomRange? Well i assume the random other functions will randomly be not there, since they're random, but my first part still applies :)

anonymity

2009-12-21 17:13:43

HolySmokes Freddy… this is truly great.

One word to describe it: Wizard!

Freddy1990

2009-12-21 17:28:09

From: Dan Cardin
35% including all of the formy/drawing stuff and random other functions that i noticed weren't yet added, like RandomRange? Well i assume the random other functions will randomly be not there, since they're random, but my first part still applies :)


In the meanwhile it's 40% that I've got finished, and yes, form functions, a few drawing functions, math functions, dtms, ocr, these things haven't been added yet… But I'm working on it. I'm also adding a lot of new functions that weren't in SCAR before, which slows me down a little
I suppose, but they're certainly worth it.

This is the current list:
function SimilarColors(const Color1, Color2, Tolerance: Integer): Boolean;
function SimilarBitmaps(const iBitmap1, iBitmap2, Tolerance: Integer): Boolean;
function GetTolerance(const Color1, Color2: Integer): Integer;
function GetClosestColor(const Color: Integer; const Colors: TIntegerArray): Integer;
function SetToleranceMode(const Mode: Byte): Byte;
function GetToleranceMode: Byte;
procedure SetTolMode2Modifiers(const HueChangeBounds, SatChangeBounds: Single);
procedure GetTolMode2Modifiers(out HueChangeBounds, SatChangeBounds: Single);
procedure SetTolMode3Modifiers(const Sensitivity: Integer);
procedure GetTolMode3Modifiers(out Sensitivity: Integer);
function BitmapAssigned(const iBitmap: Integer): Boolean;
function BitmapToString(const iBitmap: Integer): AnsiString;
function BitmapFromString(const Width, Height: Integer; const BitmapString: AnsiString): Integer;
function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer;
function LoadBitmap(const FileName: string): Integer;
function FreeBitmap(const iBitmap: Integer): Boolean;
function SaveBitmap(const iBitmap: Integer; const FileName: string): Boolean;
function CreateBitmap(const Width, Height, Color: Integer): Integer;
procedure GetBitmapSize(const iBitmap: Integer; out Width, Height: Integer);
function GetBitmapPixel(const iBitmap: Integer; const x, y: Integer): Integer;
procedure SetBitmapPixel(const iBitmap: Integer; const x, y, Color: Integer);
procedure ReplaceBitmapColor(const iBitmap: Integer; const OldColor, NewColor: Integer);
procedure ReplaceBitmapColorTolerance(const iBitmap: Integer; const OldColor, NewColor, Tolerance: Integer);
function CountBitmap(const iBitmap: Integer; const xs, ys, xe, ye: Integer): Integer;
function CountBitmapTolerance(const iBitmap: Integer; const xs, ys, xe, ye, Tolerance: Integer): Integer;
function CountTranspBitmap(const iBitmap, TranspColor: Integer; const xs, ys, xe, ye: Integer): Integer;
function CountTranspBitmapTolerance(const Bmp, TranspCol: Integer; const xs, ys, xe, ye, Tol: Integer): Integer;
function FindBitmap(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapTolerance(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindBitmaps(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapsTolerance(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindTranspBitmap(const iBitmap, TranspColor: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindTranspBitmapTolerance(const iBitmap, TranspColor: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindTranspBitmaps(const iBitmap, TranspColor: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindTranspBitmapsTolerance(const iBitmap, TranspColor: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindBitmapSpiral(const iBitmap: Integer; var x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapSpiralTolerance(const iBitmap: Integer; var x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindBitmapsSpiral(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindBitmapsSpiralTolerance(const iBitmap: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindTranspBitmapSpiral(const iBitmap, TranspColor: Integer; var x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindTranspBitmapSpiralTolerance(const iBitmap, TranspColor: Integer; var x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindTranspBitmapsSpiral(const iBitmap, TranspColor: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindTranspBitmapsSpiralTolerance(const iBitmap, TranspColor: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindDeformedBitmap(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; Range: Integer; AllowPartialAccuracy: Boolean; out Accuracy: Extended): Boolean;
function FindDeformedBitmapTolerance(const iBitmap: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer; Range: Integer; AllowPartialAcc: Boolean; out Accuracy: Extended): Boolean;
function FindTranspDeformedBitmap(const iBitmap, TranspColor: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; Range: Integer; AllowPartialAcc: Boolean; out Accuracy: Extended): Boolean;
function FindTranspDeformedBitmapTolerance(const iBitmap, TranspColor: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer; Range: Integer; AllowPartialAcc: Boolean; out Accuracy: Extended): Boolean;
procedure WriteLn(const s: string);
procedure Status(const s: string);
function AppPath: string;
procedure ClearDebug;
procedure TerminateScript;
function ScriptPath: string;
procedure Wait(const ms: Cardinal);
function GetSystemTime: Cardinal;
procedure ConvertTime(const ms: Cardinal; out h, m, s: Cardinal);
function TimeRunning: Cardinal;
procedure GetMousePos(out x, y: Integer);
procedure MoveMouse(x, y: Integer);
procedure ClickMouse(const x, y: Integer; const Button: TMouseButton);
procedure MoveMouseSmooth(const x, y: Integer);
procedure MoveMouseSmoothEx(const x, y, MinSleepTime, MaxSleepTime, MaxDistance, Gravity, Forces: Integer);
procedure HoldMouse(const x, y: Integer; const Button: TMouseButton);
procedure ReleaseMouse(const x, y: Integer; const Button: TMouseButton);
procedure MoveWindMouseEx(x, y, rx, ry, MouseSpeed: Integer);
procedure MoveWindMouse(const x, y, rx, ry: Integer);
procedure ClickWindMouse(const x, y, rx, ry: Integer; const Button: TMouseButton);
procedure MouseBox(const x1, y1, x2, y2: Integer);
procedure ClickMouseBox(const x1, y1, x2, y2: Integer; const Button: TMouseButton);
function GetCursorType: TCursor;
procedure SendKeys(const s: string);
procedure SendKeysHuman(const s: string);
procedure KeyDown(const Key: Byte);
procedure KeyUp(const Key: Byte);
function IsNumpadEnabled: Boolean;
function IsCapsLockEnabled: Boolean;
procedure ColorToRGB(const Color: Integer; out R, G, B: Byte);
function RGBToColor(const R, G, B: Byte): Integer;
function GetColor(const x, y: Integer): Integer;
function GetColors(const Points: TPointArray): TIntegerArray;
function CountColor(const Color: Integer; const xs, ys, xe, ye: Integer): Integer;
function CountColorTolerance(const Color: Integer; const xs, ys, xe, ye, Tol: Integer): Integer;
function FindColor(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindColorTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColors(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindColorsTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorSpiral(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindColorSpiralTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorsSpiral(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer): Boolean;
function FindColorsSpiralTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorSkipBox(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; const SkipBox: TBox): Boolean;
function FindColorSkipBoxTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer; const SkipBox: TBox): Boolean;
function FindColorsSkipBox(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer; const SkipBox: TBox): Boolean;
function FindColorsSkipBoxTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tolerance: Integer; const SkipBox: TBox): Boolean;
function FindColorSkipBoxes(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorSkipBoxesTolerance(const Color: Integer; out x, y: Integer; const xs, ys, xe, ye, Tol: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorsSkipBoxes(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorsSkipBoxesTolerance(const Color: Integer; out Points: TPointArray; const xs, ys, xe, ye, Tol: Integer; const SkipBoxes: TBoxArray): Boolean;
function FindColorCircle(const Color: Integer; out x, y: Integer; const mx, my, r: Integer): Boolean;
function FindColorCircleTolerance(const Color: Integer; out x, y: Integer; const mx, my, r, Tolerance: Integer): Boolean;
function FindColorsCircle(const Color: Integer; out Points: TPointArray; const mx, my, r: Integer): Boolean;
function FindColorsCircleTolerance(const Color: Integer; out Points: TPointArray; const mx, my, r, Tolerance: Integer): Boolean;
function FindColoredAreaCenter(var x, y: Integer; const xs, ys, xe, ye: Integer): Boolean;
function FindColoredAreaCenterTolerance(var x, y: Integer; const xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColoredAreaBox(var Box: TBox; const x, y, xs, ys, xe, ye: Integer): Boolean;
function FindColoredAreaBoxTolerance(var Box: TBox; const x, y, xs, ys, xe, ye, Tolerance: Integer): Boolean;
function Random(const Range: Integer): Integer;
function ArcCos(const X: Extended): Extended;
function ArcSin(const X: Extended): Extended;
function Exp(const X: Extended): Extended;
function Power(const Base, Exponent: Extended): Extended;
function IntPow(const Base: Extended; const Exponent: Integer): Extended;
function MaxI(const A, B: Integer): Integer;
function MaxE(const A, B: Extended): Extended;
function MinI(const A, B: Integer): Integer;
function MinE(const A, B: Extended): Extended;
function SameValue(const A, B: Extended): Boolean;
function Ceil(const X: Extended): Integer;
function Floor(const X: Extended): Integer;
function Sqr(const X: Extended): Extended;
function Rand: Extended;
function Inversus(const X: Extended): Extended;
function InCircle(const x, y, mx, my, r: Integer): Boolean;
function InTriangle(const x, y, x1, y1, x2, y2, x3, y3: Integer): Boolean;
function PolarToCart(Point: PPoint): TPoint;
function CartToPolar(Point: TPoint): PPoint;
function DegToRad(const Degrees: Extended): Extended;
function RadToDeg(const Radians: Extended): Extended;
function IntPower(const Base: Extended; const Exponent: Integer): Extended;
function Tan(const X: Extended): Extended;
function ArcCos(const X: Extended): Extended;
function ArcSin(const X: Extended): Extended;
function ArcTan(const X: Extended): Extended;
function ArcTan2(const X: Extended): Extended;
function Cot(const X: Extended): Extended;
function Sec(const X: Extended): Extended;
function Csc(const X: Extended): Extended;
function CosH(const X: Extended): Extended;
function SinH(const X: Extended): Extended;
function TanH(const X: Extended): Extended;
function CotH(const X: Extended): Extended;
function SecH(const X: Extended): Extended;
function CscH(const X: Extended): Extended;
procedure GetClientSize(out Width, Height: Integer);
function GetClientHandle: Hwnd;
procedure SetClientHandle(const Handle: Hwnd);
function Point(const X, Y: Integer): TPoint;
function Polar(const Radius, Theta: Extended): PPoint;
function IntToBox(const xStart, yStart, xEnd, yEnd: Integer): TBox;
function IntInBox(const x, y: Integer; const Box: TBox): Boolean;
function PointToBox(const p1, p2: TPoint): TBox;
function PointInBox(const Point: TPoint; const Box: TBox): Boolean;
function BoolToStr(const Bool: Boolean): string;
function TPAInTPA(const SubTPA, TPA: TPointArray): Boolean;
function GetTPABounds(const TPA: TPointArray): TBox;
function MiddleTPAEx(const TPA: TPointArray; out x, y: Integer): Boolean;
function MiddleTPA(const TPA: TPointArray): TPoint;
function InvertTPA(const TPA: TPointArray): TPointArray;
function CombineTPA(const TPA1, TPA2: TPointArray): TPointArray;
function ExcludeTPA(const ExclTPA, TPA: TPointArray): TPointArray;
function ReadInterSCARMessage(const Channel: string): string;
function SendInterSCARMessage(const Channel, Message: string): Boolean;
procedure DebugBitmap(const Bmp: Integer);
procedure HideDebugImg;
function ByteToHex(const Value: Byte): AnsiString;
function HexToByte(const Hex: AnsiString): Byte;
function IntToHex(const Value: Cardinal): AnsiString;
function HexToInt(const Hex: AnsiString): Cardinal;
function MD5(const s: string): string;

Currently it doesn't support forms yet because I want to spend some time implementing them with new features from Delphi 2010.

Dan Cardin

2009-12-21 19:35:10

new features?! like what?

Freddy1990

2009-12-21 19:39:58

FindColoredAreaCenter for example, already 44% now btw…

Gu3st...

2009-12-22 17:10:48

Wow, you're working like a machine Freddy :)
I think you're a liar when you say you got little time on your hands.. :p

Freddy1990

2009-12-22 19:48:17

From: Zyt3x
Wow, you're working like a machine Freddy :)
I think you're a liar when you say you got little time on your hands.. :p


Hmm, well, I've stretched my time as far as I could, I won't be making many more changes for a month or so. After that I can resume at full speed :)

Wanted

2009-12-22 19:49:50

From: Freddy1990
FindColoredAreaCenter for example, already 44% now btw…


FindColoredAreaCenter?? why man… we have ATPA's

Freddy1990

2009-12-22 20:49:53

From: IceFire908
FindColoredAreaCenter?? why man… we have ATPA's


First off, because it's faster. Also, you have ATPAs, SCAR does not. Given, I'm adding more TPA functions, but still… Finally, FindColorSpiral2 did this, well, somewhat FindColoredAreaCenter combined with FindColorSpiral. To emulate FindColorSpiral2 in the compatibility mode, I'd need it anyway.

marpis

2009-12-22 21:25:15

From: Freddy1990
Also, you have ATPAs, SCAR does not. Given, I'm adding more TPA functions, but still…


Add WizzyPlugin's FindColorsSpiral etc. and we get them out of the plugin -> faster ;)

E: Cooperate with Wizzup ofc

Widget

2009-12-22 21:30:12

From: marpis
Add WizzyPlugin's FindColorsSpiral etc. and we get them out of the plugin -> faster ;)

E: Cooperate with Wizzup ofc


Won't happen; TPA stuff is GPL, so Freddy won't be able to use it unless SCAR becomes open-source (and we're still about 140 years off from that)

Freddy1990

2009-12-22 22:50:53

From: marpis
Add WizzyPlugin's FindColorsSpiral etc. and we get them out of the plugin -> faster ;)

E: Cooperate with Wizzup ofc


Since when does WizzyPlugin have FindColorsSpiral? Also, I will not be using any code from WizzyPlugin, same as before.

Wizzup?

2009-12-23 06:09:02

From: Freddy1990
Since when does WizzyPlugin have FindColorsSpiral? Also, I will not be using any code from WizzyPlugin, same as before.


Of course not. (Seriously, why do you even say that? No one accused you of doing that)
And to everyone else, Wizzyplugin has no license, so it is public domain. You can do whatever the f*ck you want to do with it. For all I care you make a plugin "MyHandwrittenPlugin" and use all the Wizzyplugin code.

From: marpis
E: Cooperate with Wizzup ofc


I don't think any of us will live to see that. But who knows… ;)

Widget

2009-12-23 06:12:28

From: Wizzup?
public domain


Oh, nevermind me then. I just assume everything you write is GPL. :p

Also, Freddy will rewrite it anyway just because he wants to take up more time :)

Freddy1990

2009-12-23 07:51:25

From: Wizzup?
I don't think any of us will live to see that. But who knows… ;)


Yes, at least we can agree upon that… Now if we can please get back on-topic.