← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #664345]: CPU usage going through the roof when running script

 

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

David Bachschmid posted a new comment:
Thanks again. Solved the first problem.
My second problem is that sikuli does not click the point in the image which I set it to click on. Right now it only clicks the middle of the search region.

Here's my new code:

Settings.MoveMouseDelay = 0.1
running = True

def runHotkey(event):
    global running
    running = False
    
Env.addHotkey(Key.F1, KeyModifier.CTRL, runHotkey)

while running:
    if Region(2927,567,639,340).exists("Fight.png"): Region(2927,567,639,340).click()
    if Region(2804,219,332,161).exists(Pattern("hero.png").targetOffset(-97,251)): Region(2804,219,332,161).click()
    if Region(3037,617,584,324).exists(Pattern("Dungeon.png").similar(0.95)): Region(3037,617,584,324).click()
    if Region(2804,219,332,161).exists(Pattern("hero.png").targetOffset(-202,247)): Region(2804,219,332,161).click()
    if Region(2255,174,612,493).exists(Pattern("rewards.png").similar(0.90)):
        Region(2255,174,612,493).click()
        Region(3243,632,211,237).wait("skip.png", 6)
        Region(3243,632,211,237).click()

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