Jump to content

UnKnOwned

Active Members
  • Posts

    33
  • Joined

  • Last visited

Profile Information

  • Interests
    Understanding how things work.

UnKnOwned's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Introduction Plug-in frameworks have basic principles to follow and can support whatever the developer wants it to. There are many options for various languages when it comes to plug-in frameworks but not so much in terms of Autoit. The subject matter here though is not to define what a plug-in framework is suppose to be or what it should support (for a brief overview you can go here) http://en.wikipedia.org/wiki/Plug-in_(computing) Objective 1) Create a minimal non application specific plug-in framework base structure that will support non-compiled .au3 scripts in the form of extended functionality features or plug-ins for AU3 compiled.exe executable's. Model Model Overview The above model demonstrates a chain style plugin whereas all functionality is initiated and received from a global point being the Host Application. Theoretically two directional functionality can take place between both Host Application & plug-ins in the above model reproducing two-way plugin structural behavior. To make this as functional as possible we take out everything in the Host Application, and all we leave behind is a generic skeleton for the framework as well as any application specific instructions for handling incoming plug-ins. The plug-ins ultimately become the functioning parts of the application and/or the application directions for the framework. The Host application becomes a zombie for handling whatever the hell we tell it to handle. All application feature functionality resides in the plug-ins. The Empty Compiled AU3 file is you guessed it, a module a piece of reusable software the middle man for handling parameters that will in turn invoke the plugin same as you would if you brought the Autoit interpreter with you. The plug-ins can then send parameters back to the main application telling it how to respond. During the 2nd initialization of the Host Application via the initialized plug-in we will check for parameters passed. In the end what you have is a very well mannered base component for you application specific framework. One that waits in turn while having a conversation with the other components, only speaks when spoken to, and finishes what it starts in the form of start with one process end with one process. Components 1) Host Application (YourApplication.exe) 2) Empty Compiled Au3 file (pluginloader.exe) - self explanatory 3) Plug-in (plugin.au3) Research Resources https://code.google.com/p/jin-plugin/ http://www.drdobbs.com/cpp/building-your-own-plugin-framework-part/204202899 http://www.eclipse.org/articles/Article-Plug-in-architecture/images/listeners_extensions.jpg http://www.cs.tut.fi/~mda/documentation/eclipse/MadeArchitecture.gif http://www.programcreek.com/wp-content/uploads/2011/09/EclipsePluginArchitecture2.jpg
  2. My apologies guinness, and beg pardon my ignorance and bless your patience. Like this @CompiledAU3.exe <------ PLUGIN.au3 P.S. I do know the term UDF
  3. I only know of what I have listed under the links in my profile.
  4. @PhoenixXL ini contains strings where the macro is not the first or only param, and could be surrounded by other strings hence the question about re. [section] key=Time today is @hour:@min:@sec P.S. Good stuff here, personal thanks for keeping notes like this. @YogiBear I also wanted to add some thanks for the direction as well. After some research of the regex tool included in the help file I was led here Regular expressions do not seem so bad it is like learning dos for %x () //%*#&@^^ crap all over again except with a much more powerful result.
  5. @PhoenixXL I'm not quite sure I follow in terms of expanding Autoit @macros to their values, and since I seem to be terrible at asking questions, I will just show you what I am trying to accomplish. Read ini file sections set key names to Autoit usable variables set key values to Autoit variable values derived from ini key names. At the moment I am only interested in replacing the macros for their values. Snippet Local $Config_File = '.config.ini' Local $INI_Sections = IniReadSectionNames($Config_File) For $i = 1 to $INI_Sections[0] $S_Name = IniReadSection($Config_File, $INI_Sections[$i]) For $x = 1 To $S_Name[0][0] Assign($S_Name[$x][0], get($S_Name[$x][1], 'INI|val')) Next Next Func get($sData, $stype) Switch $stype Case 'INI|val' $ret = _LitMacs($sData) Return($ret) EndSwitch EndFunc To make this work I use this mess Func _LitMacs($sData) $ret = StringReplace($sData, '@AppDataCommonDir', @AppDataCommonDir) $ret = StringReplace($ret, '@AppDataDir', @AppDataDir) $ret = StringReplace($ret, '@AutoItExe', @AutoItExe) $ret = StringReplace($ret, '@AutoItPID', @AutoItPID) $ret = StringReplace($ret, '@AutoItVersion', @AutoItVersion) $ret = StringReplace($ret, '@AutoItX64', @AutoItX64) ;$ret = StringReplace($ret, '@COM_EventObj', @COM_EventObj) $ret = StringReplace($ret, '@CommonFilesDir', @CommonFilesDir) $ret = StringReplace($ret, '@Compiled', @Compiled) $ret = StringReplace($ret, '@ComputerName', @ComputerName) $ret = StringReplace($ret, '@ComSpec', @ComSpec) $ret = StringReplace($ret, '@CPUArch', @CPUArch) $ret = StringReplace($ret, '@CR', @CR) $ret = StringReplace($ret, '@CRLF', @CRLF) $ret = StringReplace($ret, '@DesktopCommonDir', @DesktopCommonDir) $ret = StringReplace($ret, '@DesktopDir', @DesktopDir) $ret = StringReplace($ret, '@DesktopHeight', @DesktopHeight) $ret = StringReplace($ret, '@DesktopWidth', @DesktopWidth) $ret = StringReplace($ret, '@DesktopDepth', @DesktopDepth) $ret = StringReplace($ret, '@DesktopRefresh', @DesktopRefresh) $ret = StringReplace($ret, '@DocumentsCommonDir', @DocumentsCommonDir) $ret = StringReplace($ret, '@error', @error) ;$ret = StringReplace($ret, '@exitCode', @exitCode) ;$ret = StringReplace($ret, '@exitMethod', @exitMethod) $ret = StringReplace($ret, '@extended', @extended) $ret = StringReplace($ret, '@FavoritesCommonDir', @FavoritesCommonDir) $ret = StringReplace($ret, '@FavoritesDir', @FavoritesDir) ;$ret = StringReplace($ret, '@GUI_CtrlId', @GUI_CtrlId) ;$ret = StringReplace($ret, '@GUI_CtrlHandle', @GUI_CtrlHandle) ;$ret = StringReplace($ret, '@GUI_DragId', @GUI_DragId) ;$ret = StringReplace($ret, '@GUI_DragFile', @GUI_DragFile) ;$ret = StringReplace($ret, '@GUI_DropId', @GUI_DropId) ;$ret = StringReplace($ret, '@GUI_WinHandle', @GUI_WinHandle) $ret = StringReplace($ret, '@HomeDrive', @HomeDrive) $ret = StringReplace($ret, '@HomePath', @HomePath) $ret = StringReplace($ret, '@HomeShare', @HomeShare) $ret = StringReplace($ret, '@HOUR', @HOUR) $ret = StringReplace($ret, '@HotKeyPressed', @HotKeyPressed) $ret = StringReplace($ret, '@IPAddress1', @IPAddress1) $ret = StringReplace($ret, '@IPAddress2', @IPAddress2) $ret = StringReplace($ret, '@IPAddress3', @IPAddress3) $ret = StringReplace($ret, '@IPAddress4', @IPAddress4) $ret = StringReplace($ret, '@KBLayout', @KBLayout) $ret = StringReplace($ret, '@LF', @LF) $ret = StringReplace($ret, '@LogonDNSDomain', @LogonDNSDomain) $ret = StringReplace($ret, '@LogonDomain', @LogonDomain) $ret = StringReplace($ret, '@LogonServer', @LogonServer) $ret = StringReplace($ret, '@MDAY', @MDAY) $ret = StringReplace($ret, '@MIN', @MIN) $ret = StringReplace($ret, '@MON', @MON) $ret = StringReplace($ret, '@MSEC', @MSEC) $ret = StringReplace($ret, '@MUILang', @MUILang) $ret = StringReplace($ret, '@MyDocumentsDir', @MyDocumentsDir) $ret = StringReplace($ret, '@NumParams', @NumParams) $ret = StringReplace($ret, '@OSArch', @OSArch) $ret = StringReplace($ret, '@OSBuild', @OSBuild) $ret = StringReplace($ret, '@OSLang', @OSLang) $ret = StringReplace($ret, '@OSServicePack', @OSServicePack) $ret = StringReplace($ret, '@OSType', @OSType) $ret = StringReplace($ret, '@OSVersion', @OSVersion) $ret = StringReplace($ret, '@ProgramFilesDir', @ProgramFilesDir) $ret = StringReplace($ret, '@ProgramsCommonDir', @ProgramsCommonDir) $ret = StringReplace($ret, '@ProgramsDir', @ProgramsDir) $ret = StringReplace($ret, '@ScriptDir', @ScriptDir) $ret = StringReplace($ret, '@ScriptFullPath', @ScriptFullPath) $ret = StringReplace($ret, '@ScriptLineNumber', @ScriptLineNumber) $ret = StringReplace($ret, '@ScriptName', @ScriptName) $ret = StringReplace($ret, '@SEC', @SEC) $ret = StringReplace($ret, '@StartMenuCommonDir', @StartMenuCommonDir) $ret = StringReplace($ret, '@StartMenuDir', @StartMenuDir) $ret = StringReplace($ret, '@StartupCommonDir', @StartupCommonDir) $ret = StringReplace($ret, '@StartupDir', @StartupDir) $ret = StringReplace($ret, '@SW_DISABLE', @SW_DISABLE) $ret = StringReplace($ret, '@SW_ENABLE', @SW_ENABLE) $ret = StringReplace($ret, '@SW_HIDE', @SW_HIDE) $ret = StringReplace($ret, '@SW_LOCK', @SW_LOCK) $ret = StringReplace($ret, '@SW_MAXIMIZE', @SW_MAXIMIZE) $ret = StringReplace($ret, '@SW_MINIMIZE', @SW_MINIMIZE) $ret = StringReplace($ret, '@SW_RESTORE', @SW_RESTORE) $ret = StringReplace($ret, '@SW_SHOW', @SW_SHOW) $ret = StringReplace($ret, '@SW_SHOWDEFAULT', @SW_SHOWDEFAULT) $ret = StringReplace($ret, '@SW_SHOWMAXIMIZED', @SW_SHOWMAXIMIZED) $ret = StringReplace($ret, '@SW_SHOWMINIMIZED', @SW_SHOWMINIMIZED) $ret = StringReplace($ret, '@SW_SHOWMINNOACTIVE', @SW_SHOWMINNOACTIVE) $ret = StringReplace($ret, '@SW_SHOWNA', @SW_SHOWNA) $ret = StringReplace($ret, '@SW_SHOWNOACTIVATE', @SW_SHOWNOACTIVATE) $ret = StringReplace($ret, '@SW_SHOWNORMAL', @SW_SHOWNORMAL) $ret = StringReplace($ret, '@SW_UNLOCK', @SW_UNLOCK) $ret = StringReplace($ret, '@SystemDir', @SystemDir) $ret = StringReplace($ret, '@TAB', @TAB) $ret = StringReplace($ret, '@TempDir', @TempDir) ;$ret = StringReplace($ret, '@TRAY_ID', @TRAY_ID) $ret = StringReplace($ret, '@TrayIconFlashing', @TrayIconFlashing) $ret = StringReplace($ret, '@TrayIconVisible', @TrayIconVisible) $ret = StringReplace($ret, '@UserProfileDir', @UserProfileDir) $ret = StringReplace($ret, '@UserName', @UserName) $ret = StringReplace($ret, '@WDAY', @WDAY) $ret = StringReplace($ret, '@WindowsDir', @WindowsDir) $ret = StringReplace($ret, '@WorkingDir', @WorkingDir) $ret = StringReplace($ret, '@YDAY', @YDAY) $ret = StringReplace($ret, '@YEAR', @YEAR) Return($ret) EndFunc Thank you in advance.
  6. Plugin Framework. Are there some existing projects around? I know of a couple, I am wondering if there are some that I am missing.
  7. Simply put, how do you search a string for Autoit macros using RegEx? Here is where I am at so far. $ret = StringRegExp($sData, '([@]{1,3})(?:\B)') I am reading here http://www.autoitscript.com/autoit3/docs/tutorials/regexp/regexp.htm & http://www.codeproject.com/Articles/9099/The-30-Minute-Regex-Tutorial I do not use if ever regular expressions as I have been misguided but will start using them now.
  8. Looking for a little direction here from the more experienced mindsets. Has anyone substantially tackled this subject yet? Maybe something I have not yet found or just does not exist? I am familiar with what I have listed under the resource links in my profile, but has anyone been able to do this locally yet? No temp files please. Stating some obviousness here so we can be on the same page this go around. #include $somevar never works because that is not how it was designed to work, and makes perfect sense. After compilation of the main files importing, exporting, or extending functionality directly does not work either, scripting language + interpreter = same reason you wont get a compiled .au3 script to run from memory "modau3 please with a side of mashed 00004000 potatoes" at least not legally by Autoit policies. Has this been worked out using pure autoit, or am I just asking stupid questions?
  9. @guinness This seems a more dignified place to start and for us to end this session on. I can understand completely reluctance on your part and without knowing me my internet words can come across a bit trite at times. That mixed with some lazy mindsets can create a disposition non to friendly from the receiving end. Actions will always speak louder than words so it would do me no good in stating that I intend on sticking around for awhile, but I do as long as I am welcome. I was going to send this note of gratitude to you in a PM as it seems best to leave a topic where it was started, "on topic" and ending on a perfect note which you have done so on, "solved". Thank you again for that. I then remembered that prefixing every Google search query with the word "Autoit" 98% of the time leads you to this forum. Between Autoit search queries, included compiled help files with miles of endless guidance, and these forums. The only thing holding anyone back from obtaining an overwhelming abundance of Autoit knowledge would indeed be "THEMSELVES". There is an entire world of knowledge at your finger tips, and anything that is not therefor retained, resides a personal flash drive for the brain. "THE INTERNET" It can be painstaking and time consuming to be a do it yourself-er, but it is much more rewarding in the end. Create a problem for yourself spend half your life figuring out the solution only to realize it consisted of two farts and a yawn, receive no recognition for efforts and I say friend, welcome to the real world. On a more personal note visit my profile page if you care to know the seriousness of this user. I am not here to spam so I will only say it would take but a min to dig up the answer to that initial question. Up until now using Autoit has only been for personal needs not having to apply theories of "Good Coding Practices" or knowing if there is a cleaner easier way to do what was wanted or if what was wanted could even be done with this language. Coding is therapeutic, coding poorly is rigorous. Now the interest has turned to something a little more educational and public. Compared to the other languages I have fiddled with over the years Autoit has a very short learning curve even for a novice programmer which makes for a powerful teaching aid into the introduction of programming logic and methodology. I've started noticing around these forums some of the more seasoned developers dabbling around with objects, memory, assembly, and some other very interesting projects not common to the scripting world. It sparked curiosity that some of these task could be completed with Autoit, interesting. I remember the source from way back when but am no longer current. I don't mind posting progress and examples of mismanaged script code that is full of errors, and some unintentional memory leaks to show willingness. If you stand naked in the rain surely eventually someone will give you some clothes or in this case lend. I hope that these words have been well received as their intent was to inform as well as introduce as I am sure it is all my pleasure. Again I thank you for your assistance on this question and look forward to the future.
  10. @gunniess There is nothing wrong with that. Thank you for reminding me about splitting lines @LF @CR and what have you. Is there any benefit in using one method over another. #include <Array.au3> $exRet = _GetLine() _ArrayDisplay($exRet) Func _GetLine() $exStr = StringSplit(BinaryToString(_Data()), @LF) $exStr[0] = UBound($exStr) - 1 Return($exStr) EndFunc Func _Data() Return( _ '0x48656C6C6F20506C616E65740D0A576F726C64206F72646572206973206F76657272617465640D0A53616C6C7920' & _ '73656C6C73207365617368656C6C7320646F776E206279207468652073656173686F726520626563617573652E2E2E' & _ '0D0A2E2E2E53616C6C7920697320616E20756E656D706C6F796564206869707069652E0D0A' _ ) EndFunc
  11. @guinness I think perhaps you and I have gotten off on the wrong foot, or maybe too many newcomers to these forums like myself have abused those who have tried to help others. So, let me be the first to apologize if anything I have stated thus far has given you the impression that either A you are wasting your time with me or B that I would degrade any response as I am sure a response given by you would be just, and respected coming from someone whom obviously knows the language much more in depth than myself. I am clearly not a teenager, I carry with me no ego, only a thirst for knowledge and understanding. I treat all people the same from the janitor to the president. If I have given you something that would in turn persist you into giving me something back negatively. I do again apologize as it was and is not my intent. This is what I have come up with thus far, but imo I feel much of it is monotonous. #include <Array.au3> #include <String.au3> Local $v_lines = _RegExEng(BinaryToString(_sampData())) msgbox(0, 'Return Virtual Lines', 'Virtual Lines in Returned Array : '& $v_lines[0] & @CRLF) Func _RegExEng($sdat) Local $larr[1] $slen = StringLen($sdat) $nlin = 0 $y = 1 For $x = 1 to $slen $clstr = StringLeft($sdat, $x) $chr = StringTrimLeft($clstr, $x - 1) If $chr = @LF then $nlin = $nlin + 1 $nchr = $x - $nlin * 2 If $nlin = '1' then $clstr = $clstr elseIf $nlin > 4 then $clstr = StringStripWS( _ StringTrimLeft($clstr, $lnchr + $nlin + $y), 1) $y = $y + 1 else $clstr = StringStripWS( _ StringTrimLeft($clstr, $lnchr + $nlin), 1) EndIf If $nlin = '1' then $cstn = $nchr else $cstn = $nchr - $cstn EndIf ReDim $larr[$nlin] $larr[0] = $nlin _ArrayAdd($larr, $clstr) $sstrn = StringSplit($clstr, ' ') ; debug vars msgbox(0, '', _ 'Current Line Number : ' & $nlin & @CRLF & _ 'Current String : ' & $clstr & _ 'Total Chars in String : ' & $cstn & @CRLF & _ 'Number of Chars Read : ' & $nchr & @CRLF & _ 'Number of Sub Strings : ' & $sstrn[0] & @CRLF & @CRLF) $lnchr = $nchr $cstn = $nchr EndIf Next Return($larr) EndFunc Func _sampData() Return( _ '0x48656C6C6F20506C616E65740D0A576F726C64206F72646572206973206F76657272617465640D0A53616C6C7920' & _ '73656C6C73207365617368656C6C7320646F776E206279207468652073656173686F726520626563617573652E2E2E' & _ '0D0A2E2E2E53616C6C7920697320616E20756E656D706C6F796564206869707069652E0D0A' _ ) EndFunc
  12. If we were speaking in literal terms and I could prove it, I would have a viral YouTube video and a new science project. Retirement would come early and the holidays would be something to look forward to. Pseudo INetGetSource('http://www.somesite/File.txt') Readin line by line of the file, store it in a array maybe? Data is now stored and ready for use get data from virtual line 1 And or, amuse me with some regular expressions.
  13. @guinness My apologies, I knew to after rereading my response posted. You must be very exact in your phrasing when it comes to the internet. I just figured with the server reference it would be common sense, but I guess I should have been more specific with the "here's". When I said without wasting server space I was referring to that section of the forums that is designated for such testing. I did not want to waste space there just to see what I like for just a couple of formatting features. Since I am only really using or testing but a couple forum features it is more logical to consolidate the little space really, but more so the content when needing to refer back to what I have used and or posted. Now, Lets stay away from StringReg as it is slower than my wife getting out of bed in the morning. The file for now will just be a plain text file, and inside it will have content like this. Chop Chop If I can understand you then why can't you understand me, and I'm an novice moron. Line number 3 Line number 4 If we grab the data from the file & write it out on the clients end the formatting will remain as it should be, but while the data is still raw it is formatted Chop Chop If I can understand you then why can't you understand me, and I'm an novice moron. Line 3 Line 4 Until it is printed out there is no way to determine line numbers as there are none. So, lets parse the text at the line feed. While the data is still raw turn it into virtual lines whereas Chop Chop would be line 1 Some examples?
  14. @guinness On a server. For arguments sake lets just say a webpage and we will do it in the form of _INetGetSource() I would like to do this. Local $file = FileOpen("test.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 Local $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line) WEnd FileClose($file) ...on the returned _INetGetSource() data This requires parsing of the data, I know. What I am wondering, is if there is a already preexisting Autoit function for this or if one has to be made? @UEZ Because, if you only do what everyone else does, surely you will never evolve into your own. I guess I could have gone down the road of Q. How do you preform a FileReadLine operation when there is no physical file and without creating a temp file to store the data? Case Scenario: Data is stored remotely. Just testing things out, didn't feel like wasting server space here testing out features. I can take out two birds with one stone this way. The second question is answered above in this post. Your final question, stop asking me rhetorical questions, or is this a question?
  15. Topic: Add Line Numbers to Data Inside a Array Q. How to parse string data at @LF. @CR, or CRLF & format into numbered lines stored inside an array using regular expressions. Case Scenario: Data is stored on a server or otherwise remotely and needs to be read and processed internally within the application without creating temp files for the data to be outputted to. Accepted Answers: @guinness #include <Array.au3> Local $sData = BinaryToString(_Data()) Local $aSRE = StringRegExp('Count' & @CRLF & $sData, '([^\r\n]*)(?:\r\n|\n|\r)(?:[\r\n]$)?', 3) $aSRE[0] = UBound($aSRE) - 1 _ArrayDisplay($aSRE) Func _Data() Return '0x48656C6C6F20506C616E65740D0A576F726C64206F72646572206973206F76657272617465640D0A53616C6C7920' & _ '73656C6C73207365617368656C6C7320646F776E206279207468652073656173686F726520626563617573652E2E2E' & _ '0D0A2E2E2E53616C6C7920697320616E20756E656D706C6F796564206869707069652E0D0A' EndFunc ;==>_Data Read: Initial Topic & Question Topic: FileReadLine Operation on Data String not File Q. How do you preform a FileReadLine operation when there is no physical file and without creating a temp file to store the data? Case Scenario: Data is stored remotely.
×
×
  • Create New...