AutoHotkey Community

It is currently May 26th, 2012, 12:19 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: 2 x Star Wars Galaxies
PostPosted: September 16th, 2008, 12:24 am 
Offline

Joined: September 16th, 2008, 12:21 am
Posts: 11
Hi,

I'm trying to write a script for Star Wars Galaxies such that I can control two characters at the same time.
Basically, I want certain keystrokes to be sent to two different Star Wars Galaxies windows at the same time.

However, I cannot seem to get the script to work.
I've searched the forums and also been looking on google and I've read the helpfile quite a bit.

I have tried adding messageboxes and it seems like the script is running through with no errors which is why I am at a loss here...

Any help would be greatly appreciated.

This is the script I have so far:

WinGet, swgid, List, Star Wars Galaxies

~7::
KeyWait 7
IfWinActive, Star Wars Galaxies
{
ControlSend,, 7, ahk_id %swgid1%
ControlSend,, 7, ahk_id %swgid2%
Return
}

WinGet, swgid, List, Star Wars Galaxies

~8::
KeyWait 8
IfWinActive, Star Wars Galaxies
{
ControlSend,, 8, ahk_id %swgid1%
ControlSend,, 8, ahk_id %swgid2%
Return
}

WinGet, swgid, List, Star Wars Galaxies

~9::
KeyWait 9
IfWinActive, Star Wars Galaxies
{
ControlSend,, 9, ahk_id %swgid1%
ControlSend,, 9, ahk_id %swgid2%
Return
}

WinGet, swgid, List, Star Wars Galaxies

~0::
KeyWait 0
IfWinActive, Star Wars Galaxies
{
ControlSend,, 0, ahk_id %swgid1%
ControlSend,, 0, ahk_id %swgid2%
Return
}
Return



Thank you!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 1:13 am 
Offline

Joined: September 16th, 2008, 12:21 am
Posts: 11
A small update, if I use "Send" it works, but obviously "Send" only sends the keystroke to the active window which defeats the whole purpose of writing this script.

... just thought I'd add it in case it makes any difference.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 2:31 pm 
Offline

Joined: September 16th, 2008, 12:21 am
Posts: 11
I know SWG isn't the most commonly played game these days, but noone has used AHK to play 2xSWG's?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 4:32 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
I assume it would be quite similar to World of Warcraft Multi-Boxing... Have you tried taking a look at those scripts? Do a forum search.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 4:38 pm 
Offline

Joined: September 16th, 2008, 12:21 am
Posts: 11
Sivvy wrote:
I assume it would be quite similar to World of Warcraft Multi-Boxing... Have you tried taking a look at those scripts? Do a forum search.


The script I posted is based on a WoW script, and I did a forum search and looked through a multitude of them, and pretty much all of them use the functions as I have them.

Also, I verified the functions used and I cannot see any errors in the script I've posted, but it still doesn't work :-/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 4:45 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Maybe try moving all of the"Return" statements outside the If statements. I think that may contribute. They are all inside the Braces.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 7:36 pm 
Offline

Joined: September 16th, 2008, 12:21 am
Posts: 11
Thanks for the suggestion, unfortunately, oving the return makes no difference.

I have actually realized that ControlSend is the part that is not working.

If I do it this way it works, although the swapping windows part is extremely annoying and I would prefer to not to it this way.

~7::
KeyWait 7
IfWinActive, Star Wars Galaxies
{
IfWinActive, ahk_id %swgid1%
{
WinActivate, ahk_id %swgid2%
Sleep, 500
Send, 7
Sleep, 100
WinActivate, ahk_id %swgid1%
Sleep, 2000
Return
}

IfWinActive, ahk_id %swgid2%
{
WinActivate, ahk_id %swgid1%
Sleep, 500
Send, 7
Sleep, 100
WinActivate, ahk_id %swgid2%
Sleep, 2000
Return
}
Return
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 8:34 pm 
Offline

Joined: September 6th, 2008, 3:11 pm
Posts: 84
If win Exist, (window 1) by ahk class, make it active, send the click.
Try making active the window you want to click before each click !


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 8:39 pm 
Offline

Joined: September 16th, 2008, 12:21 am
Posts: 11
I made http://www.autohotkey.com/forum/viewtopic.php?t=35851 thread as I've narrowed down the problem, and to explain it a bit better.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Morpheus, RUBn, SKAN, sks, StepO, Yahoo [Bot] and 19 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