← Back to team overview

sikuli-driver team mailing list archive

[Bug 1520861] Re: not correct work of operator IF

 

with such personal opinions one should start as a question.

** Changed in: sikuli
       Status: New => Invalid

** Converted to question:
   https://answers.launchpad.net/sikuli/+question/276029

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1520861

Title:
  not correct work of operator IF

Status in Sikuli:
  Invalid

Bug description:
  v.1.1.1   win10 x64

  in this line (    if ((checkdock()==1) and (checkenemy()==0)):     )
  IF work as While. Doing only checkdock() and not trying  to
  checkenemy() while checkdock()!=1

  code:

  def checkdock():
      if (stationreg.inside().exists(undock,0.5)):
          docked=1
          print "в доке"
      else:
          docked=0
          print "не в доке"
      return docked

  def checkenemy():
      if ((local.inside().exists(vrag1,0.5)) or( local.inside().exists(vrag2,0.5)) or (local.inside().exists(vrag3,0.5))):
          enemy=1
          print "есть вражина"
      else:
          enemy=0
          print "всё чисто"
      return enemy

  
  while True:
      if ((checkdock()==1) and (checkenemy()==0)):
          print "ща андокнусь"
          stationreg.inside().click(undock)
          sleep (5)
  	while (checkenemy() == 0):
  		keyDown(Key.ALT)
  		type("p")
  		keyUp(Key.ALT)
  		sleep (15)

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1520861/+subscriptions


References