i am an absolute beginner and have zero experience with programming and / or scripting.
i have been looking at autoit for about one week and thus do not know and / or understand a lot about it.
but: i have started writing a programe. i have not got very far yet, but many hours of tutorial watching and trying out things has brought me to where i am now. to be honest, i did not even think that i would make it this far. trial and error all the way. but i am quite happy to say that my programe works... well... all apart from the most important two functions. but i have given it a good shot and come to the point where my understanding is limited for what i want to do and thus i would need the help of a coding-expert.
to make a long story short i will show what i have got... i guess everything can be copy and pasted apart from the image. it is just an example image but i will upload it anyway.
1. make a simple text file and save it as "test.txt" with the following text within it:
Hammurabi walks into the forest @ 5 o'clock. 2. make a simple text file and save it as "illogic.ini" with the following text within it:
[alternation] alter=2,4,1 ;- 0 for NO alternation [spacing] steps=3 ;- aplies only if alternation is 0 ;- disable function with 0 but alternation must then aply [syntax] syntax=3,5,2 ;- 0 for RANDOM choice [symbols] symbs=a,b,c,d,e,f,g,h,i,j,k,0,1,2,3,4,5,6 ;- symbols to be used in scramble routine 3. save the image as "illogic.jpg" together with the other two files in order to have the same as me in one directory (illogic). or edit the au3 code to match with the rest.
4. save the au3 code below as "illogic.au3" in the same directory.
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> $ini = "illogic.ini" $sections = IniReadSectionNames($ini) For $a = 1 To UBound($sections) - 1 $keys = IniReadSection($ini, $sections[$a]) For $b = 1 To UBound($keys) - 1 ; ConsoleWrite($keys[$b] & @CRLF) ; ShellExecute(IniRead($ini, $sections[$a], $keys[$b], "")) Next Next #Region ### START Koda GUI section ### Form=C:\AutoIt3\illogic\illogic-mask.kxf Global $Navigation = GUICreate("illogic - the illogical scrambler", 1002, 653, -1, -1) Global $File = GUICtrlCreateMenu("&File") Global $NewFile = GUICtrlCreateMenuItem("New File", $File) Global $OpenFile = GUICtrlCreateMenuItem("Open File", $File) Global $SaveAs = GUICtrlCreateMenuItem("Save as...", $File) Global $Exit = GUICtrlCreateMenuItem("Exit", $File) Global $etc = GUICtrlCreateMenu("?") Global $About = GUICtrlCreateMenuItem("About", $etc) Global $scramble = GUICtrlCreateButton("ILLOGIC", 48, 568, 145, 33) Global $descramble = GUICtrlCreateButton("LOGIC", 240, 568, 145, 33) Global $exiteer = GUICtrlCreateButton("EXIT", 808, 568, 145, 33) Global $entry = GUICtrlCreateEdit("", 40, 128, 921, 417) GUICtrlSetData(-1, "Empty File...") GUICtrlSetBkColor(-1, 0xE3E3E3) Global $Pic1 = GUICtrlCreatePic("C:\AutoIt3\illogic\illogic.jpg", 40, 16, 921, 89) Global $reset = GUICtrlCreateButton("RESET", 432, 568, 147, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Global $exitbutton $exitbutton = MsgBox(36, "Close Aplication?", "Bye For Now & See You Next Time...") If $exitbutton = 6 Then Exit Case $Exit Global $exitbutton $exitbutton = MsgBox(36, "Close Aplication?", "Bye For Now & See You Next Time...") If $exitbutton = 6 Then Exit Case $exiteer Global $exitbutton $exitbutton = MsgBox(36, "Close Aplication?", "Bye For Now & See You Next Time...") If $exitbutton = 6 Then Exit Case $About MsgBox(0,"About...","illogic v 1.0") Case $SaveAs $EntryData = GUICtrlRead($entry) $SaveLocation = FileSaveDialog("Save file", @ScriptDir, "All Files (*.*)", 16) FileWrite($SaveLocation, $EntryData) Case $NewFile GUICtrlSetData($entry, "New File...") Case $reset GUICtrlSetData($entry, "Reset...") Case $OpenFile $read = FileOpenDialog("Open File", @ScriptDir, "All Files (*.*)", 16) $text = FileRead($read, -1) GUICtrlSetData($entry, $text) FileClose($text) EndSwitch WEnd That is now a working programe. If you open the test.txt file in the programe it will copy the text into the edit box and that is where my problem starts. I would now like the two only unused buttons "illogic" and "logic" to perform what i have intended them to do and that is where the settings from the ini file become important and also the spot where i need help because being a noobie also means not understanding how to go about solving issues where there are no tutorials...
Pressing "illogic" should transform (with the settings from the ini shown above) the text within the edit box like shown below:
Hchaj16bmemj0u3bdgr0a25bbgi0i5wadaik2alckfks14ceihn13t6egjo tchhj16beefj0o3bdgr0e25sbgi0t5@ad5ik2aoc'fkc14celho13c6egjk3. to explain how the text got scrambled let us look at the ini file:
the alternation "alter=2,4,1" describes that inbetween each letter or space there must be first two, then next four and finally one letter placed in addition to the existing text
the steps "steps=3" describes that inbetween each letter or space there must be 3 additional letters placed. this only aplies when alternation=0
the syntax "syntax=3,5,2" describes which letter must be used in which order. first the 3rd letter then from there on the 5th letter and finally the 2nd letter.
the symbols "symbs=a,b,c,d,e,f,g,h,i,j,k,0,1,2,3,4,5,6" describes what spacing letters can or must be used. basically the full alphabet and numerals and possibly even special chars
it took about twenty minutes to do this manually because i kept getting the couting wrong.
anyway, the illogic button should distort the text in accordence with the settings in the ini file and of course output it in the edit box. then the file should or could be saved as a text file.
i guess you know what the "logic" button is supposed to do... yes, it is supposed to turn the mumble-jumble back into the original text. (as long as the ini file is not altered it should work)
another idea was working with several ini files and adding a choice dropdown for the ini files, but that is not an absolute requirement.
now to my problem:
i have no idea how to carry on form the point i am at now. i have been able to read the ini values into the console but the impossible task begins now trying to make functions or variables for each parameter from the ini-file. that is where i would hope for some help from users who know what they are doing and maybe can take the time to give me a big help.
i am very much hoping for helpful replies.
edit: corrected some mistakes.