Chobyhy Posted March 11, 2007 Share Posted March 11, 2007 So I read the manual and it said there are two ways of calling the GUI. Message Loop Mode and OnEvent Mode. It says In the Message-loop mode your script will spend the majority of its time in a tight loop. This loop will simply poll the GUI using the GUIGetMsg function. In the OnEvent mode instead of constantly polling the GUI to find out if anything has happened you make the GUI temporarily pause your script and call a pre-defined function to handle the event. So if I used Message loop mode, does that mean that the script will take tons of CPU? I'm trying to find the method that will use less cpu and deliver fast response time because I need the CPU for games that I run beside. Which way would be more efficient? Thanks for your help in advance Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2007 Moderators Share Posted March 11, 2007 GUIGetMsg() has a built in buffer to prevent CPU usage... but you know, a lot of your questions could be easily solved by taking less time in SciTe just trying them out rather than asking on the forum (Trial and Error thing) to see which you feel would best suit your needs. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Chobyhy Posted March 11, 2007 Author Share Posted March 11, 2007 Hmm Well thanks for your help. Even if i make a script on SciTe, I dont think im capable of distinguishing whats a millisecond faster, so Im just asking an expert. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2007 Moderators Share Posted March 11, 2007 Hmm Well thanks for your help. Even if i make a script on SciTe, I dont think im capable of distinguishing whats a millisecond faster, so Im just asking an expert.Asking a pertinent question that you don't understand is one thing, asking one that you could answer yourself is another. One takes up un-needed disk space on the server, the other takes up only your disk space. No one has an issue with answering questions that are well thought out and shown that the requester of knowledge has made an effort to understand pre-hand, the only time that some question like this should be done, is if you think you may cause harm to your PC by doing it yourself without asking... If that is in question, then by all means, ask your question to prevent tragedy. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Chobyhy Posted March 11, 2007 Author Share Posted March 11, 2007 ... I didnt know people will take this much offense from asking a question on a forum... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2007 Moderators Share Posted March 11, 2007 (edited) ... I didnt know people will take this much offense from asking a question on a forum...Look, no where there does it say I took offense... I gave you the answer you asked, and probably more in just one short sentence. I was merely pointing out to try something first before asking... Please don't turn into one of the Village Idiots because of how you perceived what I said. At least take the time to analyze and admit you were wrong in how you perceived what I said first. Edited March 11, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 11, 2007 Developers Share Posted March 11, 2007 So I read the manual and it said there are two ways of calling the GUI. Message Loop Mode and OnEvent Mode.It saysIn the Message-loop mode your script will spend the majority of its time in a tight loop. This loop will simply poll the GUI using the GUIGetMsg function.In the OnEvent mode instead of constantly polling the GUI to find out if anything has happened you make the GUI temporarily pause your script and call a pre-defined function to handle the event.So if I used Message loop mode, does that mean that the script will take tons of CPU?I'm trying to find the method that will use less cpu and deliver fast response time because I need the CPU for games that I run beside. Which way would be more efficient?Thanks for your help in advanceEither way a loop is needed to keep the script alive.the GuiGetMsg() has a build-in 10msec pause, but when creating your own loop you can make that whatever you want .... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Chobyhy Posted March 11, 2007 Author Share Posted March 11, 2007 Thanks, Also, Smoke, I've tried and I failed thats why I'm asking it here. Why else would I post it here if I understood it. 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