Sign in to follow this  
Followers 0
tonycst

Can autoit change powerplan ?

5 posts in this topic

I want to change powerplan from what ever i have available to what ever else i have available when executing a game.

I start games by a script, so is there a line that i could add to change powerplan ?

Use of swichable graphics is dumb, because GPU gets switched but PCI link is not unless i change it manually or change to powerplan that has it OFF

 

Thanks in advance.

Share this post


Link to post
Share on other sites



tonycst,

 

I start games by a script, so is there a line that i could add

What you do with AutoIt in the world outside is entirely your own affair, but given the prohibition in the Forum rules about discussing certain possible uses, mentioning in open forum that you want help with a script that you admit is used to launch games is not a particularly clever thing to do. However, as the aim of the question is to change the power plan rather then launch a game, I will leave the thread open. Point taken for the future, I hope. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Weird. I run nearly every single program i have using either CMD or AUTOIT script. Functions are basic, save registry ad files associated with the software/game to specific location. If i format or reinstall windows, scripts would restore those registry/files and software/game works again without having to reinstall it.

I dont see why that would be prohibited, but OK.

Share this post


Link to post
Share on other sites

tonycst,

Whether you understand why the prohibition exists is entirely beside the point - the fact is that the Forum rules exist and we ask members to respect them. Thank you for the assurance that you will do so in future. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

yea.

Anyway i found some stuff.

I dont know why searching forum form here didnt show anything but searching google showed allot more useful topics.

Here is what i came up with:

Hopefully someone will find this usefull

#include <Constants.au3>
$GetCurrent = "Powercfg -getactivescheme" ;CMD command
$SetHigh = "POWERCFG /SETACTIVE SCHEME_MIN" ;min= minimum aving
$SetLow = "POWERCFG /SETACTIVE SCHEME_MAX"

Global $DOS, $Message = '' ;; added "= ''" for show only.
$DOS = Run(@ComSpec & " /c " & $GetCurrent, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ;get your current power scheme
ProcessWaitClose($DOS)
$Message = StdoutRead($DOS)
Run(@ComSpec & " /c " & $SetHigh, "", @SW_HIDE) ;Set max performance settings
$OriginalSceme = StringTrimLeft ($Message,StringInStr ($Message,":")+1) ;working on string
$OriginalScemeFinal = StringLeft ($OriginalSceme,StringInStr ($OriginalSceme,"(")-3) ;working on string
$ReturToOriginal = "POWERCFG /SETACTIVE " & $OriginalScemeFinal ;final string for previously used power scheme ID

RunWait ("Run what ever you want here")

Run(@ComSpec & " /c " & $ReturToOriginal , "", @SW_HIDE) ;Return to previously set power settings
Edited by tonycst

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  
Followers 0