Jump to content
Sign in to follow this  
CGFTW

Why does this snippet not work?

Recommended Posts

CGFTW

Do
   MouseClickDrag("left", 265, 380, 664, 380)
   Sleep(500)
   Send("^c")
   $clip = ClipGet()
   $greet = Int(0)
   $users = Int(0)
   If StringRegExp($clip, $greeting) = 1 Then
      $greet = 1
      ElseIf StringRegExp($clip, $greeting) = 0 Then
         $greet = 0
      ElseIf StringRegExp($clip, $user) = 1 Then
         $users = 1
      ElseIf StringRegExp($clip, $user) = 0 Then
         $users = 0
   EndIf
Until $users = 1 Or $greet = 1

This snippet should loop until a string (command) is said. $user and $greeting are strings for commands. When a bit of text says the $greeting command, it stops the loop and continues with the code afterward, which is normal. But, when the $user command is seen, it just keeps looping? I don't see why this could happen, but maybe you can. Thanks.

Share this post


Link to post
Share on other sites
czardas

Do
   MouseClickDrag("left", 265, 380, 664, 380)
   Sleep(500)
   Send("^c")
   $clip = ClipGet()
   $greet = 0
   $users = 0
   If StringRegExp($clip, $greeting) = 1 Then
      $greet = 1
      ;ElseIf StringRegExp($clip, $greeting) = 0 Then
      ;   $greet = 0
    ElseIf StringRegExp($clip, $user) = 1 Then
         $users = 1
      ;ElseIf StringRegExp($clip, $user) = 0 Then
      ;   $users = 0
   EndIf
Until $users = 1 Or $greet = 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×