Jump to content

*UPDATE* CPU-Mach v2.0 - NEW!


Aces
 Share

Recommended Posts

Posted Image

Changelog (v2.0): Went over fixed some bugs

Changelog (v2.0): Changed template

Changelog (v2.0): Added Quit and About Us menu items

#include <GUIConstants.au3>
opt("RunErrorsFatal", 0)

$GUItitle = "CPU-Mach v2.0"

$Form1 = GUICreate($GUItitle, 301, 401, 212, 152)
$Button1 = GUICtrlCreateButton("[ Power Off ]", 24, 32, 121, 57, 0)
$Button2 = GUICtrlCreateButton("[ Reboot ]", 24, 96, 121, 57, 0)
$Button3 = GUICtrlCreateButton("[ Log Off ]", 24, 160, 121, 57, 0)
$Button4 = GUICtrlCreateButton("[ Stand-By ]", 24, 224, 121, 57, 0)
$Label1 = GUICtrlCreateLabel("Created By: Aces-X @ AcesX91@acecoding.net", 24, 320, 252, 41)
$Pic1 = GUICtrlCreatePic("space.jpg", 152, 8, 145, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$MenuItem1 = GUICtrlCreateMenu("File")
$MenuItem3 = GUICtrlCreateMenuItem("Run", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Quit", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("About")
$MenuItem6 = GUICtrlCreateMenuItem("About Us", $MenuItem2)
GUICtrlSetBkColor($Button1, 0x000000)
GUICtrlSetBkColor($Button2, 0x000000)
GUICtrlSetBkColor($Button3, 0x000000)
GUICtrlSetBkColor($Button4, 0x000000)
GUICtrlSetColor($Button1, 0xFF0000)
GUICtrlSetColor($Button2, 0x33FF00)
GUICtrlSetColor($Button3, 0xCCFF00)
GUICtrlSetColor($Button4, 0xCCFFFF)
GUICtrlSetFont($Button1, 9, 1000)
GUICtrlSetFont($Button2, 9, 1000)
GUICtrlSetFont($Button3, 9, 1000)
GUICtrlSetFont($Button4, 9, 1000)
GUICtrlSetFont($Label1, 8, 1000)
GUISetState(@SW_SHOW)

;;Start Main Script
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            $QuitBox = MsgBox(4, $GUItitle, "Are you sure you want to quit " & $GUItitle & "?")
            If $QuitBox = 6 Then
                Exit
            ElseIf $QuitBox = 7 Then
                MsgBox(0, $GUItitle, "Returning to " & $GUItitle & "...", 1)
            EndIf
        Case $Button1
            Poweroff()
        Case $Button2
            Reboot()
        Case $Button3
            Logoff()
        Case $Button4
            Standby()
        Case $MenuItem3
            RunMenu()
        Case $MenuItem4
            Quit()
        Case $MenuItem6
            AboutUs()
    EndSwitch
WEnd

;;Functions
Func RunMenu()
    $input = InputBox("Run...", "Please type the path/file you would like to run.")
    $Run = Run($input)
    If $Run = @error Then
        MsgBox(0, $GUItitle, "Could not run " & $input & " at this time.")
    EndIf
EndFunc

Func Standby()
    If MsgBox(1, "Standby", "Your CPU will stand by when you press OK.") = 1 Then
        Shutdown(32)
    EndIf
EndFunc

Func Poweroff()
    If MsgBox(1, "Shutdown", "Your CPU will power off when you press OK.") = 1 Then
        Shutdown(9)
    EndIf
EndFunc

Func Reboot()
    If MsgBox(1, "Reboot", "Your CPU will reboot when you press OK.") = 1 Then
        Shutdown(3)
    EndIf
EndFunc

Func Logoff()
    If MsgBox(1, "Log Off", "Your CPU will log off when you press OK.") = 1 Then
        Shutdown(0)
    EndIf
EndFunc

Func Quit()
    $QuitBox = MsgBox(4, $GUItitle, "Are you sure you want to quit " & $GUItitle & "?")
    If $QuitBox = 6 Then
        Exit
    ElseIf $QuitBox = 7 Then
        MsgBox(0, $GUItitle, "Returning to " & $GUItitle & "...", 1)
    EndIf
EndFunc

Func AboutUs()
    MsgBox(0, $GUItitle & " - About Us", "Ace Coding Development was created June 28th, 2007.  Coder Aces-X had a gut feeling, this was the time he had to persue his coding dreams and create software in the deed that he would be helping people that needed it.  Ace Coding Development has great pride in its software and will always try and do what it can do to make other people better coders. www.AceCoding.net support us please, sign up for the forums today! Thank you.")
    Return 1
EndFunc

CPU-Mach v2.0

Made by me, Kevin "Aces-X" Morris

Description:

A convenient little tool to access things from the quickbar or shortcut. Please leave the .jpg file where it is.

I am a new AU3 coder, please give suggestions if you want me to try to make a program or add to this one. Thank you.

Download is below

CPU_Mach_v2.0.zip

Edited by Aces

~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public

Link to comment
Share on other sites

first of all cpu is the core of the computer, if you shut down the CPU you are shutting down the computer.

second of all, my shut down methods are fine.. they work perfectly okay - no need to bad name my program...

~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public

Link to comment
Share on other sites

Added a "Run" feature in V0.2 uploaded now.

~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public

Link to comment
Share on other sites

come on guys this has to be useful to some of you guys.

~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public

Link to comment
Share on other sites

come on guys this has to be useful to some of you guys.

"Old habits die hard", a lot of people will still use the Start menu over any easier option, just because it is familiar and people get into the habit of using it a certain way.
Link to comment
Share on other sites

I compiled it, but if you want the raw source code you can just copy and paste the one i put up into a new script.

~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public

Link to comment
Share on other sites

Yup, to be honest id rather keep my taskbar free from an extra app.

I have winkey + r to get a run box, start shutdown / log off.

winkey + l to lock my machine.

Whilst this script is a great learning experience, i personally don't see a need for it.

Otherwise, your code is neat, and nice to see you used functions instead of cramming it all on the button.

Link to comment
Share on other sites

first of all cpu is the core of the computer, if you shut down the CPU you are shutting down the computer.

second of all, my shut down methods are fine.. they work perfectly okay - no need to bad name my program...

I saw this post and laughed...

This isn't China or North Korea so everyone is entitled to opinion. Second he didn't bad name your program he pointed out where he thinks you could have done better. Also CoDEmanX why do you think the code you have is better than what Aces have? Just saying something is better doesn't really prove anything now does it.

Also I have to agree with tAKTelapis. I already have to many apps in the taskbar so why add a extra one. So your going to have to think outside the box to win users over.

Edited by AgentSmith15
Link to comment
Share on other sites

I saw this post and laughed...

This isn't China or North Korea so everyone is entitled to opinion. Second he didn't bad name your program he pointed out where he thinks you could have done better. Also CoDEmanX why do you think the code you have is better than what Aces have? Just saying something is better doesn't really prove anything now does it.

Also I have to agree with tAKTelapis. I already have to many apps in the taskbar so why add a extra one. So your going to have to think outside the box to win users over.

thanks.

~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public

Link to comment
Share on other sites

any program suggestions you guys think people may want to use? that isn't too complicating in autoitv3 (im still noob to it :)

~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public

Link to comment
Share on other sites

any program suggestions you guys think people may want to use? that isn't too complicating in autoitv3 (im still noob to it :)

Well a good habbit to get into is your formatting. The below code does exactly the same thing, but is easier to read. Make sure you use SciTE as your script editor ... it makes life MUCH easier :) The addon for SciTE called tidy can make your script look like the one below. I modified your GUI loop a bit to the more standard way autoit scripters typically do it ... with a select statement

#include <GUIConstants.au3>

GUICreate("CPU-Mach V0.2 - Made by Aces", 300, 400)

$pic = GUICtrlCreatePic(@ScriptDir & "\space.jpg", 150, 10, 130, 300)
$runmenu = GUICtrlCreateMenu("&Run")
$runitem = GUICtrlCreateMenuItem("Run...", $runmenu)
$shutdown = GUICtrlCreateButton("Power Off", 10, 10, 130, 50)
$reboot = GUICtrlCreateButton("Reboot", 10, 70, 130, 50)
$logoff = GUICtrlCreateButton("Log Off", 10, 130, 130, 50)
$notepad = GUICtrlCreateButton("Notepad", 10, 190, 130, 50)
$cmd = GUICtrlCreateButton("CMD Prompt", 10, 250, 130, 50)
$ad1 = GUICtrlCreateLabel("CPU-Mach V0.2 - " & "Created by: Kevin Aces Morris @ kmorris91@gmail.com", 5, 350, 300, 50)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $shutdown
            poweroff()
        Case $msg = $reboot
            reboot()
        Case $msg = $logoff
            logoff()
        Case $msg = $notepad
            notepad()
        Case $msg = $cmd
            cmd()
        Case $msg = $runitem
            runmenu()
    EndSelect
WEnd

Func runmenu()
    $input = InputBox("Run...", "Please type the path you would like to run.")
    If $input <> "" Then Run($input)
EndFunc   ;==>runmenu

Func cmd()
    MsgBox(0, "CMD Prompt", "Your CPU will open CMD Prompt when you press OK.")
    Run("cmd")
EndFunc   ;==>cmd

Func notepad()
    MsgBox(0, "Notepad", "Your CPU will open notepad when you press OK.")
    Run("notepad")
EndFunc   ;==>notepad

Func poweroff()
    MsgBox(0, "Shutdown", "Your CPU will power off when you press OK.")
    Shutdown(9)
EndFunc   ;==>poweroff

Func reboot()
    MsgBox(0, "Reboot", "Your CPU will reboot when you press OK.")
    Shutdown(3)
EndFunc   ;==>reboot

Func logoff()
    MsgBox(0, "Log Off", "Your CPU will log off when you press OK.")
    Shutdown(0)
EndFunc   ;==>logoffoÝ÷ Øìµæ¡øZ¾)àjg¬±¨ng¢ØÊØ^ºÇ«¶­Ýý²
"Ú!j^r`÷­ér§qëhq©ÜzXî²Ø§q«¶²+mì+¢xºÛh·­²Æ²ÊÛaÇè®Ø^®éç¢×©i×îËb¢r-Â¥vZ(X¤zØb±«­¢+Ø)%5Í  ½à Ä°ÅÕ½Ðí9½ÑÁÅÕ½Ðì°ÅÕ½Ðíe½ÕÈ
ATÝ¥±°½Á¸¹½ÑÁÝ¡¸å½ÔÁÉÍÌ=,¸ÅÕ½Ðì¤ôÄQ¡¸IÕ¸ ÅÕ½Ðí¹½ÑÁÅÕ½Ðì¤(

Now if the user clicks cancel, well, it cancels running notpad. You could do the same with the other ones two. Just remember to put a 1 for the first parameter of the MsgBox() function.

It looks like your getting the hang of things just fine. Good luck scripting! :)

Hallman

Edited by Hallman
Link to comment
Share on other sites

Honestly, I don't see any real usage of this script...

The best way to lern autoit scripting is to write scripts that are _useful_. :)

Just becuase this script isn't usefull to you doesn't mean it isn't usefull to him. Don't forget that everyone starts somewhere ... you can't tell me you made really usefull apps right when you first started. Instead of knocking his script, praise what he has and help him to improve :) Telling him to make something more usefull but not giving any help on how to accomplish that doesn't do much good.

Hallman

Edited by Hallman
Link to comment
Share on other sites

Just becuase this script isn't usefull to you doesn't mean it isn't usefull to him. Don't forget that everyone starts somewhere ... you can't tell me you made really usefull apps right when you first started. Instead of knocking his script, praise what he has and help him to improve :) Telling him to make something more usefull but not giving any help on how to accomplish that doesn't do much good.

Hallman

lol, agreed, finally, a logical thinker

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
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...