rust防锁屏
use rsautogui::mouse; use std::thread::sleep; use std::time::Duration; use anyhow::{self, Ok}; fn run(x: u16) ->Result<(), anyhow::Error>{ let timeseconds = Duration::from_secs(5); mouse::move_to(x, 500); sleep(timeseconds); Ok(()) } fn main() { let mut x: i8 = -1; loop { if x > 0{ run(100_u16).unwrap_or_else(|_|{}); }else{ run(300_u16).unwrap_or_else(|_|{}); } x = -x ; } }