I’m trying to use this new startup lolicode feature, but when using your example code I get this error: [IDLE] NullReferenceException: Object reference not set to an instance of an object.
ACQUIRELOCK globals
TRY
// Check if global token already set or if we need to refresh it
var globalsDict = ((IDictionary<String, object>)globals);
if (!globalsDict.ContainsKey("Token") || globals.NeedsRefresh)
{
// If not set or needs refresh, grab it
await GetToken();
globals.NeedsRefresh = false; // No need to refresh anymore
}
CATCH
throw;
FINALLY
RELEASELOCK globals
END
async Task GetToken()
{
// --- START EDITING HERE
// Put the blocks to grab the token here, for example
// Http Request block
// Keycheck block to see if the token is in the page, if not then just go to BAN
// Parse block to parse the token from data.SOURCE to a variable called Token
// --- STOP EDITING HERE
globals.Token = "xxd";
LOG "Saved globals.Token"
}