diff --git a/maa-sys/src/binding.rs b/maa-sys/src/binding.rs index 5e5aa58e..259d1d53 100644 --- a/maa-sys/src/binding.rs +++ b/maa-sys/src/binding.rs @@ -88,6 +88,13 @@ link! { config: *const ::std::os::raw::c_char, block: AsstBool, ) -> AsstAsyncCallId; + + pub fn AsstSetConnectionExtras( + handle: AsstHandle, + name: *const ::std::os::raw::c_char, + extras: *const ::std::os::raw::c_char, + ) -> AsstBool; + pub fn AsstAsyncClick(handle: AsstHandle, x: i32, y: i32, block: AsstBool) -> AsstAsyncCallId; pub fn AsstAsyncScreencap(handle: AsstHandle, block: AsstBool) -> AsstAsyncCallId; diff --git a/maa-sys/src/lib.rs b/maa-sys/src/lib.rs index 9f666282..00107632 100644 --- a/maa-sys/src/lib.rs +++ b/maa-sys/src/lib.rs @@ -217,6 +217,21 @@ impl Assistant { }) } + /// Set the connection extras of the assistant + pub fn set_connection_extras( + &self, + name: impl ToCString, + extras: impl ToCString, + ) -> Result<()> { + handle_asst(unsafe { + binding::AsstSetConnectionExtras( + self.handle, + name.to_cstring()?.as_ptr(), + extras.to_cstring()?.as_ptr(), + ) + }) + } + /// Click the screen at the given position pub fn async_click(&self, x: i32, y: i32, block: bool) -> Result { Ok(unsafe { binding::AsstAsyncClick(self.handle, x, y, block.into()) })