Hi all
I've just started using this program and the scripting because the Joint Operations game didn't let me set any toggles for posture of my player. My current problem is this (having solved the posture one):
when I try to use the in-game chat, the "C" key (which is scripted for the "prone function" in the game) is unavailable to be used for typing. What I want to do is have the script watch for EITHER the Enter keystroke (showing I've sent my typed message) OR the Esc keystroke (showing I canceled my typed message). I know KeyWait will work for 1 keystroke, but how do I do the either / or situation?
Here's the script I put together, in case its any use for anyone else who sees this.
Code:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: Cymbrogi (cymbrogi@gmx.net)
;
;
; Stand is mapped to Delete
; Crouch is mapped to End
; Prone is mapped to PgDn
; This will let you have more of a toggle to your positions than the 3 key setup in JO.
; For example, if you are standng, hitting LShift will go to crouch. Then, if you want to go prone,
; you hit C. Because of the nested IF statements, you are able to hit C to stand up from that prone
; hit LShift to go back to crouching, using LShift again to stand up.
; The effect is that, if you keep track of what position you are in, hitting the key that matches that
; position (hit C if in prone and LShift if in crouch) will let you stand up. No more messing with a
; third key to stand up!
Process, Priority, , High
#KeyHistory 0
SetBatchLines, 10ms
stand=true
crouch=false
prone=false
LShift::
; Standing, so crouch when hit LShift
if stand=true
if crouch=false
if prone=false
{
send,{End}
stand=false
crouch=true
prone=false
return
}
; Crouching, so stand when hit Lshift
if stand=false
if crouch=true
if prone=false
{
send,{Delete}
stand=true
crouch=false
prone=false
return
}
; Prone, so crouch when hit Lshift
if stand=false
if crouch=false
if prone=true
{
send,{End}
stand=false
crouch=true
prone=false
return
}
; End of routine for Lshift
C::
; Standing, so go prone when hit C
if stand=true
if crouch=false
if prone=false
{
send,{PgDn}
stand=false
crouch=false
prone=true
return
}
; Prone already, so stand when hit C
if stand=false
if crouch=false
if prone=true
{
send,{Delete}
stand=true
crouch=false
prone=false
return
}
; Crouching, so go prone when hit C
if stand=false
if crouch=true
if prone=false
{
send,{PgDn}
stand=false
crouch=false
prone=true
return
}
; End of routine for C