AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Script Merging Standard

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Veovis



Joined: 13 Feb 2006
Posts: 389
Location: Utah

PostPosted: Tue Jan 30, 2007 11:17 pm    Post subject: Script Merging Standard Reply with quote

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."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Jan 30, 2007 11:22 pm    Post subject: Reply with quote

Nice. I know there will be demand for this.
Back to top
View user's profile Send private message Send e-mail
TucknDar



Joined: 07 Jan 2006
Posts: 47
Location: Oslo, Norway

PostPosted: Wed Jan 31, 2007 8:12 am    Post subject: Reply with quote

Good work. This would be very useful. I'm an AHK novice and merging scripts isn't too easy for me, but I suspect this would be very helpful!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Wed Jan 31, 2007 8:21 am    Post subject: Reply with quote

I already explained merging problems. Its far from easy like you specified......

And you didn't take into account most problematic thing - OnMessage.
And what about Gui numbers ?
Oh.. yes, I forgot this nasty one, for witch there is no solution: if one script has some continious thingie nothing else can work while it does.... as it will block execution of other scripts. It can simply show the message box and all included scripts are doomed. Smile

Also, 3-5 mega of RAM usage is not correct anylisis. Its more like 1-2 MB cuz of planty of shared memory that is repeatedly counted for eatch process.

I think this is the bigest problem of AHK and making this solo thing to work will create entirely different working environment. As multithreading is in question it requires complete redesign of internals of AHK, and you guess that Chris has no time for that. Other developers maybe, one day... but I didn't see this in any scripting language...
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group