1

In my fascination of the knowledge i learned about jscript (see here and here and here) to press keyboard keys and mouse keys within a batch file. However i want to take this to a more practical application.

There are certain games, such as minecraft, that require constant feedback that a button is being pressed. With the current links i provided, there does not seem to be any way of having the buttons pressed down for an extended period of time as to simulate movement or something within a game.

I get that it would be easier to install software to do this automatically but at the same time it is much more efficient to manipulate what is already installed on ones computers as it saves a significant amount of memory and processing power when compared to getting additional software. I do not care what language or how deep the programming must go, all i ask is that i can easily manipulate it through batch files like i could do with the SendKeys method in jscript.

Community
  • 1
  • 1
Jouster500
  • 762
  • 12
  • 25
  • Can't be done in batch. – SomethingDark Apr 27 '15 at 00:03
  • You could use vbs and WScript.Shell - SendKeys, nothing to install with that. Have a look at http://stackoverflow.com/questions/4457907/how-to-prevent-auto-locking-feature-of-an-xp-machine-using-vbscript to get some ideas – Scott C Apr 27 '15 at 00:21
  • alright ill take a peak – Jouster500 Apr 27 '15 at 01:37
  • the link you provided are literally the same source i went to manipulate the information with in the above 3 links. There was nothing detailing how to have the key continually pressed. – Jouster500 Apr 27 '15 at 01:47
  • Pressed repeatedly or held down? – SomethingDark Apr 27 '15 at 04:18
  • Held down. I have tried repedeately of running multiple instances of the program for key presses to see if it could pass as it being held down =\ – Jouster500 Apr 27 '15 at 13:04
  • OK changed the title from continually pressed to continually hold for clarity's sake. – Jouster500 Apr 27 '15 at 21:50
  • There is something interesting i came across today when messing around with the code a bit more. It appears that running %SendKeys% "{w 50}" creates a sort of loop that when an actual key is pressed, "locks the key". I changed it to something different like numlock and ran it alongside with pressing the actual key. This created a sort of lock on the key that i initially pressed while the loop was running. This leads me to believe that all keys when held enter a sort of timer loop state. If i can pinpoint the exact times of the timer, i could infinitely press keys to move around within the game – Jouster500 May 02 '15 at 22:52

1 Answers1

0

Dug this out of the grave recently...

http://www.vbforums.com/showthread.php?705791-SendKeys-Hold-Down-a-Key

Here, users are using a VB script to hold a key down. However i do not have the time to verse myself in this yet, nor how to properly manipulate it into a batch script

ARG, its for html pages. JavaScript also follows suite with keydown,keypress,and keyup responses to handle user input, but never actually get the thing to be imitated on the local system. If only the games I want to play (tf2 in this case) could handle an environment in Linux then I could use xdotool. In this case I may just give up and revert to using a program that can do this faster than I can. If that's the case, can anyone give me some pointers? I know of autolt and hotkeys, but can they do what I desire?

Jouster500
  • 762
  • 12
  • 25