Total_newbie Posted March 21, 2007 Share Posted March 21, 2007 Hi, I'm writting a script that will encrypt the log whene exiting. It works ok if I close the script or when the script finishes Is there anyway to run a exit(encryption) script when the script is killed via taskmanager or pskill.exe? Thanks Total_newbie Link to comment Share on other sites More sharing options...
lod3n Posted March 21, 2007 Share Posted March 21, 2007 Why don't you encrypt each entry as it's made? [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Total_newbie Posted March 21, 2007 Author Share Posted March 21, 2007 Why don't you encrypt each entry as it's made?Sounds like a plan. I will check it slows down the script or any other side effect.thanks a lot lod3n Link to comment Share on other sites More sharing options...
BrettF Posted March 21, 2007 Share Posted March 21, 2007 (edited) Sounds like a plan. I will check it slows down the script or any other side effect. thanks a lot lod3n Opt (" *Insert AutoIt On Exit Func Here Cause I cant Remeber It :"> *", "0 or 1... I cant rember that either ") Just do a helpfile seacrch for "exit" and see the opt entry..... Should do what you want. Edit: The proper is: Opt("OnExitFunc","OnAutoItExit");"OnAutoItExit" called Opt("OnExitFunc","FunctionName") Edited March 21, 2007 by bert 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...
Total_newbie Posted March 21, 2007 Author Share Posted March 21, 2007 Opt (" *Insert AutoIt On Exit Func Here Cause I cant Remeber It :"> *", "0 or 1... I cant rember that either ") Just do a helpfile seacrch for "exit" and see the opt entry..... Should do what you want. Edit: The proper is: Opt("OnExitFunc","OnAutoItExit");"OnAutoItExit" called Opt("OnExitFunc","FunctionName")thanks bert. I'm actually using it but it only works in the cases I mentioned before. when the script is killed I can't run the function that I want. I think the best option would be encrypting each text string...testing right now :-) Link to comment Share on other sites More sharing options...
Total_newbie Posted March 21, 2007 Author Share Posted March 21, 2007 Why don't you encrypt each entry as it's made?Hi guys,I tried the options suggested by lod3n of encrypting every string before writing to file but got some problem with the crypto.au3 or DLLstruct.au3.here is my codeCODE#include <crypto.au3>$password= "a"$file="file.enc"$linecounter=1Func _WriteLine($text) ConsoleWrite("Text:" & $text & " Line coutner: "&$linecounter&@CRLF) $text=_EncryptString($text&@CRLF,$password) If FileWriteLine($file,$text Then $linecounter=$linecounter+1 If $linecounter>5 then ConsoleWrite("Counter exceeded maximum number of lines that it can write(5)=" & $linecounter&@CRLF) Exit EndIfEndFunc_WriteLine("test1")_WriteLine("test2")_WriteLine("test3")_WriteLine("test4")_WriteLine("test5")_WriteLine("test6")_WriteLine("test7")I have attached the error that I'm receiving. Strange enough the function is definitely there in crypto.au3 :-(.Thoughts?Regards,crypto_au3_error.bmp Link to comment Share on other sites More sharing options...
lod3n Posted March 22, 2007 Share Posted March 22, 2007 I don't have crypto.au3 on my machine. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] 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