Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
BaGGy
Post
by BaGGy » Wed Mar 19, 2003 1:26 am
I am trying to macro in this game called Endless Ages, everyone else uses this exact program to do what I want to do. But for some odd reason it WONT work for me.
This is my script:
Code: Select all
Send>q
Wait>1.0
MouseMove>70,90
Wait>0.2
LClick
Wait>1.5
LUp
Wait>1.5
It will move the mouse to the correct location, but it WONT press the Q button nor will it press my Left mouse button. Whats up with that?
-
Captive
- Macro Veteran
- Posts: 213
- Joined: Sun Oct 20, 2002 8:37 pm
- Location: Colorado, USA
Post
by Captive » Wed Mar 19, 2003 4:20 am
Normally, these types of script first a SetFocus first. Make sure the applicaiton that you want to have the 'q' sent to is in focus.
(You can use a GetActiveWindow in your script to check and test if it really is in focus)
-
BaGGy
Post
by BaGGy » Wed Mar 19, 2003 1:52 pm
So something like this?
Code: Select all
Let>WF_TYPE=1
GetActiveWindow>EXNGN,800,600
SetFocus>EXNGN
Send>q
Wait>1.0
MouseMove>70,90
Wait>0.2
LClick
Wait>1.5
LUp
Wait>1.5
-
support
- Automation Wizard
- Posts: 1450
- Joined: Sat Oct 19, 2002 4:38 pm
- Location: London
-
Contact:
Post
by support » Wed Mar 19, 2003 7:36 pm
Hi,
If you run that it will focus itself. The active window will be Macro Scheduler (unless run from a hotkey).
There's also very little point in focusing the active window since the active window is by definition already focused.
Look under Tool/View System Window to work out the correct name of the window you need to focus.
-
BaGGy
Post
by BaGGy » Wed Mar 19, 2003 9:50 pm
This is what the "View System Winows" thing shows:
43385184 - Afx:00400000:3:00010011:00000000:00BD03FD "EXNGN"
Ok still having problems, the script is pressing the q button but that only shows up if I bring up the "Enter chat message:" thing.
This is really odd, cause I have tried using working scripts that OTHER players use and they dont work for me.
I am using Windows 2000 Professional Service Pack 2, and thats the same OS that one of the players who were ABLE to use the scripts.
Anyone have a clue as to whats going on?
-
Captive
- Macro Veteran
- Posts: 213
- Joined: Sun Oct 20, 2002 8:37 pm
- Location: Colorado, USA
Post
by Captive » Wed Mar 19, 2003 9:57 pm
What I should have made clear, was: The most common reason scripts of this type fail is because the window people want the text to go to is not in focus.
Here's a small script that will give you 5 seconds to set focus to a window, and then the script will tell you it's window title, position, etc.
Let>WF_TYPE=2
MessageModal>After you click OK, set focus to a window. I will check it's title and position in 5 seconds.
Wait>5
GetActiveWindow>sWinTitle,iWinLeft,iWinTop,iWinWidth,iWinHeight
Let>sLine1=Window Title: %sWinTitle%
Let>sLine2=Left/Top=%iWinTop%,%iWinLeft%
Let>sLine3=Width/Height=%iWinWidth%,%iWinHeight%
MessageModal>%sLine1%%CRLF%%sLine2%%CRLF%%sLine3%
-
BaGGy
Post
by BaGGy » Wed Mar 19, 2003 10:07 pm
Ok so when I get that Focus information, how should I use it?
-
BaGGy
Post
by BaGGy » Wed Mar 19, 2003 10:24 pm
Captive here is the information I got:
Code: Select all
Window Title: EXNGN
Left/Top=0,0
Width/Height=800,600
-
Captive
- Macro Veteran
- Posts: 213
- Joined: Sun Oct 20, 2002 8:37 pm
- Location: Colorado, USA
Post
by Captive » Thu Mar 20, 2003 5:05 am
Try something like this:
SetFocus>EXNGN
Wait>0.5
Send>q
Wait>1.0
MouseMove>70,90
Wait>0.2
LClick
For this, the window title must be exactly "EXNGN", which is apparently what it is from what you pasted.
I noticed in your initial script, you had a LClick, followed by a LUp. "LClick" is the same as: LDown LUp ... so in this case you don't need the LUp.
(However this is unlikely to be the cause of your "send" problem.")
When pasting code to these forums, I recommend using the 'Code' button (which uses the 'pre' tags) rather than 'quote'. The main difference is the way extra spaces are copied to the clipboard.
-
BaGGy
Post
by BaGGy » Mon Mar 24, 2003 4:38 am
Fixed it, apparently it doesnt like letting me use the keyboard along with the game. So I bound the mouse buttons to work with it and it works, I am using the middle mouse button and the left mouse button. All works perfect now, odd eh?