AutoHotkey Community

It is currently May 27th, 2012, 8:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: July 12th, 2006, 8:40 am 
Offline

Joined: July 12th, 2006, 7:37 am
Posts: 21
Location: California
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 12th, 2006, 8:44 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 13th, 2006, 5:08 am 
Offline

Joined: July 12th, 2006, 7:37 am
Posts: 21
Location: California
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2006, 9:27 pm 
Offline

Joined: April 5th, 2004, 7:24 pm
Posts: 98
Location: Connecticut USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2006, 1:35 am 
Offline

Joined: July 12th, 2006, 7:37 am
Posts: 21
Location: California
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2006, 3:45 pm 
Offline

Joined: April 5th, 2004, 7:24 pm
Posts: 98
Location: Connecticut USA
+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


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Google Feedfetcher, XstatyK and 60 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