Jump to content

Shut down bot


JReinn
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Developers

Any fast help greatly appreciated.

You are kidding ...right ?

Did you bother to search or open the helpfile?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Developers

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:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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 ...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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...
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...