Jump to content
Sign in to follow this  
PcExpert

CPU usage

Recommended Posts

PcExpert

Hello,

A couple minutes ago I fnished a program, but when I try it my cpu usage goes to 51% is there something wrong? I have been searching in the process list and from then on I knew that it was my program that uses 51% of my CPU. Can somebody please help me?

Kind Regards,

PcExpert

P.S. No errors showed up when I compiled the program

Share this post


Link to post
Share on other sites
BigDod

Hello,

A couple minutes ago I fnished a program, but when I try it my cpu usage goes to 51% is there something wrong? I have been searching in the process list and from then on I knew that it was my program that uses 51% of my CPU. Can somebody please help me?

Kind Regards,

PcExpert

P.S. No errors showed up when I compiled the program

Post your script so that we can see what is wrong.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
pecloe

perhaps you've got some loops without guigetmsg() or sleeps

Share this post


Link to post
Share on other sites
PcExpert

Ok, here it is:

Opt("TrayIconHide", 1)

Run ("Auto Clicker.exe")

WinWaitActive("Auto Clicker")

MouseClick("left", 559, 390, 1)

Send ("{HOME}")

Send ("{RIGHT}")

Send ("7")

MouseClick("left", 472, 431, 1)

MouseClick("left", 271, 754, 1)

Do

$x = 833

$y = 652

$Color = 0x392010

If (PixelGetColor($x, $y) == $Color) Then

MyFunction()

EndIf

Until PixelGetColor($x, $y) == $Color

Func MyFunction()

MsgBox(0, 'Found', 'The color was found at those coords')

EndFunc

MouseClick("left", 774, 222, 1)

MouseClick("left", 751, 224, 1)

MouseClick("left", 787, 223, 1)

MouseClick("left", 824, 247, 1)

MouseClick("left", 777, 239, 1)

Share this post


Link to post
Share on other sites
pecloe

script

Edited by pecloe

Share this post


Link to post
Share on other sites
PcExpert

What do you mean with Script, pecloe?

Edited by PcExpert

Share this post


Link to post
Share on other sites
pecloe

try adding a sleep(10) in the do until loop

Share this post


Link to post
Share on other sites
PcExpert

I shall try it in 5 minutes

Edited by PcExpert

Share this post


Link to post
Share on other sites
PcExpert

It returns errors. So I woul'd like to ask you (w0uter) a question: Woul'd you like to place the script you edited in my script? Then I can be sure that it works

Share this post


Link to post
Share on other sites
w0uter

It returns errors. So I woul'd like to ask you (w0uter) a question: Woul'd you like to place the script you edited in my script? Then I can be sure that it works

Opt("TrayIconHide", 1)
Run ("Auto Clicker.exe")
WinWaitActive("Auto Clicker")
MouseClick("left", 559, 390, 1)
Send ("{HOME}{RIGHT}7")
MouseClick("left", 472, 431, 1)
MouseClick("left", 271, 754, 1)

$x = 833
$y = 652
$Color = 0x392010

While 1
If PixelGetColor($x, $y) = $Color Then exitloop
sleep(10)
Wend

MyFunction()


MouseClick("left", 774, 222, 1)
MouseClick("left", 751, 224, 1)
MouseClick("left", 787, 223, 1)
MouseClick("left", 824, 247, 1)
MouseClick("left", 777, 239, 1)

Func MyFunction()
    MsgBox(0, 'Found', 'The color was found at those coords')
EndFunc

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Share this post


Link to post
Share on other sites
pecloe

Func MyFunction()
    MsgBox(0, 'Found', 'The color was found at those coords')
    Return
EndFunc

Share this post


Link to post
Share on other sites
PcExpert

Thanks, it works now

Share this post


Link to post
Share on other sites
Proph

Is it a good habit to use Sleep(10) on every loop in a script?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.