HELP WITH JUMP/GOTO IN OTHER IF STATEMENT [CS0159]

image IN OB1 FINE

IN OB2

BLOCK:HttpRequest
  url = "http://exemple.com:8689/token.php"
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK
string STATUSNAME = "";
IF STRINGKEY @data.RESPONSECODE DoesNotContain "200"
data.SOURCE = $"SERVER DOWN OR SOMETHING LIKE THAT \\n<b>RESPONSECODE:</b>  {data.RESPONSECODE}";
JUMP #TELEGRAM

END
IF STRINGKEY @data.RESPONSECODE Contains "200"
IF STRINGKEY @data.SOURCE DoesNotMatchRegex "\b(Ok)\b"

STATUSNAME = "NEW IP DETECTED 😎";
LOG @STATUSNAME
#TELEGRAM

BLOCK:HttpRequest
  url = "https://api.telegram.org/[HIDDENINFO]/sendMessage"
  TYPE:STANDARD
  $"chat_id=958084223&parse_mode=html&text=%3Cb%3E<STATUSNAME>%3C/b%3E: \\n<data.SOURCE>"
  "application/x-www-form-urlencoded"
ENDBLOCK
END
END

I GET THIS ERROR , @Ruri

[IDLE] CompilationErrorException: (11,10): error CS0159: No such label 'TELEGRAM' within the scope of the goto statement

Try this

BLOCK:HttpRequest
  url = "http://exemple.com:8689/token.php"
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK
string STATUSNAME = "";
IF STRINGKEY @data.RESPONSECODE DoesNotContain "200"
data.SOURCE = $"SERVER DOWN OR SOMETHING LIKE THAT \\n<b>RESPONSECODE:</b>  {data.RESPONSECODE}";
JUMP #TELEGRAM
END
IF STRINGKEY @data.RESPONSECODE Contains "200"
IF STRINGKEY @data.SOURCE DoesNotMatchRegex "\b(Ok)\b"

STATUSNAME = "NEW IP DETECTED 😎";
LOG @STATUSNAME

END
END
#TELEGRAM
BLOCK:HttpRequest
  url = "https://api.telegram.org/[HIDDENINFO]/sendMessage"
  TYPE:STANDARD
  $"chat_id=958084223&parse_mode=html&text=%3Cb%3E<STATUSNAME>%3C/b%3E: \\n<data.SOURCE>"
  "application/x-www-form-urlencoded"
ENDBLOCK

1 Like

JUMP Worked fine !, But it 's not the same statement logic , anyway thank you dude for your feedback :black_heart:

1 Like
BLOCK:HttpRequest
  url = "http://HOST:8689/token.php"
  TYPE:STANDARD
  ""
  "application/x-www-form-urlencoded"
ENDBLOCK
string STATUSNAME = "";
IF STRINGKEY @data.RESPONSECODE EqualTo "200"
IF STRINGKEY @data.SOURCE DoesNotMatchRegex "\\b(Ok)\\b"
STATUSNAME = "NEW IP/NOOB DETECTED 😎";
END
END
IF STRINGKEY @data.RESPONSECODE NotEqualTo "200"
data.SOURCE = $"SERVER DOWN OR SOMETHING LIKE THAT \\n<b>RESPONSECODE:</b>  {data.RESPONSECODE}";
STATUSNAME = "WILI WILI 😥";
END
IF STRINGKEY @STATUSNAME MatchesRegex "WILI|NEW"
BLOCK:HttpRequest
  url = "https://api.telegram.org/[HIDDENTOKEN]/sendMessage"
  TYPE:STANDARD
  $"chat_id=958084223&parse_mode=html&text=%3Cb%3E<STATUSNAME>%3C/b%3E: \\n<data.SOURCE>"
  "application/x-www-form-urlencoded"
ENDBLOCK
END

I resolved this by adding MatchesRegex . Can you look at the source to understand?

Thank You for All :black_heart: