Initial Commit
commit
bb9f774081
|
@ -0,0 +1,2 @@
|
||||||
|
# autokey
|
||||||
|
A dragonfire CSM to automatically press keys (Includes AutoSneak and AutoSprint)
|
|
@ -0,0 +1,21 @@
|
||||||
|
autokey = {}
|
||||||
|
|
||||||
|
function autokey.register_keypress_cheat(setting, desc, category, keyname, condition)
|
||||||
|
local was_active = false
|
||||||
|
minetest.register_globalstep(function()
|
||||||
|
local is_active = minetest.settings:get_bool(setting) and (not condition or condition())
|
||||||
|
if is_active then
|
||||||
|
minetest.set_keypress(keyname, true)
|
||||||
|
elseif was_active then
|
||||||
|
minetest.set_keypress(keyname, false)
|
||||||
|
end
|
||||||
|
was_active = is_active
|
||||||
|
end)
|
||||||
|
minetest.register_cheat(desc, category, setting)
|
||||||
|
end
|
||||||
|
|
||||||
|
autokey.register_keypress_cheat("autosneak", "AutoSneak", "Movement", "sneak", function()
|
||||||
|
return core.localplayer:is_touching_ground()
|
||||||
|
end)
|
||||||
|
|
||||||
|
autokey.register_keypress_cheat("autosprint", "AutoSneak", "Movement", "special1")
|
|
@ -0,0 +1,3 @@
|
||||||
|
name = autokey
|
||||||
|
author = Fleckenstein
|
||||||
|
description = A dragonfire CSM to automatically press keys (Includes AutoSneak and AutoSprint)
|
|
@ -0,0 +1,2 @@
|
||||||
|
autosneak (AutoSneak) bool false
|
||||||
|
autosprint (AutoSprint) bool false
|
Loading…
Reference in New Issue