end,
})
-core.register_chatcommand("findnodes", {
- description = "Scan for one or multible nodes in a radius around you",
- param = "<radius> <node1>[,<node2>...]",
- func = function(param)
- local radius = tonumber(param:split(" ")[1])
- local nodes = param:split(" ")[2]:split(",")
- local pos = core.localplayer:get_pos()
- local fpos = core.find_node_near(pos, radius, nodes, true)
- if fpos then
- return true, "Found " .. table.concat(nodes, " or ") .. " at " .. core.pos_to_string(fpos)
- end
- return false, "None of " .. table.concat(nodes, " or ") .. " found in a radius of " .. tostring(radius)
- end,
-})
-
core.register_chatcommand("place", {
params = "<X>,<Y>,<Z>",
description = "Place wielded item",
return false, pos
end,
})
+
+core.register_chatcommand("setyaw", {
+ params = "<yaw>",
+ description = "Set your yaw",
+ func = function(param)
+ local yaw = tonumber(param)
+ if yaw then
+ core.localplayer:set_yaw(yaw)
+ return true
+ else
+ return false, "Invalid usage (See /help setyaw)"
+ end
+ end
+})
+
+core.register_chatcommand("setpitch", {
+ params = "<pitch>",
+ description = "Set your pitch",
+ func = function(param)
+ local pitch = tonumber(param)
+ if pitch then
+ core.localplayer:set_pitch(pitch)
+ return true
+ else
+ return false, "Invalid usage (See /help setpitch)"
+ end
+ end
+})
--- autosneak
+local function register_keypress_cheat(cheat, keyname)
+ local was_enabled = false
+ core.register_globalstep(function()
+ if core.settings:get_bool(cheat) then
+ was_enabled = true
+ core.set_keypress(keyname, true)
+ elseif was_enabled then
+ was_enabled = false
+ core.set_keypress(keyname, false)
+ end
+ end)
+end
-local autosneak_was_enabled = false
-
-core.register_globalstep(function()
- if core.settings:get_bool("autosneak") then
- core.set_keypress("sneak", true)
- autosneak_was_enabled = true
- elseif autosneak_was_enabled then
- autosneak_was_enabled = false
- core.set_keypress("sneak", false)
- end
-end)
-
+register_keypress_cheat("autosneak", "sneak")
+register_keypress_cheat("autosprint", "special1")
settings->setDefault("enable_node_tracers", "false");
settings->setDefault("node_esp_nodes", "");
settings->setDefault("only_trace_players", "false");
+ settings->setDefault("autosprint", "false");
// Keymap
settings->setDefault("remote_port", "30000");