Jump to content

Recommended Posts

Posted

Filewrite()

@min @mDay @year...ect macro reference..

trry

$Time=@Year & ' : ' & @MON & ' : ' & @MDAY & ' : ' & @Hour & ' : ' & @MIN & ' : ' & @SEC
$x='Test'
Filewrite('C:\TEXT.txt',@CRLF & '[' & $time & '] ' & $x & @CRLF)
; just repeat this for each line you want
Posted

Filewrite()

@min @mDay @year...ect macro reference..

trry

$Time=@Year & ' : ' & @MON & ' : ' & @MDAY & ' : ' & @Hour & ' : ' & @MIN & ' : ' & @SEC
$x='Test'
Filewrite('C:\TEXT.txt',@CRLF & '[' & $time & '] ' & $x & @CRLF)
; just repeat this for each line you want
Trying this.

But isn't there away to make your your own command Example.

LogThis.au3

code here to log it

main script.au3

#include <logthis.au3>

LogThis("some text here")

Or this far from possible?

Posted

well you could do this..

Hotkeyset ('{ESC}', '_Exit')

while 1
$Time=@Year & ' : ' & @MON & ' : ' & @MDAY & ' : ' & @Hour & ' : ' & @MIN & ' : ' & @SEC
msgbox (0, 'TEST', 'EXAMPLE')
If @ERROR then
$x='Error'
LOGTHIS ($Time, $x)
else
$x='Msgbox recieved!'
LOGTHIS ($Time, $x)
endif
sleep (100)
Wend

Func LOGTHIS ($Time, $x)
Filewrite('C:\TEXT.txt',@CRLF & '[' & $time & '] ' & $x & @CRLF)
Return
Endfunc

Func _Exit ()
$x='Script ended.'
LOGTHIS ($Time, $x)
exit
endfunc
Posted

NP.. BTW the _Exit() doesnt work on that example :D sorry haha

Posted (edited)

Just a quick check.

#include <logthis.au3>

If ProcessExists($Exe) Then
    MsgBox(0, "Error!", "Diablo II Is Already Running...", 3)
        $x = 'Diablo II Was Already Running.'
        LogThis($Time, $x)
        Exit
    Else
        Sleep($LaunchDelay)
    ShellExecute($Exe,"-w -skiptobnet", $ExeDir)
EndIf

LogThis.au3

Func LOGTHIS ($Time, $x)
Filewrite('C:\TEXT.txt',@CRLF & '[' & $time & '] ' & $x & @CRLF)
Return
Endfunc

Would this work?

Edited by Godly
Posted

Out of curiosity wouldn't the function _FileWriteLog work for what you need?

Of course creating your own function for it gives you more control if needed.

"Human kind cannot gain anything without first giving something in return, to obtain; something of equal value must be lost."The Help File is truly your friend.

Posted

Out of curiosity wouldn't the function _FileWriteLog work for what you need?

Of course creating your own function for it gives you more control if needed.

Yeah I decided to go with _FileWriteLog(). Creating my own function would take to long, and take me away from my current project.

Problem Defiantly Solved!

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
×
×
  • Create New...