pub struct Bot { /* private fields */ }Implementations§
Source§impl Bot
impl Bot
Sourcepub fn position(&self) -> Option<(usize, usize)>
pub fn position(&self) -> Option<(usize, usize)>
The bot’s current position, once received from the server.
Sourcepub fn safe_directions(&self) -> Vec<MoveDirection>
pub fn safe_directions(&self) -> Vec<MoveDirection>
Returns every direction whose neighbouring cell is currently empty.
Sourcepub fn is_blocked(&self, direction: MoveDirection) -> bool
pub fn is_blocked(&self, direction: MoveDirection) -> bool
True if moving in direction from the current position would hit a trail.
Returns true when the position is unknown.
Sourcepub fn write_packet(&mut self, packet: ClientPacket)
pub fn write_packet(&mut self, packet: ClientPacket)
Write a raw packet to the server.
Sourcepub fn chat(&mut self, message: impl Into<String>)
pub fn chat(&mut self, message: impl Into<String>)
Send a message in chat, make sure to not get rate limited.
Sourcepub fn do_move(&mut self, direction: MoveDirection)
pub fn do_move(&mut self, direction: MoveDirection)
Set a move direction. (I think you should only do one per tick I dir not test several)
Auto Trait Implementations§
impl Freeze for Bot
impl RefUnwindSafe for Bot
impl Send for Bot
impl Sync for Bot
impl Unpin for Bot
impl UnsafeUnpin for Bot
impl UnwindSafe for Bot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more