norax Posted October 27, 2010 Share Posted October 27, 2010 (edited) im writing a script that will essentially #include specific files like plugins to the main script. here is what i have so far, im having a problem with using 2 or more different "plugins" it will only keep including the data from when it loaded the first time even tho the file is rewritten properly. if i restart it works fine untill i try a different plugin again. any thoughts? expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #Include <File.au3> $Form1 = GUICreate("Plugin Loader", 396, 138, 192, 124) $List1 = GUICtrlCreateList("", 0, 0, 297, 136) $Button1 = GUICtrlCreateButton("Launch Plugin", 304, 0, 91, 25) $Button2 = GUICtrlCreateButton("Add Plugin", 304, 32, 91, 25) $Button3 = GUICtrlCreateButton("Remove Plugin", 304, 56, 91, 25) GUISetState(@SW_SHOW) $plugins = "" $plugint = IniRead("config.ini", "Plugins", "Plugint", "") $0 = 1 While $0 <= $Plugint $plug = IniRead("config.ini", "Plugins", "Plugin" & $0, "") $plugins = $plugins & " " & $plug GUICtrlSetData($List1, $plug) $0 += 1 WEnd While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $plugname = GUICtrlRead($List1) & ".e2s" BufferScript($plugname) EndSwitch WEnd Func BufferScript($plugname) $0 = 1 FileDelete("plugtemp.e2s") While $0 <= _FileCountLines($plugname) FileWrite("plugtemp.e2s", FileReadLine($plugname, $0) & @CRLF) $0 += 1 WEnd #include "plugtemp.e2s" EndFunc heres the config file [Plugins] Plugint=2 Plugin1=WinRefresh Plugin2=EditScript to test make a file with .e2s as extension and put anything for code in it ie: msgbox(0,"1","1"). and a config file that is setup similar to the above. ty in advanced Edited October 27, 2010 by norax Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 28, 2010 Share Posted October 28, 2010 #includeThat weird character at the start makes it a "compiler directive". Includes are not conditional thereby. Whatever is in the include will literally be copied in the script at the location of the include line before the script executes.If you want to use #include for plugins you have to have everything as au3's and restart for any change. .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...
norax Posted October 28, 2010 Author Share Posted October 28, 2010 #includeThat weird character at the start makes it a "compiler directive". Includes are not conditional thereby. Whatever is in the include will literally be copied in the script at the location of the include line before the script executes.If you want to use #include for plugins you have to have everything as au3's and restart for any change. would any other function be more suitable? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 28, 2010 Share Posted October 28, 2010 Easiest would be to just make every plugin it's own app, and then Run() it. .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...
norax Posted October 28, 2010 Author Share Posted October 28, 2010 Easiest would be to just make every plugin it's own app, and then Run() it.well yes but then they wouldnt quite be plugins they would be executables that didnt need the loader script 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