FuryCell Posted July 28, 2005 Share Posted July 28, 2005 (edited) This script takes a constants file and generates a new one with the only constants needed by your script. This is useful as it might speed up your script and shave off a few kb as well.It has a problem with tabs being in the value of the constants as it will delete them. You can turn off this option if tabs are only in the value by creating an ini called config.ini that looks like this. [Main] RemoveTabs=0 This works fine for GuiConstants.au3 as it has not tabs in its values.If interest is high I plan to improve it.Please let me know what you think. -SolidSnakeEdit:Scroll Down to post #7 for the new version. (The tab problem is fixed.) Edited October 10, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
ezzetabi Posted July 28, 2005 Share Posted July 28, 2005 Cool! Link to comment Share on other sites More sharing options...
FuryCell Posted July 28, 2005 Author Share Posted July 28, 2005 Cool!<{POST_SNAPBACK}>Thanks for the feedback.I plan to add more features to it like remembering the last opened path and also get around the tab issue. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
FuryCell Posted July 28, 2005 Author Share Posted July 28, 2005 (edited) Updated. Tab Problem Fixed. Ini file no longer used as there is no longer any problem with tabs. Also forgot to mention it supports command line parameters in the format: ConstantsGenerator "Constants File" "Script File" "Output File" Edited July 29, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
FuryCell Posted July 28, 2005 Author Share Posted July 28, 2005 (edited) Updated again. Fixed a bug where it always saved to out.au3. Here is an example: If you ran Constants Generator on this script with GUIConstants.au3: If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 Opt("GUIResizeMode",$GUI_DOCKLEFT+$GUI_DockBottom) GuiCreate("Test", 220, 40,(@DesktopWidth-220)/2, (@DesktopHeight-40)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $ButtonMB = GuiCtrlCreateButton("Show MsgBox", 0, 0, 220, 40) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $Msg=$ButtonMB MsgBox(0,"Test","This is a test.") Case Else ;;; EndSelect WEnd Exit It would generate a new GUIConstants.au3 that looks like this: Global Const $GUI_EVENT_CLOSE = -3 Global Const $GUI_DOCKLEFT = 0x0002 Global Const $GUI_DOCKBOTTOM = 0x0040 Global Const $WS_OVERLAPPED = 0 Global Const $WS_OVERLAPPEDWINDOW = 0x00CF0000 Global Const $WS_CLIPSIBLINGS = 0x04000000 Global Const $WS_VISIBLE = 0x10000000 I've also seen 4kb shaved off the size of the compiled script and a 3% increase in script startup speed. Edited July 30, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
FuryCell Posted August 2, 2005 Author Share Posted August 2, 2005 (edited) Updated Again. Added:-A GUI-Ability to remember last opened files.-a progress bar-an Icon here are some pics:Note:Made this post a few days ago but hit the delete button by mistake so I had to post it again.Edit: Pics and Zip removed. Get the new version from the post below. Edited December 12, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
FuryCell Posted August 2, 2005 Author Share Posted August 2, 2005 (edited) Updated again. Fixed the ? in the results MsgBox(). Meant for it to have an I and it now shows you a percent reduction for the new constants file. Here are some Pics. ConstGen.zip Edited August 4, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
mr.underperson Posted May 31, 2006 Share Posted May 31, 2006 Excellent idea! I just started doing this, by hand. No more! Thanks! -mu Link to comment Share on other sites More sharing options...
Celeri Posted July 26, 2007 Share Posted July 26, 2007 Well it's been a long time and I think the Constants Generator has been abandonned.Since 3.2 you have to pick each constants file individually . So here's a little DOS magic for you out there:CD C:\Program Files\AutoIT3\Include COPY *constants.au3 allconstants.au3Then choose allconstants.au3 as your Input Constants File.BEWARE: These constants are made into includes so that new values and bugs are easy to implement. By manually integrating these constants into your program you will not benefit from these changes (although I'm betting nothing much will happen ehehehe).If you have no idea what this is then you probably should not mess with this! I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!) Link to comment Share on other sites More sharing options...
ashley Posted July 26, 2007 Share Posted July 26, 2007 i can see this becomeing a sticky.. also i think sould be include in next version of autoit... tell a mod... Free icons for your programs Link to comment Share on other sites More sharing options...
MHz Posted July 26, 2007 Share Posted July 26, 2007 Well it's been a long time and I think the Constants Generator has been abandonned.Since 3.2 you have to pick each constants file individually .I just do it by right clicking on the script and using SendToA3X which has a Constants Generator based on SolidSnake's Constants Generator code. Link to comment Share on other sites More sharing options...
Celeri Posted July 27, 2007 Share Posted July 27, 2007 I just do it by right clicking on the script and using SendToA3X which has a Constants Generator based on SolidSnake's Constants Generator code.And I taught I was so smart Hey I remember installing this a while ago ... didn't know it could do that ... maybe it couldn't back then. I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!) Link to comment Share on other sites More sharing options...
FuryCell Posted July 28, 2007 Author Share Posted July 28, 2007 I just do it by right clicking on the script and using SendToA3X which has a Constants Generator based on SolidSnake's Constants Generator code.Glad to see my old code is being put to use. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
MHz Posted July 28, 2007 Share Posted July 28, 2007 Glad to see my old code is being put to use. What can I say. Your code is priceless. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now