AutoHotkey Community

It is currently May 26th, 2012, 4:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: March 27th, 2009, 9:21 am 
Offline

Joined: March 27th, 2009, 9:18 am
Posts: 4
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 5:05 pm 
yes. do you use a second screen?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 6:35 pm 
Offline

Joined: March 27th, 2009, 9:18 am
Posts: 4
Do you mean monitor? Only 1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 6:45 pm 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
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...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 7:06 pm 
Offline

Joined: January 12th, 2009, 11:38 pm
Posts: 55
Location: Southern Ca, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 7:30 pm 
Offline

Joined: March 27th, 2009, 9:18 am
Posts: 4
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?
:(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 8:41 pm 
Quote:
Can i do what i want or not?
Yes


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 9:05 pm 
Offline

Joined: March 27th, 2009, 9:18 am
Posts: 4
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2009, 9:49 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 30th, 2009, 9:56 pm 
Offline

Joined: January 12th, 2009, 11:38 pm
Posts: 55
Location: Southern Ca, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2009, 10:22 pm 
Cant you use ControlClick for a click function?

I'm still having troubles with what you wrote for me, seems to not work :(


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2009, 1:05 am 
Anyone?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, rbrtryn, SKAN, tterB, Yahoo [Bot] and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group