.similar(float_similarity) does nothing

Asked by arminius on 2018-05-21

    def FIRST_zero_loop():
      print('Start of definition FIRST_zero_loop')
      current_loop = (loop[0]) #zero
      print('Searching......at the FIRST_zero_loop. Searching at the 14th level.')
      match_percent_address = r"USER_ADDRESS\zero_loop\match_percent.txt"
      file = open(match_percent_address)
      similarity = file.read()
      file.close()
      similarity = float(similarity)
      count = 0
      testtargetOffsetX = 1
      testtargetOffsetY = -8
      float_similarity = float(similarity)
      current_level = (level[14]) #fourteenth
      main_address = r"USER_ADDRESS\zero_loop"
      Reg = Region(413,242,519,366)
      search = True
      while search:# Searching......at the zero loop. Searching at the 14th level.
        if Reg.exists(Pattern("zero_loop_first_image_used.png").targetOffset(testtargetOffsetX,testtargetOffsetY).similar(similarity)):
          current_image = (image[1]) # 1st Image
          search = False
          SECOND_Print_image_details(current_loop, current_level)
        elif

  Reg.exists(Pattern(Pattern("zero_loop_twentieth_image_used.png").targetOffset(1,-11)).targetOffset(testtargetOffsetX,testtargetOffsetY).similar(float_similarity)):
          print("20th image found")
          current_image = (image[20]) #20th Image
          search = False
         SECOND_Print_image_details(current_loop, current_level)
        else:
          count = count + 1
          match_percent_address = r"USER_ADDRESS\zero_loop\match_percent.txt"
          file = open(match_percent_address)
          similarity = file.read()
          file.close()
          similarity = float(similarity)
          similarity = similarity - 0.01 # reduce by 1%
          string_similarity = str(similarity)
          print"" + (current_player) + ", " + (current_planet) + ", Loop:" + (current_loop) + ", Level:" + (current_level) + ", similarity:" + (string_similarity)

          text = str(similarity)
          f = open(match_percent_address, 'w')
          f.write(text)
          f.flush()
          f.close()
          return

    similarity is at 0.3, it's not only seeing it's target it's seeing well over a dozen targets, but it does not see any of them.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
arminius
Solved:
2018-05-23
Last query:
2018-05-23
Last reply:
arminius (arminius75) said : #1

Figured it out.