Compare commits

...

23 Commits

Author SHA1 Message Date
ErrorNoInternet 9c858c4a1a chore(nix): use craneLib.devShell 2026-05-10 13:02:09 -04:00
ErrorNoInternet 54a7ae14a1 chore(gitignore): add /result* 2026-05-09 21:21:54 -04:00
ErrorNoInternet 92a969b06a build(deps): update everything 2026-05-09 15:28:25 -04:00
ErrorNoInternet ee653392e3 feat(flake): migrate to crane 2026-05-09 14:43:15 -04:00
ErrorNoInternet e902db8b2c chore(flake): update inputs 2026-05-09 14:42:05 -04:00
ErrorNoInternet 4d1321c77e fix(flake): fix pkg-config for openssl 2026-05-02 15:07:24 -04:00
ErrorNoInternet 3ce06e1731 refactor!: replace setters with fields 2026-05-02 15:07:24 -04:00
ErrorNoInternet 6cb5a4e73f Merge pull request #13 from ErrorNoInternet/dependabot/cargo/tokio-1.52.1 2026-05-01 21:48:11 -04:00
ErrorNoInternet bbf20d3b03 Merge pull request #11 from ErrorNoInternet/dependabot/nix/rust-overlay-ff88db3 2026-05-01 21:48:05 -04:00
ErrorNoInternet d9bb2397c2 Merge pull request #9 from ErrorNoInternet/dependabot/nix/nixpkgs-1c3fe55 2026-05-01 21:47:58 -04:00
ErrorNoInternet 9295827fce Merge pull request #15 from ErrorNoInternet/dependabot/cargo/mimalloc-0.1.50 2026-05-01 21:46:19 -04:00
ErrorNoInternet 9d2ecdea28 Merge pull request #14 from ErrorNoInternet/dependabot/cargo/zip-8.6.0 2026-05-01 21:46:15 -04:00
ErrorNoInternet ffaa16b496 Merge pull request #12 from ErrorNoInternet/dependabot/nix/flake-parts-5250617 2026-05-01 21:46:08 -04:00
ErrorNoInternet a24ea30178 Merge pull request #10 from ErrorNoInternet/dependabot/cargo/clap-4.6.1 2026-05-01 21:46:00 -04:00
ErrorNoInternet 4edf89ecda Merge pull request #8 from ErrorNoInternet/dependabot/github_actions/dot-github/workflows/uncenter/setup-taplo-2 2026-05-01 21:45:24 -04:00
dependabot[bot] b7ee912250 build(deps): bump mimalloc from 0.1.48 to 0.1.50
Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.48 to 0.1.50.
- [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases)
- [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.48...v0.1.50)

---
updated-dependencies:
- dependency-name: mimalloc
  dependency-version: 0.1.50
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:08:01 +00:00
dependabot[bot] 2f19565896 build(deps): bump zip from 8.5.1 to 8.6.0
Bumps [zip](https://github.com/zip-rs/zip2) from 8.5.1 to 8.6.0.
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zip-rs/zip2/compare/v8.5.1...v8.6.0)

---
updated-dependencies:
- dependency-name: zip
  dependency-version: 8.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:07:42 +00:00
dependabot[bot] 9ba3860ee1 build(deps): bump tokio from 1.51.1 to 1.52.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.51.1 to 1.52.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.51.1...tokio-1.52.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.52.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:07:23 +00:00
dependabot[bot] 8020aec18d build(deps): bump flake-parts from f20dc5d to 5250617
Bumps [flake-parts](https://github.com/hercules-ci/flake-parts) from `f20dc5d` to `5250617`.
- [Commits](https://github.com/hercules-ci/flake-parts/compare/f20dc5d9b8027381c474144ecabc9034d6a839a3...5250617bffd85403b14dbf43c3870e7f255d2c16)

---
updated-dependencies:
- dependency-name: flake-parts
  dependency-version: 5250617bffd85403b14dbf43c3870e7f255d2c16
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:07:07 +00:00
dependabot[bot] 931a59c42a build(deps): bump rust-overlay from e8046c1 to ff88db3
Bumps [rust-overlay](https://github.com/oxalica/rust-overlay) from `e8046c1` to `ff88db3`.
- [Commits](https://github.com/oxalica/rust-overlay/compare/e8046c1d9ccadd497c2344d8fa49dab62f22f7be...ff88db34cfa486fc4964a6991cab1678d82eee8c)

---
updated-dependencies:
- dependency-name: rust-overlay
  dependency-version: ff88db34cfa486fc4964a6991cab1678d82eee8c
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:07:05 +00:00
dependabot[bot] 07a25cae78 build(deps): bump clap from 4.6.0 to 4.6.1
Bumps [clap](https://github.com/clap-rs/clap) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.6.0...clap_complete-v4.6.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:07:03 +00:00
dependabot[bot] de07372a4f build(deps): bump nixpkgs from 8110df5 to 1c3fe55
Bumps [nixpkgs](https://github.com/NixOS/nixpkgs) from `8110df5` to `1c3fe55`.
- [Commits](https://github.com/NixOS/nixpkgs/compare/8110df5ad7abf5d4c0f6fb0f8f978390e77f9685...1c3fe55ad329cbcb28471bb30f05c9827f724c76)

---
updated-dependencies:
- dependency-name: nixpkgs
  dependency-version: 1c3fe55ad329cbcb28471bb30f05c9827f724c76
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:07:00 +00:00
dependabot[bot] d46a4f8244 build(deps): bump uncenter/setup-taplo from 1 to 2 in /.github/workflows
Bumps [uncenter/setup-taplo](https://github.com/uncenter/setup-taplo) from 1 to 2.
- [Release notes](https://github.com/uncenter/setup-taplo/releases)
- [Commits](https://github.com/uncenter/setup-taplo/compare/v1...v2)

---
updated-dependencies:
- dependency-name: uncenter/setup-taplo
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 01:06:11 +00:00
14 changed files with 438 additions and 719 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v6
- name: Install taplo
uses: uncenter/setup-taplo@v1
uses: uncenter/setup-taplo@v2
- name: Run taplo lint
run: taplo lint Cargo.toml
+4 -13
View File
@@ -1,13 +1,4 @@
.luarc.json
target
# Devenv
.devenv*
devenv.local.nix
devenv.local.yaml
# direnv
.direnv
# pre-commit
.pre-commit-config.yaml
/.direnv
/.luarc.json
/result*
/target
Generated
+313 -622
View File
File diff suppressed because it is too large Load Diff
+5 -9
View File
@@ -1,19 +1,15 @@
{
lib,
craneLib,
pkgs,
rust,
self,
}:
pkgs.rustPlatform.buildRustPackage {
craneLib.buildPackage {
pname = "errornowatcher";
version = self.shortRev or self.dirtyShortRev;
version = "0.2.0";
cargoLock.lockFile = ./Cargo.lock;
src = lib.cleanSource ./.;
src = craneLib.cleanCargoSource ./.;
nativeBuildInputs = with pkgs; [
rust
clang
mold
pkg-config
];
Generated
+58 -24
View File
@@ -1,15 +1,51 @@
{
"nodes": {
"crane": {
"locked": {
"lastModified": 1778106249,
"narHash": "sha256-cM/AuKy5tMhwOOQIbha8ZRRMHVfNf7cv2aljIw+qoCg=",
"owner": "ipetkov",
"repo": "crane",
"rev": "6d015ea29630b7ad2402841386da2cb617a470a7",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1778314245,
"narHash": "sha256-a8p3JMunVzj0o86V9CNTyEFw7z4105QWl+bEz6Du8Jw=",
"owner": "nix-community",
"repo": "fenix",
"rev": "f54d645218048a7abe226983a922cdaca63cd845",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1772408722,
"narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
"lastModified": 1777988971,
"narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
"rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff",
"type": "github"
},
"original": {
@@ -20,11 +56,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1774709303,
"narHash": "sha256-D3Q07BbIA2KnTcSXIqqu9P586uWxN74zNoCH3h2ESHg=",
"lastModified": 1777954456,
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8110df5ad7abf5d4c0f6fb0f8f978390e77f9685",
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
"type": "github"
},
"original": {
@@ -36,11 +72,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1772328832,
"narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=",
"lastModified": 1777168982,
"narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742",
"rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14",
"type": "github"
},
"original": {
@@ -51,28 +87,26 @@
},
"root": {
"inputs": {
"crane": "crane",
"fenix": "fenix",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
"nixpkgs": "nixpkgs"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1775013181,
"narHash": "sha256-zPrt6oNM1r/RO5bWYaZ3hthfG9vzkr6kQdoqDd5x4Qw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "e8046c1d9ccadd497c2344d8fa49dab62f22f7be",
"lastModified": 1778246258,
"narHash": "sha256-RUZuOfzouSaK/VjcOCU/P5Nb3EhpM8qGnIcHWIIo4Sw=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "73ca1d4ef136e2367627d698f00db94882b49440",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
}
+13 -21
View File
@@ -1,21 +1,22 @@
{
inputs = {
crane.url = "github:ipetkov/crane";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
crane,
fenix,
flake-parts,
nixpkgs,
rust-overlay,
self,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
@@ -32,32 +33,23 @@
...
}:
let
rust = pkgs.rust-bin.nightly.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer-preview"
];
};
craneLib = (crane.mkLib pkgs).overrideToolchain fenix.packages.${system}.complete.toolchain;
in
{
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
devShells.default = pkgs.mkShell {
devShells.default = craneLib.devShell {
name = "errornowatcher";
inputsFrom = [ self'.packages.default ];
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.taplo ];
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
RUST_BACKTRACE = 1;
};
packages = rec {
default = errornowatcher;
errornowatcher = pkgs.callPackage ./. { inherit rust self; };
errornowatcher = pkgs.callPackage ./. { inherit craneLib; };
};
};
};
+1 -1
View File
@@ -99,7 +99,7 @@ function attack_entities(target_kind, minimum)
pos.y = pos.y + 1.5
hold_sword()
client:look_at(pos)
client.looking_at = pos
client:attack(e.id)
while client.has_attack_cooldown do
sleep(100)
+2 -2
View File
@@ -6,7 +6,7 @@ function hold_items_in_hotbar(target_kinds, inventory)
if index >= 37 and index <= 45 and table.contains(target_kinds, item.kind) then
inventory = nil
sleep(500)
client:set_held_slot(index - 37)
client.held_slot = index - 37
return true
end
end
@@ -35,7 +35,7 @@ end
function steal(item_name)
for _, chest_pos in ipairs(client:find_blocks(client.position, get_block_states({ "chest" }))) do
client:go_to({ position = chest_pos, radius = 3 }, { type = RADIUS_GOAL })
client:look_at(chest_pos)
client.looking_at = chest_pos
local container = client:open_container_at(chest_pos)
for index, item in ipairs(container.contents) do
+1 -1
View File
@@ -2,7 +2,7 @@ function look_at_player(name)
local player = get_player(name)
if player then
player.position.y = player.position.y + 1
client:look_at(player.position)
client.looking_at = player.position
end
end
+1 -1
View File
@@ -141,7 +141,7 @@ function interact_bed()
end
client:go_to({ position = bed, radius = 2 }, { type = RADIUS_GOAL, options = { without_mining = true } })
client:look_at(bed)
client.looking_at = bed
client:block_interact(bed)
end
+2 -2
View File
@@ -17,7 +17,7 @@ pub fn held_item(_lua: &Lua, client: &Client) -> Result<ItemStack> {
Ok(ItemStack(client.get_held_item()))
}
pub fn held_slot(_lua: &Lua, client: &Client) -> Result<u8> {
pub fn get_held_slot(_lua: &Lua, client: &Client) -> Result<u8> {
Ok(client.component::<Inventory>().selected_hotbar_slot)
}
@@ -113,7 +113,7 @@ pub fn open_inventory(_lua: &Lua, client: &Client, (): ()) -> Result<Option<Cont
Ok(client.open_inventory().map(Container))
}
pub fn set_held_slot(_lua: &Lua, client: &Client, slot: u8) -> Result<()> {
pub fn set_held_slot(_lua: &Lua, client: &mut Client, slot: u8) -> Result<()> {
if slot > 8 {
return Ok(());
}
+5 -1
View File
@@ -43,7 +43,11 @@ pub async fn mine(_lua: Lua, client: UserDataRef<Client>, position: Vec3) -> Res
Ok(())
}
pub fn set_mining(_lua: &Lua, client: &Client, state: bool) -> Result<()> {
pub fn get_mining(_lua: &Lua, client: &Client) -> Result<bool> {
Ok(client.is_mining())
}
pub fn set_mining(_lua: &Lua, client: &mut Client, state: bool) -> Result<()> {
client.left_click_mine(state);
Ok(())
}
+14 -11
View File
@@ -33,20 +33,30 @@ impl UserData for Client {
f.add_field_method_get("air_supply", state::air_supply);
f.add_field_method_get("container", container::container);
f.add_field_method_get("dimension", world::dimension);
f.add_field_method_get("direction", movement::direction);
f.add_field_method_get("direction", movement::get_direction);
f.add_field_method_set("direction", movement::set_direction);
f.add_field_method_get("experience", state::experience);
f.add_field_method_get("eye_position", movement::eye_position);
f.add_field_method_get("go_to_reached", movement::go_to_reached);
f.add_field_method_get("has_attack_cooldown", interaction::has_attack_cooldown);
f.add_field_method_get("health", state::health);
f.add_field_method_get("held_item", container::held_item);
f.add_field_method_get("held_slot", container::held_slot);
f.add_field_method_get("held_slot", container::get_held_slot);
f.add_field_method_set("held_slot", container::set_held_slot);
f.add_field_method_get("hunger", state::hunger);
f.add_field_method_get("id", id);
f.add_field_method_get("looking_at", movement::looking_at);
f.add_field_method_get("jumping", movement::get_jumping);
f.add_field_method_set("jumping", movement::set_jumping);
f.add_field_method_get("looking_at", movement::get_looking_at);
f.add_field_method_set("looking_at", movement::set_looking_at);
f.add_field_method_get("menu", container::menu);
f.add_field_method_get("mining", interaction::get_mining);
f.add_field_method_set("mining", interaction::set_mining);
f.add_field_method_get("pathfinder", movement::pathfinder);
f.add_field_method_get("position", movement::position);
f.add_field_method_get("position", movement::get_position);
f.add_field_method_set("position", movement::set_position);
f.add_field_method_get("sneaking", movement::get_sneaking);
f.add_field_method_set("sneaking", movement::set_sneaking);
f.add_field_method_get("tab_list", tab_list);
f.add_field_method_get("username", username);
f.add_field_method_get("uuid", uuid);
@@ -72,15 +82,8 @@ impl UserData for Client {
m.add_method("get_block_state", world::get_block_state);
m.add_method("get_fluid_state", world::get_fluid_state);
m.add_method("jump", movement::jump);
m.add_method("look_at", movement::look_at);
m.add_method("open_inventory", container::open_inventory);
m.add_method("set_component", state::set_component);
m.add_method("set_direction", movement::set_direction);
m.add_method("set_held_slot", container::set_held_slot);
m.add_method("set_jumping", movement::set_jumping);
m.add_method("set_mining", interaction::set_mining);
m.add_method("set_position", movement::set_position);
m.add_method("set_sneaking", movement::set_sneaking);
m.add_method("sprint", movement::sprint);
m.add_method("start_mining", interaction::start_mining);
m.add_method("start_use_item", interaction::start_use_item);
+18 -10
View File
@@ -125,7 +125,7 @@ pub async fn start_go_to(
Ok(())
}
pub fn direction(_lua: &Lua, client: &Client) -> Result<Direction> {
pub fn get_direction(_lua: &Lua, client: &Client) -> Result<Direction> {
let direction = client.direction();
Ok(Direction {
y: direction.y_rot(),
@@ -133,6 +133,11 @@ pub fn direction(_lua: &Lua, client: &Client) -> Result<Direction> {
})
}
pub fn set_direction(_lua: &Lua, client: &mut Client, direction: Direction) -> Result<()> {
client.set_direction(direction.y, direction.x);
Ok(())
}
pub fn eye_position(_lua: &Lua, client: &Client) -> Result<Vec3> {
Ok(Vec3::from(client.eye_position()))
}
@@ -142,7 +147,7 @@ pub fn jump(_lua: &Lua, client: &Client, (): ()) -> Result<()> {
Ok(())
}
pub fn looking_at(lua: &Lua, client: &Client) -> Result<Option<Table>> {
pub fn get_looking_at(lua: &Lua, client: &Client) -> Result<Option<Table>> {
Ok(
if let HitResult::Block(ref result) = **client.component::<HitResultComponent>() {
let table = lua.create_table()?;
@@ -158,7 +163,7 @@ pub fn looking_at(lua: &Lua, client: &Client) -> Result<Option<Table>> {
)
}
pub fn look_at(_lua: &Lua, client: &Client, position: Vec3) -> Result<()> {
pub fn set_looking_at(_lua: &Lua, client: &mut Client, position: Vec3) -> Result<()> {
client.look_at(azalea::Vec3::new(position.x, position.y, position.z));
Ok(())
}
@@ -189,21 +194,20 @@ pub fn pathfinder(lua: &Lua, client: &Client) -> Result<Table> {
Ok(table)
}
pub fn position(_lua: &Lua, client: &Client) -> Result<Vec3> {
pub fn get_position(_lua: &Lua, client: &Client) -> Result<Vec3> {
Ok(Vec3::from(*client.component::<Position>()))
}
pub fn set_direction(_lua: &Lua, client: &Client, direction: Direction) -> Result<()> {
client.set_direction(direction.y, direction.x);
Ok(())
pub fn get_jumping(_lua: &Lua, client: &Client) -> Result<bool> {
Ok(client.jumping())
}
pub fn set_jumping(_lua: &Lua, client: &Client, jumping: bool) -> Result<()> {
pub fn set_jumping(_lua: &Lua, client: &mut Client, jumping: bool) -> Result<()> {
client.set_jumping(jumping);
Ok(())
}
pub fn set_position(_lua: &Lua, client: &Client, new_pos: Vec3) -> Result<()> {
pub fn set_position(_lua: &Lua, client: &mut Client, new_pos: Vec3) -> Result<()> {
client.query_self::<&mut Position, _>(|mut pos| {
pos.x = new_pos.x;
pos.y = new_pos.y;
@@ -212,7 +216,11 @@ pub fn set_position(_lua: &Lua, client: &Client, new_pos: Vec3) -> Result<()> {
Ok(())
}
pub fn set_sneaking(_lua: &Lua, client: &Client, sneaking: bool) -> Result<()> {
pub fn get_sneaking(_lua: &Lua, client: &Client) -> Result<bool> {
Ok(client.crouching())
}
pub fn set_sneaking(_lua: &Lua, client: &mut Client, sneaking: bool) -> Result<()> {
client.set_crouching(sneaking);
Ok(())
}