How to make IF i get "recaptcha_needed" when i send login request on websocket

I work on websocket when i hit to webscoket send i if account contains Invaild status failed but when 3 - 4 test i get captcha i wan to make if when i get captcha go to solve captcha and try again login

BLOCK:WsConnect
  customHeaders = {}
ENDBLOCK

BLOCK:WsSend
  message = "login msg"
ENDBLOCK

BLOCK:WsRead
  => VAR @wsReadOutput
ENDBLOCK

IF STRINGKEY @wsReadOutput Contains "recaptcha_needed"
BLOCK:SolveRecaptchaV2
  => VAR @captchaRespose
ENDBLOCK

BLOCK:WsSend
  message = $"login msg with captcha <captchaRespose>"
ENDBLOCK

END
BLOCK:WsRead
LABEL:WebSocket Read 2
  => VAR @wsReadOutput
ENDBLOCK

try this

i getting error when i send login msg with captcha because login and captcha diffrent message

BLOCK:WsConnect
LABEL:BAGLAN
  url = "wss://socket/"
  keepAliveMilliseconds = 15000
  customHeaders = {}
  SAFE
ENDBLOCK

BLOCK:WsSend
LABEL:SELAMVER
  message = "{\"command\":\"request_session\",\"params\":{\"language\":\"tur\",\"site_id\":1457,\"afec\":\"hnqq2eTEquHvrkE8ECgH0dQMSPyHTXmEr-1L\",\"release_date\":\"06/03/2023-18:47\"}}"
ENDBLOCK

BLOCK:WsRead
LABEL:SELAMCEVAP
  => VAR @wsReadOutput
ENDBLOCK

BLOCK:Delay
LABEL:BEKLEAGAM
  milliseconds = 1000
ENDBLOCK

BLOCK:WsSend
LABEL:LOGINGONDER
  message = $"{\"command\":\"login\",\"params\":{\"username\":\"<input.USER>\",\"password\":\"<input.PASS>\",\"encrypted_token\":true,\"local_ip\":\"ip\"}}"
ENDBLOCK

BLOCK:WsRead
LABEL:LOGINCHECK
  => VAR @LOGINCHECK
ENDBLOCK

IF STRINGKEY @LOGINCHECK Contains "captcha"
BLOCK:SolveRecaptchaV2
  siteKey = "1"
  siteUrl = "1"
  => VAR @RECAL
ENDBLOCK

BLOCK:WsSend
LABEL:CAPT
  message = $"{\"command\":\"validate_recaptcha\",\"params\":{\"version\":\"v2\",\"g_recaptcha_response\":\"<RECAL>\"},\"rid\":\"168170964403717\"}"
ENDBLOCK

BLOCK:WsRead
LABEL:CAPTGONDER
  => VAR @wsReadOutput
ENDBLOCK

BLOCK:WsRead
LABEL:LOGINCHECK2
  pollIntervalInMilliseconds = 20
  timeoutMilliseconds = 20000
  SAFE
  => VAR @LOGINCHECK
ENDBLOCK

BLOCK:WsSend
  message = $"{\"command\":\"login\",\"params\":{\"username\":\"<input.USER>\",\"password\":\"<input.PASS>\",\"encrypted_token\":true,\"local_ip\":\"93ab48e2-a199-4f23-8d3f-37ee3cf16cd4.local\"}} {\"command\":\"validate_recaptcha\",\"params\":{\"version\":\"v2\",\"g_recaptcha_response\":\"<RECAL>\"},\"rid\":\"168170964403717\"}"
ENDBLOCK

END
BLOCK:WsRead
LABEL:WebSocket Read 2
  => VAR @LOGINCHECK
ENDBLOCK

BLOCK:Keycheck
LABEL:SORGUBASLAT
  banIfNoMatch = False
  KEYCHAIN SUCCESS OR
    STRINGKEY @LOGINCHECK Contains ",\"auth_token\":\""
  KEYCHAIN FAIL OR
    STRINGKEY @LOGINCHECK Contains "InvalidUsernamePassword"
    STRINGKEY @LOGINCHECK Contains "M\\u00fc\\u015fteri Kilitli"
    STRINGKEY @LOGINCHECK Contains "Argument error"
    STRINGKEY @LOGINCHECK Contains "\"msg\":\"Invalid credentials\",\""
  KEYCHAIN FAIL OR
    STRINGKEY @LOGINCHECK Contains "\"Invalid JSON\",\""
  KEYCHAIN BAN OR
    STRINGKEY @LOGINCHECK Contains "WrongLoginAttempts"
ENDBLOCK

BLOCK:Delay
  milliseconds = 1000
ENDBLOCK

BLOCK:WsSend
  message = "{\"command\":\"get_user\",\"params\":{},\"rid\":\"168044557029514\"}"
ENDBLOCK

BLOCK:WsRead
  => VAR @Mangir
ENDBLOCK

BLOCK:Parse
  input = @Mangir
  leftDelim = ",\"balance\":"
  rightDelim = ",\"balance\":null,"
  MODE:LR
  => CAP @Mangirss
ENDBLOCK

BLOCK:Keycheck
  banIfNoMatch = False
  KEYCHAIN SUCCESS OR
    FLOATKEY @Mangirss GreaterThan 1000
  KEYCHAIN CUSTOM OR
    FLOATKEY @Mangirss LessThan 1000
ENDBLOCK

BLOCK:WsDisconnect
ENDBLOCK