scythetleppo Posted May 8, 2006 Share Posted May 8, 2006 Hi, if you have: while 1 check to see if a program exists wend that works to activate as soon as you open the program. the problem is you can'tdo anything but be trapped in the loop the whole time. is there a way to react to a program being opened anytime during the normal pogram? Link to comment Share on other sites More sharing options...
Valuater Posted May 8, 2006 Share Posted May 8, 2006 (edited) you should check the bottom portion of the help files for the examples... almost all of them have while/wend loops and do many things in it your program would end without a loop also 8) Edited May 8, 2006 by Valuater Link to comment Share on other sites More sharing options...
scythetleppo Posted May 8, 2006 Author Share Posted May 8, 2006 (edited) you should check the bottom portion of the help files for the examples... almost all of them have while/wend loops and do many things in ityour program would end without a loop also8)the help files i have have a total ov < 10 while wend examples, none of which are what I'm looking for. The closest one was:$checksum = PixelChecksum(0,0, 50,50); Wait for the region to change, the region is checked every 100ms to reduce CPU loadWhile $checksum = PixelChecksum(0,0, 50, 50) Sleep(100)WEndMsgBox(0, "", "Something in the region has changed!")that would stop the script though, and dosomething else.I want toDo somethingkeep doing itkeep doing it (program detected)keep doing it (action taken because of that program being opened)keep doing itfinish.(not a loop, just different stuff) Edited May 8, 2006 by scythetleppo Link to comment Share on other sites More sharing options...
scythetleppo Posted May 8, 2006 Author Share Posted May 8, 2006 you should check the bottom portion of the help files for the examples... almost all of them have while/wend loops and do many things in ityour program would end without a loop also8)bump Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 8, 2006 Moderators Share Posted May 8, 2006 Hi, if you have: while 1 check to see if a program exists wend that works to activate as soon as you open the program. the problem is you can'tdo anything but be trapped in the loop the whole time. is there a way to react to a program being opened anytime during the normal pogram?Guess you could do something like: Local $CheckSum = '' While 1 If ProcessExists('Programs.exe') Then $CheckSum = PixelChecksum(0,0, 50,50) While PixelChecksum(0,0, 50,50) = $CheckSum ;Do whatever WEnd EndIf ; Rest of script that doesn't care if the Process Exists or not Sleep(10) WEnd 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...
scythetleppo Posted May 8, 2006 Author Share Posted May 8, 2006 (edited) Guess you could do something like: Local $CheckSum = '' While 1 If ProcessExists('Programs.exe') Then $CheckSum = PixelChecksum(0,0, 50,50) While PixelChecksum(0,0, 50,50) = $CheckSum ;Do whatever WEnd EndIf ; Rest of script that doesn't care if the Process Exists or not Sleep(10) WEnd wouldn't that only check in the beginning, then not later while the script runs? edit: what im trying to do is:If any time during unrelated actions, a program is opened, action happens. Edited May 8, 2006 by scythetleppo Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 8, 2006 Moderators Share Posted May 8, 2006 (edited) wouldn't that only check in the beginning, then not later while the script runs?edit: what im trying to do is:If any time during unrelated actions, a program is opened, action happens.Have you tried it? Break it down:1. An infinate loop2. If/Then Statement (If processexists) Do something3. Get CheckSum Value if ProcessExists4. Another loop inside the infinate loop, but conditional on if the processexists and the checksum is still the same5. Sleep(10) to ease up usage on the CPUIf that's not what you want, then break it down in steps like that, because all we are doing is guessing if not.Edit:Also elaborate on "Program" starts, is it a specific program or literally any program? Edited May 8, 2006 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...
scythetleppo Posted May 8, 2006 Author Share Posted May 8, 2006 Have you tried it? Break it down:1. An infinate loop2. If/Then Statement (If processexists) Do something3. Get CheckSum Value if ProcessExists4. Another loop inside the infinate loop, but conditional on if the processexists and the checksum is still the same5. Sleep(10) to ease up usage on the CPUIf that's not what you want, then break it down in steps like that, because all we are doing is guessing if not.Edit:Also elaborate on "Program" starts, is it a specific program or literally any program?I don't think I've explained it right. Pretend I wanna make a game that plays just as normal. If someone turns on a known hack process, it kills the process without missing a beat. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 8, 2006 Moderators Share Posted May 8, 2006 Like I said, have you tried anything I put up there or read any of the documentation, look at what you typed you wanted then look in the help file, it sticks out like a soar thumb.While 1 ;My script doing what it does If ProcessExists('KnownHackProcess.exe') Then ProcessClose('KnownHackProcess.exe') WEnd 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...
scythetleppo Posted May 8, 2006 Author Share Posted May 8, 2006 Like I said, have you tried anything I put up there or read any of the documentation, look at what you typed you wanted then look in the help file, it sticks out like a soar thumb.While 1 ;My script doing what it does If ProcessExists('KnownHackProcess.exe') Then ProcessClose('KnownHackProcess.exe') WEnd That's not it. What that does is: Runs whole game. Checks for hack after the game is over. I wantto know how to disable the process at any time the process is loaded, from the beginning of the script until the end. Like a better way of doing this: script starts check for process script does something check for process script does another thing check for process script keepsworking. The ways that are in the help file, and the ways you have suggested, would do this: script starts script does something script does another thing script keeps working. check for process Also, those would stop the whole game if they activated a hack. while 1 while process doesnt exist do stuff wend wend would end the game ifsomeone activated the process. I want this: Script running. NEW OTHER file is opened, Script does not stop running! it closes the OTHER process. Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 8, 2006 Share Posted May 8, 2006 HI, haven't read the hole thread, but maybe AdlibEnable helps you. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
scythetleppo Posted May 8, 2006 Author Share Posted May 8, 2006 HI,haven't read the hole thread, but maybe AdlibEnable helps you.So long,MegaYES! thanks that's it! Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 8, 2006 Share Posted May 8, 2006 YES! thanks that's it! Welcome!So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 8, 2006 Moderators Share Posted May 8, 2006 That's not it. What that does is:Runs whole game.Checks for hack after the game is over. I wantto know how to disable the process at any time the process is loaded, from the beginning of the script until the end.Like a better way of doing this:script startscheck for processscript does somethingcheck for processscript does another thingcheck for processscript keepsworking.The ways that are in the help file, and the ways you have suggested, would do this:script startsscript does somethingscript does another thingscript keeps working.check for processAlso, those would stop the whole game if they activated a hack.while 1while process doesnt existdo stuffwendwendwould end the game ifsomeone activated the process.I want this:Script running. NEW OTHER file is opened, Script does not stop running! it closes the OTHER process.Wow, you do have it in you... That was the best explination you've given thus far of what you want, and I actually understood it. Had you explained it like this before (In detail), you would have had your answer LONG ago, it's good still that you have found what you needed.Good Luck. 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...
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