Sign in to follow this  
Followers 0
BasicOs

Screen Spy logging

7 posts in this topic

#1 ·  Posted (edited)

It is a savescreen-logger, it logs screen captures continously, it recycles the image files and keep the number of files created to fit the select period of time size.(next will change not only to period but to size)

by example if you choose one day logging when finishing the day, it replaces oldest files for new ones.

estimated space needed, Time-Space:

one hour 1 fps only: 70kb x 3600=252Mb,

one day=6Gb

one week=42Gb which is pretty for pc control .

Now you have savemode to decrease the space saved, it saves when mouse input.

Now you can clean up the images directory.

Credits to LazyCat :lmao: for dll func

Can you help:-Missing some batch to convert jpeg into avi,divx or mpeg, any ideas? It can be done by external programms but not yet under command line :)

You can volunteer :whistle:o:):) to make a better version, better help and better interface, also to correct my English language mistakes :huh2:

If you are interested to help, please Personal Message me or post here.

;----------------------------------------------------------------------------

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.0

; Language:       English

; Platform:       Win9x / NT

; Author:         BasicOs, personal message at autoitscript.com(forum)

; dllauthor: Lazycat

;

; Script Keys and info:

; size of captured images depend on screen, they are approximate

; +!h capture one hour jpgs  in dir img en imgdump subdir.(250Mb aprox)

; +!d capture one day jpgs  in dir img en imgdump subdir. (6 Gb aprox)

; +!w capture one week jpgs  in dir img en imgdump subdir.(42 Gb aprox)

; ----------------------------------------------------------------------------

Global $rsal = 0, $thesecs = 3600, $mouseCoordinates[2], $secs2shot = 1, $wmovedelay = 2

$mouseCoordinates[0] = 0

$mouseCoordinates[1] = 0

$SaveMode = 1

HotKeySet("+!x", "terminate")

HotKeySet("+!p", "pausecap")

HotKeySet("+!h", "caphour")

HotKeySet("+!d", "capday")

HotKeySet("+!w", "capweek")

HotKeySet("+!e", "caphelp")

HotKeySet("+!r", "rubdir") ;clean directory

While 1

   If $rsal = 0 Then main()

   Sleep(500)

WEnd

Exit

Func caphour()

   $rsal = 0

   $thesecs = 3600

   MsgBox(36, "Change of Period", "Changed period to " & $thesecs / 3600 & "hour", 5)

EndFunc   ;==>caphour

Func capday()

   $rsal = 0

   $thesecs = 3600 * 24

   MsgBox(1, "Change of Period", "Changed period to " & $thesecs / 3600 & "hour", 5)

EndFunc   ;==>capday

Func capweek()

   $rsal = 0

   MsgBox(1, "Change of Period", "Changed period to 7 days", 5)

   $thesecs = 3600 * 24 * 7

EndFunc   ;==>capweek

Func pausecap()

   MsgBox(1, "Stopped", "Press Period to go on", 5)

   $rsal = 1

EndFunc   ;==>pausecap

Func caphelp()

   MsgBox(1, "Help", "Press for max period for recycle, H for 1 hour, D for 1 day,W for 1 week" & @CR & " p for pause, r for rub all imgs in dir, x for exit, E for help")

EndFunc   ;==>caphelp

Func main()

   $totalfiles = 0 ;total files created this time , should be number of files in imgdump dir, ideas please?

   While 1

      If not (FileExists(@ScriptDir & "\imgdump\")) Then DirCreate(@ScriptDir & "\imgdump")

      If $rsal = 1 Then ExitLoop

      If @OSTYPE = "WIN32_WINDOWS" Then

         $thesavedname = @ScriptDir & "\imgdump\" & StringRight(StringReplace(_DateTime(), "_", ""), 8) & ".jpg"

      Else

         $thesavedname = @ScriptDir & "\imgdump\" & _DateTime() & ".jpg"

      EndIf

      If $SaveMode And Not IsMouseMove($mouseCoordinates) Then

         If $wmovedelay < 1 Then ContinueLoop

      Else

         $mouseCoordinates = MouseGetPos()

         $wmovedelay = 10

      EndIf

      $wmovedelay = $wmovedelay - 1

      DllCall("captdll.dll", "int", "CaptureScreen", "str", $thesavedname, "int", 50)

      Sleep( ($secs2shot * 1000) - 3) ;dalay 3

      If $totalfiles > $thesecs Then

         recyclefile() ; excess of files deleted

      Else

         $totalfiles = $totalfiles + 1

      EndIf

   WEnd

EndFunc   ;==>main

Func _DateTime()

   Return @YEAR & '_' & @MON & '_' & @MDAY & '_' & @HOUR & '_' & @MIN & '_' & @SEC

EndFunc   ;==>_DateTime

Func terminate()

   Exit

EndFunc   ;==>terminate

Func rubdir()

   DirRemove(@ScriptDir & "\imgdump", 1)

EndFunc   ;==>rubdir

Func recyclefile()

   $search = FileFindFirstFile(@ScriptDir & "\imgdump\*.*")

   ; Check if the search was successful

   If $search = -1 Then

      ; "No files/directories matched the search pattern")

      Return

   EndIf

   While 1

      $file = FileFindNextFile($search)

      If @error Then ExitLoop

      If $file = "." Or $file = ".." Then ContinueLoop

      FileDelete(@ScriptDir & "\imgdump\" & $file)

      ExitLoop

   WEnd

   FileClose($search)

EndFunc   ;==>recyclefile

Func IsMouseMove($pos0)

   $pos = MouseGetPos()

   If $pos[0] = $pos0[0] And $pos[1] = $pos0[1] Then Return 0

   Return 1

EndFunc   ;==>IsMouseMove

I hope you enjoy working on our Screen-Capture-Logging project and thank you for helping to make this a useful programm. :)

Edit: Tidy source.

*** Fixed names 8.3 for WIN 98 (check it out please).

*** New Smart MouseMoves-Save-Space-Mode

***New SmartMouseMoves delays pause of shooting, 10scs after last move

Todo:

* Gui for qetting rid of half of the Hotkeys and more Options:

changing the default fps, SaveMode, ..... any volunteer to make Gui?

* Include Iskeypress in SmartMode and change period concept into number of shots.

* Make New sleep-mode, 10 minutes without mousemove,it stops logging..X_Done

* when disconnected, it takes snapshots using a specipic hotkey(sort of Printscreen)

- *Count number of files in images-dir in case you restart the program(now it counts only the created files at this run of the program)

* Shot only one particular window when in options

Edited by BasicOs

Autoit.es - Foro Autoit en Español Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http

Share this post


Link to post
Share on other sites



I can't test it, but it looks great :lmao:

Actually I was thinking about creating something like this for 10 minutes ago while I was walking

towards the local chinafood-shop here. But I soon found out that the shop was closed so now

I've ordered a pizza. Anyone want a bite ? Ooh, that wasn't the topic here. Sorry o:):)

For your question on a program that can compile jpg-files into movies I've been using different

programs that can do some similar jobs, though I think they only supported bmp and tga.

I searched Google and I did get some hits that looked promising.

Sorry that I couldn't help.

I'm wondering, how long (can't test this myself) does it take to create one single

jpg of a full 1024x768 screen ? Thanks.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

run on W98SE: Works but o:)

- tested yesterday's original version, surprisingly VERY sloooooowwwwww :"> (2 minutes for an image)!!!

- did some monitoring and found that, we got severe problem with short file names :) , i suppose it has something to do with FAT32, W98SE handling of shorts names when homonyms, and possibly other stuff??

- changed original names for shortened ones, don't need to be strictly 8.3 but make sure 8.3 names are not all homonyms) see code below (just changed timestamp format)

$r= int(TimerInit()/1000)
$p=StringLeft("000000",8-stringlen(string($r)))&string($r)
DllCall("captdll.......\SC" & $p & ".jpg",....)

- also changed Sleep() to my _DeepSleep to save a litle bit of CPU (useful mainly if snapshots are taken at a several SEC interval)

and it works fine!! :):whistle: THX to Lazycat (and you BasicOS :) ) EDIT> correct a mistake :lmao: (sorry about that!!) <EDIT

i'll go to new version

Edited by lupusbalo

Share this post


Link to post
Share on other sites

You could only log when the mouse position has changed or a button was pressed. Just a hint to save space.

And by the way: Use Tidy for AutoIt. Your code looks horrible.


[quote name='d2hacker88' date='Jan 6 2005, 05:10 PM']Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.[right][snapback]52215[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

I'm wondering, how long (can't test this myself) does it take to create one single

jpg of a full 1024x768 screen ? Thanks.

it depends greatly of your hardware, e.g.with last ata disks and enough mem, almost nothing.

slower pcs some milliseconds..

Win 98SE :did some monitoring and found that, we got severe problem with short file names

fixed: WIN98 changed original names for shortened ones

You could only log when the mouse position has changed or a button was pressed. Just a hint to save space.

Fixed Tidy o:)

A problem is when there is some programm working you want to check without user input, (e.g.servers).With the new ver you can control the space as it recycles.

Fixed: a mouse move save-space-mode for your case, have you any func to tell when Iskeypress? also IsWheelmove? please

Also someone :lmao:to make a GUI for most Hotkeyset being included in only one Hotkeyset, .(also including smart-save-space-mode) .. I think too many Hotkeyset Yet.

Thanks for feedbak


Autoit.es - Foro Autoit en Español Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http

Share this post


Link to post
Share on other sites

it depends greatly of your hardware, e.g.with last ata disks and enough mem, almost nothing.

slower pcs some milliseconds..

<{POST_SNAPBACK}>

Aaah, great ! :lmao:

Thanks for the info BasicOs !

Share this post


Link to post
Share on other sites

Someone want to make a nice GUI?, I am not so good artist for such nice :lmao: paintings....... some ideas?

Todo:

* Gui for qetting rid of half of the Hotkeys and more Options:

changing the default fps, SaveMode, ..... any volunteer to make Gui?

* Include Iskeypress in SmartMode and change period concept into number of shots.

* Make New sleep-mode, 10 minutes without mousemove,it stops logging..X_Done

* when disconnected, it takes snapshots using a specipic hotkey(sort of Printscreen)

- *Count number of files in images-dir in case you restart the program(now it counts only the created files at this run of the program)

* Shot only one particular window when in options


Autoit.es - Foro Autoit en Español Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http

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