Jump to content

help me code this little script


phpzzz
 Share

Recommended Posts

Hi all, i am new here, i am also new at programing, and i know we can do this little task with autoit, but i have no idea how to code it, can any one help me code this little script

I need a script run this task:

- at 9:00 EST , it auto hit the printscreen key

- at 11:00 EST, it auto hit the printscreen key again

- this script may able to run on background.

the reason i need this task, because im using a screen recording software but it doesn't support recurring recording, so i set printscreen as recording hot key, so this script can help me auto record by sending printscreen key on background at specific time..

i would be really appreciated for your help..

thanks

Edited by phpzzz
Link to comment
Share on other sites

Not many people on the forums will code something for you. If you want that go to rentacoder.com but this script is extremely simple. Just look in the helpfile for while loops, the @hour macro, and the Send() function.

Link to comment
Share on other sites

I'll write it for, but thats all, just for learning.

While 1
If @Hour = 9 Then Send("{PRINTSCREEN}")
If @Hour = 11 Then Send("{PRINTSCREEN}")
Sleep(1000)
WEnd

Now was that to hard?

yes actually...your script will press print screen hundreds of times at 9 and same at 11 lol
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

$0 = 0

$11 = 0

While 1

if $9 = 0 then

If @Hour = 9 Then

Send("{PRINTSCREEN}")

$11 = 0

$9 = 1

endif

endif

if $11 = 0 then

If @Hour = 11 Then

Send("{PRINTSCREEN}")

$9 = 0

$11 = 1

endif

endif

Sleep(1000)

WEnd

Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

  • Moderators

yes, but the program could lag...and then u get nothing...

Local $i_dummy = 0
While 1
    If @Hour = 9 and @Min = 0 Then $i_dummy = Send("{PRINTSCREEN}") + Sleep(60000)
    If @Hour = 11 and @min = 0 Then $i_dummy = Send("{PRINTSCREEN}") + Sleep(60000)
    Sleep(1000)
WEnd
There, that\'ll solve your issues.

Edit:

Or if you want to get really silly:

While 1
    If @Hour = 9 and @Min = 0 Then Sleep(600000 + Send("{PRINTSCREEN}"))
    If @Hour = 11 and @min = 0 Then Sleep(600000 + Send("{PRINTSCREEN}"))
    Sleep(1000)
WEnd
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

One last edit! :D

easy as it gets ;)

$check = 0

While 1
   if $check <> 1 then
      If @Hour = 9 Then
         Send("{PRINTSCREEN}")
         $check = 1
       endif
   endif
   if $check <> 2 then
      If @Hour = 11 Then
         Send("{PRINTSCREEN}")
         $check = 2
      endif
   endif
Sleep(1000)
WEnd
Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

I think it would be easiest to just put Send("{PRINTSCREEN}") into an autoIt script, compile it to an .exe, then have Windows Scheduler run that .exe at 9 and 11. Problem solved! This way there isn't and infinite autoIt loop running in the background, hosing up the system.

Link to comment
Share on other sites

  • Moderators

I think it would be easiest to just put Send("{PRINTSCREEN}") into an autoIt script, compile it to an .exe, then have Windows Scheduler run that .exe at 9 and 11. Problem solved! This way there isn't and infinite autoIt loop running in the background, hosing up the system.

;) ... what / how does a loop "hose" a system? There's no CPU usage at all, and it's not doing anything but twice a day.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I think it would be easiest to just put Send("{PRINTSCREEN}") into an autoIt script, compile it to an .exe, then have Windows Scheduler run that .exe at 9 and 11. Problem solved! This way there isn't and infinite autoIt loop running in the background, hosing up the system.

damn you lol haha, the man's a genius! lol

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
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...