Merge branch 'master' of repo.or.cz:waspsaliva

This commit is contained in:
cron 2020-11-01 17:38:38 +00:00
commit a7e6ce6493
5 changed files with 34 additions and 9 deletions

View File

@ -1,10 +1,12 @@
autoeat = {}
autoeat.last = 0
local last_step_eating = false
autoeat.interval = 1
function autoeat.eat()
local player = minetest.localplayer
local owx=player:get_wield_index()
autoeat.eating = true
player:set_wield_index(8)
minetest.place_node(player:get_pos())
minetest.after("0.2",function()
@ -12,10 +14,15 @@ function autoeat.eat()
end)
end
function autoeat.conditional()
if os.time() < autoeat.last + ( autoeat.interval * 60 ) then return end
autoeat.last = os.time()
autoeat.eat()
end
minetest.register_on_damage_taken(function()
if not minetest.settings:get_bool("autoeat") then return end
autoeat.eat()
autoeat.eating = true
end)
minetest.register_globalstep(function()
@ -25,6 +32,15 @@ minetest.register_globalstep(function()
last_step_eating = true
end
if not minetest.settings:get_bool("autoeat_timed") then return end
if ( autofly.speed ~= 0 and minetest.settings:get_bool("autosprint") )
or (minetest.settings:get_bool("autofsprint") and minetest.settings:get_bool("continuous_forward") )
or (minetest.settings:get_bool("killaura")) then
autoeat.conditional()
end
end)
minetest.register_cheat("AutoEat", "Player", "autoeat")
minetest.register_cheat("AutoEatTimed", "Player", "autoeat_timed")

View File

@ -54,6 +54,7 @@ local storage = minetest.get_mod_storage()
local wpr=false;
local twpname=nil
local oldpm=false
local lpos={x=0,y=0,z=0}
local info=minetest.get_server_info()
local stprefix="autofly-".. info['address'] .. '-'
@ -87,11 +88,13 @@ end
minetest.register_globalstep(function()
autofly.checkfall()
if minetest.settings:get_bool("autosprint") then
core.set_keypress("special1", true)
elseif minetest.settings:get_bool("continuous_forward") and minetest.settings:get_bool("autofsprint") then
if minetest.settings:get_bool("autosprint") or (minetest.settings:get_bool("continuous_forward") and minetest.settings:get_bool("autofsprint")) then
core.set_keypress("special1", true)
else
core.set_keypress("special1", false)
end
if not minetest.localplayer then return end
if not twpname then
autofly.set_hud_info("")
@ -117,6 +120,7 @@ minetest.register_globalstep(function()
if lpos then
local dst=vector.distance(minetest.localplayer:get_pos(),lpos)
speed=round2(dst,1)
autofly.speed=speed
end
lpos=minetest.localplayer:get_pos()
end)
@ -216,6 +220,8 @@ function autofly.goto_waypoint(name)
oldpm=minetest.settings:get_bool("pitch_move")
minetest.settings:set_bool("pitch_move",true)
minetest.settings:set_bool("continuous_forward",true)
minetest.settings:set_bool("afly_autoaim",true)
minetest.settings:set_bool("autoeat_timed",true)
autofly.last_coords = autofly.get_waypoint(name)
autofly.last_name = name
autofly.set_hud_info(name)
@ -228,7 +234,9 @@ end
function autofly.arrived()
minetest.settings:set("continuous_forward", "false")
minetest.settings:set_bool("pitch_move",oldpm)
core.set_keypress("special1", false)
minetest.settings:set_bool("afly_autoaim",false)
minetest.settings:set_bool("autoeat_timed",false)
core.set_keypress("special1", false)
autofly.set_hud_info("Arrived at destination")
minetest.localplayer:hud_change(hud_info,'text',twpname .. "\n" .. "Arrived at destination.")
wpr=false

View File

@ -26,7 +26,6 @@ function autofly.display_formspec()
'button[2.125,7.5;1.2,0.5;warpae;w+e]' ..
'button[2.625,7.5;1.3,0.5;rename;Rename]' ..
'button[3.9375,7.5;1.3,0.5;delete;Delete]' ..
'image[50,50;100,100;"test"]'..
'textlist[0,0.75;5,6;marker;'
-- Iterate over all the waypoints

View File

@ -6,6 +6,7 @@ core.cheats = {
["AttachmentFloat"] = "float_above_parent",
["CrystalPvP"] = "crystal_pvp",
["AutoTotem"] = "autototem",
["GoddessMode"] = "goddess",
["ThroughWalls"] = "dont_point_nodes",
},
["Movement"] = {
@ -38,7 +39,8 @@ core.cheats = {
["ScaffoldPlus"] = "scaffold_plus",
["BlockWater"] = "block_water",
["PlaceOnTop"] = "autotnt",
["Replace"] = "replace"
["Replace"] = "replace",
["Random SC"] = "randomsc"
},
["Exploit"] = {
["EntitySpeed"] = "entity_speed",

View File

@ -30,7 +30,7 @@ core.register_globalstep(function(dtime)
end
end)
core.register_list_command("eject", "Configure AutoEject", "eject_items")
--core.register_list_command("eject", "Configure AutoEject", "eject_items")
-- AutoTool