PcExpert Posted March 8, 2006 Posted March 8, 2006 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
BigDod Posted March 8, 2006 Posted March 8, 2006 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,PcExpertP.S. No errors showed up when I compiled the programPost your script so that we can see what is wrong. 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
pecloe Posted March 8, 2006 Posted March 8, 2006 perhaps you've got some loops without guigetmsg() or sleeps
PcExpert Posted March 8, 2006 Author Posted March 8, 2006 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 = 0x392010If (PixelGetColor($x, $y) == $Color) Then MyFunction()EndIfUntil PixelGetColor($x, $y) == $ColorFunc MyFunction() MsgBox(0, 'Found', 'The color was found at those coords')EndFuncMouseClick("left", 774, 222, 1)MouseClick("left", 751, 224, 1)MouseClick("left", 787, 223, 1)MouseClick("left", 824, 247, 1)MouseClick("left", 777, 239, 1)
PcExpert Posted March 8, 2006 Author Posted March 8, 2006 (edited) What do you mean with Script, pecloe? Edited March 8, 2006 by PcExpert
w0uter Posted March 8, 2006 Posted March 8, 2006 (edited) $x = 833 $y = 652 $Color = 0x392010 While 1 If PixelGetColor($x, $y) = $Color Then exitloop sleep(10) Wend MyFunction() Edited March 8, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
PcExpert Posted March 8, 2006 Author Posted March 8, 2006 (edited) I shall try it in 5 minutes Edited March 8, 2006 by PcExpert
PcExpert Posted March 8, 2006 Author Posted March 8, 2006 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
w0uter Posted March 8, 2006 Posted March 8, 2006 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 worksOpt("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
pecloe Posted March 8, 2006 Posted March 8, 2006 Func MyFunction() MsgBox(0, 'Found', 'The color was found at those coords') Return EndFunc
w0uter Posted March 8, 2006 Posted March 8, 2006 Func MyFunction() MsgBox(0, 'Found', 'The color was found at those coords') Return EndFunc autoit returns automaticly My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Proph Posted March 11, 2006 Posted March 11, 2006 Is it a good habit to use Sleep(10) on every loop in a script?
nfwu Posted March 11, 2006 Posted March 11, 2006 (edited) It depends on what kind of loop it is. #) EDIT: I mean, what the loop does. Edited March 11, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now