A couple weeks ago, i noticed that the various scripts i had downloaded from the forum or made myself were each taking 3-5 megs of memory to run. Not a huge deal, but if you have several running you could be using 20-40 megs of memory. So I created a Master.ahk that contained all of the others (except for some more advanced ones like
launcher and
sysinfo)
One thing that i quickly noticed was that some scripts could not be squished so easily. Many guis are labeled 1,2,3,etc as well as the common 99.
Variables pose another possible overlap. Simple names like val,name,var,temp, etc are too common, and might cause the scripts to interfere with each other. Also, if one script has a memory leak it could pose problems.
Other problems include tray icons, setformat, coordmode etc.
However, these problems can be solved (except guis...) by a standard of programming "etiquette" if you will. i think it would be useful to provide scripts to people in a way that they can be consolidated cleanly and easily.
I have quickly created a BETA script Merger, and depending on the reaction i get from my fellow users i will continue.
Making a script conform to the standard is easy, and will not affect running the script alone. We simply place XML tags within comments in the script
Code:
;<script template="0.1">
;<name>Script Name</name>
;<author>Author</author>
;<version>1.0</version>
;<description>This is the template for the Script Merging Standard 1.0</description>
;<autoexecute>
...
autoexecute code
...
return
;</autoexecute>
;<functions>
...
gosubs, hotkeys, and functions go here
...
;</functions>
;</scripts>
Here is the Script Merger BETA 0.1and two example scripts (Lock Check and my Volume Program)
Download Merger01.zip
I was thinking maybe we could make a standard, unless a var is in a function it must be prepended with something unique like Launch_varname. Things like menu,tray,icon and setformat should be changed just before they are used, and changed back to their default after they are used. That kind of thing. What do you all think?
_________________
"Power can be given overnight, but responsibility must be taught. Long years go into its making."