From 307594723c354a4b988913bedf99b2c533ced720 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 9 May 2022 19:06:57 -0500 Subject: write how i want using the held item to work --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 909ae47e..d0dea3da 100755 --- a/README.md +++ b/README.md @@ -38,6 +38,24 @@ loop { println!(m); bot.reconnect().await.unwrap(); }, + Event::Hunger(h) { + if !h.using_held_item() && h.hunger <= 17 { + match bot.hold_item(azalea::ItemGroup::Food).await { + Ok(_) => {}, + Err(e) => { + println!("{}", e); + break; + } + } + match bot.use_held_item().await { + Ok(_) => {}, + Err(e) => { + println!("{}", e); + break; + } + } + } + } _ => {} } } -- cgit v1.2.3 From 6b7ebc8675726419724956fc90201bb6cf73d63a Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 9 May 2022 19:14:13 -0500 Subject: Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d0dea3da..f4beecba 100755 --- a/README.md +++ b/README.md @@ -10,15 +10,15 @@ I named this Azalea because it sounds like a cool word and this is a cool librar ## Goals -- Do everything a vanilla client can do -- Be easy to use -- Bypass most/all anticheats -- Support the latest Minecraft version -- Be fast +- Do everything a vanilla client can do. +- Be easy to use. +- Bypass most/all anticheats. +- Support the latest Minecraft version. +- Be fast and memory efficient. ## Example code -Note that these doesn't work yet, it's just how I want the API to look. +Note that these don't work yet, it's just how I want the API to look. ```rs use azalea::{Account, Event}; -- cgit v1.2.3 From fd3a5ea87fa13bfaab7e099bbe15b9623fd55e74 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 9 May 2022 19:15:03 -0500 Subject: change recv to next in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4beecba..7f3e2f0d 100755 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ let bot = Bot::offline("bot"); bot.join("localhost".try_into().unwrap()).await.unwrap(); loop { - match bot.recv().await { + match bot.next().await { Event::Message(m) { if m.username == bot.username { return }; if m.message = "go" { -- cgit v1.2.3 From ef3cbe27f2a7eed5c635924d6fa0401dd04eae77 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 9 May 2022 19:34:51 -0500 Subject: hold_item -> hold --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f3e2f0d..084b981d 100755 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ loop { }, Event::Hunger(h) { if !h.using_held_item() && h.hunger <= 17 { - match bot.hold_item(azalea::ItemGroup::Food).await { + match bot.hold(azalea::ItemGroup::Food).await { Ok(_) => {}, Err(e) => { println!("{}", e); -- cgit v1.2.3