Sign in to follow this  
Followers 0
seres

bip after five minutes

8 posts in this topic

hello, im trying to make a program that count 5 minutes and after that it sends a message and a sound of warning, i dont know the commands so, can u help me please

Share this post


Link to post
Share on other sites



Wow - 120 posts and the simplest of the scripts still eludes you ...

Hint: use:

- Sleep + For/Next (While/Wend or Do/until) OR

- TimerInit/TimerDiff + (While/Wend or Do/until)

There are many ways to accomplish this and it's all basics.

Have you tried anything at all?


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

He certainly hasn't tried reading the help file in over 2 years.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

hello ty for the help i have done it with sleep but i was looking for something like a timer like delphi i think timerinit will do the problem is that after sleeping i cat do anything

Edited by seres

Share this post


Link to post
Share on other sites

Are you looking for something like this?

AdlibEnable("_beep", 2000) ; beeping every 2 seconds
While 1
    Sleep(5000)
    MsgBox(0,"","test") ; message is popping every 5 seconds
WEnd
Func _beep()
    Beep(500,500)
EndFunc

Hi ;)

Share this post


Link to post
Share on other sites

Are you looking for something like this?

AdlibEnable("_beep", 2000) ; beeping every 2 seconds
While 1
    Sleep(5000)
    MsgBox(0,"","test") ; message is popping every 5 seconds
WEnd
Func _beep()
    Beep(500,500)
EndFunc

thanks but i already have done that, my problem is that once the script is a sleep i cant do anything else i use 3 buttons and one has that code and the other 2 has different functions, but when i click the first button i have to wait 4.7 minutes and wile waiting the other 2 buttons looses functionality until it passes 4.7 minutes, im searching for a timer or something that doesnt has to sleep

Share this post


Link to post
Share on other sites

Hi,

AdlibEnable("_beep", 300000) ; every 5 min start function _beep ()

Func _beep ()
    Beep(500,500)
    MsgBox (0,"Message","Message") ; or what you want
EndFunc

The other buttons will be functional....

;-))

Stefan

Share this post


Link to post
Share on other sites

Your problem is quite complicated and require more than a simple answer. Try this simple timer solution, who know if you can tweak it to your needs.

HotKeySet("a","_func1")
$init = 0
While 1
    Sleep(10)
Wend
Func _func1()
    ; If this function is called less than 5 seconds after the previous call, 
    ; then it will simply quit
    If TimerDiff($init) < 5000 Then Return 
    $init = TimerInit() ; reset initial time
    MsgBox(0,"","Test",1)
EndFunc

Hi ;)

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