Jump to content

Constant Check


Recommended Posts

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

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)

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 load

While $checksum = PixelChecksum(0,0, 50, 50)

Sleep(100)

WEnd

MsgBox(0, "", "Something in the region has changed!")

that would stop the script though, and dosomething else.

I want to

Do something

keep doing it

keep doing it (program detected)

keep doing it (action taken because of that program being opened)

keep doing it

finish.

(not a loop, just different stuff)

Edited by scythetleppo
Link to comment
Share on other sites

  • Moderators

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

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 by scythetleppo
Link to comment
Share on other sites

  • Moderators

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 loop

2. If/Then Statement (If processexists) Do something

3. Get CheckSum Value if ProcessExists

4. Another loop inside the infinate loop, but conditional on if the processexists and the checksum is still the same

5. Sleep(10) to ease up usage on the CPU

If 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 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

Have you tried it? Break it down:

1. An infinate loop

2. If/Then Statement (If processexists) Do something

3. Get CheckSum Value if ProcessExists

4. Another loop inside the infinate loop, but conditional on if the processexists and the checksum is still the same

5. Sleep(10) to ease up usage on the CPU

If 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

  • Moderators

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

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

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

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

  • Moderators

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.

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...