Jump to content
Sign in to follow this  
Marlo

Cliplogger

Recommended Posts

Marlo

This is pretty much my first Example script in all the time i've been on this forum :mellow: So hope it goes down well

So basicly it just logs all String values that have been coped to the clipboard.

The clip entrys are then saved to an ini file along with a time stamp

Global Const $sLogFile = @ScriptDir & "\ClipLogger.ini" ;File to save the information to
Global $sLastClip = ""                                  ;a record of the previous clipboard entry

_ReduceMemory()
While Sleep(250)
    _CheckClipboard()
WEnd

;Checks to see if there has been a new clipboard entry.
Func _CheckClipboard()
    Local $sCurrentClip = ClipGet()
    If Not $sCurrentClip Then Return 0
    If $sCurrentClip <> $sLastClip Then
        _AddToLog($sCurrentClip)
        $sLastClip = $sCurrentClip
    EndIf
EndFunc   ;==>_CheckClipboard

;Adds the clip entry to the file
Func _AddToLog($sValue)
    Local $hFile = FileOpen($sLogFile, 1)
    FileWriteLine($hFile, _Time() & " " & $sValue)
    FileClose($hFile)
EndFunc   ;==>_AddToLog

;Returns the current time in HH:MM:SS format
Func _Time()
    Return @HOUR & ":" & @MIN & ":" & @SEC
EndFunc   ;==>_Time

;Reduce the memory used up by the script
;Thanks to jftuga for the idea behind this function
Func _ReduceMemory()
    Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndFunc   ;==>_ReduceMemory

Comments?


Click here for the best AutoIt help possible.Currently Working on: Autoit RAT

Share this post


Link to post
Share on other sites
ludocus

this is pretty cool..

altough.. Why would you want to use this?

Share this post


Link to post
Share on other sites
Andreik

You can use this function _FileWriteLog().


When the words fail... music speaks

Share this post


Link to post
Share on other sites
LarryDalooza

There is a way to get notified when the clipboard changes. If you incorporate that it would be more impressive.

It is some function like SetClipboardViewer or some crap like that. Google it and play.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

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  

×