Sign in to follow this  
Followers 0
Faustvii

Alarm

13 posts in this topic

#1 ·  Posted (edited)

AlarmDialog

#NoTrayIcon
FileInstall("Alarm.exe", "")
GUICreate("Alarm", 500, 200)
GUICtrlCreateLabel("Set Alarm Time:", 30, 50)
GUICtrlCreateLabel("Set Alarm Sound:", 30, 85)
GUICtrlCreateLabel("Press Here when your Awake -------->", 30, 135)
GUICtrlCreateLabel("If you click exit or close this program then the alarm wont work keep this open.", 30, 175)
$Time = GUICtrlCreateInput("00:00:00", 30, 65, 210, 20)
$alarmsound = GUICtrlCreateInput("wakeup.mp3", 30, 105, 210, 20)
$alerboxtime = GUICtrlCreateButton("Set Time", 242, 62, 95)
$alerboxsound = GUICtrlCreateButton("Set Sound", 242, 102, 95)
$imup = GUICtrlCreateButton("Im Awake", 242, 130, 95)


GUICtrlCreateLabel("Options:", 400, 10)
$Exit = GUICtrlCreateButton("Exit", 400, 25, 95)
$startalarm = GUICtrlCreateButton("Start", 400, 50, 95)
$start = IniWrite( "alarmsetup.ini", "Settings", "Alarmtime", "00:00:00")
$start1 = IniWrite( "alarmsetup.ini", "Settings", "AlarmSound", "wakeup.mp3")
$Alarmfile = IniRead("alarmsetup.ini", "Settings", "Alarmsound", "wakeup.mp3")
$Alarmtime = IniRead("alarmsetup.ini", "Settings", "Alarmtime", "")
GUISetState(@SW_SHOW)

Func Alerttime()
    $whattime1 = GUICtrlRead($Time)
    $whattime = IniWrite( "alarmsetup.ini", "Settings", "Alarmtime", "" & $whattime1)
    MsgBox(1, "Alarm", "Alarm Time Is: " & $whattime1)
EndFunc;==>Alerttime

Func alarmstart()
    Run( "Alarm.exe")
EndFunc;==>alarmstart

Func Alarmsound()
    $whatsound1 = GUICtrlRead($alarmsound)
    $whatsound = IniWrite( "alarmsetup.ini", "Settings", "AlarmSound", "" & $whatsound1)
    MsgBox(1, "Alarm", "Alarm Sound Is: " & $whatsound1)
EndFunc;==>Alarmsound
Func close()
    ProcessClose("Alarm.exe")
    ProcessClose("AlarmDialog.exe")
EndFunc;==>close

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $startalarm
            alarmstart()
        Case $msg = $imup
            ProcessClose("Alarm.exe")
        Case $msg = $alerboxtime
            Alerttime()
        Case $msg = $alerboxsound
            Alarmsound()
        Case $msg = $Exit
            close()
    EndSelect
WEnd

Alarm

#include <Date.au3>
#NoTrayIcon
$Alarmfile = IniRead("alarmsetup.ini", "Settings", "Alarmsound", "")
$Alarmtime = IniRead("alarmsetup.ini", "Settings", "Alarmtime", "")

Func Wakeup()
    $alarm = $alarm + 1
    Do
        SoundPlay($Alarmfile, 1)
            Sleep(2500*87)
    Until $alarm = 350
EndFunc ;==>Wakeup

While 1
    $time1 = _NowTime(5)
    Sleep(250); sleep
    Sleep(250); sleep
    Sleep(250); sleep
    Sleep(250); sleep
    If $time1 = $Alarmtime Then Wakeup()
    
WEnd

First run alarmdialog and then run alarm

Tell me what you think.. Ty updated alarm whit help from SmOke_N

Edited by Liope

Share this post


Link to post
Share on other sites



28 views and no replys :lmao:

Share this post


Link to post
Share on other sites

28 views and no replys :lmao:

$alarm = 1 + 1
    Do
        SoundPlay($Alarmfile, 1)
        $x = 1 + 1
        Do
            Sleep("2500")
        Until $x = 87
    Until $alarm = 350

Wouldn't you just be stuck in the 2nd Do loop forever? You never let it out of the loop because $x will never = 87 if it can't continue. I don't know what your trying to accomplish there or I would try to write a For loop for you on it.


[center]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.[/center]

Share this post


Link to post
Share on other sites

cause i didnt want to have 87 sleeps there so i changed it and i havent testede it so i didnt knew if it would work..

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Would this work?

For $i = 1 To 350
        SoundPlay($Alarmfile, 1)
        Sleep(2500*87)
    Next

or this?

Local $alarm = 0
    Do
        $alarm = $alarm + 1
        SoundPlay($Alarmfile, 1)
        Sleep(2500*87)
    Until $alarm = 350

Edit: Typo

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

ty didnt knew you could use 2500*87 in a sleep..

Share this post


Link to post
Share on other sites

i made this a loooooooooooooooooooooooooooooong time ago

and it was more easy to use -.-

and that all, because it was only 1 data!


[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

For future reference also, $x = 1 + 1 will always = 2, you'll delclare $x then use $x = $x + 1 for released version or $x += 1 for beta version.

Local $x = ''
Do
    $x = $x + 1
Until $x = 100
MsgBox(0, 'Test', $x)

Or for beta

Local $x = ''
Do
    $x += 1
Until $x = 100
MsgBox(0, 'Test', $x)

[center]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.[/center]

Share this post


Link to post
Share on other sites

i made this a loooooooooooooooooooooooooooooong time ago

and it was more easy to use -.-

and that all, because it was only 1 data!

Any point here other than your perfection in helping Liope with his/her project?

[center]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.[/center]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

oh the $x thing must be a typo ill just change it ty for the help SmOke_N

What do you think about the alarm?

Edited by Liope

Share this post


Link to post
Share on other sites

it works fine (i remember your netparty :lmao:)


My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
Share on other sites

it works fine (i remember your netparty ;))

totaly chock to everbody when it played a song.. :lmao:

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Yes white noise ;):lmao:o:):king:

Edited by rambo3889

My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

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