Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
FHannes

SCAR Divi 4.00.00 Pre-Alpha

Recommended Posts

I've been "less active" lately, when it comes to releasing new things. The reason for this is that I've been working on a new project for quite some time now. So now I'd like to present the first public pre-release version for SCAR Divi 4.00, which will replace SCAR Divi 3.xx eventually, when it's finished. This is a pre-alpha release, so it could be far from stable.

 

SCAR Divi 4 marks a major milestone in SCAR's evolution. It focuses on object oriented programming, performance and rapid development. Unlike SCAR Divi 3, this version runs scripts in a separate process, which prevents the script from ever causing the IDE to crash or to be affected in any negative way. Scripts will now execute at lightning speed, as SCAR 4 is powered by the powerful Delphi Web Script engine, which executes scripts efficiently by employing a powerful interpreter engine. The engine also offers a very extensive pascal syntax, with a lot of features which aren't even present in Delphi. This engine was chosen over other engines as it provides the perfect scripting environment, which is very powerful, yet easy to learn.

 

You're probably wondering what SCAR 4 can do right now. So here's a list:

  • Send input to/capture windows
  • Work with bitmaps (WIP)
  • Display errors/hints in-code live
  • Display compiler messages live
  • Display runtime exceptions
  • Code completion
  • Code hints
  • Load included core units
  • Garbage collection
  • Compile projects consisting out of multiple units

 

This list of abilities will of course be growing rapidly. at the moment there is no documentation available yet, but the included core API units can be used as a reference. Keep in mind that the API is still under development and is prone to changes.

 

This small sample demonstrates how to capture a window and convert the image to a bitmap string.

 

uses Macro;

var Wnd = TWndTarget.Create(200886); // Replace number with a window handle
WriteLn(Wnd.Capture.SaveToString);

 

Aside from the main API, a scripted legacy API is also included, which aims to emulate the SCAR Divi 3 API. To include it, add "Legacy" to uses.

 

Downloads: SCAR Divi Development

 

scar4-pre.png

 

Enjoy :)

 

~Freddy

Edited by Freddy
  • Like 1

Share this post


Link to post
Share on other sites

I've uploaded a new copy, I'll be including small testscripts as well now with the prerelease versions. This will give you guys a better idea of how to use SCAR 4 as well.

 

For example:

[scar]uses Bitmaps;

 

var Bmp = TBitmap.Create(100, 100);

Bmp.Pixels[Point(50, 50)] := 255;

WriteLn(Bmp.CountColor([255]));

WriteLn(Bmp.CountColor([0]));

WriteLn(Bmp.CountColor([0, 255]));

WriteLn(Bmp.CountColor([]));[/scar]

Share this post


Link to post
Share on other sites

Wow, very nice work! A bit Visual Studio-esque, but still looks neat.

 

Nice to see it being mutli-process now, too :)

 

I am guessing you are using the "nightly" DWScript verson, too?

 

EDIT: Couple of things I have encountered thus far:

  • The error messages are extremely unhelpful ("Failed to compile.")
  • When indenting, code completion lists only a few methods (namely ones starting with "E", then "En"...)
  • Form editor is pointless
  • Colour picker/Eyedropper tool does not have any balloon help, neither does the client selection crosshair
  • Help -> Download News doesn't visibly do anything
  • Other areas need changes to match the new interface (e.g. form editor, DTM editor, settings)
  • No code completion for unit names in the uses clause
  • Slow redrawing when resizing the program results in flickering and visible lag
  • Noticeable input lag
  • "Structure" dialog doesn't populate
  • The editor always seems to display a squiggly red underline on the first line
  • What I found annoying, was that the "Open" dialog box always went back to the defined workspace, instead of last opened folder.
  • Redoing (CTRL+Y) an action redoes each individual character types, not words, whereas Undo undoes entire actions.
  • The following code seems to cause DWScript (the "engine") to crash:
    [scar]
    type
    TTestClass = class
    public
    procedure SetBool(const Bool: Boolean);
    function GetBool: Boolean;
    end;
    [/scar]
  • And on that note, logs aren't properly generated :(

 

Anyways, time for bed now :)

Edited by Daniel

Share this post


Link to post
Share on other sites

This is a pre-alpha version. Most stuff isn't finished or implemented yet. As for the compiler errors, they are shown in the compiler messages tab, failed to compile is a message sent by the engine. Also, the engine doesn't crash on that code you pasted, but that wouldn't compile, the class methods aren't implemented... The structure panel seems to populate just fine. I'm also not experiencing any input lag, what OS are you on?

Edited by Freddy

Share this post


Link to post
Share on other sites
This is a pre-alpha version. Most stuff isn't finished or implemented yet.

I am aware of that. Was just letting you know.

 

Also, the engine doesn't crash on that code you pasted, but that wouldn't compile, the class methods aren't implemented...

They are, and it does.

 

The structure panel seems to populate just fine.

It doesn't. It's empty (aside from the typical "Classes"..."Variables").

 

I'm also not experiencing any input lag, what OS are you on?

Windows 7 x86_64 (same as you, I would imagine). It's like SSH'ing into a server where you have 500ms ping - the delay between character strokes is quite noticeable.

Share this post


Link to post
Share on other sites
It doesn't. It's empty (aside from the typical "Classes"..."Variables").

Is there anything in the script for it to populate it with?

 

Windows 7 x86_64 (same as you, I would imagine). It's like SSH'ing into a server where you have 500ms ping - the delay between character strokes is quite noticeable.
I'll look into it, but so far I haven't been able to reproduce the issue.

Share this post


Link to post
Share on other sites

Now this seems neat! I'm without a doubt impressed by the new design, the removal of the native Windows look is refreshing!

Unfortunately I'm without a Windows-installation so I can not test it (yet)..

 

I got a couple of questions to go:

- Will you be using the experimental JIT for DWS?

- If not using JIT: How is the performance gain given by DWScript then?

- Can the GC be turned of, simply to allow for manual handling, and speedup?

 

 

* In the meanwhile... Installing WinXP in VBox again *

 

Edit: The archive seems to be partially corrupt:

- Unexpected end of archive

... Checksum error at <bin\libcef.dll, bin\scar.exe ... many more> - Corrupted files.

Edited by slacky

Share this post


Link to post
Share on other sites

I will be using the JIT compiler once it's stable. I'm estimating the performance gain to be a factor of 25 at least without JIT, with JIT I'd have to guess 100 or more. GC can't be turned off, but given the performance gain in comparison to PS, it doesn't really seem like an issue to me.

Share this post


Link to post
Share on other sites

I've read about the JIT in a few articles, have not had time to test it my self, but it's definitely fast enough to avoid having to write Delphi extensions in SCAR, and thinking of the set of benchmarks I've seen, it's actually comparable to compiled code.

 

You have mentioned that SCAR is "ready" for multiple script-engines, if you find time, you could implement the experimental JIT as an alternative, just for the heck of it.

 

- Anyways I hope you find time to re-upload the RAR-file containing SCAR Divi 4 (pre-alpha) - WinRAR clams that it's broken.

Share this post


Link to post
Share on other sites

SCAR 4 has a completely new engine infrastructure, it's not built to support multiple engines. I'll upload a new archive when I have another build ready. I'm really busy with schoolstuff atm though.

Share this post


Link to post
Share on other sites
- Anyways I hope you find time to re-upload the RAR-file containing SCAR Divi 4 (pre-alpha) - WinRAR clams that it's broken.

SLACKEEEEH, just get 7-Zip - it is free and open-source alternative for WinRar / WinZip!

I had no problems extracting it using 7-Zip... ;)

Share this post


Link to post
Share on other sites
SLACKEEEEH, just get 7-Zip - it is free and open-source alternative for WinRar / WinZip!

I had no problems extracting it using 7-Zip... ;)

Yeah, maybe it would'a worked in a perfect world, but not this day... Same error appeared with 7-zip, same with gzip as well. So there is something going on with that file. U sure you managed to unpack it (was it runnable afterward)?

 

Now that I've got WinXP-BE reinstalled in VBox, maybe I'll find some time to come back to the environment and do some "scaring".

 

@Freddy: Then you got yet another thing to implement - Just for the heck of it! Now isn't that just great, huh? ;P

Edited by slacky

Share this post


Link to post
Share on other sites

Yeah it works just fine, just tested again.

Maybe the problem occurs only with XP? :o ..or something to do with VBoxing? Who knows, hmm..

But yep, everything works just fine under Windows 7. :\

Share this post


Link to post
Share on other sites

It's not the VBox, I was unable to unpack it under Linux as well - tested with all my archive managers (4).. The same problem occurs (bin/scar.exe is corrupt). I was able to extract 4 of 16MB of the scar.exe-file [CRC is invalid], everything else went smooth... What ever - I'll wait for a later release, and hope that the problem doesn't show again.

 

Fucking Windows-7-only-extractable-archive-thing - To hell with it.

Edited by slacky

Share this post


Link to post
Share on other sites
Same error appeared with 7-zip, same with gzip as well. So there is something going on with that file. U sure you managed to unpack it (was it runnable afterward)?

 

Redownload it?

Share this post


Link to post
Share on other sites

I try to download it ... at first it said about 20 MB then when it reach 2.5MB it finished the download.

I guess that's why when trying to extract the file it got corrupt.

 

Also, I haven't used Scar in a while...the version 3.12 have Silent Mouse option ...

But the new version 3.38 doesn't seem to include the Silent Mouse .... would the 4.0 include the Silent Mouse option.

It would be nice just to be able to run the Scar and play with the computer at the same time

Share this post


Link to post
Share on other sites

The "silent mouse option" will be readopted, but do keep in mind that it does not and never worked for most games.

 

EDIT: I've been sick for a week or 2, I haven't been able to do much during that time. I can't upload a new build at the moment, because I'm working on a large feature, that's currently unfinished and because of that, fairly unstable. I have however repackaged the existing build and reuploaded it. Progress will be slow during the next month, as I'm currently studying for my finals.

Edited by Freddy

Share this post


Link to post
Share on other sites

I am offically in love with SCAR 4! Freddy i love it! Along with the overload command! Ive started creating an include for SCAR 4, so far i have a bunch of math, point, and mouse functions!

 

sample:

[scar]

unit GMRL.Mouse;

 

interface

uses

Legacy.Mouse, GMRL.Points;

 

procedure GetMousePos(var P: TPoint); overload;

function GetMousePos: TPoint; overload;

function MMouse(X, Y, RX, RY: Integer): TPoint; overload;

function MMouse(P: TPoint; RX, RY: Integer): TPoint; overload;

function MMouse(P: TPoint): TPoint; overload;

function MMouse(Box: TBox): TPoint; overload;

function MMouse(CX, CY, Radius: Integer): TPoint; overload;

function MMouse(P: TPoint; Radius: Integer): TPoint; overload;

function HoldMouseWait(X, Y, RX, RY, MinTime, MaxTime: Integer; Btn: TMouseButton): TPoint; overload;

function HoldMouseWait(P: TPoint; RX, RY, MinTime, MaxTime: Integer; Btn: TMouseButton): TPoint; overload;

function HoldMouseWaitBox(X1, Y1, X2, Y2, MinTime, MaxTime: Integer; Btn: TMouseButton): TPoint; overload;

function HoldMouseWaitBox(B: TBox; MinTime, MaxTime: Integer; Btn: TMouseButton): TPoint; overload;

function Mouse(X, Y, RX, RY: Integer; Btn: TMouseButton): TPoint; overload;

function Mouse(P: TPoint; RX, RY: Integer; Btn: TMouseButton): TPoint; overload;

function Mouse(P: TPoint; Btn: TMouseButton): TPoint; overload;

function Mouse(Box: TBox; Btn: TMouseButton): TPoint; overload;

function Mouse(CX, CY, Radius: Integer; Btn: TMouseButton): TPoint; overload;

function Mouse(P: TPoint; Radius: Integer; Btn: TMouseButton): TPoint; overload;

 

 

implementation

 

uses

GMRL.Math;

.................................................................

[/scar]

Share this post


Link to post
Share on other sites

The new API is a bit difficult to get started with but after that its a breeze ive almost created an entire include! Is there any way to store the units another place than the core folder?

 

Heres a bitmap function i created, simple and effective. The new API almost does everything for you about like Delphi, there are a few bugs in code completion that are a bit annoying but and the fact it doesn't let you finish a line of code and before it starts checking for missing attributes is kind of annoying to.

 

 

Heres my progress so far

https://github.com/ShadowRecon/GMRL4

Edited by shadowrecon

Share this post


Link to post
Share on other sites

How is the development going with this version of SCAR?

 

Also how are includes going to work in the final version or have you considered this yet?

 

Ive been working pretty hard with GMRL trying to get enough functions to actually write a script for runescape and try it out, still working on the TFunctions tho, but ive managed to implement alot of them so far.

Share this post


Link to post
Share on other sites
Is there any way to store the units another place than the core folder?[/url]

I don't really remember all that much any more, but have you tried:

uses
 Someunit in 'myunits\Someunit.pas' //this is usually in the dpr-file..

// or:
uses
 myunits.Someunit //never tested, but I think i've seen something like this.

Edited by slacky

Share this post


Link to post
Share on other sites

At the moment it's not possible to include files outside of the core library. This will be possible once the entire file system is implemented. I've already started work on that particular aspect, but currently all of my projects are on hold because I'm studying for my finals. When they're over I will finish and release SCAR Divi 3.39, as well as continue development on SCAR 4.

 

Includes will look/work quite different than what people are used to, but I won't go into details until I've actually had a chance to complete that part of the code. That way I'm sure that everything I'd like to do is possible and works.

Share this post


Link to post
Share on other sites

Oh Okay. Am i wasting my time trying to develop a RS07 include using all these units? Thats my main worry. I hate feeling as if i just waster my time. . . which i am sure many feel. But overall i like SCAR 4, it is very fast and i would almost compare its speed with Delphi its self. It seems to compile fast, execute code at an extremely fast speed compared to PS and seems to have as much functionality as Delphi!

Share this post


Link to post
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...