AlmarM Posted February 9, 2008 Share Posted February 9, 2008 I saw the Mario Screen Mate script and I wanted to create a Reminder (Warn u on time) I got this: expandcollapse popup#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. Link to comment Share on other sites More sharing options...
Kademlia Posted February 9, 2008 Share Posted February 9, 2008 (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 February 9, 2008 by Kademlia Link to comment Share on other sites More sharing options...
Achilles Posted February 9, 2008 Share Posted February 9, 2008 (edited) expandcollapse popup#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 February 9, 2008 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
AlmarM Posted February 9, 2008 Author Share Posted February 9, 2008 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now