 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Jaegan
Joined: 12 Jul 2006 Posts: 21 Location: California
|
Posted: Wed Jul 12, 2006 7:40 am Post subject: Keystroke delay and leaving a subroutine (WC3 related) |
|
|
I've been messing around with AHK for a few days, and I have been trying to make a few scripts to give me an edge in WarCraft3. Sadly my lack of programming experience has caught up with me, so I could use your insights.
1. Keystroke delay problem
The first thing I am trying to do is make a simple hotkey (or hotstring) that will instantly train a couple of units and then return to my first control group. My first attempt looked something like this
:*::^e:4ee1
(In this case, the four was my barracks, e the unit I wanted to train, and one my main control group.) This managed to go the barracks and train a single unit, but that was all. I first tried using the sleep option, but that didn't work. I then tried using the SendPlay option, hoping that a small delay would remedy the problem. No such luck. I must be missing some timing related setting that prevents it from working.
2. Chat and subroutines
Many gaming scripts disable the game related hotkeys after pressing enter or escape so that normal typing can be accomplished. For whatever reason, I often find a way to have the hotkeys on while chatting and off while playing. I would like to set up a hotkey that automatically puts me back into the "game" subroutine, so that I can quickly get back to it if something goes wrong, or simply press it occasionally to ensure proper function.
I will likely be using autowarkeys, so it would just need to return to the beginning of the script. I might need to program something with more finesse down the line, but this should be fine for now.
3.
Were I to program in a hotstring to use all of my heroes’ nukes, are there any pitfalls I should be aware of? I think it would be fun to program in an undead nukefest hotkey, which would instantly target all three heroes’ nukes on the selected target. I imagine that the answer to the first question should answer this too, since I would just need to expand the script a little and add in some mouse clicks (which I can figure out how to do if I search hard enough.)
Thanks for reading this whole thing. I appreciate the help guys.
-Jaegan
Bonus Question: If I am using Logitech setpoint, which remaps mouse buttons to keyboard keys, will this cause problems with AHK? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Jul 12, 2006 7:44 am Post subject: |
|
|
| Quote: | | If I am using Logitech setpoint, which remaps mouse buttons to keyboard keys, will this cause problems with AHK ? | Never ever say never. What has Logitech told you so far? |
|
| Back to top |
|
 |
Jaegan
Joined: 12 Jul 2006 Posts: 21 Location: California
|
Posted: Thu Jul 13, 2006 4:08 am Post subject: |
|
|
Haven't looked into the setpoint information all that much- it was more of a curiosity question I suppose. I've been spending most of my energy trying to get my script to work.
That last thing I tried was
KeyDelay, 10,0 Play
+e::SendPlay, 4ee1
Still doesn't work though. The key strokes are too fast for the game to process, so I have to use some sort of delaying procedure. I think my syntax must be wrong, since I have tried using delays as big as 1000 and still had the same results. The only programming I have ever done was a small project for my business Info Systems class, so most of this is way over my head. I know enough to program just about everything once the delays are in place though- the rest is just changing some of the letters around and adding a {click} here and there. Any pointers you can offer would be great. |
|
| Back to top |
|
 |
jamestr
Joined: 05 Apr 2004 Posts: 98 Location: Connecticut USA
|
Posted: Sat Jul 15, 2006 8:27 pm Post subject: |
|
|
this worked for me
| Code: | SetKeyDelay 50
+w::send 3pp2 |
also
you are sending 'e' characters and your hotkey is also an 'e', could be trouble, i would use a different hotkey letter, or $ prefix
$+e::Send, 4ee1 |
|
| Back to top |
|
 |
Jaegan
Joined: 12 Jul 2006 Posts: 21 Location: California
|
Posted: Sun Jul 16, 2006 12:35 am Post subject: |
|
|
Thanks Jamestr for the help. I've actually been working on the script for the past week or so, since no one responded immediatly, and eventually figured it out after several hours. I'm still really grateful for the response though.
Could you explain your last comment a bit more for me? I still know next to nothing about programming, so could you explain exactly what the $ does in this context? An example of the code would help too, since I often place the symbols in the wrong place.
Thanks again man. In a little while I'm going to post some of the scripts I made in the other forum so you guys can use them, if you think they would help at all. A lot of the programming is sloppy and can be touched up, but I'll leave that to you guys to refine for your own uses.
-Jaegan |
|
| Back to top |
|
 |
jamestr
Joined: 05 Apr 2004 Posts: 98 Location: Connecticut USA
|
Posted: Sun Jul 16, 2006 2:45 pm Post subject: |
|
|
+e::Send, 4ee1
above hotkey is +e and its sends 'ee'
the 'ee' will trigger the +e and the script might loop.
$+e:: tells ahk to avoid this problem
This page shows the various prefix(modifier) keys.
http://www.autohotkey.com/docs/Hotkeys.htm#Symbols |
|
| 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
|