Hello,
I have a list of codes, each accompanied by number combinations. For each successful hit, I want to move to the next code automatically. Currently, I have to manually enter each code for each job, which is time-consuming. What I’d like to do is create a list of multiple codes and automatically move to the next one as soon as the correct combination is found. I’m using two variables: input.GOODS to store the code and input.CODE which is used by OpenBullet2 for the combinations.
Any help would be appreciated. Thanks.
Share your config and data sample
You may want to use an approach similar to the one described here. Basically make use of global variables to change the combination for all bots, the first bot that finds a hit will increase the combination for everybody.
@Ruri
Would this be correct ?
Startup:
// BLOCK: Constant List
data.ExecutingBlock("Constant List");
globals.keys = ConstantList(data, new List<string> { "code1", "code2" });
data.LogVariableAssignment(nameof(globals.keys));
// BLOCK: Constant Integer
data.ExecutingBlock("Constant Integer");
globals.index = ConstantInteger(data, 0);
data.LogVariableAssignment(nameof(globals.index));
// BLOCK: LoliCode
data.ExecutingBlock("LoliCode");
globals.pins = new List<string>();
for (int i = 0; i <= 9999; i++)
{
globals.pins.Add(i.ToString("D4"));
}
data.LogVariableAssignment(nameof(globals.pins));
// BLOCK: Constant Integer
data.ExecutingBlock("Constant Integer");
globals.pinIndex = ConstantInteger(data, 0);
data.LogVariableAssignment(nameof(globals.pinIndex));
Config:
// BLOCK: LoliCode
data.ExecutingBlock("LoliCode");
string codeList = globals.keys[globals.index];
string currentPin = globals.pins[globals.pinIndex];
data.LogVariableAssignment(nameof(codeList));
data.LogVariableAssignment(nameof(currentPin));
// BLOCK: Http Request
data.ExecutingBlock("Http Request");
await HttpRequestStandard(data, new StandardHttpRequestOptions
{
Content = $"{{ \"code\": \"{codeList}\", \"pinCode\": \"{currentPin}\" }}",
ContentType = "application/json",
UrlEncodeContent = false,
Url = "",
Method = RuriLib.Functions.Http.HttpMethod.POST,
AutoRedirect = true,
MaxNumberOfRedirects = 8,
ReadResponseContent = true,
AbsoluteUriInFirstLine = false,
HttpLibrary = RuriLib.Functions.Http.Options.HttpLibrary.SystemNet,
SecurityProtocol = RuriLib.Functions.Http.SecurityProtocol.SystemDefault,
CustomCookies = new Dictionary<string, string>(),
CustomHeaders = new Dictionary<string, string>
{
},
TimeoutMilliseconds = 15000,
HttpVersion = "1.1",
AlwaysSendContent = false,
DecodeHtml = false
}).ConfigureAwait(false);
// BLOCK: LoliCode
data.ExecutingBlock("LoliCode");
// Incrementation sécurisée des index
if (globals.pinIndex < globals.pins.Count - 1)
{
globals.pinIndex++;
}
else if (globals.index < globals.keys.Count - 1)
{
globals.index++;
globals.pinIndex = 0;
}
if (CheckCondition(data, data.SOURCE.AsString(), StrComparison.Contains, "\"amount\":0,"))
{
data.STATUS = "LOW";
return;
}
if (CheckCondition(data, data.SOURCE.AsString(), StrComparison.Contains, "REDEMPTION"))
{
data.STATUS = "USED";
return;
}
if (CheckCondition(data, data.SOURCE.AsString(), StrComparison.Contains, "ACTIVATION"))
{
data.STATUS = "SUCCESS";
return;
}
// BLOCK: Keycheck
data.ExecutingBlock("Keycheck");
if (CheckCondition(data, data.SOURCE.AsString(), StrComparison.Contains, "{\"error\":\"UNKNOWN\"}")
|| CheckCondition(data, data.SOURCE.AsString(), StrComparison.Contains, "{\"error\":\"INVALID\"}"))
{
data.STATUS = "FAIL";
return;
}
if (CheckGlobalBanKeys(data))
{
data.STATUS = "BAN";
return;
}
if (CheckGlobalRetryKeys(data))
{
data.STATUS = "RETRY";
return;
}
I tried with input.CODE as the pin input, but obviously, I need it to reset to 0 once hit or custom occurs, so I thought of storing them in a constant and use infinite loop when executing the config, but still unsure it will reset it to 0 like this, as I have no track in the job, as I’m not using any internal variables anymore…