AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Macro connected to a window

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Skulz



Joined: 27 Mar 2009
Posts: 4

PostPosted: Fri Mar 27, 2009 8:21 am    Post subject: Macro connected to a window Reply with quote

It is possible to connect the macro to a window(it is a game), in order to do something else with other programs, games ecc ecc without be obliged to see the window for run properly the macro?
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Mar 27, 2009 4:05 pm    Post subject: Reply with quote

yes. do you use a second screen?
Back to top
Skulz



Joined: 27 Mar 2009
Posts: 4

PostPosted: Fri Mar 27, 2009 5:35 pm    Post subject: Reply with quote

Do you mean monitor? Only 1
Back to top
View user's profile Send private message
aCkRiTe



Joined: 21 Jul 2006
Posts: 555

PostPosted: Fri Mar 27, 2009 5:45 pm    Post subject: Reply with quote

Im not sure if I understand your question correctly, but if your looking for your script/macro to run only when a certain window exist or is active, you can take a look at the following:

IfWinActive
IfWinExist
_________________

HTH...
Back to top
View user's profile Send private message
Lighthouse



Joined: 12 Jan 2009
Posts: 55
Location: Southern Ca, USA

PostPosted: Fri Mar 27, 2009 6:06 pm    Post subject: Reply with quote

It depends what you are trying to send to the window.

I would suggest you check out PostMessage
And then Send Messages by Rajat
Quote:
Another advantage to PostMessage is that the Window can be in the background; by contrast, sending mouse clicks would require it to be active.
Back to top
View user's profile Send private message
Skulz



Joined: 27 Mar 2009
Posts: 4

PostPosted: Fri Mar 27, 2009 6:30 pm    Post subject: Reply with quote

Now i will read that.

Yes i haven't understand the question before XD.
I want a macro that have to work only with a game(that is played in window), and at the same i want to use my pc and not to be obliged to see only the game with the macro.

Ah there are only macro with keyboard, no mouse clicks


Edit: read something, not understand a lot XD
The macro is this:
Loop, 3000000000000000
{

Send, {F7}
Sleep, 4000
Send, {CTRLDOWN}z{CTRLUP}
Sleep, 2000
Send, {F3}
Sleep, 7000

}


Can i do what i want or not?
Sad
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Mar 27, 2009 7:41 pm    Post subject: Reply with quote

Quote:
Can i do what i want or not?
Yes
Back to top
Skulz



Joined: 27 Mar 2009
Posts: 4

PostPosted: Fri Mar 27, 2009 8:05 pm    Post subject: Reply with quote

So what have I to use? ifwinexist, ifwinactive?? what? XD
Really Im not pratical whit these things XD.
Can you say me what i have to add to the macro in order to work?
Back to top
View user's profile Send private message
illusive1011
Guest





PostPosted: Fri Mar 27, 2009 8:49 pm    Post subject: Reply with quote

I'm in the same boat.

Code:

Loop 60 ;Farm the tree 60 times
{
    Click
    Sleep 11000
}
return

send {r} ;detach axe
Sleep, 3000
send {6} ;select rest ability
Sleep, 3000
Click 1 ;trigger rest ability
Sleep, 18000 ;wait 3 minutes
return

^!p::Pause


My question is, how can I have this script repeat itself for a SPECIFIC window, so I can minimize it and not have to worry about it. I want it to farm the tree 60 times, rest and then repeat all while having the game minimized.
Back to top
Lighthouse



Joined: 12 Jan 2009
Posts: 55
Location: Southern Ca, USA

PostPosted: Mon Mar 30, 2009 8:56 pm    Post subject: Reply with quote

Sorry for bringing this one back up front.

What you are looking for is something like:
Code:

Loop 60
{
    controlsend, , r,  The name of the game window
    sleep, 3000
    controlsend, ,6, the name of the game window
    sleep, 3000
    ;cannot use a click on an inactive window.
    controlsend, ,1, the name of the game window
    sleep 18000
    return
}
msgbox Looping finished!

^!p::Pause
Back to top
View user's profile Send private message
illusive1011
Guest





PostPosted: Sun Apr 05, 2009 9:22 pm    Post subject: Reply with quote

Cant you use ControlClick for a click function?

I'm still having troubles with what you wrote for me, seems to not work Sad
Back to top
illusive1011
Guest





PostPosted: Wed Apr 08, 2009 12:05 am    Post subject: Reply with quote

Anyone?
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group