Jump to content
Sign in to follow this  
nekokk

Can I execute script to a inactive process ?

Recommended Posts

nekokk

1.

Is it possible to assign specific script to specific process?and the script will only effect the process.

2.

Can I execute a script to a inactive process?

My question may be stupid, dont laugh at me :)

Thank you in advance.

Share this post


Link to post
Share on other sites
nekokk

No any reply?

Does this mean its's impossible to do? or now one knows?

Share this post


Link to post
Share on other sites
buzz44

I think know one knows what your saying... Can you please rephase your question and say what your hoping to achieve.


qq

Share this post


Link to post
Share on other sites
nekokk

I think know one knows what your saying... Can you please rephase your question and say what your hoping to achieve.

<{POST_SNAPBACK}>

For example

I want a script is operative on my MSN but it's inoperative when I change window to another window like a game , and operative again when MSN window is active.

I know I can pause the script , but I prefer automation to manpower.

Second question

Can I make the script operative on a game that window is not active?

==> I execute a script for some specific game==>talk to friends with MSN(the script is still work on the game but dont influence my MSN.)

I am sorry If my poor English confuse you. :)

Share this post


Link to post
Share on other sites
buzz44

While 1
   If WinActive("Msn name thing") Then
     ; Do stuff
   Else
    ; Do stuff when not active, or just leave out the else statement
   EndIf
Wend

Should get you started hopefully.


qq

Share this post


Link to post
Share on other sites
nekokk

thank you for your reply

CODE

While 1

If Winactive("Game name") then

send("a")

sleep(5000)

send("a")

sleep(5000) <====change focus to MSN from the game at this moment.

send("a")

sleep(5000)

send("a")

sleep(5000)

send("a")

sleep(5000)

else

send("b")

sleep(5000)

send("b")

sleep(5000)

send("b")

sleep(5000)

send("b")

sleep(5000)

send("b")

sleep(5000)

Wend

Question 1

If I change focus to my MSN from the game,Will the script send keystrokes a to my MSN window?(my hope is the keystrokes a won't send to my MSN window.)

Question 2

If I execute this script when I am using MSN(but the game is existing),which window(game or MSN) the keystrokes b will influence?(my hope is the keystrokes b will Influence the Game(inactive).)

thank you in advance.

Edited by nekokk

Share this post


Link to post
Share on other sites
buzz44

A1. Yes the key strokes will be send to the msn window. You can get around this by looking at ControlSend() in the help file.

A2. Your script so far relies on the If...EndIf Statement, it will send "a" of the game window is active and send "b" when it is not active.

If you start the script while msn is the active window it will send "b" to any window that is active, unless it is the game window where it will send "a".


qq

Share this post


Link to post
Share on other sites
nekokk

A1. Yes the key strokes will be send to the msn window. You can get around this by looking at ControlSend() in the help file.

A2. Your script so far relies on the If...EndIf Statement, it will send "a" of the game window is active and send "b" when it is not active.

If you start the script while msn is the active window it will send "b" to any window that is active, unless it is the game window where it will send "a".

<{POST_SNAPBACK}>

I understood :)

These answers means I cant send any key with au3 to a inactive process.

My previous idea was to do somthing in my game and do another thing like chat with my friends at the same time on one computer. but I think I have fantastic notions, lol.

Thank you Burrup.

Share this post


Link to post
Share on other sites
buzz44

Anytime. Like I said above look at ControlSend() in the help file. You will be able to talk on msn and send text specifically to your game window.


qq

Share this post


Link to post
Share on other sites
nekokk

Anytime. Like I said above look at ControlSend() in the help file. You will be able to talk on msn and send text specifically to your game window.

<{POST_SNAPBACK}>

I will try to understand what Controlsend() function can do.

Thank you :)

Share this post


Link to post
Share on other sites
rawr

can you also send leftclicks to an inactive window?

Share this post


Link to post
Share on other sites
MSLx Fanboy

ControlClick() will do the job


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites
rawr

Instead of using buttons for ControlClick() is it also possible to use cordinates?

Share this post


Link to post
Share on other sites
MSLx Fanboy

The AU3 Window Info program will give you the name of the button. I would suggest against coordinates only because it may not always be located at that coordinate.


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites
rawr

I know but is it also possible to use coordinates, If it is please give an example.

Share this post


Link to post
Share on other sites
SmOke_N

Please answer the question stated above. :)

<{POST_SNAPBACK}>

All they were trying to do is help.

Don't know if this will help, but I remembered reading this, maybe you can get it to work for you. We know you can respond on whether something doesn't work, hope you can if this does too:

Insolence's Minimized MouseClicks


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.

Share this post


Link to post
Share on other sites
rawr

TY for reply that link really helped alot. :)

Share this post


Link to post
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
Sign in to follow this  

×