← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #680738]: switchApp()

 

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

Eric Jordan posted a new comment:
Hello,

your suggestion worked!

so, I was practicing again trying to learn to send keyboard commands and
now I got this error: I tried to google it and there was millions of
fixes but I dont understand what it meant to fix it.

[error] SyntaxError ( "mismatched input '' expecting DEDENT", )

here is my code:

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

BR = switchApp("Blood Rites")

if not BR.isRunning():
    exit(1)
if BR.hasWindow():
    print "window:", BR.window()
game = App.focusedWindow()
use(game)
highlight(1)

while(BR.hasWindow() and running):
   if exists(Pattern("1557877521896.png").similar(0.89)):
print "Found spot"
    keyDown("1")
    keyUp()
      
  #    click(Pattern("1557878772334.png").similar(0.90))
      
    
  #  imgClickPoint = Pattern("imgClickPoint.png").similar(0.89)
#clickPoint = find(imgClickPoint)
#hover(clickPoint)
#for i in range(1):
 #   mouseDown(Button.LEFT)
  #  mouseUp()

wait(2)
print "************** The End"

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