Sign in to follow this  
Followers 0
AlmarM

I DONT get it anymore

4 posts in this topic

I saw the Mario Screen Mate script and I wanted to create a Reminder (Warn u on time)

I got this:

#include <GUIConstants.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)

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

Func _Remind()
    $Warn_GUI = GUICreate("REMIND", 200, 200, -1, -1)
    $Remind_Label = GUICtrlCreateLabel("Reminding u:", 10, 10)
    $Reming_What = GUICtrlCreateLabel(GUICtrlRead($What_Input), 10, 30)
    $GotIt = GUICtrlCreateButton("Got It!", 10, 10)
    GUISetState()
    
    Do
        $nMsg2 = GUIGetMsg()
    Until ($nMsg2 = $GUI_EVENT_CLOSE) Or ($nMsg2 = $GotIt)
    $act = 0
    GUIDelete($Warn_GUI)
EndFunc

But it wont do the _Remind() func. Does someone can help me ?


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



#2 ·  Posted (edited)

If $act = 1 Then <--- this one is "" you defined globaly but didn´t set it anywhere to 1

Try working more with ConsoleWrite("$act= " & $act & @CRLF) helps me alot.

Edited by Kademlia

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

#include <GUIConstants.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
;~          If $act = 1 Then
                $h = GUICtrlRead($h_Input)
                $m = GUICtrlRead($m_Input)
                $remind = true
;~          EndIf
    EndSelect
    
    If $remind then 
        If (@HOUR >= $h) Then
            If (@MIN >= $m) Then
                _Remind()
                $remind = false
            EndIf
        EndIf
    EndIf
WEnd

Func _Remind()
    $Warn_GUI = GUICreate("REMIND", 200, 200, -1, -1)
    $Remind_Label = GUICtrlCreateLabel("Reminding u:", 10, 10)
    $Reming_What = GUICtrlCreateLabel(GUICtrlRead($What_Input), 10, 30)
    $GotIt = GUICtrlCreateButton("Got It!", 10, 10)
    GUISetState()
   
    Do
        $nMsg2 = GUIGetMsg()
    Until ($nMsg2 = $GUI_EVENT_CLOSE) Or ($nMsg2 = $GotIt)
    GUIDelete($Warn_GUI)
EndFunc

Your code would only work if you pressed go and the time was right. This way it checks constantly and then, when the time is right, it shows the reminder.

Your reminder GUI doesn't work very well but you can fix that.

Edited by Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Thx, it works :)

Im going to Post it at Example Scripts now :)


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

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