Sign in to follow this  
Followers 0
imacrazyballoono

Script during logoff

3 posts in this topic

How can I make the script write to a file just before it logs of or shutdowns?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

For anyone who cares, I ended up just having it continuously writing it to a file.

do
$file = fileopen("C:\Documents and Settings\other\My Documents\Stuff\timer.txt", 0)
$time = filereadline($file)
fileclose($file)
MsgBox(4096, "Test", $time)

$time = $time - 1

$file2 = fileopen("C:\Documents and Settings\other\My Documents\Stuff\timer.txt", 2)
FileWriteLine($file, $time)
fileclose($file)
until $time < 0
Edited by imacrazyballoono

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Put this in your script, it'll do whatever is there when the script exits

Func OnAutoItExit ( )
 ;Your code here
EndFunc

AutoIt Help File:

Defines a user-defined function that will be called when the script exits.

Edited by AutoItKing

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
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
Sign in to follow this  
Followers 0