diff --git a/src/func.rs b/src/func.rs index ffad41e..05e3819 100644 --- a/src/func.rs +++ b/src/func.rs @@ -328,51 +328,6 @@ pub async fn main_logic(options: &[(&str, usize)], tts: &mut Tts, enigo: &mut En pen.inject(); } - #[cfg(feature = "advanced")] - fn gamepad(gamepad: &mut GamepadInjector, rng: &mut rand::rngs::ThreadRng) { - let lists: Vec<(Vec<(&str, usize)>, usize)> = vec![ - (GAMEPAD_BUTTONS.to_vec(), 5), - (GAMEPAD_MOVE.to_vec(), 3), - (GAMEPAD_SPECIAL.to_vec(), 1), - ]; - let index: WeightedIndex = - WeightedIndex::new(lists.iter().map(|item: &(Vec<(&str, usize)>, usize)| item.1)).unwrap(); - let list: &Vec<(&str, usize)> = &lists[index.sample(rng)].0; - let index2: WeightedIndex = - WeightedIndex::new(list.iter().map(|item: &(&str, usize)| item.1)).unwrap(); - let action = list[index2.sample(rng)].0; - match action { - "LeftThumbstickMove" => { - gamepad.update_left_thumbstick((rng.gen_range(-1.0..=1.0), rng.gen_range(-1.0..=1.0))); - gamepad.inject(); - thread::sleep(Duration::from_millis(rng.gen_range(0..=5000))); - gamepad.update_left_thumbstick((0.0,0.0)); - } - "RightThumbstickMove" => { - gamepad.update_right_thumbstick((rng.gen_range(-1.0..=1.0), rng.gen_range(-1.0..=1.0))); - gamepad.inject(); - thread::sleep(Duration::from_millis(rng.gen_range(0..=5000))); - gamepad.update_right_thumbstick((0.0,0.0)); - } - "LeftTrigger" => { - gamepad.update_left_trigger(rng.gen_range(0.0..=1.0)); - gamepad.inject(); - thread::sleep(Duration::from_millis(rng.gen_range(0..=5000))); - gamepad.update_left_trigger(0.0); - } - "RightTrigger" => { - gamepad.update_right_trigger(rng.gen_range(0.0..=1.0)); - gamepad.inject(); - thread::sleep(Duration::from_millis(rng.gen_range(0..=5000))); - gamepad.update_right_trigger(0.0); - } - _=>{ - gamepad.toggle_button(action); - } - } - gamepad.inject(); - } - #[cfg(feature = "advanced")] pub async fn main_logic_adv(options: &[(&str, usize)], tts: &mut Tts, enigo: &mut Enigo, gamepadobj: &mut GamepadInjector, penobj: &mut PenInjector) { let mut rng: rand::prelude::ThreadRng = thread_rng();