Added setpitch & setyaw commands; AutoSprint

This commit is contained in:
Elias Fleckenstein 2020-11-23 13:26:51 +01:00
parent 128ac35a91
commit 4dd5ecfc55
5 changed files with 46 additions and 28 deletions

View File

@ -134,21 +134,6 @@ core.register_chatcommand("set", {
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",
@ -174,3 +159,31 @@ core.register_chatcommand("dig", {
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
})

View File

@ -18,6 +18,7 @@ core.cheats = {
["Jesus"] = "jesus",
["NoSlow"] = "no_slow",
["AutoSneak"] = "autosneak",
["AutoSprint"] = "autosprint",
},
["Render"] = {
["Xray"] = "xray",

View File

@ -1,14 +1,15 @@
-- 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")

View File

@ -2353,3 +2353,5 @@ enable_node_tracers (NodeTracers) bool false
node_esp_nodes (NodeESP Nodes) string
only_trace_players (OnlyTracePlayers) bool false
autosprint (AutoSprint) bool false

View File

@ -135,6 +135,7 @@ void set_default_settings(Settings *settings)
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");