Jump to content

CleanScript


Recommended Posts

What do you think I meant with this part?

could be done by tidy

;-)

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Developers

What do you think I meant with this part?

;-)

peethebee

Maybe I misunderstood but weren't you refering to point 1&2 only for Tidy ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi!

I'm sorry, yes I were...

But point 3 is done by internal needs in CleanScript anyway. So there is hopefully no need for tidy in that case. But I really like it for many other ones such as 1) and 2)!

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Seems logic as it makes the script unreadable...

Perhaps we have to do this part...

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

  • Developers

Seems logic as it makes the script unreadable...

Perhaps we have to do this part...

peethebee

I could add TabChar=-1 to remove the indentation... its a 1 min job.... :P

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi,

When I use it on one of my scripts (the first one I tested) I get an error about a missing variable.

I use AutoIt v. 3.2.0.1 (Removed the beta already).

The problem is that when an included script includes another script for the constants, they are not added in the cleaned script.

To clearify what I mean I have created a small example. (see attachment)

....

Thank you, i found the problem, i'll fix it tomorrow (one more removed bug :P )

I think Markus can fix this right when allowing all cases of incLuDE ;-)

I'll do so ^^

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

OK

- I fixed the problem with double includes:

A file, includet by another includet file, will be includet too now.

As there is checked, if a file is includet already, it isn't possible that one file is includet twice.

- Now also lines as

#iNclUde                     "*.au3"           (much space here)

can be found, but notice that there mustn't be any space between the brackets ("";<>).

I'll send it to peethebee, that he can post it at the start of the topic.

Markus

Edited by Markus

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

Hello!

I think we will have to make the English version which will definately follow even the standard.

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

It would be nice if there was an English translation. I tried the new version but it did not save my script. I don't understand German so I don't know what is wrong

Hm that's strange.

If there is no destinationpath given in the gui, the cleaned script should be saved to the same dir as the sourcepath and the new file should have _clean.au3 at the end.

Have you given a destination path in the gui? If yes, could you post that path? Maybe the dir wasn't existing?

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

And when you let the destination path empty? Also no new file?

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

Hm that's strange.

If there is no destinationpath given in the gui, the cleaned script should be saved to the same dir as the sourcepath and the new file should have _clean.au3 at the end.

Have you given a destination path in the gui? If yes, could you post that path? Maybe the dir wasn't existing?

Both source & destination path I used was to the desktop (C:\Documents and Settings\Administrator\Desktop\...) Like someone said before, if the file exist then you can overwrite it but then I tries with a new filename, nothing is saved.

Link to comment
Share on other sites

Ups :P FileGetShortName doesn't work for files, that aren't existing alrdy, we should have minded that, it will be fixed in the next version. Thanks for your help.

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Nice work peethebee. The funny thing is i was in the process of writing my own script cleaner when you released this. You can find it here:

http://www.autoitscript.com/forum/index.php?showtopic=33021

However, i do like yours better. It is faster and cleans more of the script, so thanks for sharing it with us. There is only one problem i had, i don't understand anything that the prompt is saying because i don't know German. :)

[EDIT]

[iMPORTANT]

I just noticed something about your cleanscript.exe. I am well aware that it isn't a virus, however, Norton Antivirus freaks out when your cleanscript.exe is placed in the temporary folder. I am not sure why because it doesn't flip if it is in any other folder, it just freaks when it sees that it is in the temporary folder. I am not sure why this is, it is possible that another program with a similar binary structure or name that is a known virus copies itself into the temporary directory and Norton is falsely detecting it as so.

I have Norton Corporate v10 and it is extremely rare for it to falsely identify an executable, you may want to report this to them.

[Edit]

Upon closer inspection i have found that my script is slower, but removes more stuff than yours. After about 5 passes on the script, mine reduces the size of the script slightly more.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

@taurus905: Did you try it with the new version? Could you give the script's output here?

peethebee

peethebee,

I just downloaded the new version from this post:

http://www.autoitscript.com/forum/index.ph...st&p=223494

The first time I tried it, I named an output file in the "Destination path:" and again it did not produce any output script.

The second time I ran CleanScript GUI.au3 I left "Destination path:" blank and it did produce an output script with the same path and name of the "Source path:" with "_clean.au3" appended.

I am happy with the results and will be using your CleanScript GUI.au3 in the future. :) Thank you.

One suggestion.

I use #Region and #EndRegion but would like these to be cleaned also. I was going to include that cleaning in my Simple Obfuscator.au3 found in my signature, which I will be using along with your CleanScript GUI.au3 and EnCodeIt. Now I have to find the best order in which to use these three scripts.

Keep up the good work. I will be following your progress.

I can see how this could be very useful if it were included in AutoIt sometime in the future.

taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...