Innovative Posted January 27, 2008 Share Posted January 27, 2008 (edited) Obviously , _StringEncrypt(1, "test", "test", 1) will works .. But no matter what.. it returns a empty string for me .. I did #include <string.au3> Is this a bug or something like that ? Edited January 27, 2008 by CrazeStar1074 Link to comment Share on other sites More sharing options...
BrettF Posted January 27, 2008 Share Posted January 27, 2008 Does the helpfile example fail for you? expandcollapse popup#include <guiconstants.au3> #include <string.au3> ; GUI and String stuff $WinMain = GuiCreate('Encryption tool', 400, 400) ; Creates window $EditText = GuiCtrlCreateEdit('',5,5,380,350) ; Creates main edit $InputPass = GuiCtrlCreateInput('',5,360,100,20, 0x21) ; Creates the password box with blured/centered input $InputLevel = GuiCtrlCreateInput(1, 110, 360, 50, 20, 0x2001) $UpDownLevel = GUICtrlSetLimit(GuiCtrlCreateUpDown($inputlevel),10,1) ; These two make the level input with the Up|Down ability $EncryptButton = GuiCtrlCreateButton('Encrypt', 170, 360, 105, 35) ; Encryption button $DecryptButton = GuiCtrlCreateButton('Decrypt', 285, 360, 105, 35) ; Decryption button GUICtrlCreateLabel('Password', 5, 385) GuiCtrlCreateLabel('Level',110,385) ; Simple text labels so you know what is what GuiSetState() ; Shows window Do $Msg = GuiGetMsg() If $msg = $EncryptButton Then GuiSetState(@SW_DISABLE,$WinMain); Stops you from changing anything $string = GuiCtrlRead($EditText); Saves the editbox for later GUICtrlSetData($EditText,'Please wait while the text is Encrypted/Decrypted.'); Friendly message GuiCtrlSetData($EditText,_StringEncrypt(1,$string,GuiCtrlRead($InputPass),GuiCtrlRead($InputLevel))) ; Calls the encryption. Sets the data of editbox with the encrypted string ; The encryption starts with 1/0 to tell it to encrypt/decrypt ; The encryption then has the string that we saved for later from edit box ; It then reads the password box & Reads the level box GuiSetState(@SW_ENABLE,$WinMain); This turns the window back on EndIf If $msg = $DecryptButton Then GuiSetState(@SW_DISABLE,$WinMain); Stops you from changing anything $string = GuiCtrlRead($EditText); Saves the editbox for later GUICtrlSetData($EditText,'Please wait while the text is Encrypted/Decrypted.'); Friendly message GuiCtrlSetData($EditText,_StringEncrypt(0,$string,GuiCtrlRead($InputPass),GuiCtrlRead($InputLevel))) ; Calls the encryption. Sets the data of editbox with the encrypted string ; The encryption starts with 1/0 to tell it to encrypt/decrypt ; The encryption then has the string that we saved for later from edit box ; It then reads the password box & Reads the level box GuiSetState(@SW_ENABLE,$WinMain); This turns the window back on EndIf Until $msg = $GUI_EVENT_CLOSE; Continue loop untill window is closed Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Innovative Posted January 27, 2008 Author Share Posted January 27, 2008 Yes.. it returned an empty string too.. Please help T.T urgent Link to comment Share on other sites More sharing options...
Bowmore Posted January 27, 2008 Share Posted January 27, 2008 Yes.. it returned an empty string too.. Please help T.T urgent Your code as posted works fine for me using the latest versions of AutoIt. Environment = 3.2.10.0 under WIN_XP/Service Pack 2 X86 _StringEncrypt(1, "test", "test", 1) = 10249CAA2F88B4EB Environment = 3.2.11.0 under WIN_XP/Service Pack 2 X86 _StringEncrypt(1, "test", "test", 1) = 10249CAA2F88B4EB "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Innovative Posted January 28, 2008 Author Share Posted January 28, 2008 But it returned a blank string for me .. why is it so ? Link to comment Share on other sites More sharing options...
BrettF Posted January 28, 2008 Share Posted January 28, 2008 But it returned a blank string for me .. why is it so ?Could be a range of reasons. Looking at the actual function, I cannot see any reason for it to fail. Did you happen to catch the @error code? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Innovative Posted January 28, 2008 Author Share Posted January 28, 2008 (edited) #Include <string.au3> $encrypt = _StringEncrypt(1, "test", "test") MsgBox(0, "", @Error & "/" & @extended) $decrypt = _StringEncrypt(0, $encrypt, "test") MsgBox(0, "", @Error & "/" & @extended) First msgbox returned "0/0" Second returned "1/0" Whats the problem ? I dont think its the problem with String.au3 become i replaced a working one but it still fail. Edited January 28, 2008 by CrazeStar1074 Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 28, 2008 Share Posted January 28, 2008 Do it this way and post the results:#Include <string.au3> $encrypt = _StringEncrypt(1, "test", "test") ConsoleWrite("Debug: $encrypt = " & $encrypt & " @error = " & @error & " @extended = " & @extended & @LF) $decrypt = _StringEncrypt(0, $encrypt, "test") ConsoleWrite("Debug: $dencrypt = " & $decrypt & " @error = " & @error & " @extended = " & @extended & @LF) I get:>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\Scripts\Test_2.au3" Debug: $encrypt = 10249CAA2F88B4EB @error = 0 @extended = 0 Debug: $dencrypt = test @error = 0 @extended = 0 +>07:52:18 AutoIT3.exe ended.rc:0 Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Innovative Posted January 28, 2008 Author Share Posted January 28, 2008 I dont know how ConsoleWrite works so i did it this way #Include <string.au3> $encrypt = _StringEncrypt(1, "test", "test") Msgbox(0, "", "Debug: $encrypt = " & $encrypt & " @error = " & @error & " @extended = " & @extended & @LF) $decrypt = _StringEncrypt(0, $encrypt, "test") Msgbox(0, "", "Debug: $dencrypt = " & $decrypt & " @error = " & @error & " @extended = " & @extended & @LF) ClipPut("Debug: $encrypt = " & $encrypt & " @error = " & @error & " @extended = " & @extended & @CRLF & "Debug: $dencrypt = " & $decrypt & " @error = " & @error & " @extended = " & @extended & @LF & "") and it returned : Debug: $encrypt = @error = 0 @extended = 0 Debug: $dencrypt = @error = 0 @extended = 0 Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 28, 2008 Share Posted January 28, 2008 I dont know how ConsoleWrite works so i did it this way #Include <string.au3> $encrypt = _StringEncrypt(1, "test", "test") Msgbox(0, "", "Debug: $encrypt = " & $encrypt & " @error = " & @error & " @extended = " & @extended & @LF) $decrypt = _StringEncrypt(0, $encrypt, "test") Msgbox(0, "", "Debug: $dencrypt = " & $decrypt & " @error = " & @error & " @extended = " & @extended & @LF) ClipPut("Debug: $encrypt = " & $encrypt & " @error = " & @error & " @extended = " & @extended & @CRLF & "Debug: $dencrypt = " & $decrypt & " @error = " & @error & " @extended = " & @extended & @LF & "") and it returned : Debug: $encrypt = @error = 0 @extended = 0 Debug: $dencrypt = @error = 0 @extended = 0 ConsoleWrite() just writes to the scrolling console pane of the SciTE window. I prefer it to MsgBox for debug because I don't have to respond to a string of annoying pop ups. You are not getting a string back from _StringEncrypt(). Have you modified the string.au3 UDF in any way? What version of AutoIt are you running? Run the code the way I posted it (with ConsoleWrite) and post all of the output in the SciTE console pane, including any errors and the lines that report program versions. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
weaponx Posted January 28, 2008 Share Posted January 28, 2008 Correct spelling and a more informative title would really help this topic. Link to comment Share on other sites More sharing options...
GaryFrost Posted January 28, 2008 Share Posted January 28, 2008 Correct spelling and a more informative title would really help this topic.How's that? SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
weaponx Posted January 28, 2008 Share Posted January 28, 2008 How's that?A lot better. Link to comment Share on other sites More sharing options...
Innovative Posted January 28, 2008 Author Share Posted January 28, 2008 1 ) Nop.. i did not modified any of the includes file.. 2 ) v3.2.10.0 3 ) >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\user\Desktop\StringEncrypt.au3" Debug: $encrypt = @error = 0 @extended = 0 Debug: $dencrypt = @error = 1 @extended = 0 >Exit code: 0 Time: 1.087 Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 28, 2008 Share Posted January 28, 2008 1 ) Nop.. i did not modified any of the includes file.. 2 ) v3.2.10.03 )>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\user\Desktop\StringEncrypt.au3" Debug: $encrypt = @error = 0 @extended = 0Debug: $dencrypt = @error = 1 @extended = 0>Exit code: 0 Time: 1.087Why are you avoiding running this from SciTE and posting the output from that...? Please run it from SciTE with F5 and copy/paste/post the contents of the console pane at the bottom of the SciTE window (not just the "Debug:" lines). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Innovative Posted January 29, 2008 Author Share Posted January 29, 2008 -.- thats what i get after pressing F5 .. You want the result of SyntaxCheck prod ? >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\user\Desktop\FTP_Example.au3" Debug: $encrypt = @error = 0 @extended = 0 Debug: $dencrypt = @error = 1 @extended = 0 >Exit code: 0 Time: 1.379 Link to comment Share on other sites More sharing options...
BrettF Posted January 29, 2008 Share Posted January 29, 2008 -.- thats what i get after pressing F5 .. You want the result of SyntaxCheck prod ? >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\user\Desktop\FTP_Example.au3" Debug: $encrypt = @error = 0 @extended = 0 Debug: $dencrypt = @error = 1 @extended = 0 >Exit code: 0 Time: 1.379Like this: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\francisb\Desktop\msn_test\tester.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>16:39:49 Starting AutoIt3Wrapper v.1.9.5.6 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X86) >Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3 +>16:39:49 AU3Check ended.rc:0 >Running:(3.2.10.0):C:\Program Files\AutoIt All of it. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Generator Posted January 29, 2008 Share Posted January 29, 2008 If this helps.. >"E:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "E:\Documents and Settings\Mike Jin\桌面\GUIInputSetOnlyNumbers_Example.au3" /autoit3dir "E:\Program Files\AutoIt3" /UserParams +>22:37:06 Starting AutoIt3Wrapper v.1.9.4 >Running AU3Check (1.54.10.0) from:E:\Program Files\AutoIt3 +>22:37:06 AU3Check ended.rc:0 >Running:(3.2.10.0):E:\Program Files\AutoIt3\autoit3.exe "E:\Documents and Settings\Mike Jin\桌面\GUIInputSetOnlyNumbers_Example.au3" Debug: $encrypt = @error = 0 @extended = 0 Debug: $dencrypt = @error = 1 @extended = 0 +>22:37:07 AutoIT3.exe ended.rc:0 +>22:37:08 AutoIt3Wrapper Finished >Exit code: 0 Time: 2.917 Link to comment Share on other sites More sharing options...
Innovative Posted January 29, 2008 Author Share Posted January 29, 2008 But that is what i ONLY get after pressing F5 .. Nothing else more.. Link to comment Share on other sites More sharing options...
BrettF Posted January 29, 2008 Share Posted January 29, 2008 Can you paste it in already please? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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