Jump to content
FHannes

SCAR Divi 3.38 Final

Recommended Posts

SCAR Divi 3.38.00 has been released. This version was scheduled to be released on the 21st and has not gone through the RC stage, however, due to a critical bug in several TIA/TEA functions (#187), I've decided to push the release as soon as possible. If any more bugs should surface, they will be fixed in 3.38.01. This build offers a huge amount of new functions which are now part of SCAR's scripting API.

 

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

 

Changelog:

Bugfixes:
- Possibly critical fixes for several TIA functions: TIAIntersect, TIAUnique and TIAInTIA (+ TEA equivalents)
- [#175] Saving an untitled file doesn't update the program title
- [#187] Bug with certain data sets in several TIA and TEA functions

New:
- procedure ReplaceColors(const Bmp: TSCARBitmap; const Colors: TIntArray; const NewColor: Integer);
- procedure ReplaceColorsTol(const Bmp: TSCARBitmap; const Colors: TIntArray; const NewColor, Tol: Integer);
- function RandomTIA(const Count, Range: Integer): TIntArray;
- function RandomTIAEx(const Count, Range: Integer; const AllowDuplicates: Boolean): TIntArray;
- procedure OffsetTEA(var TEA: TExtArray; const Offset: Extended);
- function TEAInsert(var TEA: TExtArray; const Index: Integer; const Ext: Extended): Integer;
- function InvertColor(const Color: Integer): Integer;
- TSCARBitmap.Invert
- function SpiralPoint(const Pos: Cardinal): TPoint;
- function SpiralPointEx(const Pos: Cardinal; const Origin: TPoint): TPoint;
- function SpiralPos(const Pt: TPoint): Cardinal;
- function SpiralPosEx(const Pt, Origin: TPoint): Cardinal;
- procedure SortTPASpiral(var TPA: TPointArray);
- procedure SortTPASpiralEx(var TPA: TPointArray; const Point: TPoint);
- function CopyTIA(const TIA: TIntArray): TIntArray;
- function CopyTIAEx(const TIA: TIntArray; const Index, Count: Integer): TIntArray;
- function ATPADelete(var ATPA: T2DPointArray; const Index: Integer): TPointArray;
- function ATIADelete(var ATIA: T2DIntArray; const Index: Integer): TIntArray;
- function ATPAContains(const ATPA: T2DPointArray; const TPA: TPointArray): Boolean;
- function ATIAContains(const ATIA: T2DIntArray; const TIA: TIntArray): Boolean;
- function PermuteTPA(const TPA: TPointArray): T2DPointArray;
- function PermuteTIA(const TIA: TIntArray): T2DIntArray;
- procedure TIAFreq(const TIA: TIntArray; out Values, Frequencies: TIntArray);
- procedure TIARelFreq(const TIA: TIntArray; out Values: TIntArray; out Frequencies: TExtArray);
- procedure TPAFreq(const TPA: TPointArray; out Values: TPointArray; out Frequencies: TIntArray);
- procedure TPARelFreq(const TPA: TPointArray; out Values: TPointArray; out Frequencies: TExtArray);
- procedure TEAFreq(const TEA: TExtArray; out Values: TExtArray; out Frequencies: TIntArray);
- procedure TEARelFreq(const TEA: TExtArray; out Values, Frequencies: TExtArray);
- procedure TEARange(const TEA: TExtArray; out Lo, Hi: Extended);
- function CombineTEA(const TEA1, TEA2: TExtArray): TExtArray;
- procedure SortTEA(var TEA: TExtArray);
- procedure SortTEAEx(var TEA: TExtArray; const Ext: Extended);
- function TEAMean(const TEA: TExtArray): Extended;
- function TEASum(const TEA: TExtArray): Extended;
- procedure TEARemove(var TEA: TExtArray; const Ext: Extended);
- procedure TEARemoveEx(var TEA: TExtArray; const Ext: Extended; const All: Boolean);
- function CopyTEA(const TEA: TExtArray): TExtArray;
- function CopyTEAEx(const TEA: TExtArray; const Index, Count: Integer): TExtArray;
- procedure TIAAdd(var TIA: TIntArray; const Value: Integer); (Alias: OffsetTIA)
- procedure TIAAddEx(var TIA: TIntArray; const Values: TIntArray);
- procedure FillTIA(var TIA: TIntArray; const Int: Integer);
- procedure FillTIAEx(var TIA: TIntArray; const Values: TIntArray);
- procedure TIASubtract(var TIA: TIntArray; const Value: Integer);
- procedure TIASubtractEx(var TIA: TIntArray; const Values: TIntArray);
- procedure TIAMultiply(var TIA: TIntArray; const Value: Integer);
- procedure TIAMultiplyEx(var TIA: TIntArray; const Values: TIntArray);
- procedure TIADivide(var TIA: TIntArray; const Value: Integer);
- procedure TIADivideEx(var TIA: TIntArray; const Values: TIntArray);
- function TIAToTEA(const TIA: TIntArray): TExtArray;
- procedure TEAAdd(var TEA: TExtArray; const Value: Extended); (Alias: OffsetTEA)
- procedure TEAAddEx(var TEA: TExtArray; const Values: TExtArray);
- procedure FillTEA(var TEA: TExtArray; const Value: Extended);
- procedure FillTEAEx(var TEA: TExtArray; const Values: TExtArray);
- procedure TEASubtract(var TEA: TExtArray; const Value: Extended);
- procedure TEASubtractEx(var TEA: TExtArray; const Values: TExtArray);
- procedure TEAMultiply(var TEA: TExtArray; const Value: Extended);
- procedure TEAMultiplyEx(var TEA: TExtArray; const Values: TExtArray);
- procedure TEADivide(var TEA: TExtArray; const Value: Extended);
- procedure TEADivideEx(var TEA: TExtArray; const Values: TExtArray);
- procedure FillTPA(var TPA: TPointArray; const Value: TPoint);
- procedure FillTPAEx(var TPA: TPointArray; const Values: TPointArray);
- procedure Write(x);
- function RoundTEA(const TEA: TExtArray): TIntArray;
- function TruncTEA(const TEA: TExtArray): TIntArray;
- function FloorTEA(const TEA: TExtArray): TIntArray;
- function CeilTEA(const TEA: TExtArray): TIntArray;
- procedure TIAPush(var TIA: TIntArray; const Value: Integer);
- function TIAPop(var TIA: TIntArray): Integer;
- procedure TPAPush(var TPA: TPointArray; const Point: TPoint);
- function TPAPop(var TPA: TPointArray): TPoint;
- procedure TEAPush(var TEA: TExtArray; const Value: Extended);
- function TEAPop(var TEA: TExtArray): Extended;
- function TIAMedian(const TIA: Integer): Extended;
- function TEAMedian(const TEA: TExtArray): Extended;
- procedure SortTPAByColumn(var TPA: TPointArray);
- TIntegerArray = TIntArray (alias)
- TExtendedArray = TExtArray (alias)
- TStringArray = TStrArray (alias)
- TBooleanArray = TBoolArray (alias)
- procedure TIAReplace(var TIA: TIntArray; const OldValue, NewValue: Integer);
- procedure TIAReplaceEx(var TIA: TIntArray; const OldValues: TIntArray; const NewValue: Integer);
- procedure TEAReplace(var TEA: TExtArray; const OldValue, NewValue: Extended);
- procedure TEAReplaceEx(var TEA: TExtArray; const OldValues: TExtArray; const NewValue: Extended);
- procedure TPAReplace(var TPA: TPointArray; const OldPoint, NewPoint: TPoint);
- procedure TPAReplaceEx(var TPA: TPointArray; const OldPoints: TPointArray; const NewPoint: TPoint);
- procedure ReverseTEA(var TEA: TExtArray);
- function TPAZip(const XValues, YValues: TIntArray): TPointArray;
- procedure TPAUnzip(const TPA: TPointArray; out XValues, YValues: TIntArray);
- SCAR338-00_UP define (Where 00 is the minor version)
- function ReadFileLine(const FileNum: Integer; out Str: string): Boolean;
- function WriteFileLine(const FileNum: Integer; const Str: string): Boolean;

Tweaks:
- TPAMiddle => TPAMean
- SortATPAByMiddle => SortATPAByMean
- SortATPAByMiddleEx => SortATPAByMeanEx
- Huge performance improvements for StrToTIA
- TIAMean now throws an exception when an empty array is passed

Removed:
- procedure TPASort(var TPA: TPointArray); (alias: SortTPA)
- procedure TPASortEx(var TPA: TPointArray; const Point: TPoint); (alias: SortTPAEx)
- function AMax(const TIA: TIntArray): Integer; (alias: TIAMax)
- function AMin(const TIA: TIntArray): Integer; (alias: TIAMin)
- function TPAMiddleEx(const TPA: TPointArray; out x, y: Integer): Boolean;
- procedure BubbleSort(var Values: TIntArray);
- procedure BubbleSortB(var Values: TIntArray);
- procedure QuickSort(var Values: TIntArray);
- function Average(const Values: TExtArray): Extended; (alias: TEAMean)

 

Enjoy!

 

~Freddy

Link to comment
Share on other sites

I like these a lot also. But I still ponder on what we can use these arrays for? Array functions that is. We could use them for accuracy, and other things. But I'm still unsure of the full extent of what we could do with these.

 

Good job Freddy!

Statistics? :) I know there's many uses really, just takes some time for us to figure em out..

I know Freddy doesn't add anything without a good reason though, thats for sure! :P

Link to comment
Share on other sites

Good work!

 

Excluding almost all built in functions in SCAR (Like FindColorSpiral(), ReplaceColors() etc...), would it be complicated for you (Freddy) to link SCAR to a Python interpiter, and preferably add Pythonic syntaxhighlight/or just disable highlighting?

 

This way one would (if selected) be able to use SCAR with the python-interpiter for general mocroing (even tho it would just work as a normal IDE). I know it would be really low priority for you, but it can't be too hard to implement/try to implement as an alternative?

 

All functions can be in Pascal, it's not to hard to communicate between the languages, one could use socket for most communication... I've used socket between my Python macro and a Java based runescape client for quite some time... Quite simple solution, might hava a fiew negative sides, but not really any problems there.

Edited by slacky
Link to comment
Share on other sites

Good work!

 

Excluding almost all built in functions in SCAR (Like FindColorSpiral(), ReplaceColors() etc...), would it be complicated for you (Freddy) to link SCAR to a Python interpiter, and preferably add Pythonic syntaxhighlight/or just disable highlighting?

 

This way one would (if selected) be able to use SCAR with the python-interpiter for general mocroing (even tho it would just work as a normal IDE). I know it would be really low priority for you, but it can't be too hard to implement/try to implement as an alternative?

 

All functions can be in Pascal, it's not to hard to communicate between the languages, one could use socket for most communication... I've used socket between my Python macro and a Java based runescape client for quite some time... Quite simple solution, might hava a fiew negative sides, but not really any problems there.

 

You can use some of the things SCAR has, outside of SCAR in a Dynamic Link Library...at least I think so

 

As for python, wouldn't you need language bindings for the pascal -> python? idk...

 

Try pming Freddy...

Link to comment
Share on other sites

You can use some of the things SCAR has, outside of SCAR in a Dynamic Link Library...at least I think so

 

As for python, wouldn't you need language bindings for the pascal -> python? idk...

 

Try pming Freddy...

regarding crosslanguage bindings: SCAR is just another IDE (particularly made for macroing). One would need some sort of crosslanguage communication or bindings for python to be able to use SCARs functions, this can be done in quite a lot ways, but in the end, I guess every function which should be available through Python would need some sort of "crosscommunication". As mentioned, one can i.e use socket for that part, I do not remember how SMART commnicates with SCAR, but that as well is an option.

 

SCARs DDL-files are written in Lazarus, FPC or delphi, I could use Ctypes-library, but it ain't easy to use in this case, but fully possible. My concern is the type-binding, i.e Integer, or Array. Thay might be somwhat different, witch makes this solution somwhat complicated. But without any doubt, it's the best solution. And, I would be glad to try write a soltuion, if it means me being able to use Python through SCAR.

Thare aren't a lot of threads on this matter out there, but a fiew I found:

Link1, Link2, Link3

Intresting project on the matter that Works with FPC, Lazarus and Delphi, one could thake the source, and rip it apart to see how it works.

 

I've made everything I need for macroing in python: Bitmapfinding (OpenCV), FindColor(s), spiral search for colors, simple but good OCR (OpenCV) and PyTesser, mouse, and keyboard simulation etc, etc... And as for runescape I use OpenCV for flawless mapwalking, and stuff like that... It's not even slow even though there is much Python behind it, i've implemented many features in C.

 

Even though it's working quite well, I miss sitting in SCAR, the IDE, I miss the community... I would love to be able to contribite to this forum, or any other SCAR related site. But through Python.

 

I will give it a fiew days before I PM - Freddy might come around to answer my question.

Edited by slacky
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...