Xand3r Posted May 5, 2008 Share Posted May 5, 2008 Is it possible to include files after compilation? for example: i have 2 scripts - main script and second script is there a way to compile the main script and then change the second script and it still gets included ?(with the new content ofc) Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
weaponx Posted May 5, 2008 Share Posted May 5, 2008 To put it simply, no. Think of the compilation process being similar to baking cookies. If one dough has chocolate chips and one has walnuts you can easily integrate them together prior to baking. Once they are baked you can no longer add ingredients. Link to comment Share on other sites More sharing options...
Xand3r Posted May 5, 2008 Author Share Posted May 5, 2008 (edited) well let's use your example : you bake a cake(it's bigger ) and then... lets say u want to add suggar on top that's what i want Edit: i know how to... do it ... sort of but... you have a blank exe that runs the main script wich includes the second script but... that way the main script is not compiled it's just executed Edited May 5, 2008 by TheMadman Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 5, 2008 Share Posted May 5, 2008 Sugar is defined as: write a script parser and parse your secondary script. Link to comment Share on other sites More sharing options...
Xand3r Posted May 5, 2008 Author Share Posted May 5, 2008 (edited) ok .. bad example ... anyway it would be great if we could do that it would be so easy do add `plugins` to our scripts btw: thanks for the replys Edited May 5, 2008 by TheMadman Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 5, 2008 Share Posted May 5, 2008 (edited) There are many ways to fake "plugins", look at how my "Franks Gadget" work or search for others in the Example Scripts forumEdit: PPlayer has plugins, maybe worth checking also Edited May 5, 2008 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Xand3r Posted May 5, 2008 Author Share Posted May 5, 2008 tnx .. i'll check it out Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
weaponx Posted May 5, 2008 Share Posted May 5, 2008 ok .. bad example ...anyway it would be great if we could do that it would be so easy do add `plugins` to our scriptsbtw: thanks for the replys Well you can just keep your scripts uncompiled and distribute them with the autoit wrapper, or use one empty compiled script that just calls your main and secondary scripts using /Autoit3ExecuteScripthttp://www.autoitscript.com/autoit3/docs/i...htm#CommandLine Link to comment Share on other sites More sharing options...
Xand3r Posted May 5, 2008 Author Share Posted May 5, 2008 base.exe: Run(@AutoItExe & ' /AutoIt3ExecuteScript "main.au3"')oÝ÷ Úf¢«·jëh×6$a=InputBox("" , "") If $a="1" Then #include"1.au3" ElseIf $a="2" Then #include"2.au3" EndIfoÝ÷ ÛV®Ý«¢+Ù5Í ½à À°ÅÕ½ÐíÑÍÐÅÕ½Ðì°ÅÕ½ÐíÔÝɽÑÄÅÕ½Ðì¤oÝ÷ Ûf®Ý«¢+Ù5Í ½à À°ÅÕ½ÐíÑÍÐÅÕ½Ðì°ÅÕ½ÐíÔÝɽÑÈÅÕ½Ðì¤ this does exactly what i want but... as u can see the source of the main is not copiled.. well gues i have to ... live with it Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
SkinnyWhiteGuy Posted May 5, 2008 Share Posted May 5, 2008 Your example only works due to 1.au3 and 2.au3 being very simple, and won't work for larger things. #Include Statements are basically Code that the Interpreter sees, and where ever it sees these, it copies the entire file that you reference there in to where the #include line is. So, your example translates to: $a=InputBox("" , "") If $a="1" Then MsgBox(0 , "test" , "u wrote 1") ElseIf $a="2" Then MsgBox(0 , "test" , "u wrote 2") EndIf That is done internally BEFORE your script is ran. Once your script is running, you can delete your files, or just move them onto a FlashDrive, and remove them from the computer, and the program will continue to run with your #include lines, because of this fact. I looked into "plugins" or at least Dynamic Code execution, and after studying how it all works, I personally decided it wasn't worth it for just my play project (game server). Like Richard said, to truly do what you want, you'd have to write your own Script Parser, which is no trivial task. Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 5, 2008 Share Posted May 5, 2008 Hi, maybe you can include all include files in main and then read your second script and execute the source with execute command. Mega P.S: Why updating compiled files? Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Xand3r Posted May 5, 2008 Author Share Posted May 5, 2008 i'm not trying to update compiled files i'm trying to make it possible to add code to an already compiled script by the use of an external .au3.. and... oups i tried what u said about the includes and you were right Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro 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