Venom Alarm Clock

By blackvenomm666 on Apr 24, 2011

its an easy to use alarm clock load into a new remotes then open it from the nicklist or the menubar. in the dialog go to file then add sound. you can add wma's mp3's wav's. after you add a sound or more than one go down to the edit box that you can type in and put the time you want the alarm to go off at in the h:nn:tt format for those of you who dont know what that looks like it would look like this >>>5:30:pm. you also need to highlight a sound from the sound section so after you do that and have your time in the edit box click on set. then turn it on. this was made on v6.32 and it was tested on v6.35 so i know for sure it works on those two versions other than that idk. ok added a repeat function. set it to on and it will repeat your alarm as soon as the wav file/mp3 file thats playing ends. if mp3 you will get a small error if you have an mp3 player that automatically moves to the next song on mp3 end. there is no way for me to fix that for you though sorry haha. and after setting everything you can close the alarm clock if you want if you set it properly when the time you want the alarm to go off comes it will open the dialog if its closed added a snooze edit feature. go into file click on change snooze time. then set how long you want it to wait until the alarm goes off again. set it by minutes. so 1 2 3 4 5 if you plan to use the snooze button you must do that before you turn the alarm on.
Image

Menu Menubar,Nicklist,Channel {
  .Venom Alarm Clock: dialog $iif($dialog(alarmclock.System),-v,-md alarmclock.System) alarmclock.System
}
Dialog alarmclock.System {
  Title "Alarm clock"
  Size -1 -1 182 100
  Option dbu
  text "Wake up sounds", 1, 60 08 40 10
  list 2, 02 20 144 60, hsbar vsbar
  button "Set Alarm ",3, 02 78 37 12 , flat
  edit "h:nn:tt5:30:pm", 4, 45 78 40 12, autohs
  button "Snooze ",5, 92 78 37 12 , flat
  menu "File", 6
  item "Add Sound", 7, 6
  item "Delete Sound", 11, 6
  item "Chang Snooze Time", 14, 6
  edit "", 8, 138 78 40 12, read
  Radio "Alarm On " 9, 147 20 34 10, flat
  Radio "Alarm off " 10, 147 32 34 10, flat
  check "Repeat on", 12, 147 45 34 9
  check "Repeat off", 13, 147 57 34 9

}
on *:dialog:alarmclock.System:sclick:3: {
  .set %alarmsound $did(2).sel
  .set %wakeup $did(4).text
  .timerwakeup 0 1 wakemeup

}
on *:dialog:alarmclock.System:init:*: {
  alarmsound
  .timercurrenttime 0 1 currenttime
  if (%alarmclock == on ) {
    did -c alarmclock.System 9
    did -ra alarmclock.system 4 %wakeup 
  }
  if (%alarmclock == off ) { did -c alarmclock.System 10
  }
  if ( %repeatalarm == on ) { did -c alarmclock.System 12
  }
  if ( %repeatalarm == off ) { did -c alarmclock.System 13
  }
}
on *:dialog:alarmclock.System:sclick:5: {
  .splay stop
  .timersnooze 1 %snoozetime splay $read(alarmsound.txt, %alarmsound)
}

on *:dialog:alarmclock.System:menu:7: {
  write alarmsound.txt $$sfile(C:\,Choose Directory) | alarmsound 
}
On *:dialog:alarmclock.System:sclick:9: { 
  if ( $did(4).text == h:nn:tt5:30:pm) {  noop $input(Please enter a time to wake up at ex 5:30:pm,uwo,Error!) 
    did -u alarmclock.System 9
    did -c alarmclock.System 10
  }
  if (!$did(2).sel) { noop $input(Please select a sound from the list to use as your wakeup sound,uwo,Error!) 
    did -u alarmclock.System 9
    did -c alarmclock.System 10
  }
  else { set %alarmclock on 
  }
}

On *:dialog:alarmclock.System:sclick:10: { 
  set %alarmclock off
  .timersnooze off
  .timerwakeup off
  .splay stop
}
on *:dialog:alarmclock.System:menu:11: {
  if (!$did(2).sel) { noop $input(Please Highlite A Sound In List Box To Delete,uwo,Error!) } | else { write -dl $+ $did(2).sel alarmsound.txt
    did -r alarmclock.system 2
    alarmsound

  }

}
on *:dialog:alarmclock.System:menu:14: {
  /set %snoozetime $calc($+($$?"How many minutes? ex 5 6 7 8") * 60)
}
On *:dialog:alarmclock.System:sclick:12: { 
  set %repeatalarm on
  did -u alarmclock.System 13
}
On *:dialog:alarmclock.System:sclick:13: { 
  set %repeatalarm off
  did -u alarmclock.System 12
}

on *:dialog:alarmclock.System:close:*:{ 
  .timercurrenttime off
}
on *:WAVEEND: {
  if (%alarmclock == on) && (%repeatalarm == on) {
    splay $read(alarmsound.txt, %alarmsound )
  }
}
on *:MP3END: {
  if (%alarmclock == on) && (%repeatalarm == on) {
    splay $read(alarmsound.txt, %alarmsound )
  }
}
alias currenttime {
  did -ra alarmclock.System 8 $time(h:nn::ss:tt)
}
alias alarmsound { did -r alarmclock.system 2 | var %x = 1 | while ( %x <= $lines(alarmsound.txt)) { did -za alarmclock.system 2 $nopath($read(alarmsound.txt,%x)) | inc %x } }
alias wakemeup { if (%wakeup == $time(h:nn:tt)) && (%alarmclock == on) { splay $read(alarmsound.txt, %alarmsound ) | .timerwakeup off | if (!$dialog(alarmclock.System)) { .dialog -v,-md alarmclock.System alarmclock.System } } }

Comments

Sign in to comment.
blackvenomm666   -  Apr 26, 2011

updated now has repeat function and the ability to change how long the snooze waits via the file menu

 Respond  
D34th   -  Apr 26, 2011

Makes sense cant wait to see the finish product man :D

 Respond  
blackvenomm666   -  Apr 26, 2011

yea i do do that with some of my snippets but some i don't i unno. i'll eventually go through em all and redo them. that and this one isnt 100% done yet im going to add a repeat function and prolly add a way so people can choose how long the snooze button works for instead of having snooze perm set at 5 min.

 Respond  
D34th   -  Apr 26, 2011

Seeing as you created it Venom im 120% sure it works lol.
Although i still think u should clean up your code a bit. using $did and $devent. Example:

If ($Devent == Sclick) { 
  If $did = 5 { 
  .splay stop
  .timersoonze 1 300 soplay $Read(Alarmsounds.txt, %alarmsound)
}

^ Just easyer for debugging

 Respond  
Sharky_Dude   -  Apr 26, 2011

works just like you said, Good job!

 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.