Alarm Clock

By samcobra on Oct 27, 2005

Basically, when you load up the script, it will ask you to find a music file which you will then have as your set alarm. To use, just type /alarm [time]. the time has to be in hh:mm format, but you don't have to put in am/pm or military time. For example, if I want my alarm to wake me up at 6:30, then I would type /alarm 06:30. Everything else is taken care of. Unfortunately, for simplicity's sake, i only allowed the alarm clock to ring at the next 06:30, whether it be am or pm.

on *:load: { loadshit }
alias loadshit {
dialog -m choose
timer 1 2 dialog -x choose choose
}
on *:dialog:chose:close:*: {
set %alarmnoise $sfile(c:/,please choose a music file)
var %tg $left(%alarmnoise,3)
if (%tg == mp3) {set %tag -p}
if (%tg == wav)||(%tag == wma) {set %tag -w}
if (%tg == idi) {set %tag -m}
else { loadshit }
}
alias alarm { var %alti $1-
if ($len(%alti) == 4) { var %alti 0 $+ %alti }
  set %alarmtime %alti
echo 4,7you have just set your alarm to %alarmtime $+ !!
echo 4,7Brought to you by CobraScript::> Email samcobra@gmail.com if you have any problems.
  timeralarm -o 0 2 stalarm
set %al 1
}
alias stalarm {
  set %curtime $asctime(hh:nn)
  if (%curtime == %alarmtime) { 
    vol -p 65535
    splay %tag %alarmnoise 
    dialog -md stop stop
    timerta off
  }
  elseif (%al) { timerta -o 1 1 tryagain }
}

alias tryagain {
  stalarm
}

dialog stop {
  title CobraScript
  size -1 -1 100 70
  option dbu
  button "STOP ALARM",1,25 7 75 55
}

on *:dialog:stop:sclick:1 {
  stop
  dialog -x stop stop
unset %al
}

alias stop {
  splay stop
  timerta off
  unset %alarmtime
  unset %curtime
unset %al
}

dialog choose {
  title "Choose your Alarm Noise"
  size -1 -1 130 10
  option dbu
  text "Please choose a music file as your alarm noise",1,0 0 120 25
}

Comments

Sign in to comment.
dangerous_angel   -  Aug 23, 2009

I got the same problem, i typed /timers off. and it was fixed. This sript is a good idea, just needs to be seriously worked on, otherwise it shouldn't be here to cause probs for other people.

 Respond  
RagBot   -  Jun 20, 2008

Kay i tested it, and it awful!! and none of the editing could of done it, i just added choose to get it to open. when it\'s on i get:

you have just set your alarm to 07:30!!
Brought to you by CobraScript::> Email samcobra@gmail.com if you have any problems.

  • Timer alarm activated
  • /splay: invalid parameters (line 121, Remotes II)
  • /splay: invalid parameters (line 121, Remotes II)
  • Timer ta activated
  • Timer ta activated
  • Timer ta activated
  • Timer ta activated
  • Timer ta activated
    and i removed it and now i\'m getting this major spam:
    19:32… Unknown command: STALARM
    19:32… Unknown command: STALARM
    19:32… Unknown command: STALARM every second (I CAN\'T GET RID OF IT!!)

1/10 <- too good of a rating
P.S. sorry for 3 posts in a row

 Respond  
RagBot   -  Jun 20, 2008

you didn\'t explain how to choose a music file and adding it:

Go to options and go under sounds->requests and click on the button near the bottom that should start with \"C:\\" and then select a folder that has music in it. then select the file type inside the droplist above the button. Then you go to Sounds and keep pressing the button untill a popup comes up that has music files in it and select the song you want from it. Then click OK and your set.
I hope it helps ^_^

 Respond  
RagBot   -  Jun 20, 2008

the \"on load\" command happens when you first open the dialog, and the only way to open it is to do \"on load\", or /load shit . So basicly the \"on load\" is useless.

EDIT: Plus for it to work you need to change:

dialog -m choose

to

dialog -m choose choose
 Respond  
samcobra   -  Nov 01, 2005

it goes to the next available time when the alarm time is the same as the current time. IE... if u set it to 6:30 and kept resetting it, then it would go off twice a day.

 Respond  
Is|ander   -  Oct 28, 2005

let\'s say i want to wake up 6:30 p.m. instead of 6:30 a.m. or how does your script works? it alarms at both 6:30 a.m. AND 6:30 p.m.? how am i suppose to know?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.