← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #691800]: Cannot import name Vision

 

Question #691800 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/691800

Description changed to:
Hi, I'm trying to make a code for a game that clicks immediately after
the "image/pattern" appears. My problem is it's too slow, I require
about 20-40ms of reaction time.

reg.wait("Get Ready Image",FOREVER)
reg.wait(Pattern("Click Me Image").similar(0.78),FOREVER)
click(reg.getLastMatch())
Settings.MoveMouseDelay = 0.0
Settings.WaitScanRate = 100
Settings.DelayBeforeMouseDown = 0.0

I played this command on https://humanbenchmark.com/tests/reactiontime
and I got an average of 60-70ms. Checking on the message box it says
about 20-35ms when it clicked. I tried importing the module Vision to
speed up sikuli but the error says "Cannot import name Vision".

 Also is changing DelayBeforeMouseDown changes it or is it already the
default? Is there a way to make it react faster without upgrading my
hardware?

I have tried onChange() commands but I don't get why it still continues to click even though I called stopObserver().
reg.wait("Get Ready Image",FOREVER)
def react(event):
    click(reg)
    wait(0.5)
Settings.MoveMouseDelay = 0.0
Settings.ObserveScanRate = 100
Settings.DelayBeforeMouseDown = 0.0
reg.onAppear(Pattern("Click Me Image").similar(0.78),react)
reg.observe(FOREVER)
reg.stopObserver()

P.S. The game is in Bluestacks and could run offline, would that help?
Thanks in advance!

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