refactor!: replace setters with fields
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user