Jump to content
Sign in to follow this  
phpzzz

help me code this little script

Recommended Posts

phpzzz

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

Share this post


Link to post
Share on other sites
TehWhale

9, 11? AM/PM?

Share this post


Link to post
Share on other sites
phpzzz

Hi Alienware, it is

9:00 am est - 11:00 am est

thanks alot..

9, 11? AM/PM?

Share this post


Link to post
Share on other sites
BrettF
phpzzz

Hi BrettF, can you code it for me, i have no idea what to start..

thans

Share this post


Link to post
Share on other sites
ReaImDown

Hi BrettF, can you code it for me, i have no idea what to start..

thans

which is why we have a helpfile, try b4 you ask ;)

While 1

sleep(10)

;your coding here

wend


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

Share this post


Link to post
Share on other sites
dbzfanatic

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.

Share this post


Link to post
Share on other sites
TehWhale

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(60000)
WEnd

Now was that to hard?

Edited by Alienware

Share this post


Link to post
Share on other sites
ReaImDown

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]

Share this post


Link to post
Share on other sites
TehWhale

That is true, didn't think of it! ;)

Share this post


Link to post
Share on other sites
ReaImDown

$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]

Share this post


Link to post
Share on other sites
TehWhale

$0 = 0

$11 = 0

While 1

if $9 = 0 then

If @Hour = 9 Then Send("{PRINTSCREEN}")

$11 = 0

$9 = 1

endif

if $11 = 0 then

If @Hour = 11 Then Send("{PRINTSCREEN}")

$9 = 0

$11 = 1

endif

Sleep(1000)

WEnd

Mines better, and shorter Damnit! I just edited my post ;)

Share this post


Link to post
Share on other sites
ReaImDown

Mines better, and shorter Damnit! I just edited my post ;)

nvm, I lied...but...now your script will press print screen 60 times at nine and 60 times at 11 lol


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

Share this post


Link to post
Share on other sites
TehWhale

One last edit! ;)

Share this post


Link to post
Share on other sites
ReaImDown

One last edit! ;)

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

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

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
ReaImDown

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]

Share this post


Link to post
Share on other sites
jmHoekst

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.

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
ReaImDown

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]

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  

×