Bug in OB2

@Ruri Today I was making an Config and It needed the Proxy to be setted in u:p@a:p Format So I made the below code

BLOCK:CountOccurrences
  input = $"<data.Proxy>"
  word = ":"
  => VAR @p
ENDBLOCK

BLOCK:ConstantString
  value = $"<data.Proxy>"
  => VAR @constantStringOutput
ENDBLOCK
IF INTKEY @p GreaterThan 1
BLOCK:Parse
  input = @constantStringOutput
  leftDelim = ":"
  MODE:LR
  => VAR @parseOutput1
ENDBLOCK

BLOCK:Parse
  input = @constantStringOutput
  rightDelim = ":"
  MODE:LR
  => VAR @add
ENDBLOCK

BLOCK:Parse
  input = @parseOutput1
  leftDelim = ":"
  MODE:LR
  => VAR @up
ENDBLOCK

BLOCK:Parse
  input = @parseOutput1
  prefix = $"http://<up>@<add>:"
  rightDelim = ":"
  SAFE
  MODE:LR
  => VAR @port
ENDBLOCK

BLOCK:ConstantString
  value = $"http://<up>@<add>:<port>"
  SAFE
  => VAR @PROXY
ENDBLOCK
ELSE
BLOCK:ConstantString
  value = $"http://<constantStringOutput>"
  SAFE
  => VAR @PROXY
ENDBLOCK
END

The PROXY Variables are Created Only once using ELSE Command but I seem to get an weird Error which wouldnt let me use same name for 2 Variables. I am not sure if the Mistake is on me or The Code , If Its on me I request someone to correct me. The Error I get can be seen below

image

Sliced [email protected]:123 into:

USERNAME: [email protected]

PASSWORD: 123

USER: [email protected]

PASS: 123

[IDLE] CompilationErrorException: (68,5): error CS0103: The name ‘PROXY’ does not exist in the current context

BOT ENDED AFTER 116 ms WITH STATUS: ERROR

If this is an Error on Code , I kindly request you to fix it Ruri

when using a variable inside an if else loop, you need to declare the variable before the loop.

Like Could you provide me updated code

Just insert a constant string block before the loop.

BLOCK:ConstantString
LABEL:GENERAL PROXY
  => VAR @PROXY
ENDBLOCK

Seems like a lot of work to parse the proxy from string when everything you need is already there. Just write this in the LoliCode

string proxy = "";

if (data.Proxy is not null)
{
  proxy = data.Proxy.Username == "" 
    ? $"{data.Proxy.Host}:{data.Proxy.Port}"
    : $"{data.Proxy.Username}:{data.Proxy.Password}@{data.Proxy.Host}:{data.Proxy.Port}";
}

LOG proxy