thenewkid Posted February 13, 2007 Posted February 13, 2007 Hi this script works good but if the clock hits over 00:00 then it will close the notepad does any one know how to make it not to close the notepad intill 06:00 #include <Date.au3> $pro = "Untitled - Notepad" Func _Time() $Time = _NowTime(4) if $Time <= "19:00" Then WinClose($pro) Else EndIf EndFunc Func _IFprorun() While 1 If WinExists($pro) Then _Time() Else Sleep(500) EndIf WEnd EndFunc ProcessSetPriority("nopro.exe",0) ;to lower drag on cpu _IFprorun() some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with
Moderators SmOke_N Posted February 13, 2007 Moderators Posted February 13, 2007 Global $sTitleOfWin = 'Untitled - Notepad' Global $sHourShutdown = '19', $sMinuteShutDown = '00' AdlibEnable('_IfProRun', 1000) While 1 Sleep(0x7FFFFFFF) WEnd Func _IfProRun() If WinExists($sTitleOfWin) Then If Int(@HOUR) = Int($sHourShutdown) And Int(@MIN) >= Int($sMinuteShutDown) Then WinClose($sTitleOfWin) EndIf EndIf EndFunc 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.
thenewkid Posted February 14, 2007 Author Posted February 14, 2007 Thanks smoke but that script does not do what i need it to ive been working on mine with a bit of help from yours but it all ways shows the 2ed msgbox and not the first when i think it shold can any one help #include <Date.au3> $pro = "Untitled - Notepad" Func _Time() $Time = _NowTime(4) if $Time >= "19:00" And $Time <= "06:00" Then MsgBox(0,"","in the time zone") Else MsgBox(0,"","out side the zime zone") WinClose($pro) EndIf EndFunc Func _IFvodorun() While 1 If WinExists($pro) Then _Time() Else Sleep(500) EndIf WEnd EndFunc ;main----------------- ProcessSetPriority("nopro.exe",0) _IFvodorun() some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with
Moderators SmOke_N Posted February 14, 2007 Moderators Posted February 14, 2007 (edited) Thanks smoke but that script does not do what i need it to ive been working on mine with a bit of help from yours but it all ways shows the 2ed msgbox and not the first when i think it shold can any one help #include <Date.au3> $pro = "Untitled - Notepad" Func _Time() $Time = _NowTime(4) if $Time >= "19:00" And $Time <= "06:00" Then MsgBox(0,"","in the time zone") Else MsgBox(0,"","out side the zime zone") WinClose($pro) EndIf EndFunc Func _IFvodorun() While 1 If WinExists($pro) Then _Time() Else Sleep(500) EndIf WEnd EndFunc ;main----------------- ProcessSetPriority("nopro.exe",0) _IFvodorun()Um, you just want to shut down a window at a certain hour and minute? That's exactly what the script that I gave you does. Edit: Yep, just verified... Shuts it down when the hour I want to is = to, and the minute I want to is = to. Are you trying to shut it down between the hours of xx and xx? Edited February 14, 2007 by SmOke_N 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.
thenewkid Posted February 14, 2007 Author Posted February 14, 2007 (edited) no i want it to shutdown a window if the time is <=19:00 And >= 06:00 and shuts it down if the time is not within the 13hr timezone so if the zime is 03:00 it will keep it opan and if the time is 15:00 it will close the window Edited February 14, 2007 by thenewkid some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with
Moderators SmOke_N Posted February 14, 2007 Moderators Posted February 14, 2007 no i want it to shutdown a window if the time is <=19:00 And >= 06:00 and shuts it down if the time is not within the 13hr timezone so if the zime is 03:00 it will keep it opan and if the time is 15:00 it will close the windowGlobal $sTitleOfWin = 'Untitled - Notepad' Global $sHourShutdown1 = '19', $sMinuteShutDown1 = '00', $sHourShutdown2 = '06', $sMinuteShutDown2 = '00' AdlibEnable('_IfProRun', 1000) While 1 Sleep(0x7FFFFFFF) WEnd Func _IfProRun() If WinExists($sTitleOfWin) Then If (Int(@HOUR) <= Int($sHourShutdown1) And Int(@MIN) <= Int($sMinuteShutDown1)) And _ (Int(@HOUR) >= Int($sHourShutdown2) And Int(@MIN) >= Int($sMinuteShutDown2)) Then WinClose($sTitleOfWin) EndIf EndIf EndFunc 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.
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