← Back to team overview

sikuli-driver team mailing list archive

[Question #661348]: Progam slowing down - MouseDown: extended delay

 

New question #661348 on Sikuli:
https://answers.launchpad.net/sikuli/+question/661348

Hi,

I am using sikuli for automating a game. The full code is pretty long but the part that moves / clicks mouse is as follows:-

class click_thread(threading.Thread):
    def __init__(self, reg_to_click):
        threading.Thread.__init__(self)
        self.reg_to_click = reg_to_click
    def run(self):
        click_lock.acquire()
        click_func(self.reg_to_click)
        click_lock.release()

def click_func(reg_to_click):
    while True:
        if auto_mouse == 'go':         #this is global variable to 'pause' the mouse actions if need be by reassigning it somewhere else
            Settings.MoveMouseDelay = 0.1
            Settings.DelayBeforeMouseDown = 0.1
            Settings.ClickDelay = 0.1
            click(reg_to_click.getCenter())
            mouseMove(0,50)
            break
        else:
            print((time.asctime(time.localtime(time.time()))),"click func recd call - waiting 1s")
            wait(1)

click_lock = threading.Lock()


I am using threading to take care of mouse  actions. Other functions in the code create a thread instance whenever they need the mouse to click something on the screen in the following way:-

            click_thread_instance = click_thread(reg_to_click)
            click_thread_instance.start()
            click_thread_instance.join()

The program slows down as it runs, resulting in a lot of 'timeouts' in the game i use it on. When i check logs, the most frequent entry seems to be 'MouseDown: extended delay'. I have tried running it both from IDE and the command line. It appears to make no difference to this problem. Any idea what might be causing this and what can be done to rectify it?

My env:-
OS:- Microsoft Windows 10 Home, 64-bit
Java:- Version 8, Update 151, build 1.8.0_151-b12
Sikuli: 1.1.1

Thanks in Advance.
Shekhar

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.