Welcome Guest.   Make a donation to an author on the site November 24, 2014, 02:09:45 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: simple quick'n'dirty alarm  (Read 5904 times)
insert_nick
Supporting Member
**
Posts: 72


View Profile WWW Give some DonationCredits to this forum member
« on: September 12, 2006, 05:23:15 AM »

I'm sorry I don't know if there is a better place than this in these forums where similar help requests can be posted, so please forgive me and point me to the right forum. Btw, what I want is someone fixing this little script for me, as I can't see where the bug is. Simply I'd like a script where I manually edit the alarm time, and it beeps when the time is passed. It loads fine, no error messages, but it just doesn't work. Thanks in advance, and please don't forget to tell me which is the right place where to post help requests on little coding snacks which probably are not fresh "ideas" and could already exist somewhere...
[copy or print]
;Alarm.ahk

alarm=2030 ;alarm time (hhmm)
checkevery=59000 ;time between checks in ms

SetTimer,CHECK,%checkevery%
Return

CHECK:
SetTimer,CHECK,Off
StringMid,now,A_Now,9,4
If (now>=start)
{
SoundBeep
}
SetTimer,CHECK,%checkevery%,On
Return
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #1 on: September 12, 2006, 06:02:33 AM »

If you just want something that works, why reinvent the wheel?  Would MicroEggTimer do?  When it times out, it keeps beeping until you make an effort to stop it.



Logged
insert_nick
Supporting Member
**
Posts: 72


View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: September 12, 2006, 06:36:12 AM »

Thanks, but it's not what I want. I want an AutoHotKey script so I can change it as much as I like, depending on the situation.

Mainly, I want to use the PC speaker as alarm output, but I want to fine-control the frequency and the repeating cycles of the beep, and change them easily (i.e. editing the script). And when I want to play a wav file instead, I should be able to, having an editable ahk script. Moreover, I don't want the app in the taskbar, so it doesn't bother me when I press Alt-Tab: the ahk script solves this issue too.

The one I've posted would be the best for me, but there's something which prevents it from working, so I ask here help to fix the bug, as I am sadly a big fan of AutoHotKey, but a very beginner in scripting for it ;)
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #3 on: September 12, 2006, 08:00:48 AM »

I want an AutoHotKey script so I can change it as much as I like

I wondered if you might...  Why not ask in the AHK forums?  That seems the logical place for scripting queries.

Logged
jgpaiva
Global Moderator
*****
Posts: 4,711



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: September 12, 2006, 09:06:16 AM »

I think that all that should work, although in one of the last lines you should have:

[copy or print]
SetTimer,CHECK,On
instead of
[copy or print]
SetTimer,CHECK,%checkevery%,On
Logged

insert_nick
Supporting Member
**
Posts: 72


View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: September 12, 2006, 05:59:22 PM »

Done! I post it here, if anyone wants to use/improve it. Thanks to Skrommel for his "tutorial" on how to script in AutoHotKey, which is the code itself of his nice and polished scripts :)


EDIT: Still doesn't work... help wanted

* Alarm.zip (1.21 KB - downloaded 216 times.)
« Last Edit: September 14, 2006, 05:09:02 AM by insert_nick » Logged
insert_nick
Supporting Member
**
Posts: 72


View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: September 14, 2006, 05:11:56 AM »

uhm... it seemed to work with simple tests, but today I've realized it was an illusion: it just triggers after the same amount of time, regardless of the alarm variable. If someone figures out how to fix it I'll be very glad, I'm still not very confident with the AutoHotKey language.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,711



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: September 14, 2006, 05:19:29 AM »

That's because you have a small typo, insert_nick.
In the following line,
[copy or print]
If (now>=start)
you most probably meant:
[copy or print]
If (now>=alarm)

Logged

insert_nick
Supporting Member
**
Posts: 72


View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: September 14, 2006, 09:07:33 AM »

Thanks! It was that!  embarassed
Attached the fixed version.

* Alarm.zip (1.31 KB - downloaded 275 times.)
Logged
lanux128
Global Moderator
*****
Posts: 6,132



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: September 14, 2006, 08:46:17 PM »

here's some alarm clock scripts from AHK forums that i've used in various ways...

Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.056s | Server load: 1.87 ]