Jump to content
Sign in to follow this  
JReinn

Shut down bot

Recommended Posts

JReinn

I need a code, for a bot, that can turn your computer off, at a certain time. Like I bought this game once, and it ended downloading around 1 AM in the morning, and I needed to get up early, but I stayed up, because I don't want my computer on all night. So you can set the bot up, so you write hour in one textbox, and minutes in the other. You click start bot (or press a certain button, like F5 or something, and the bot starts). When the time becomes what you wrote (System time), the bot will shut down the computer.

Any fast help greatly appreciated.

Share this post


Link to post
Share on other sites
Jos

Any fast help greatly appreciated.

You are kidding ...right ?

Did you bother to search or open the helpfile?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
JReinn

You are kidding ...right ?

Did you bother to search or open the helpfile?

Yes, I did.

Share this post


Link to post
Share on other sites
JReinn

..and ? found anything ?

Nope, that's why I posted here.

Share this post


Link to post
Share on other sites
Jos

Nope, that's why I posted here.

I am sorry but I simply do not believe you put ANY real effort in it for the simple fact that when you specify shutdown in the index AND search of the helpfile you will get hits for the required command.

Now if you are wondering why I refuse to help directly is because I do not like people coming here and ask for fast replies, that is in general an indication of a young impatient person.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
James

Well this should work:

#include <GUIConstants.au3>

Global $wHour, $wMins, $isCounting = False

AdlibEnable("GetTime", 1000)

$hGui = GUICreate("Shutdown Bot", 297, 44, 307, 303)
GUICtrlCreateLabel("Hours:", 8, 8, 43, 17)
$mHour = GUICtrlCreateInput("", 56, 8, 49, 21)
GUICtrlCreateLabel("Mins:", 120, 8, 29, 17)
$mMins = GUICtrlCreateInput("", 152, 8, 57, 21)
$Start = GUICtrlCreateButton("Start", 216, 8, 75, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Start
            $rHour = GUICtrlRead($mHour)
            $rMins = GUICtrlRead($mMins)
            
            $isCounting = True; We're counting!
            While $isCounting = True
                If $wHour = $rHour And $wMins = $rMins Then
                    Shutdown(1); Shutdown
                EndIf
            WEnd
    EndSwitch
WEnd

Func GetTime()
    $wHour = @HOUR
    $wMins = @MIN
EndFunc

Share this post


Link to post
Share on other sites
JReinn

I am sorry but I simply do not believe you put ANY real effort in it for the simple fact that when you specify shutdown in the index AND search of the helpfile you will get hits for the required command.

Now if you are wondering why I refuse to help directly is because I do not like people coming here and ask for fast replies, that is in general an indication of a young impatient person.

Jos

I have put some effort in searching, and I'm sorry I said "Fast response", but I really needed this.

Well this should work:

#include <GUIConstants.au3>

Global $wHour, $wMins, $isCounting = False

AdlibEnable("GetTime", 1000)

$hGui = GUICreate("Shutdown Bot", 297, 44, 307, 303)
GUICtrlCreateLabel("Hours:", 8, 8, 43, 17)
$mHour = GUICtrlCreateInput("", 56, 8, 49, 21)
GUICtrlCreateLabel("Mins:", 120, 8, 29, 17)
$mMins = GUICtrlCreateInput("", 152, 8, 57, 21)
$Start = GUICtrlCreateButton("Start", 216, 8, 75, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Start
            $rHour = GUICtrlRead($mHour)
            $rMins = GUICtrlRead($mMins)
            
            $isCounting = True; We're counting!
            While $isCounting = True
                If $wHour = $rHour And $wMins = $rMins Then
                    Shutdown(1); Shutdown
                EndIf
            WEnd
    EndSwitch
WEnd

Func GetTime()
    $wHour = @HOUR
    $wMins = @MIN
EndFunc
Thanks for the code!

You are the best.

Share this post


Link to post
Share on other sites
Jos

Say what?

"Jerk" - Thanks... I posted after you did!

Close :(

You simple spoinled the whole point I was trying to make ... so I should be entitled to call you something ... :mellow:


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos

Well I didn't mean to "spoinled" your point, you posted while I was posting my response.

:mellow: yea yea .... i know, I am a bad speller ...

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
JReinn

Could it be able to make a countdown timer (Tooltip text) that shows, when the computer turns off with hours, minutes & seconds?

Share this post


Link to post
Share on other sites
JReinn

I'm sure you could do that. Create a label and every second start counting down.

I'm new to AutoIt... The code would be, like??? I don't understand you completely :/

Share this post


Link to post
Share on other sites
JReinn

I wonder if a better way to do this is simply look for the download to be done, then shutdown. What if the download hangs...

Oh, what are you on? dialup? or is the thing you are downloading a movie?

I download a game, from ea manager...

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.