Jump to content
FHannes

SCAR Divi 3.31 Final

Recommended Posts

SCAR Divi 3.31 Final has been released! This is a pretty giant release, featuring an entirely new system to wrap the script engine offering better performance and stability, support for ZLib compression, HEX/Base64 encoding, SQLite3 databases and more!

 

I'm also releasing the format for encoding SCAR bitmap strings, which will make it easier to create 3rd party tools to generate, use and store the bitmap strings. I will put up specifications in the wiki soon, currently you can check out this post: http://forums.scar-divi.com/showthread.php?914-Bitmap-Encoding

The post contains a script to decode the new bitmap encoding format I added which differs little from the old one aside from some small details, but is more convenient to use.

Note that you can use the appropriate tool in the tools menu to update the bitmaps using an older encoding in your scripts to this new encoding.

 

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

 

Changelog:

Bugfixes:
- Small bug in loading toolbars/docks
- ReadLn didn't return the result
- Bug in the settingsmanager caused issues when changing the editor format
- CallProc didn't return the proper result
- Local variables were bugged in code completion
- Bitmap updater tool had some issues with converting the b format
- [#37] Bug in FindColorSpiral(Tolerance) threw access violation when initial x and y were outside of search bounds

Improvements:
- New interface for script engine
- Improved compile/running time measurement
- Vastly improved speed for displaying variable content while debugging
- Updated bitmap encoding

Additions:
- function FileAge(const Path: string): TDateTime;
- function ScriptFile: AnsiString;
- function Base64ToStr(const Str: AnsiString): AnsiString;
- function StrToBase64(const Str: AnsiString): AnsiString;
- function HexToStr(const Str: AnsiString): AnsiString;
- function StrToHex(const Str: AnsiString): AnsiString;
- function ZLibCompress(const Str: AnsiString): AnsiString;
- function ZLibDecompress(const Str: AnsiString): AnsiString;
- function WorkspacePath: AnsiString;
- const SQL_OK, SQL_ERROR, SQL_INTERNAL, SQL_PERM, SQL_ABORT, SQL_BUSY, SQL_LOCKED, SQL_FULL, SQL_ROW, SQL_DONE
- function SQLOpen(const Path: string; const CreateIfNotFound: Boolean): Integer;
- function SQLFree(const DBIndex: Integer): Boolean;
- function SQLAssigned(const DBIndex: Integer): Boolean;
- function SQLLastID(const DBIndex: Integer): Integer;
- procedure SQLStart(const DBIndex: Integer; const TransactionType: TSQLTransactionType);
- procedure SQLCommit(const DBIndex: Integer);
- procedure SQLRollback(const DBIndex: Integer);
- procedure SQLQuery(const DBIndex: Integer; const Query: string);
- function SQLQueryEx(const DBIndex: Integer; const Query: string): Integer;
- function SQLQueryFree(const QueryIndex: Integer): Boolean;
- function SQLQueryAssigned(const QueryIndex: Integer): Boolean;
- function SQLQueryStep(const QueryIndex: Integer): Integer;
- function SQLQueryReset(const QueryIndex: Integer): Integer;
- procedure SQLBindStr(const QueryIndex, ParamIndex: Integer; const Str: string);
- procedure SQLBindInt(const QueryIndex, ParamIndex: Integer; const Int: Integer);
- procedure SQLBindInt64(const QueryIndex, ParamIndex: Integer; const Int: Int64);
- procedure SQLBindByte(const QueryIndex, ParamIndex: Integer; const _Byte: Byte);
- procedure SQLBindBool(const QueryIndex, ParamIndex: Integer; const Bool: Boolean);
- function SQLColumnStr(const QueryIndex, ColumnIndex: Integer): string;
- function SQLColumnInt(const QueryIndex, ColumnIndex: Integer): Integer;
- function SQLColumnInt64(const QueryIndex, ColumnIndex: Integer): Int64;
- function SQLColumnByte(const QueryIndex, ColumnIndex: Integer): Byte;
- function SQLColumnBool(const QueryIndex, ColumnIndex: Integer): Boolean;

Removed:
- BitmapFromString2

 

Enjoy this release!

 

~Freddy

Link to comment
Share on other sites

has the bot's function overall improved? Or will script writers have to adapt their scripts first?

 

It's not a bot, and no backwards compatibility was broken other than BitmapFromString2 which hasn't been used for years, so there shouldn't be any scripts actually using it. Also only WriteLn is now exported to plugins, but this is also almost never used, and only applies to plugins.

Link to comment
Share on other sites

Speaking of which: Freddy, I filed a bug report for an issue with code hints/code completion that's been driving me crazy. They work, just not when editing my script.

 

Edit any other script and they work. Fire up my script in the editor and they stop working. I have been going insane trying to figure out if it is something wrong with my script or I just hit an obscure bug. Starting to feel a bit paranoid: Is he doing it just to mess with my head?

Link to comment
Share on other sites

I like the new features in scar 3.31 but it seems to be really buggy, ive finally manage to make a mantis account and report the bugs, I think it should of had a bit more beta testing before release. Im sure you will get the errors fixed, but for now im reverting back to 3.30.

 

The only bug you've reported doesn't seem to be a bug... ScriptPath works fine for me and Janilabo, maybe you didn't actually save the script first?

Link to comment
Share on other sites

Im sorry, I was jsut upset with that function not working. I am currently back on scar 3.31 because i like the new features over an image loading.. lol.

 

Asfar as the image loading that has been one of my headaches over this weekend. See it always worked before in 3.30. See here is what i was doing..

 

ScriptFolder/ ->

MainScript.Scar

ScriptData/ ->

Image.png

Form.Scar

 

The issue was loadfromfile, for some reason in 3.31 when i called LoadFromFile(BackGround, ScriptPath+'image.png'); it doesnt load the file. But if i pass the location as a variable from the mainscript to the form.scar file it works.. now keep in mind the way i have this set up worked in Scar 3.30. So something has changed. Or in scar 3.30 my script was running on sheer luck.

Edited by shadowrecon
Link to comment
Share on other sites

Im sorry, I was jsut upset with that function not working. I am currently back on scar 3.31 because i like the new features over an image loading.. lol.

 

Asfar as the image loading that has been one of my headaches over this weekend. See it always worked before in 3.30. See here is what i was doing..

 

ScriptFolder/ ->

MainScript.Scar

ScriptData/ ->

Image.png

Form.Scar

 

The issue was loadfromfile, for some reason in 3.31 when i called LoadFromFile(BackGround, ScriptPath+'image.png'); it doesnt load the file. But if i pass the location as a variable from the mainscript to the form.scar file it works.. now keep in mind the way i have this set up worked in Scar 3.30. So something has changed. Or in scar 3.30 my script was running on sheer luck.

 

ScriptPath works

You should be using LoadBitmap(Path) instead of LoadFromFile

Link to comment
Share on other sites

Probably not, why not just use a .bmp??

The reason im using loadfromfile is because its made for tsender objects.

As of now the problem is solved just took a little working around. The problem was not loading the file but getting the path. For some reason if i called the script from another script it returned nothing as script path, where as if i passed the path to the script from the main script it worked. Strange thing is it worked before scar 3.31.

Link to comment
Share on other sites

The reason im using loadfromfile is because its made for tsender objects.

As of now the problem is solved just took a little working around. The problem was not loading the file but getting the path. For some reason if i called the script from another script it returned nothing as script path, where as if i passed the path to the script from the main script it worked. Strange thing is it worked before scar 3.31.

 

What you're claiming is not possible. The ScriptPath function will return the path of the script you're running, not of the file you use it in, obviously. This has always been the case.

Link to comment
Share on other sites

What you're claiming is not possible. The ScriptPath function will return the path of the script you're running, not of the file you use it in, obviously. This has always been the case.
For some reason it always worked before images always loaded. Other wise i wouldnt be saying it was bug. It must of just been running on a fluke.. but me and RSutton scripts are setup like that to load the images. I am now just passing the path through a var to the script.
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...