Press 'infinitely' keypad button

0

I'm doing a test in python3.5 using the pyautogui library. My goal is for the algorithm to push buttons for me.

import pyautogui

while True:
 pyautogui.press('f1')

In this case, he is pressing f1. I ran several tests and it really works on my pc. But, I would like to test it in a game, Lineage II, but it does not catch: S. I have tested with letters a, b, c ... (in my pc it works, in the server not: S). Would you have tips on how to put it to work on the server?

    
asked by anonymous 25.08.2016 / 14:17

1 answer

0

The function "press ()" is no more than the use of the "keyDown ()" and "keyUp ()" functions in sequence.

It may be that the two functions are evoked with a too short interval between them to be recognized by the game.

Try the following:

import pyautogui, time

while True:
    pyautogui.keyDown('f1')
    time.sleep(1)
    pyautogui.keyUp('f1')

However, most games block third-party script execution just to avoid circumventing the player interface.

    
26.08.2016 / 11:38