Jump to content

Picture Taker


 Share

Recommended Posts

No Description...Enjoy :>

Erm...I should note you have to close with "Task Mananger" and it is best to review this code before running :unsure:

#NoTrayIcon
#include <Misc.au3>
#Include <Date.au3>
#include <Timers.au3>
#include <ScreenCapture.au3>

_Singleton(@ScriptName)

$IdleMinimum = 5000

While 1
    AdlibRegister("_Pic" , 5000)
    Do
        Sleep(20)
    Until _Timer_GetIdleTime() >= $IdleMinimum
    AdlibUnRegister("_Pic")
    _Idle()
WEnd

Func _Idle()
    If _Timer_GetIdleTime() >= $IdleMinimum Then
    Do
        Sleep(20)
    Until _Timer_GetIdleTime() < $IdleMinimum
    EndIf
EndFunc

Func _Gen_Name()
    $Time = _NowTime()
    $Time_Split = StringSplit($Time , ":")
    Return @MON & "-" & @MDAY & "-" & @YEAR & " (" & $Time_Split[1] & "-" & $Time_Split[2] & "-" & $Time_Split[3] & ")"
EndFunc

Func _Pic()
    $Folder_Name = @MON & "-" & @MDAY & "-" & @YEAR

    If Not FileExists($Folder_Name) Then
        DirCreate(@MON & "-" & @MDAY & "-" & @YEAR)
    EndIf

    _ScreenCapture_Capture(@ScriptDir & "\" & $Folder_Name & "\" & _Gen_Name() & ".jpg")
EndFunc
Edited by FriendsFade
Link to comment
Share on other sites

Don't see the point of any of this

$IdleMinimum = 5000

While 1
    AdlibRegister("_Pic" , 5000)
    Do
        Sleep(20)
    Until _Timer_GetIdleTime() >= $IdleMinimum
    AdlibUnRegister("_Pic")
    _Idle()
WEnd

Func _Idle()
    If _Timer_GetIdleTime() >= $IdleMinimum Then
    Do
        Sleep(20)
    Until _Timer_GetIdleTime() < $IdleMinimum
    EndIf
EndFunc

Perhaps you could explain .

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Don't see the point of any of this

$IdleMinimum = 5000

While 1
    AdlibRegister("_Pic" , 5000)
    Do
        Sleep(20)
    Until _Timer_GetIdleTime() >= $IdleMinimum
    AdlibUnRegister("_Pic")
    _Idle()
WEnd

Func _Idle()
    If _Timer_GetIdleTime() >= $IdleMinimum Then
    Do
        Sleep(20)
    Until _Timer_GetIdleTime() < $IdleMinimum
    EndIf
EndFunc

Perhaps you could explain .

If you run it you will see how it works...I cannot really explain it but to sum it up it is a Picture Spy :unsure:

Edited by FriendsFade
Link to comment
Share on other sites

If you run it you will see how it works...I cannot really explain it but to sum it up it is a Picture Spy :unsure:

Is'nt it just the same as

#NoTrayIcon
#include <Misc.au3>
#Include <Date.au3>
#include <Timers.au3>
#include <ScreenCapture.au3>

AdlibRegister("_Pic" , 5000)

_Singleton(@ScriptName)

While 1
    Sleep(20)
WEnd

Func _Gen_Name()
    $Time = _NowTime()
    $Time_Split = StringSplit($Time , ":")
    Return @MON & "-" & @MDAY & "-" & @YEAR & " (" & $Time_Split[1] & "-" & $Time_Split[2] & "-" & $Time_Split[3] & ")"
EndFunc

Func _Pic()
    $Folder_Name = @MON & "-" & @MDAY & "-" & @YEAR

    If Not FileExists($Folder_Name) Then
        DirCreate(@MON & "-" & @MDAY & "-" & @YEAR)
    EndIf

    _ScreenCapture_Capture(@ScriptDir & "\" & $Folder_Name & "\" & _Gen_Name() & ".jpg")
EndFunc

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Is'nt it just the same as

#NoTrayIcon
#include <Misc.au3>
#Include <Date.au3>
#include <Timers.au3>
#include <ScreenCapture.au3>

AdlibRegister("_Pic" , 5000)

_Singleton(@ScriptName)

While 1
    Sleep(20)
WEnd

Func _Gen_Name()
    $Time = _NowTime()
    $Time_Split = StringSplit($Time , ":")
    Return @MON & "-" & @MDAY & "-" & @YEAR & " (" & $Time_Split[1] & "-" & $Time_Split[2] & "-" & $Time_Split[3] & ")"
EndFunc

Func _Pic()
    $Folder_Name = @MON & "-" & @MDAY & "-" & @YEAR

    If Not FileExists($Folder_Name) Then
        DirCreate(@MON & "-" & @MDAY & "-" & @YEAR)
    EndIf

    _ScreenCapture_Capture(@ScriptDir & "\" & $Folder_Name & "\" & _Gen_Name() & ".jpg")
EndFunc

Well my code is not exactly well put together...but no this wouldn't be the same because mine looks for user activity of the computer instead of just taking pictures every X seconds :unsure:
Link to comment
Share on other sites

I don't think you can explain how it works because it is terrible. I mean, it does what you intend, but horribly written. You should just register the Adlib, then in the adlib function check the idle time. If it is less than your minimum, take a pic. Those loops are ghastly.

Link to comment
Share on other sites

I don't think you can explain how it works because it is terrible. I mean, it does what you intend, but horribly written. You should just register the Adlib, then in the adlib function check the idle time. If it is less than your minimum, take a pic. Those loops are ghastly.

Yes, I know this is horribly written and that is because I wrote this script a long time ago and only worked on it for just over 10 minutes and also because it was my first time using a few of the functions. I am no pro when it comes to Autoit and I am still learning although I think it's safe to say that I have improved and if I rewrote this code it would be a whole neater.

I am sorry for all that I inconvenienced by posting this and I will review my code before posting next time but I was just posting a few scraps I had on my hard drive.

Thanks :unsure:

Link to comment
Share on other sites

FriendsFade

You have not inconvenienced anyone, when you post an example script, it follows that you may get comments or questions about it, most of the time they will be constructive.

You have nothing to be sorry for.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...