PcExpert Posted March 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
BigDod Posted March 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
pecloe Posted March 8, 2006 Share Posted March 8, 2006 perhaps you've got some loops without guigetmsg() or sleeps Link to comment Share on other sites More sharing options...
PcExpert Posted March 8, 2006 Author Share 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) Link to comment Share on other sites More sharing options...
pecloe Posted March 8, 2006 Share Posted March 8, 2006 (edited) script Edited March 8, 2006 by pecloe Link to comment Share on other sites More sharing options...
PcExpert Posted March 8, 2006 Author Share Posted March 8, 2006 (edited) What do you mean with Script, pecloe? Edited March 8, 2006 by PcExpert Link to comment Share on other sites More sharing options...
pecloe Posted March 8, 2006 Share Posted March 8, 2006 sorry, is that all of it? Link to comment Share on other sites More sharing options...
PcExpert Posted March 8, 2006 Author Share Posted March 8, 2006 Yes, that's all Link to comment Share on other sites More sharing options...
pecloe Posted March 8, 2006 Share Posted March 8, 2006 try adding a sleep(10) in the do until loop Link to comment Share on other sites More sharing options...
w0uter Posted March 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
PcExpert Posted March 8, 2006 Author Share Posted March 8, 2006 (edited) I shall try it in 5 minutes Edited March 8, 2006 by PcExpert Link to comment Share on other sites More sharing options...
PcExpert Posted March 8, 2006 Author Share 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 Link to comment Share on other sites More sharing options...
w0uter Posted March 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
pecloe Posted March 8, 2006 Share Posted March 8, 2006 Func MyFunction() MsgBox(0, 'Found', 'The color was found at those coords') Return EndFunc Link to comment Share on other sites More sharing options...
PcExpert Posted March 8, 2006 Author Share Posted March 8, 2006 Thanks, it works now Link to comment Share on other sites More sharing options...
w0uter Posted March 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
Proph Posted March 11, 2006 Share Posted March 11, 2006 Is it a good habit to use Sleep(10) on every loop in a script? Link to comment Share on other sites More sharing options...
nfwu Posted March 11, 2006 Share 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() Link to comment Share on other sites More sharing options...
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