Struggling with loli code

Hi, I’m trying to encode a string using current proxy, use that string in a request and set bot status to retry if the bot doesn’t have a proxy. However, I’m getting this error:

error CS0103: The name string_key does not exist in the current context

Here is the code:

TRY

// create a string using current proxy

CATCH

SET VAR STRINGKEY @data.STATUS = "RETRY"

END

// use that string in a request

The goal would be to make the bot retry if it doesn’t have a proxy, but the bot seems to continue anyway. I also thought about making it in a different way, it didn’t work neither:

if not proxy:
      bot.status = retry
      # assume the bot ends here
else:
      // doing other stuffs

What would be the best way to achieve this ?
Thanks !

In the first piece of code, the syntax is wrong

TRY
// create a string using current proxy
CATCH
data.STATUS = "RETRY";
return;
END

In the second piece of code, you used python (??) for some reason that is really obscure to me, or maybe it’s just pseudocode ^^

if (data.Proxy is null)
{
  data.STATUS = "RETRY";
  return;
}

// Doing other stuff

Honestly I would use the second version which is much better. You don’t need an else since if the status is retry, the return will automatically end execution right there and won’t proceed with the code you write after the if statement.

Also you should know that if you set the status as RETRY, it will not take a proxy from the proxy pool when it checks the data for the 2nd time (it will use the same proxy). It only does that with BAN. So unless you’re setting the proxy manually in the code, you’re setting yourself up for an endless loop when you actually run this.

1 Like

Thanks you ! the second piece of code was a pseudocode and i set the proxy manually in the config !