Created
April 14, 2023 02:47
-
-
Save syobocat/54eae27d3f84b4ed91f0c0f6b72f9089 to your computer and use it in GitHub Desktop.
連射機
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Written on: 2021/08/19 | |
use enigo::*; | |
use std::{io, thread, time}; | |
fn main() { | |
let mut interval = 0; | |
let mut is_ok = false; | |
while !is_ok { | |
println!("Time interval (milliseconds): "); | |
let mut input = "".to_owned(); | |
io::stdin().read_line(&mut input).ok(); | |
if let Ok(x) = input.trim().parse::<u64>() { | |
interval = x; | |
is_ok = true; | |
} else { | |
println!("Please enter a number.") | |
} | |
} | |
println!("3..."); | |
thread::sleep(time::Duration::from_millis(1000)); | |
println!("2..."); | |
thread::sleep(time::Duration::from_millis(1000)); | |
println!("1..."); | |
thread::sleep(time::Duration::from_millis(1000)); | |
println!("GO!!!"); | |
let mut enigo = Enigo::new(); | |
loop { | |
enigo.mouse_click(MouseButton::Left); | |
thread::sleep(time::Duration::from_millis(interval)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment