Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
shutdown computer
#1
Hey, I havent used QM in a long time, so i'm messing around with it a little and I was wondering... how could i set up a macro to shutdown at like say 5:00 AM in the morning.

I know i need shutdown 3 but how do i get the time frame for it to shutdown to work?
#2
Code:
Copy      Help
shutdown 1

hit control-p and then click on schedule at the bottom left.
An old blog on QM coding and automation.

The Macro Hook
#3
ok thanks it works but im just curious... is there another way to do it other then schedule... like every night i wanna let my computer run to a certain time then shut off but it might not be the same time every night... so is there another way to set it up where i can adjust the time inside the macro rather then having to reset it all inside the properties?
#4
you could use a trigger but i dont recomend it.

if you put in this in just before the shutdown command it will wait for 10 min. you could do it that way.
Code:
Copy      Help
rep 10
,60
An old blog on QM coding and automation.

The Macro Hook
#5
yea i was gonna do that but i was just gonna try something a little harder then that... before i had it:

Code:
Copy      Help
str s
;top
s.time
out s
if s="8/1/2007 5:00:00 AM"
,shutdown 1
else
,goto top
,


but for the if part i dont like having to put the date... so is there some way i could fix that?
#6
if you look in the QM help under 'time' it gives the whole break down on how to use it.
An old blog on QM coding and automation.

The Macro Hook
#7
Code:
Copy      Help
str s
rep
,s.time("-" "h:mm tt")
,out s
,if s="5:00 AM"
,,shutdown 1
,,end
,30
#8
Works great, thanks gin, and thanks ken.
#9
Hey one last question... Is there a way to set this up so I can set the time in another macro...

Set Time:
Code:
Copy      Help
5:00 AM


Shutdown Computer:
Code:
Copy      Help
str s
rep
,s.time("-" "h:mm tt")
,out s
,if s="5:00 AM"
,,shutdown 1
,,end
,30


I want the Macro or Function "Set Time" to be able to adjust the time in the macro "Shutdown Computer" rather then setting the time in "Shutdown Computer". Any ideas on how this would work?... No biggie if not, I just wanted to see how cool I could set up this macro. Big Grin
#10
set 'str s' as a global


Code:
Copy      Help
str+ s
#11
Or use registry.

Set Time:
Code:
Copy      Help
str st
st="5:00 AM"
rset st "shutdown time"

Shutdown Computer:
Code:
Copy      Help
str st
...
,rget st "shutdown time"
,if s=st
,,...
#12
OK i tried this but it didnt work?

Shutdown Computer:
Code:
Copy      Help
str s
str+ st
rep
,s.time("-" "h:mm tt")
,out s
,if s=st
,,shutdown 1
,,end
,30


Set Time:
Code:
Copy      Help
str+ st="12:51 PM"


but this didnt work? any ideas why?[/code]
#13
Nevermind... I forgot to try saving it in registry... and now it works. Thanks Again.


Shutdown Computer:
Code:
Copy      Help
str s
str st
rep
,s.time("-" "h:mm tt")
,out s
,rget st "shutdown time"
,if s=st
,,shutdown 1
,,end
,30


Set Time:
Code:
Copy      Help
str st
st="1:00 PM"
rset st "shutdown time"


Forum Jump:


Users browsing this thread: 1 Guest(s)