Sign in to follow this  
Followers 0
Baritonomarchetto

Autoit scripts default priority

7 posts in this topic

#1 ·  Posted (edited)

Hi all,

what's the default priority on autoit script not defining "ProcessSetPriority" ? Normal (2)?

Also: i want to change the priority of the script itslef: how can i detect the "self ID" of my script?

Thanks :)

PS: notice that in the online manual there's a broken link to "_ProcessGetPriority"

Edited by Baritonomarchetto

Share this post


Link to post
Share on other sites



Baritonomarchetto,

from the helpfile:

@AutoItPID         PID of the process in which the script is running.

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks, I hadn't tought about looking at macros :)

I am trying to change the priority loading a value from a ".ini" with a script like:

#include <Process.au3>

Local $priority= IniRead(".celler.ini", "misc", "priority", "0")

ProcessSetPriority("celler.au3", $priority)

$i_Priority_Level = _ProcessGetPriority(@AutoItPID)
MsgBox(0, "AutoIt Script", "Should be 0: " & $i_Priority_Level)

... but it always returns the default value (2), whatever i define in the "iniRead" string or ".ini" file ... what could be wrong with it?

Thanks

Edited by Baritonomarchetto

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

By default all programs run as normal priority.

You can programatically change that, but it is not recommended to go higher than "high" (that means real-time), because you're going to get your PC unresponsive.

Edited by hannes08

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Thanks, i know that toying with priority levels is not recommended :). May i ask you to take a look at the little script i wrote in the previous post for "priority check/change"?

Share this post


Link to post
Share on other sites

Use the @AutoItPID macro in both function calls: ProcessSetPriority and _ProcessGetPriority


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

That solved the problem! Thanks!

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