Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Update latest tag
run: |
git tag -f latest
git push -f origin latest
git push --force origin latest

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/dev/thoq/Alya.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public String[] initializeModules() {
new Script(Category.MOVEMENT, "longjump"),
new Script(Category.MOVEMENT, "highjump"),
new Script(Category.MOVEMENT, "wee"),
new Script(Category.PLAYER, "sprint"),
new Script(Category.MOVEMENT, "sneak"),
new Script(Category.MOVEMENT, "sprint"),
new Script(Category.PLAYER, "noslowdown"),
new Script(Category.PLAYER, "inventory"),
//todo: fix blink
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/lua/alya.d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function AlyaMC.getHurtTime() end
function AlyaMC.getEntityId() end
---@param boolean
function AlyaMC.setSneakPressed(pressed) end
---@param boolean
---@return boolean
function AlyaMC.isOnSolidBlock() end

---sets the player's step height (vanilla default is 0.5)
Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/lua/modules/movement/sneak.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local moduleTable = alya.modules.register("Sneak", "Makes you sneak", "MOVEMENT")
local mode = moduleTable.addModeSetting("Mode", "Sneak mode", "Normal", "Normal", "Twerk")
local createNormalMode = loadScript("/lua/modules/movement/sneak/normal.lua")
local createTwerkMode = loadScript("/lua/modules/movement/sneak/twerk.lua")

local twerkTimer = alya.timer.create()

createNormalMode(moduleTable, mode)
createTwerkMode(moduleTable, mode, twerkTimer)

moduleTable.onEnable(function()
twerkTimer.reset()
end)

moduleTable.onDisable(function()
alya.mc.setSneakPressed(false)
end)
10 changes: 10 additions & 0 deletions src/main/resources/lua/modules/movement/sneak/normal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
local function createNormalMode(moduleTable, mode)
alya.events.on("update", function()
if not moduleTable.isEnabled() then return end
if not mode.is("Normal") then return end
alya.mc.setSneakPressed(true)
end)
end


return createNormalMode
13 changes: 13 additions & 0 deletions src/main/resources/lua/modules/movement/sneak/twerk.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local function createTwerkMode(moduleTable, mode, timer)
alya.events.on("update", function()
if not moduleTable.isEnabled() then return end
if not mode.is("Twerk") then return end
if timer.hasElapsedAndReset(500, true) then
alya.mc.setSneakPressed(false)
else
alya.mc.setSneakPressed(true)
end
end)
end

return createTwerkMode
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local moduleTable = alya.modules.register("Sprint", "Auto-Sprint", "PLAYER")
local moduleTable = alya.modules.register("Sprint", "Auto-Sprint", "MOVEMENT")
local omniSprint = moduleTable.addBooleanSetting("OmniSprint", "Sprint in all directions", false)

alya.events.on("playerinput", function(event)
Expand Down
34 changes: 17 additions & 17 deletions src/main/resources/lua/modules/player/fucker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ local currentPitch = 0
local rotationSpeed = 0.15

local bedBlockIds = {
[26] = true, -- bed
[355] = true, -- bed (white)
[26] = true, -- bed
[355] = true, -- bed (white)
}

local function isTargetBlock(block)
Expand Down Expand Up @@ -72,12 +72,12 @@ local function findPathToTarget(targetX, targetY, targetZ)
end

local neighbors = {
{ x = current.x + 1, y = current.y, z = current.z },
{ x = current.x - 1, y = current.y, z = current.z },
{ x = current.x, y = current.y, z = current.z + 1 },
{ x = current.x, y = current.y, z = current.z - 1 },
{ x = current.x, y = current.y + 1, z = current.z },
{ x = current.x, y = current.y - 1, z = current.z },
{ x = current.x + 1, y = current.y, z = current.z },
{ x = current.x - 1, y = current.y, z = current.z },
{ x = current.x, y = current.y, z = current.z + 1 },
{ x = current.x, y = current.y, z = current.z - 1 },
{ x = current.x, y = current.y + 1, z = current.z },
{ x = current.x, y = current.y - 1, z = current.z },
}

for _, neighbor in ipairs(neighbors) do
Expand Down Expand Up @@ -138,14 +138,14 @@ local function getRotationToBlock(x, y, z)
local playerX = alya.mc.getPlayerX()
local playerY = alya.mc.getPlayerY() + 1.5
local playerZ = alya.mc.getPlayerZ()

local dx = x + 0.5 - playerX
local dy = y + 0.5 - playerY
local dz = z + 0.5 - playerZ

local yaw = math.atan2(-dx, dz) * (180 / math.pi)
local pitch = math.atan2(dy, math.sqrt(dx * dx + dz * dz)) * (180 / math.pi)

return yaw, pitch
end

Expand Down Expand Up @@ -238,12 +238,12 @@ alya.events.on("motion", function(event)
if #pathBlocks > 0 then
local nextBlock = pathBlocks[1]
local targetYaw, targetPitch = getRotationToBlock(nextBlock.x, nextBlock.y, nextBlock.z)

currentYaw = lerpAngle(currentYaw, targetYaw, rotationSpeed)
currentPitch = lerpAngle(currentPitch, targetPitch, rotationSpeed)

alya.combat.setClientRotation(currentYaw, currentPitch)

if hasLineOfSight(nextBlock.x, nextBlock.y, nextBlock.z) then
alya.mc.sendRotation(currentYaw, currentPitch)
breakBlockInstant(nextBlock.x, nextBlock.y, nextBlock.z)
Expand All @@ -261,11 +261,11 @@ alya.events.on("render3d", function(event)
if not moduleTable.isEnabled() then return end
if not highlight.isEnabled() then return end
if not targetBlockPos then return end

local x = targetBlockPos.x
local y = targetBlockPos.y
local z = targetBlockPos.z

local color = alya.visual.toARGB(255, 255, 0, 0)
alya.visual.drawBox3D(x + 0.5, y + 0.5, z + 0.5, 1, 1, color, 2.0)
end)
end)
Loading