AllSystemGo Posted October 28, 2006 Share Posted October 28, 2006 (edited) I have a couple of un answered questions and I hope you guys are going to be able to help me out with that!! 1- I have a little program that open up a web page and make a couple of mouseclick and mousemove stuff, so obviously I have a problem. Someone could easily close the webpage while my script is running and then it would start doing some weird stuff, maybe even deleting stuff. So I want to know is there any way, while my script is running to disable the keyboard and the mouse so no one touches it and/or have a validation that the webpage is still active if not then stop the execution of the script. 2- The same script I'm talking about is in a loop and I need it to run every 30 minute but the thing is it's suxing up alot of CPU juice, 50% almost, is there a way to optimize the way I'm doing my thing ?? While 1 If _TicksToTime() > $NextStart Then $NextStart = _TicksToTime() + 30 * 60 * 1000 Run Function EndIf WEnd Cheers and hope you can help!!! Edited October 28, 2006 by AllSystemGo Link to comment Share on other sites More sharing options...
xcal Posted October 28, 2006 Share Posted October 28, 2006 1. Look up BlockInput. 2. Put in Sleep(100) inside the while/wend loop. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 28, 2006 Share Posted October 28, 2006 (edited) We have a handy function called BlockInput(). Call it and use 1 as the parameter. It is a direct use of the WINAPI BlockInput. As for keeping processor use down, use Sleep() with about a 1 second sleep. Something like Sleep(1000) after your EndIf in the code provided. Edit: curses, same info, same post time! Edited October 28, 2006 by Icekirby1 Link to comment Share on other sites More sharing options...
dandymcgee Posted October 28, 2006 Share Posted October 28, 2006 (edited) As for the disabling check the helpfile for BlockInput(). Try using Adlibenable() to save memory usage while the script is running. Set the Adlibenable function to run every 30 minutes like so: Adlibenable("Function", 1800000). EDIT: I'm guessing you know about the BlockInput function by now . Three posts at the same time... lol. Edited October 28, 2006 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
xcal Posted October 28, 2006 Share Posted October 28, 2006 (edited) @Icekirby1 And on top of that, your post count just turned to 666. o.O Edited October 28, 2006 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
AllSystemGo Posted October 28, 2006 Author Share Posted October 28, 2006 Wow guys fast answers.. Thank you very much Cheers!!!! Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 28, 2006 Share Posted October 28, 2006 Now, including this post, I will have 669. 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