 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Mohog
Joined: 31 Oct 2009 Posts: 2
|
Posted: Sat Oct 31, 2009 7:13 am Post subject: Crash when commands sent through AHK, not when manual |
|
|
When I send commands to Monopoly Tycoon Demo through AutoHotKey, it crashes Monopoly Tycoon Demo. When I send the commands manually, it works as expected.
Steps to reproduce:
[list=]Download and install Monopoly Tycoon Demo from here or run this script, which should download and install the demo for you;[/list]
[list=]Running the application and clicking "Play" works as expected;[/list]
[list=]However, running this script, which should be the same, makes the program give an error message in Windows XP;[/list]
[list=]This script, which just sends an Enter instead of clicking "Play" also crashes in the same way. [/list]
Please let me know if I can provide any more details.
[Moved from Bug Reports forum. ~jaco0646] |
|
| Back to top |
|
 |
wrong section alert Guest
|
Posted: Sat Oct 31, 2009 7:36 am Post subject: |
|
|
This should be posted in Ask For Help, before posting here in Bug Reports. There is no indication that this is an AHK problem and not a problem with the application (or even the application trying to defeat ACH scripting).
Mod, if you disagree, I will not take offence if you delete my post.  |
|
| Back to top |
|
 |
Mohog
Joined: 31 Oct 2009 Posts: 2
|
Posted: Sat Oct 31, 2009 7:50 am Post subject: Really? |
|
|
Thanks for your comment.
If you click "Play" manually, this application works. If you ask AHK to automate clicking "Play", it crashes. It is repeatable and is evidenced by the linked scripts. I thought the point of AHK was to simulate clicking things manually. In this case, AHK is causing different behaviour than clicking things manually, so it seems like a bug to me.
I cannot see what help people can give me with a one line command crashing a program, but I'm happy to post it there if that would be more useful.
I am pretty sure that Monopoly Tycoon was written before AHK, so I doubt that it is deliberate! |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 739 Location: Minnesota, USA
|
Posted: Sun Nov 01, 2009 12:45 am Post subject: |
|
|
It may not be targeting programs like AHK directly, but it is possible that there is an anti-cheat mechanism in the game. By what you described this seems like a problem with the game itself or your script's interaction with it, not a problem with AHK. Take the last guy's advice and post your script in Ask For Help. _________________ Unless otherwise stated, all code is untested
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Sun Nov 01, 2009 6:43 am Post subject: |
|
|
ControlClick sends standard Windows messages such as WM_LBUTTONDOWN and WM_LBUTTONUP to simulate "clicking" on a specific window. It isn't intended to (and couldn't possibly) behave the same as a physical mouse click. Send with the default send mode (SendEvent) uses keybd_event to simulate keyboard input; AutoHotkey merely uses it to "tell" the operating system which key to simulate, and the operating system does the rest. I think it is very unlikely that AutoHotkey is at fault here.
| Quote: | | I am pretty sure that Monopoly Tycoon was written before AHK, so I doubt that it is deliberate! | FYI, the methods employed by these two commands have existed long before Monopoly Tycoon was published. |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 626
|
Posted: Wed Nov 04, 2009 2:47 pm Post subject: |
|
|
Send has no "," according to the help
"WINDOW_WAIT("Monopoly Tycoon","Monopoly Tycoon Demo v1.0",20)"
Does this function consist of "WinWait, WinTitle, WinText, Seconds"?
"Sleep, 300"
Is is possible that this is not enough time for window to "settle"? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|