From bcd76e787d9707cee3c44eb29b3fe10aa486dc24 Mon Sep 17 00:00:00 2001 From: AmokDev Date: Fri, 20 Jun 2025 05:50:08 +0300 Subject: [PATCH] unix support --- Cargo.toml | 2 ++ src/main.rs | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 240875a..4c44c81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,8 @@ parking_lot = "0.12.3" tokio = { version = "1.45.0", features = ["full", "io-std"] } tracing = "0.1.41" tracing-subscriber = "0.3.19" + +[target.'cfg(windows)'.dependencies] win32console = "0.1.5" [profile.dev] diff --git a/src/main.rs b/src/main.rs index 9f7e77b..f636c99 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,7 @@ use utils::commands; use std::time::Instant; use utils::tools::*; use once_cell::sync::OnceCell; +#[cfg(windows)] use win32console::console::WinConsole; static OWNER_NAME: OnceCell = OnceCell::new(); @@ -22,12 +23,19 @@ pub struct State { pub messages_received: Arc> } -#[tokio::main] -async fn main() { - match WinConsole::set_title("UwUMine | Auto-Farm Bot") { +#[cfg(windows)] +fn rename_windows_console() { + match WinConsole::set_title("UwUMine | Auto Bot") { Ok(_) => print!(""), Err(e) => eprintln!("oshibka {}", e), }; +} + +#[tokio::main] +async fn main() { + + #[cfg(windows)] + rename_windows_console(); println!(":: Бот сделан AmokDev"); println!(":: Удачи в игре!");