I searched searched all forum and google.
All the people talking about power usage and cpu usage in the system not the AHK script
I have simple script with Loop with sleep in between checking what key pressed.
Now when no key is pressed and its not activated because game is not running , it should be 0.
I have cpu usage 12% and Power usage is very high.
No programs running. I need a solution.
Any expert please? Give me sample code to check a program running and if it runs , run a loop to check some key pressed.
Now if the program is not opened , cpu usage and power usage has to be zero.
Thanks much
High CPU USAGE ( power usage) from AHK script. This give me headache
Re: High CPU USAGE ( power usage) from AHK script. This give me headache
You can post your script on the forum to have readers examine it and provide you with specific feedback.
Re: High CPU USAGE ( power usage) from AHK script. This give me headache
Code: Select all
#HotIf WinActive("Path of Exile")
global toggle1:= false
;global Check:=0
;SetTimer Check, 5000
;Check:
;if (A_TimeIdlePhysical > 3000) {
;toggle1:=false
;}
;else {
;Sleep 30000
;toggle1:=true
;}
NumLock::
{
global toggle1
toggle1:= !toggle1
}
;comment Ctrl+Alt+S - ^!s::
shiftstatus:=0
LastKey:=0
loop
{
if 00
sleep 5000
if WinActive("Path of Exile")
if toggle1 == false
{
outer:
if GetKeyState("z","P")
{
send "t"
sleep 200
click "down"
sleep 100
send "q"
sleep 100
send "w"
sleep 100
LastKey:="z"
}
sleep 100
}
}
Its simple script to not to click too many keys when you are playing hours and hurting fingers. More of one button play.
Now POE lags. So i am looking for areas to trim any other program eating resources. I saw AHK eats 12% and very high power usage when game is not running and no other programs running
Last edited by gregster on 05 Jan 2024, 21:15, edited 1 time in total.
Reason: Removed img-tags which only work with direct image links, and which broke the link above.
Reason: Removed img-tags which only work with direct image links, and which broke the link above.
Re: High CPU USAGE ( power usage) from AHK script. This give me headache
Code: Select all
if 00
sleep 5000
Re: High CPU USAGE ( power usage) from AHK script. This give me headache
i dont like software check , i thought AHK using windows dll to get interrupt on any key pressed.
if 00 code i copied from somewhere.
i am looking for a solution. i prefer interrupt call on any key pressed.
I initially thought loop is called on interrupt.
if 00 code i copied from somewhere.
i am looking for a solution. i prefer interrupt call on any key pressed.
I initially thought loop is called on interrupt.
Re: High CPU USAGE ( power usage) from AHK script. This give me headache
Can you modify the code elegantly so the functionality same. Also i want to get cpu usage when game is not running. Even if game is running i want ahk to use munimal resources as it is few lines of code.
Re: High CPU USAGE ( power usage) from AHK script. This give me headache
A general idea is below. You can run the script and then examine the Windows Task Manager to determine the resources that it uses. Rounds to zero over here, in terms of CPU.
Code: Select all
#Requires AutoHotkey v2.0
toggle1 := True
winTitle := 'Path of Exile'
#HotIf WinActive(winTitle) && toggle1
z:: {
While GetKeyState(ThisHotkey, 'P')
SendEvent 1
}
#HotIf WinActive(winTitle)
NumLock::Global toggle1 := !toggle1
#HotIf