diff --git a/CONFIG.md b/CONFIG.md index 7612beb..62c826e 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -26,11 +26,10 @@ Offset refers to the the time between the snipe request leaving your computer/se ### Options -| Option | Default | Description | -| ------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `mode` | mandatory field | Sniping mode. Choose between `mj` (Mojang authentication), `ms` (Microsoft authentication), or `prename` (GC sniping). | -| `offset` | mandatory field | Snipe offset | -| `name_queue ` | `[]` | Enables name queueing. | +| Option | Default | Description | +| -------- | --------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `mode` | mandatory field | Sniping mode. Choose between `mj` (Mojang authentication), `ms` (Microsoft authentication), or `prename` (GC sniping). | +| `offset` | mandatory field | Snipe offset | ### Examples @@ -146,6 +145,39 @@ password = "youaremylittlepogchamp" bearer = "minecraft access token" ``` +## Name Queue + +An optional module that alows you to specify a name queue, in which the sniper will snipe names specified on the queue sequentially. + +### Options + +| Option | Default | Description | +| -------------------- | --------------- | ------------------------------------------------------------------------------------------------------ | +| `queue` | `[]` | Specifies name queue. | +| `never_stop_sniping` | mandatory field | When enabled, the sniper will continue to snipe names from the queue even after a snipe is successful. | + +### Examples + +#### If the sniper successfully snipes "Dream", the sniper will stop sniping + +```toml +# config.toml + +[name_queue] +queue = ["Dream", "Marc"] +never_stop_sniping = false +``` + +#### If the sniper successfully snipes "Dream" and there are more accounts available to snipe with, attempt to snipe "Marc" + +```toml +# config.toml + +[name_queue] +queue = ["Dream", "Marc"] +never_stop_sniping = true +``` + ## Skin An optional module that when specified will enable skin change after successful snipes. diff --git a/Cargo.lock b/Cargo.lock index 79eef69..4b1cd89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "buckshot" -version = "4.0.3" +version = "4.0.4" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 223da70..cd1b04d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "buckshot" -version = "4.0.3" +version = "4.0.4" authors = ["tropicbliss "] edition = "2021" license = "MIT" diff --git a/src/config.rs b/src/config.rs index 88e9812..fadc9a1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,7 +10,13 @@ struct PrivateConfig { #[serde(deserialize_with = "to_task")] mode: SnipeTask, skin: Option, - name_queue: Option>, + name_queue: Option, +} + +#[derive(Deserialize)] +pub struct NameQueue { + pub queue: Vec, + pub never_stop_sniping: bool, } #[derive(Deserialize)] @@ -20,7 +26,7 @@ pub struct Config { pub offset: u32, pub mode: SnipeTask, pub skin: Option, - pub name_queue: Option>, + pub name_queue: Option, } #[derive(PartialEq)] @@ -130,7 +136,7 @@ pub fn new() -> Result { bail!("No accounts provided in config file"); } if let Some(count) = &cfg.name_queue { - if count.is_empty() { + if count.queue.is_empty() { bail!("No name provided in name queue"); } } diff --git a/src/main.rs b/src/main.rs index a3e357e..cdd0482 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,8 +30,8 @@ async fn main() -> Result<()> { } let name_list = if let Some(name) = args.name { vec![name] - } else if let Some(x) = config.name_queue.clone() { - x + } else if let Some(x) = &config.name_queue { + x.queue.clone() } else { let name = cli::get_name_choice().with_context(|| "Failed to get name choice")?; vec![name] @@ -191,6 +191,12 @@ async fn main() -> Result<()> { })?; writeln!(stdout(), "{}", style("Successfully changed skin").green())?; } + if let Some(name_queue) = &config.name_queue { + if name_queue.never_stop_sniping && !config.account_entry.is_empty() { + config.account_entry.remove(account_idx); + continue; + } + } break; } writeln!(stdout(), "Failed to snipe {}", name)?; diff --git a/src/sockets.rs b/src/sockets.rs index 92ccef1..e0017e9 100644 --- a/src/sockets.rs +++ b/src/sockets.rs @@ -80,12 +80,11 @@ pub async fn snipe_executor( let status: u16 = res[9..] .parse() .expect("Failed to parse HTTP status code from string"); - let res_data = ResData { + ResData { status, timestamp, account_idx, - }; - res_data + } }); handles.push(handle); }