Jump to content

Recommended Posts

Posted

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.

  • Developers
Posted (edited)

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

Posted

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
Posted

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.

  • Developers
Posted

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

Posted

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

Posted

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 :/
Posted

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

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
×
×
  • Create New...