I haven't actually tested these yet, but pretty sure they'll work just fine. If there are any problems, let me know.

This pack includes So_MakeAnsi for both v1 and v2.

Edit: Added the random planet maker script as well.

Thank you for honoring me with your first tests of your decompiler on my scriptsI have downloaded them and will let you know if it did a good enough job.I look forward to the possibility of its release.

You have saved me the time to test it against something I have source forto see how it does .. now I can let everyone know how close you came to nailing it.

I hope its real close , this is something that has been wanted by many players whom dislike compiled scripts.Plus it will save a lot of time for authors , now YOU can fix their scripts .. hahaha

Ok , looked through the 0_login script .. for those whom have my .ctsSame version that you can have as .ts here ...

Please try the .ts one out and let me know if it works the same.I have found (in the first few hundred lines)a couple waiton commands made into settexttriggersand a bunch of killtriggers with " around them (may cause errors)as well as if statements changed IF ($var = "1") to IF ($Var = 1)which WILL be problematic at the end results.

I will continue on reading/comparing original to this decompile.I cant wait to get to the includes to see that also.

I did notice that any comments were removed and most word placements wereremoved.. making reading a bit harder for me , but aesthetically ok in script running.

So far good job .. hope the .ts runs right.I'll be back to post more in a bit .. for those following.

Aside from the before mention things I found , the includes contain many of the same problems but may still work .. someone please test .. I dont want tochance it since I would have to rename mine and further confuse myself indebugging.

Looks good for the most part , and thank you for sharing my scripts .. this one script that I spent many years in perfecting for all types of servers and modswill help many people learn many advanced ways to overcome obstaclesa server can throw at you.

I'm sure there are many parts that can be added to mombot to get its login script up to par.But the 0_login has the ability to launch your BOT script if you fill out theGlobals.cfg correctly.

Anyways , I'm done ranting and fact finding on this .. as a whole .. Good job ShadowYour decompiler seems to work , at least to get inside the script to rip partsand bypass security for the most part.

I look forward to your release so we all can use it.And not just on my scripts .. lol j/k

Ok , looked through the 0_login script .. for those whom have my .ctsSame version that you can have as .ts here ...

Please try the .ts one out and let me know if it works the same.I have found (in the first few hundred lines)a couple waiton commands made into settexttriggersand a bunch of killtriggers with " around them (may cause errors)as well as if statements changed IF ($var = "1") to IF ($Var = 1)which WILL be problematic at the end results.

I will continue on reading/comparing original to this decompile.I cant wait to get to the includes to see that also.

I did notice that any comments were removed and most word placements wereremoved.. making reading a bit harder for me , but aesthetically ok in script running.

So far good job .. hope the .ts runs right.I'll be back to post more in a bit .. for those following.

Vid

Hi Vid,

A couple of points here.

None of this is documented, so everything I did was based on reading the released twx source code and reverse engineering it. There were many bugs in my earlier iterations of this based on unexpected behavior by the compiler. I have fixed most of them.

When you compile a .CTS to .TS, it is actually compiling it into bytecode - meaning that it breaks down the statements (setvar, send, etc) and turns them into individual bytes that refer to what each statement does. It then has a structure where the bytes following reference each of the parameters (variables, constants, etc) used by the command, and it separately adds all the text strings, encrypted, to the end of the file, along with the labels (unencrypted).

The compiler throws away all comments, so the .CTS doesn't contain any of the comments in the original code. Those are impossible to reproduce.

When you actually load a .TS into TWX, it compiles it exactly as it would if you ran TWXC on it, and then executes the compiled code. So the only difference in performance between loading a .CTS or a .TS is that the startup time to load the script is slightly slower with a .TS (because it has to compile it to run it).

Anyway, back to what's changed/missing. The compiler converts all if/then/else and while statements to "BRANCH" statements. These are in the twx documentation describing what they do as a compiler internal statement (but can actually be used in scripts directly). So, an if statement like:

While statements are similarly changed into BRANCH and GOTO. This is reflected in the output of my decompiler. I may go back and clean it up, but it's difficult work, and the code generated runs just fine.

re waiton - the compiler converts this directly:

waiton "foo"

to:

settexttrigger WAITON1 :28 "foo":WAITON1

Meaning, if you put a "waiton" in your code, it is automatically converted to a trigger by the compiler. So it's no difference from using a trigger.

Waitfor is different - it is a separate function and ignores all other triggers. Waiton can be interrupted by other triggers because it's a trigger itself.

I suspect waitfor is faster, based on how the compiler handles it.

More on this later - I plan to document all of this for anyone who wants to work on this in the future.

I am happy to discuss with you sometime if you'd like.

I would love for you to look at the other scripts and provide any feedback you have so I can make the decompiler better. It's over 2000 lines of c# code already. I do plan to release it once I am sure I have dealt with all the edge cases.

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum