Jump to content

Project: illogic - the illogical scrambler (a customizable word scrambler)


Recommended Posts

@roeselpi 

In that kind of case you should remake a new thread. 

 

Becose you're asking much different things. and people probably wont read this until here. 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

hmm, i do not really want to start a new topic for every question i might have, if it all is about one script or individual parts of that script. i was taught to do one topic and follow up on that topic until it is resolved. mostly mods do not take kindly to multiple threads on just one topic. that is kind of like a no go for most moderators. i do not want to get in trouble for something like that here, because the forum is very helpful for newbies like myself.

Link to comment
Share on other sites

hello, 

update: only 1 bug left... 

bug description: when text is scrambled it only uses one ini-setting and not all ten of the individual ini mode.

code at present:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#include <WinAPIFiles.au3>
#include <MsgBoxConstants.au3>
#include <StringConstants.au3>
#include <Array.au3>
#include <String.au3>
#include <ComboConstants.au3>

#Region ### START Koda GUI section ### Form=C:\AutoIt3\illogic\illlogic-mask3.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, $ES_WANTRETURN + $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE)
GUICtrlSetData(-1, "Empty File...")
GUICtrlSetBkColor(-1, 0xE3E3E3)
Global $Pic1 = GUICtrlCreatePic("C:\AutoIt3\SciTE\heartbeat.jpg", 40, 16, 393, 89)
Global $reset = GUICtrlCreateButton("RESET", 432, 568, 147, 33)
Global $iniselect = GUICtrlCreateGroup("ini-file Selection", 456, 16, 505, 41)
Global $inifile1 = GUICtrlCreateRadio("ini-file 1", 464, 32, 85, 17)
Global $inifile2 = GUICtrlCreateRadio("ini-file 2", 568, 32, 85, 17)
Global $inifile3 = GUICtrlCreateRadio("ini-file 3", 672, 32, 85, 17)
Global $inifile4 = GUICtrlCreateRadio("ini-file 4", 776, 32, 85, 17)
Global $inifile5 = GUICtrlCreateRadio("ini-file 5", 872, 32, 85, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $modeselect = GUICtrlCreateGroup("Mode Selection", 456, 64, 505, 41)
Global $modus1 = GUICtrlCreateRadio("mode 1", 464, 80, 85, 17)
Global $modus2 = GUICtrlCreateRadio("mode 2", 568, 80, 85, 17)
Global $modus3 = GUICtrlCreateRadio("mode 3", 672, 80, 89, 17)
Global $modus4 = GUICtrlCreateRadio("mode 4", 776, 80, 85, 17)
Global $modus5 = GUICtrlCreateRadio("mode 5", 872, 80, 85, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $seeyou, $close, $aboutbox, $version
$close = "Close Aplication?"
$seeyou = "Bye For Now & See You Next Time..."
$aboutbox = "About ..."
$version = "illogic v. 1.2 - the illogical scrambler" & @CRLF & @CRLF & "(c) 2019 roeselpi" & @CRLF & @CRLF & "with a lot of help from the autoitscript.com forum, thanks a lot!"

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Global $exitbutton
            $exitbutton = MsgBox(36, $close, $seeyou)
            If $exitbutton = 6 Then Exit

        Case $Exit
            Global $exitbutton
            $exitbutton = MsgBox(36, $close, $seeyou)
            If $exitbutton = 6 Then Exit

        Case $exiteer
            Global $exitbutton
            $exitbutton = MsgBox(36, $close, $seeyou)
            If $exitbutton = 6 Then Exit

        Case $About
            MsgBox(0, $aboutbox, $version)

        Case $SaveAs
            $EntryData = GUICtrlRead($entry)
            $SaveLocation = FileSaveDialog("Save file", @ScriptDir, "All Files (*.*)", 16)
            FileOpen($SaveLocation, 2)
            FileWrite($SaveLocation, $EntryData)
            FileClose

        Case $NewFile
            GUICtrlSetData($entry, "New File...")

        Case $reset
            GUICtrlSetData($entry, "Reset...")
            GUICtrlSetState($inifile1, $GUI_UNCHECKED)
            GUICtrlSetState($inifile2, $GUI_UNCHECKED)
            GUICtrlSetState($inifile3, $GUI_UNCHECKED)
            GUICtrlSetState($inifile4, $GUI_UNCHECKED)
            GUICtrlSetState($inifile5, $GUI_UNCHECKED)
            GUICtrlSetState($modus1, $GUI_UNCHECKED)
            GUICtrlSetState($modus2, $GUI_UNCHECKED)
            GUICtrlSetState($modus3, $GUI_UNCHECKED)
            GUICtrlSetState($modus4, $GUI_UNCHECKED)
            GUICtrlSetState($modus5, $GUI_UNCHECKED)

        Case $OpenFile
            $read = FileOpenDialog("Open File", @ScriptDir, "All Files (*.*)", 2)
            $text = FileRead($read, -1)
            GUICtrlSetData($entry, $text)
            FileClose($text)

        Case $inifile1
            $file1 = "illogic1.ini"

        Case $inifile2
            $file2 = "illogic2.ini"

        Case $inifile3
            $file3 = "illogic3.ini"

        Case $inifile4
            $file4 = "illogic4.ini"

        Case $inifile5
            $file5 = "illogic5.ini"

        Case $modus1
            If GUICtrlRead($inifile1) = 1 Then
            $m1k = IniReadSection($file1, "mode 1")
            $m1k = _ArrayExtract($m1k, 1, -1, 1, 1)
            $m1k00 = $m1k[0]
            $m1k01 = $m1k[1]
            $m1k02 = $m1k[2]
            $m1k03 = $m1k[3]
            $m1k04 = $m1k[4]
            $m1k05 = $m1k[5]
            $m1k06 = $m1k[6]
            $m1k07 = $m1k[7]
            $m1k08 = $m1k[8]
            $m1k09 = $m1k[9]
            Global $Mode1Array = [$m1k00, $m1k01, $m1k02, $m1k03, $m1k04, $m1k05, $m1k06, $m1k07, $m1k08, $m1k09] ; Mode 1
            Global $replace1Array[11][2] = [[$m1k00, ""], [$m1k01, ""], [$m1k02, ""], [$m1k03, ""], [$m1k04, ""], [$m1k05, ""], [$m1k06, ""], [$m1k07, ""], [$m1k08, ""], [$m1k09, ""], ["_", " "]] ; Mode 1
            ;MsgBox(0,0,$m1k03) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile2) = 1 Then
            $m1k = IniReadSection($file2, "mode 1")
            $m1k = _ArrayExtract($m1k, 1, -1, 1, 1)
            $m1k00 = $m1k[0]
            $m1k01 = $m1k[1]
            $m1k02 = $m1k[2]
            $m1k03 = $m1k[3]
            $m1k04 = $m1k[4]
            $m1k05 = $m1k[5]
            $m1k06 = $m1k[6]
            $m1k07 = $m1k[7]
            $m1k08 = $m1k[8]
            $m1k09 = $m1k[9]
            Global $Mode1Array = [$m1k00, $m1k01, $m1k02, $m1k03, $m1k04, $m1k05, $m1k06, $m1k07, $m1k08, $m1k09] ; Mode 1
            Global $replace1Array[11][2] = [[$m1k00, ""], [$m1k01, ""], [$m1k02, ""], [$m1k03, ""], [$m1k04, ""], [$m1k05, ""], [$m1k06, ""], [$m1k07, ""], [$m1k08, ""], [$m1k09, ""], ["_", " "]] ; Mode 1
            ;MsgBox(0,0,$m1k05) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile3) = 1 Then
            $m1k = IniReadSection($file3, "mode 1")
            $m1k = _ArrayExtract($m1k, 1, -1, 1, 1)
            $m1k00 = $m1k[0]
            $m1k01 = $m1k[1]
            $m1k02 = $m1k[2]
            $m1k03 = $m1k[3]
            $m1k04 = $m1k[4]
            $m1k05 = $m1k[5]
            $m1k06 = $m1k[6]
            $m1k07 = $m1k[7]
            $m1k08 = $m1k[8]
            $m1k09 = $m1k[9]
            Global $Mode1Array = [$m1k00, $m1k01, $m1k02, $m1k03, $m1k04, $m1k05, $m1k06, $m1k07, $m1k08, $m1k09] ; Mode 1
            Global $replace1Array[11][2] = [[$m1k00, ""], [$m1k01, ""], [$m1k02, ""], [$m1k03, ""], [$m1k04, ""], [$m1k05, ""], [$m1k06, ""], [$m1k07, ""], [$m1k08, ""], [$m1k09, ""], ["_", " "]] ; Mode 1
            ;MsgBox(0,0,$m1k07) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile4) = 1 Then
            $m1k = IniReadSection($file4, "mode 1")
            $m1k = _ArrayExtract($m1k, 1, -1, 1, 1)
            $m1k00 = $m1k[0]
            $m1k01 = $m1k[1]
            $m1k02 = $m1k[2]
            $m1k03 = $m1k[3]
            $m1k04 = $m1k[4]
            $m1k05 = $m1k[5]
            $m1k06 = $m1k[6]
            $m1k07 = $m1k[7]
            $m1k08 = $m1k[8]
            $m1k09 = $m1k[9]
            Global $Mode1Array = [$m1k00, $m1k01, $m1k02, $m1k03, $m1k04, $m1k05, $m1k06, $m1k07, $m1k08, $m1k09] ; Mode 1
            Global $replace1Array[11][2] = [[$m1k00, ""], [$m1k01, ""], [$m1k02, ""], [$m1k03, ""], [$m1k04, ""], [$m1k05, ""], [$m1k06, ""], [$m1k07, ""], [$m1k08, ""], [$m1k09, ""], ["_", " "]] ; Mode 1
            ;MsgBox(0,0,$m1k09) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile5) = 1 Then
            $m1k = IniReadSection($file5, "mode 1")
            $m1k = _ArrayExtract($m1k, 1, -1, 1, 1)
            $m1k00 = $m1k[0]
            $m1k01 = $m1k[1]
            $m1k02 = $m1k[2]
            $m1k03 = $m1k[3]
            $m1k04 = $m1k[4]
            $m1k05 = $m1k[5]
            $m1k06 = $m1k[6]
            $m1k07 = $m1k[7]
            $m1k08 = $m1k[8]
            $m1k09 = $m1k[9]
            Global $Mode1Array = [$m1k00, $m1k01, $m1k02, $m1k03, $m1k04, $m1k05, $m1k06, $m1k07, $m1k08, $m1k09] ; Mode 1
            Global $replace1Array[11][2] = [[$m1k00, ""], [$m1k01, ""], [$m1k02, ""], [$m1k03, ""], [$m1k04, ""], [$m1k05, ""], [$m1k06, ""], [$m1k07, ""], [$m1k08, ""], [$m1k09, ""], ["_", " "]] ; Mode 1
            ;MsgBox(0,0,$m1k01) ; --- just for test purposes
            EndIf

        Case $modus2
            If GUICtrlRead($inifile1) = 1 Then
            $m2k = IniReadSection($file1, "mode 2")
            $m2k = _ArrayExtract($m2k, 1, -1, 1, 1)
            $m2k00 = $m2k[0]
            $m2k01 = $m2k[1]
            $m2k02 = $m2k[2]
            $m2k03 = $m2k[3]
            $m2k04 = $m2k[4]
            $m2k05 = $m2k[5]
            $m2k06 = $m2k[6]
            $m2k07 = $m2k[7]
            $m2k08 = $m2k[8]
            $m2k09 = $m2k[9]
            Global $Mode2Array = [$m2k00, $m2k01, $m2k02, $m2k03, $m2k04, $m2k05, $m2k06, $m2k07, $m2k08, $m2k09] ; Mode 2
            Global $replace2Array[11][2] = [[$m2k00, ""], [$m2k01, ""], [$m2k02, ""], [$m2k03, ""], [$m2k04, ""], [$m2k05, ""], [$m2k06, ""], [$m2k07, ""], [$m2k08, ""], [$m2k09, ""], ["_", " "]] ; Mode 2
            ;MsgBox(0,0,$m2k03) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile2) = 1 Then
            $m2k = IniReadSection($file2, "mode 2")
            $m2k = _ArrayExtract($m2k, 1, -1, 1, 1)
            $m2k00 = $m2k[0]
            $m2k01 = $m2k[1]
            $m2k02 = $m2k[2]
            $m2k03 = $m2k[3]
            $m2k04 = $m2k[4]
            $m2k05 = $m2k[5]
            $m2k06 = $m2k[6]
            $m2k07 = $m2k[7]
            $m2k08 = $m2k[8]
            $m2k09 = $m2k[9]
            Global $Mode2Array = [$m2k00, $m2k01, $m2k02, $m2k03, $m2k04, $m2k05, $m2k06, $m2k07, $m2k08, $m2k09] ; Mode 2
            Global $replace2Array[11][2] = [[$m2k00, ""], [$m2k01, ""], [$m2k02, ""], [$m2k03, ""], [$m2k04, ""], [$m2k05, ""], [$m2k06, ""], [$m2k07, ""], [$m2k08, ""], [$m2k09, ""], ["_", " "]] ; Mode 2
            ;MsgBox(0,0,$m2k04) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile3) = 1 Then
            $m2k = IniReadSection($file3, "mode 2")
            $m2k = _ArrayExtract($m2k, 1, -1, 1, 1)
            $m2k00 = $m2k[0]
            $m2k01 = $m2k[1]
            $m2k02 = $m2k[2]
            $m2k03 = $m2k[3]
            $m2k04 = $m2k[4]
            $m2k05 = $m2k[5]
            $m2k06 = $m2k[6]
            $m2k07 = $m2k[7]
            $m2k08 = $m2k[8]
            $m2k09 = $m2k[9]
            Global $Mode2Array = [$m2k00, $m2k01, $m2k02, $m2k03, $m2k04, $m2k05, $m2k06, $m2k07, $m2k08, $m2k09] ; Mode 2
            Global $replace2Array[11][2] = [[$m2k00, ""], [$m2k01, ""], [$m2k02, ""], [$m2k03, ""], [$m2k04, ""], [$m2k05, ""], [$m2k06, ""], [$m2k07, ""], [$m2k08, ""], [$m2k09, ""], ["_", " "]] ; Mode 2
            ;MsgBox(0,0,$m2k07) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile4) = 1 Then
            $m2k = IniReadSection($file4, "mode 2")
            $m2k = _ArrayExtract($m2k, 1, -1, 1, 1)
            $m2k00 = $m2k[0]
            $m2k01 = $m2k[1]
            $m2k02 = $m2k[2]
            $m2k03 = $m2k[3]
            $m2k04 = $m2k[4]
            $m2k05 = $m2k[5]
            $m2k06 = $m2k[6]
            $m2k07 = $m2k[7]
            $m2k08 = $m2k[8]
            $m2k09 = $m2k[9]
            Global $Mode2Array = [$m2k00, $m2k01, $m2k02, $m2k03, $m2k04, $m2k05, $m2k06, $m2k07, $m2k08, $m2k09] ; Mode 2
            Global $replace2Array[11][2] = [[$m2k00, ""], [$m2k01, ""], [$m2k02, ""], [$m2k03, ""], [$m2k04, ""], [$m2k05, ""], [$m2k06, ""], [$m2k07, ""], [$m2k08, ""], [$m2k09, ""], ["_", " "]] ; Mode 2
            ;MsgBox(0,0,$m2k09) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile5) = 1 Then
            $m2k = IniReadSection($file5, "mode 2")
            $m2k = _ArrayExtract($m2k, 1, -1, 1, 1)
            $m2k00 = $m2k[0]
            $m2k01 = $m2k[1]
            $m2k02 = $m2k[2]
            $m2k03 = $m2k[3]
            $m2k04 = $m2k[4]
            $m2k05 = $m2k[5]
            $m2k06 = $m2k[6]
            $m2k07 = $m2k[7]
            $m2k08 = $m2k[8]
            $m2k09 = $m2k[9]
            Global $Mode2Array = [$m2k00, $m2k01, $m2k02, $m2k03, $m2k04, $m2k05, $m2k06, $m2k07, $m2k08, $m2k09] ; Mode 2
            Global $replace2Array[11][2] = [[$m2k00, ""], [$m2k01, ""], [$m2k02, ""], [$m2k03, ""], [$m2k04, ""], [$m2k05, ""], [$m2k06, ""], [$m2k07, ""], [$m2k08, ""], [$m2k09, ""], ["_", " "]] ; Mode 2
            ;MsgBox(0,0,$m2k01) ; --- just for test purposes
            EndIf

        Case $modus3
            If GUICtrlRead($inifile1) = 1 Then
            $m3k = IniReadSection($file1, "mode 3")
            $m3k = _ArrayExtract($m3k, 1, -1, 1, 1)
            $m3k00 = $m3k[0]
            $m3k01 = $m3k[1]
            $m3k02 = $m3k[2]
            $m3k03 = $m3k[3]
            $m3k04 = $m3k[4]
            $m3k05 = $m3k[5]
            $m3k06 = $m3k[6]
            $m3k07 = $m3k[7]
            $m3k08 = $m3k[8]
            $m3k09 = $m3k[9]
            Global $Mode3Array = [$m3k00, $m3k01, $m3k02, $m3k03, $m3k04, $m3k05, $m3k06, $m3k07, $m3k08, $m3k09] ; Mode 3
            Global $replace3Array[11][2] = [[$m3k00, ""], [$m3k01, ""], [$m3k02, ""], [$m3k03, ""], [$m3k04, ""], [$m3k05, ""], [$m3k06, ""], [$m3k07, ""], [$m3k08, ""], [$m3k09, ""], ["_", " "]] ; Mode 3
            ;MsgBox(0,0,$m3k02) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile2) = 1 Then
            $m3k = IniReadSection($file2, "mode 3")
            $m3k = _ArrayExtract($m3k, 1, -1, 1, 1)
            $m3k00 = $m3k[0]
            $m3k01 = $m3k[1]
            $m3k02 = $m3k[2]
            $m3k03 = $m3k[3]
            $m3k04 = $m3k[4]
            $m3k05 = $m3k[5]
            $m3k06 = $m3k[6]
            $m3k07 = $m3k[7]
            $m3k08 = $m3k[8]
            $m3k09 = $m3k[9]
            Global $Mode3Array = [$m3k00, $m3k01, $m3k02, $m3k03, $m3k04, $m3k05, $m3k06, $m3k07, $m3k08, $m3k09] ; Mode 3
            Global $replace3Array[11][2] = [[$m3k00, ""], [$m3k01, ""], [$m3k02, ""], [$m3k03, ""], [$m3k04, ""], [$m3k05, ""], [$m3k06, ""], [$m3k07, ""], [$m3k08, ""], [$m3k09, ""], ["_", " "]] ; Mode 3
            ;MsgBox(0,0,$m3k04) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile3) = 1 Then
            $m3k = IniReadSection($file3, "mode 3")
            $m3k = _ArrayExtract($m3k, 1, -1, 1, 1)
            $m3k00 = $m3k[0]
            $m3k01 = $m3k[1]
            $m3k02 = $m3k[2]
            $m3k03 = $m3k[3]
            $m3k04 = $m3k[4]
            $m3k05 = $m3k[5]
            $m3k06 = $m3k[6]
            $m3k07 = $m3k[7]
            $m3k08 = $m3k[8]
            $m3k09 = $m3k[9]
            Global $Mode3Array = [$m3k00, $m3k01, $m3k02, $m3k03, $m3k04, $m3k05, $m3k06, $m3k07, $m3k08, $m3k09] ; Mode 3
            Global $replace3Array[11][2] = [[$m3k00, ""], [$m3k01, ""], [$m3k02, ""], [$m3k03, ""], [$m3k04, ""], [$m3k05, ""], [$m3k06, ""], [$m3k07, ""], [$m3k08, ""], [$m3k09, ""], ["_", " "]] ; Mode 3
            ;MsgBox(0,0,$m3k06) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile4) = 1 Then
            $m3k = IniReadSection($file4, "mode 3")
            $m3k = _ArrayExtract($m3k, 1, -1, 1, 1)
            $m3k00 = $m3k[0]
            $m3k01 = $m3k[1]
            $m3k02 = $m3k[2]
            $m3k03 = $m3k[3]
            $m3k04 = $m3k[4]
            $m3k05 = $m3k[5]
            $m3k06 = $m3k[6]
            $m3k07 = $m3k[7]
            $m3k08 = $m3k[8]
            $m3k09 = $m3k[9]
            Global $Mode3Array = [$m3k00, $m3k01, $m3k02, $m3k03, $m3k04, $m3k05, $m3k06, $m3k07, $m3k08, $m3k09] ; Mode 3
            Global $replace3Array[11][2] = [[$m3k00, ""], [$m3k01, ""], [$m3k02, ""], [$m3k03, ""], [$m3k04, ""], [$m3k05, ""], [$m3k06, ""], [$m3k07, ""], [$m3k08, ""], [$m3k09, ""], ["_", " "]] ; Mode 3
            ;MsgBox(0,0,$m3k08) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile5) = 1 Then
            $m3k = IniReadSection($file5, "mode 3")
            $m3k = _ArrayExtract($m3k, 1, -1, 1, 1)
            $m3k00 = $m3k[0]
            $m3k01 = $m3k[1]
            $m3k02 = $m3k[2]
            $m3k03 = $m3k[3]
            $m3k04 = $m3k[4]
            $m3k05 = $m3k[5]
            $m3k06 = $m3k[6]
            $m3k07 = $m3k[7]
            $m3k08 = $m3k[8]
            $m3k09 = $m3k[9]
            Global $Mode3Array = [$m3k00, $m3k01, $m3k02, $m3k03, $m3k04, $m3k05, $m3k06, $m3k07, $m3k08, $m3k09] ; Mode 3
            Global $replace3Array[11][2] = [[$m3k00, ""], [$m3k01, ""], [$m3k02, ""], [$m3k03, ""], [$m3k04, ""], [$m3k05, ""], [$m3k06, ""], [$m3k07, ""], [$m3k08, ""], [$m3k09, ""], ["_", " "]] ; Mode 3
            ;MsgBox(0,0,$m3k00) ; --- just for test purposes
            EndIf

        Case $modus4
            If GUICtrlRead($inifile1) = 1 Then
            $m4k = IniReadSection($file1, "mode 4")
            $m4k = _ArrayExtract($m4k, 1, -1, 1, 1)
            $m4k00 = $m4k[0]
            $m4k01 = $m4k[1]
            $m4k02 = $m4k[2]
            $m4k03 = $m4k[3]
            $m4k04 = $m4k[4]
            $m4k05 = $m4k[5]
            $m4k06 = $m4k[6]
            $m4k07 = $m4k[7]
            $m4k08 = $m4k[8]
            $m4k09 = $m4k[9]
            Global $Mode4Array = [$m4k00, $m4k01, $m4k02, $m4k03, $m4k04, $m4k05, $m4k06, $m4k07, $m4k08, $m4k09] ; Mode 4
            Global $replace4Array[11][2] = [[$m4k00, ""], [$m4k01, ""], [$m4k02, ""], [$m4k03, ""], [$m4k04, ""], [$m4k05, ""], [$m4k06, ""], [$m4k07, ""], [$m4k08, ""], [$m4k09, ""], ["_", " "]] ; Mode 4
            ;MsgBox(0,0,$m4k02) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile2) = 1 Then
            $m4k = IniReadSection($file2, "mode 4")
            $m4k = _ArrayExtract($m4k, 1, -1, 1, 1)
            $m4k00 = $m4k[0]
            $m4k01 = $m4k[1]
            $m4k02 = $m4k[2]
            $m4k03 = $m4k[3]
            $m4k04 = $m4k[4]
            $m4k05 = $m4k[5]
            $m4k06 = $m4k[6]
            $m4k07 = $m4k[7]
            $m4k08 = $m4k[8]
            $m4k09 = $m4k[9]
            Global $Mode4Array = [$m4k00, $m4k01, $m4k02, $m4k03, $m4k04, $m4k05, $m4k06, $m4k07, $m4k08, $m4k09] ; Mode 4
            Global $replace4Array[11][2] = [[$m4k00, ""], [$m4k01, ""], [$m4k02, ""], [$m4k03, ""], [$m4k04, ""], [$m4k05, ""], [$m4k06, ""], [$m4k07, ""], [$m4k08, ""], [$m4k09, ""], ["_", " "]] ; Mode 4
            ;MsgBox(0,0,$m4k04) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile3) = 1 Then
            $m4k = IniReadSection($file3, "mode 4")
            $m4k = _ArrayExtract($m4k, 1, -1, 1, 1)
            $m4k00 = $m4k[0]
            $m4k01 = $m4k[1]
            $m4k02 = $m4k[2]
            $m4k03 = $m4k[3]
            $m4k04 = $m4k[4]
            $m4k05 = $m4k[5]
            $m4k06 = $m4k[6]
            $m4k07 = $m4k[7]
            $m4k08 = $m4k[8]
            $m4k09 = $m4k[9]
            Global $Mode4Array = [$m4k00, $m4k01, $m4k02, $m4k03, $m4k04, $m4k05, $m4k06, $m4k07, $m4k08, $m4k09] ; Mode 4
            Global $replace4Array[11][2] = [[$m4k00, ""], [$m4k01, ""], [$m4k02, ""], [$m4k03, ""], [$m4k04, ""], [$m4k05, ""], [$m4k06, ""], [$m4k07, ""], [$m4k08, ""], [$m4k09, ""], ["_", " "]] ; Mode 4
            ;MsgBox(0,0,$m4k06) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile4) = 1 Then
            $m4k = IniReadSection($file4, "mode 4")
            $m4k = _ArrayExtract($m4k, 1, -1, 1, 1)
            $m4k00 = $m4k[0]
            $m4k01 = $m4k[1]
            $m4k02 = $m4k[2]
            $m4k03 = $m4k[3]
            $m4k04 = $m4k[4]
            $m4k05 = $m4k[5]
            $m4k06 = $m4k[6]
            $m4k07 = $m4k[7]
            $m4k08 = $m4k[8]
            $m4k09 = $m4k[9]
            Global $Mode4Array = [$m4k00, $m4k01, $m4k02, $m4k03, $m4k04, $m4k05, $m4k06, $m4k07, $m4k08, $m4k09] ; Mode 4
            Global $replace4Array[11][2] = [[$m4k00, ""], [$m4k01, ""], [$m4k02, ""], [$m4k03, ""], [$m4k04, ""], [$m4k05, ""], [$m4k06, ""], [$m4k07, ""], [$m4k08, ""], [$m4k09, ""], ["_", " "]] ; Mode 4
            ;MsgBox(0,0,$m4k08) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile5) = 1 Then
            $m4k = IniReadSection($file5, "mode 4")
            $m4k = _ArrayExtract($m4k, 1, -1, 1, 1)
            $m4k00 = $m4k[0]
            $m4k01 = $m4k[1]
            $m4k02 = $m4k[2]
            $m4k03 = $m4k[3]
            $m4k04 = $m4k[4]
            $m4k05 = $m4k[5]
            $m4k06 = $m4k[6]
            $m4k07 = $m4k[7]
            $m4k08 = $m4k[8]
            $m4k09 = $m4k[9]
            Global $Mode4Array = [$m4k00, $m4k01, $m4k02, $m4k03, $m4k04, $m4k05, $m4k06, $m4k07, $m4k08, $m4k09] ; Mode 4
            Global $replace4Array[11][2] = [[$m4k00, ""], [$m4k01, ""], [$m4k02, ""], [$m4k03, ""], [$m4k04, ""], [$m4k05, ""], [$m4k06, ""], [$m4k07, ""], [$m4k08, ""], [$m4k09, ""], ["_", " "]] ; Mode 4
            ;MsgBox(0,0,$m4k00) ; --- just for test purposes
            EndIf

        Case $modus5
            If GUICtrlRead($inifile1) = 1 Then
            $m5k = IniReadSection($file1, "mode 5")
            $m5k = _ArrayExtract($m5k, 1, -1, 1, 1)
            $m5k00 = $m5k[0]
            $m5k01 = $m5k[1]
            $m5k02 = $m5k[2]
            $m5k03 = $m5k[3]
            $m5k04 = $m5k[4]
            $m5k05 = $m5k[5]
            $m5k06 = $m5k[6]
            $m5k07 = $m5k[7]
            $m5k08 = $m5k[8]
            $m5k09 = $m5k[9]
            Global $Mode5Array = [$m5k00, $m5k01, $m5k02, $m5k03, $m5k04, $m5k05, $m5k06, $m5k07, $m5k08, $m5k09] ; Mode 5
            Global $replace5Array[11][2] = [[$m5k00, ""], [$m5k01, ""], [$m5k02, ""], [$m5k03, ""], [$m5k04, ""], [$m5k05, ""], [$m5k06, ""], [$m5k07, ""], [$m5k08, ""], [$m5k09, ""], ["_", " "]] ; Mode 5
            ;MsgBox(0,0,$m5k00) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile2) = 1 Then
            $m5k = IniReadSection($file2, "mode 5")
            $m5k = _ArrayExtract($m5k, 1, -1, 1, 1)
            $m5k00 = $m5k[0]
            $m5k01 = $m5k[1]
            $m5k02 = $m5k[2]
            $m5k03 = $m5k[3]
            $m5k04 = $m5k[4]
            $m5k05 = $m5k[5]
            $m5k06 = $m5k[6]
            $m5k07 = $m5k[7]
            $m5k08 = $m5k[8]
            $m5k09 = $m5k[9]
            Global $Mode5Array = [$m5k00, $m5k01, $m5k02, $m5k03, $m5k04, $m5k05, $m5k06, $m5k07, $m5k08, $m5k09] ; Mode 5
            Global $replace5Array[11][2] = [[$m5k00, ""], [$m5k01, ""], [$m5k02, ""], [$m5k03, ""], [$m5k04, ""], [$m5k05, ""], [$m5k06, ""], [$m5k07, ""], [$m5k08, ""], [$m5k09, ""], ["_", " "]] ; Mode 5
            ;MsgBox(0,0,$m5k02) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile3) = 1 Then
            $m5k = IniReadSection($file3, "mode 5")
            $m5k = _ArrayExtract($m5k, 1, -1, 1, 1)
            $m5k00 = $m5k[0]
            $m5k01 = $m5k[1]
            $m5k02 = $m5k[2]
            $m5k03 = $m5k[3]
            $m5k04 = $m5k[4]
            $m5k05 = $m5k[5]
            $m5k06 = $m5k[6]
            $m5k07 = $m5k[7]
            $m5k08 = $m5k[8]
            $m5k09 = $m5k[9]
            Global $Mode5Array = [$m5k00, $m5k01, $m5k02, $m5k03, $m5k04, $m5k05, $m5k06, $m5k07, $m5k08, $m5k09] ; Mode 5
            Global $replace5Array[11][2] = [[$m5k00, ""], [$m5k01, ""], [$m5k02, ""], [$m5k03, ""], [$m5k04, ""], [$m5k05, ""], [$m5k06, ""], [$m5k07, ""], [$m5k08, ""], [$m5k09, ""], ["_", " "]] ; Mode 5
            ;MsgBox(0,0,$m5k04) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile4) = 1 Then
            $m5k = IniReadSection($file4, "mode 5")
            $m5k = _ArrayExtract($m5k, 1, -1, 1, 1)
            $m5k00 = $m5k[0]
            $m5k01 = $m5k[1]
            $m5k02 = $m5k[2]
            $m5k03 = $m5k[3]
            $m5k04 = $m5k[4]
            $m5k05 = $m5k[5]
            $m5k06 = $m5k[6]
            $m5k07 = $m5k[7]
            $m5k08 = $m5k[8]
            $m5k09 = $m5k[9]
            Global $Mode5Array = [$m5k00, $m5k01, $m5k02, $m5k03, $m5k04, $m5k05, $m5k06, $m5k07, $m5k08, $m5k09] ; Mode 5
            Global $replace5Array[11][2] = [[$m5k00, ""], [$m5k01, ""], [$m5k02, ""], [$m5k03, ""], [$m5k04, ""], [$m5k05, ""], [$m5k06, ""], [$m5k07, ""], [$m5k08, ""], [$m5k09, ""], ["_", " "]] ; Mode 5
            ;MsgBox(0,0,$m5k06) ; --- just for test purposes
            ElseIf GUICtrlRead($inifile5) = 1 Then
            $m5k = IniReadSection($file5, "mode 5")
            $m5k = _ArrayExtract($m5k, 1, -1, 1, 1)
            $m5k00 = $m5k[0]
            $m5k01 = $m5k[1]
            $m5k02 = $m5k[2]
            $m5k03 = $m5k[3]
            $m5k04 = $m5k[4]
            $m5k05 = $m5k[5]
            $m5k06 = $m5k[6]
            $m5k07 = $m5k[7]
            $m5k08 = $m5k[8]
            $m5k09 = $m5k[9]
            Global $Mode5Array = [$m5k00, $m5k01, $m5k02, $m5k03, $m5k04, $m5k05, $m5k06, $m5k07, $m5k08, $m5k09] ; Mode 5
            Global $replace5Array[11][2] = [[$m5k00, ""], [$m5k01, ""], [$m5k02, ""], [$m5k03, ""], [$m5k04, ""], [$m5k05, ""], [$m5k06, ""], [$m5k07, ""], [$m5k08, ""], [$m5k09, ""], ["_", " "]] ; Mode 5
            ;MsgBox(0,0,$m5k08) ; --- just for test purposes
            EndIf

        Case $scramble
            $plaintext = GUICtrlRead($entry)
            ;ConsoleWrite($plaintext)

            $fillgaps = StringReplace($plaintext, " ", "_")
            ;ConsoleWrite($fillgaps)
            GUICtrlSetData($entry, $fillgaps)

            $plaintext = GUICtrlRead($entry)
            ;ConsoleWrite($plaintext)
            $Str = $plaintext

            $Arr = StringSplit($Str, "")
            ;_ArrayDisplay($Arr)
            $Arr[0] = ""

            ; ============================================================ Mode 1:
            If GUICtrlRead($modus1) = 1 Then
                $FirstIndex = $Mode1Array
                Global $NewString = ""
                Global $a = $FirstIndex
                $Raws = UBound($Arr)
                For $i = 1 To $Raws Step 1
                    $a -= 1
                    If $a = 0 Then $a = $FirstIndex
                    $NewString = $NewString & $Arr[$i - 1] & $Mode1Array[$a - 1]
                Next
            ; ============================================================ Mode 2:
            ElseIf GUICtrlRead($modus2) = 1 Then
                $SecondIndex = $Mode2Array
                Global $NewString = ""
                Global $b = $SecondIndex
                $Raws = UBound($Arr)
                For $i = 1 To $Raws Step 1
                    $b -= 1
                    If $b = 0 Then $b = $SecondIndex
                    $NewString = $NewString & $Arr[$i - 1] & $Mode2Array[$b - 1]
                Next
            ; ============================================================ Mode 3:
            ElseIf GUICtrlRead($modus3) = 1 Then
                $ThirdIndex = $Mode3Array
                Global $NewString = ""
                Global $c = $ThirdIndex
                $Raws = UBound($Arr)
                For $i = 1 To $Raws Step 1
                    $c -= 1
                    If $c = 0 Then $c = $ThirdIndex
                    $NewString = $NewString & $Arr[$i - 1] & $Mode3Array[$c - 1]
                Next
            ; ============================================================ Mode 4:
            ElseIf GUICtrlRead($modus4) = 1 Then
                $ForthIndex = $Mode4Array
                Global $NewString = ""
                Global $d = $ForthIndex
                $Raws = UBound($Arr)
                For $i = 1 To $Raws Step 1
                    $d -= 1
                    If $d = 0 Then $d = $ForthIndex
                    $NewString = $NewString & $Arr[$i - 1] & $Mode4Array[$d - 1]
                Next
            ; ============================================================ Mode 5:
            ElseIf GUICtrlRead($modus5) = 1 Then
                $FifthIndex = $Mode5Array
                Global $NewString = ""
                Global $e = $FifthIndex
                $Raws = UBound($Arr)
                For $i = 1 To $Raws Step 1
                    $e -= 1
                    If $e = 0 Then $e = $FifthIndex
                    $NewString = $NewString & $Arr[$i - 1] & $Mode5Array[$e - 1]
                Next
            EndIf

            If GUICtrlRead($modus1) = 1 Then GUICtrlSetData($entry, $NewString)
            If GUICtrlRead($modus2) = 1 Then GUICtrlSetData($entry, $NewString)
            If GUICtrlRead($modus3) = 1 Then GUICtrlSetData($entry, $NewString)
            If GUICtrlRead($modus4) = 1 Then GUICtrlSetData($entry, $NewString)
            If GUICtrlRead($modus5) = 1 Then GUICtrlSetData($entry, $NewString)

        Case $descramble
            $scrambletext = GUICtrlRead($entry)
            ;ConsoleWrite($scrambletext)
            ;$Str = $scrambletext
            ;$Arr = StringSplit($Str, "")
            ;_ArrayDisplay($Arr)

            If GUICtrlRead($modus1) = 1 Then
                $descramble1 = $scrambletext
                For $i = 0 To Ubound($replace1Array, 1) - 1
                    $descramble1 = StringRegExpReplace($descramble1, "\Q" & $replace1Array[$i][0] & "\E", $replace1Array[$i][1])
                Next
            ElseIf GUICtrlRead($modus2) = 1 Then
                $descramble2 = $scrambletext
                For $i = 0 To Ubound($replace2Array, 1) - 1
                    $descramble2 = StringRegExpReplace($descramble2, "\Q" & $replace2Array[$i][0] & "\E", $replace2Array[$i][1])
                Next
            ElseIf GUICtrlRead($modus3) = 1 Then
                $descramble3 = $scrambletext
                For $i = 0 To Ubound($replace3Array, 1) - 1
                    $descramble3 = StringRegExpReplace($descramble3, "\Q" & $replace3Array[$i][0] & "\E", $replace3Array[$i][1])
                Next
            ElseIf GUICtrlRead($modus4) = 1 Then
                $descramble4 = $scrambletext
                For $i = 0 To Ubound($replace4Array, 1) - 1
                    $descramble4 = StringRegExpReplace($descramble4, "\Q" & $replace4Array[$i][0] & "\E", $replace4Array[$i][1])
                Next
            ElseIf GUICtrlRead($modus5) = 1 Then
                $descramble5 = $scrambletext
                For $i = 0 To Ubound($replace5Array, 1) - 1
                    $descramble5 = StringRegExpReplace($descramble5, "\Q" & $replace5Array[$i][0] & "\E", $replace5Array[$i][1])
                Next
            EndIf

            If GUICtrlRead($modus1) = 1 Then GUICtrlSetData($entry, $descramble1)
            If GUICtrlRead($modus2) = 1 Then GUICtrlSetData($entry, $descramble2)
            If GUICtrlRead($modus3) = 1 Then GUICtrlSetData($entry, $descramble3)
            If GUICtrlRead($modus4) = 1 Then GUICtrlSetData($entry, $descramble4)
            If GUICtrlRead($modus5) = 1 Then GUICtrlSetData($entry, $descramble5)


    EndSwitch
WEnd

added as atachement: five ini testing files.

last thing remaining now is the bug mentioned above, then project finished. rest is only beauty tweaks

kind regards

illogic1.ini illogic2.ini illogic3.ini illogic4.ini illogic5.ini

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...