Sign in to follow this  
Followers 0
Vladi243

Start at specific time

7 posts in this topic

Hey,

I want to make my script run automatically in specific time.

I searched in the help file but I didn't understand how to do it.

Thanks

Vladi.

Share this post


Link to post
Share on other sites



Windows Task Scheduler. Unless you want to have the script constantly running in the background waiting for the time to come and call a function that would be the easiest route.

Share this post


Link to post
Share on other sites

Hello,

Mayby this is what you are looking for?

I made this along time ago (when I was a newb in AutoIt)

#include <GUIConstants.au3>
#include <Sound.au3>
Global $act

$GUI = GUICreate("Reminder v1", 200, 180, -1, -1)
$Info = GUICtrlCreateLabel("If u dont want to forget something, u" & @CRLF & "can use this program to warn u at a" & @CRLF & "giving time.", 10, 10)
$h_info = GUICtrlCreateLabel("Hour:", 10, 60)
$h_Input = GUICtrlCreateInput(@Hour, 45, 57)
$m_info = GUICtrlCreateLabel("Min:", 100, 60)
$m_Input = GUICtrlCreateInput(@Min, 125, 56, 33)
$What_info = GUICtrlCreateLabel("What sould be remembered?", 10, 90)
$What_Input = GUICtrlCreateInput("", 10, 110, 180)
$Go = GUICtrlCreateButton("Go!", 10, 140, 180, 30)
$remind = False

GUISetState()
While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Go
                $h = GUICtrlRead($h_Input)
                $m = GUICtrlRead($m_Input)
                $remind = true
    EndSelect
    
    If $remind then 
        If (@HOUR >= $h) Then
            If (@MIN >= $m) Then
                _Remind()
                $remind = false
            EndIf
        EndIf
    EndIf
WEnd

Func _Remind()
    _SoundPlay(@ScriptDir & "\Song.mp3")
    $Warn_GUI = GUICreate("REMIND", 400, 100, -1, -1)
    $Remind_Label = GUICtrlCreateLabel("Reminding u:", 10, 10)
    $Reming_What = GUICtrlCreateLabel(GUICtrlRead($What_Input), 10, 30)
    $GotIt = GUICtrlCreateButton("Got It!", 10, 65, 380)
    GUICtrlSetState($GotIt, $GUI_DISABLE)
    GUISetState()
    Sleep(2000)
    GUICtrlSetState($GotIt, $GUI_ENABLE)
  
    Do
        $nMsg2 = GUIGetMsg()
    Until ($nMsg2 = $GUI_EVENT_CLOSE) Or ($nMsg2 = $GotIt)
    _SoundStop(@ScriptDir & "\Song.mp3")
    GUIDelete($Warn_GUI)
EndFunc

Hope it helps ^^,

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

Windows Task Scheduler. Unless you want to have the script constantly running in the background waiting for the time to come and call a function that would be the easiest route.

Where can I find Windows Task Scheduler?

Hello,

Mayby this is what you are looking for?

I made this along time ago (when I was a newb in AutoIt)

#include <GUIConstants.au3>
#include <Sound.au3>
Global $act

$GUI = GUICreate("Reminder v1", 200, 180, -1, -1)
$Info = GUICtrlCreateLabel("If u dont want to forget something, u" & @CRLF & "can use this program to warn u at a" & @CRLF & "giving time.", 10, 10)
$h_info = GUICtrlCreateLabel("Hour:", 10, 60)
$h_Input = GUICtrlCreateInput(@Hour, 45, 57)
$m_info = GUICtrlCreateLabel("Min:", 100, 60)
$m_Input = GUICtrlCreateInput(@Min, 125, 56, 33)
$What_info = GUICtrlCreateLabel("What sould be remembered?", 10, 90)
$What_Input = GUICtrlCreateInput("", 10, 110, 180)
$Go = GUICtrlCreateButton("Go!", 10, 140, 180, 30)
$remind = False

GUISetState()
While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Go
                $h = GUICtrlRead($h_Input)
                $m = GUICtrlRead($m_Input)
                $remind = true
    EndSelect
    
    If $remind then 
        If (@HOUR >= $h) Then
            If (@MIN >= $m) Then
                _Remind()
                $remind = false
            EndIf
        EndIf
    EndIf
WEnd

Func _Remind()
    _SoundPlay(@ScriptDir & "\Song.mp3")
    $Warn_GUI = GUICreate("REMIND", 400, 100, -1, -1)
    $Remind_Label = GUICtrlCreateLabel("Reminding u:", 10, 10)
    $Reming_What = GUICtrlCreateLabel(GUICtrlRead($What_Input), 10, 30)
    $GotIt = GUICtrlCreateButton("Got It!", 10, 65, 380)
    GUICtrlSetState($GotIt, $GUI_DISABLE)
    GUISetState()
    Sleep(2000)
    GUICtrlSetState($GotIt, $GUI_ENABLE)
  
    Do
        $nMsg2 = GUIGetMsg()
    Until ($nMsg2 = $GUI_EVENT_CLOSE) Or ($nMsg2 = $GotIt)
    _SoundStop(@ScriptDir & "\Song.mp3")
    GUIDelete($Warn_GUI)
EndFunc

Hope it helps ^^,

AlmarM

Thanks, it helps me a little.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

control panel

Edit: it's called Scheduled Tasks in XP

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites

@windowsdir & "\tasks


Giggity

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