Merge branch 'master' of repo.or.cz:waspsaliva
This commit is contained in:
commit
a7e6ce6493
@ -1,10 +1,12 @@
|
|||||||
autoeat = {}
|
autoeat = {}
|
||||||
|
autoeat.last = 0
|
||||||
local last_step_eating = false
|
local last_step_eating = false
|
||||||
|
autoeat.interval = 1
|
||||||
|
|
||||||
function autoeat.eat()
|
function autoeat.eat()
|
||||||
local player = minetest.localplayer
|
local player = minetest.localplayer
|
||||||
local owx=player:get_wield_index()
|
local owx=player:get_wield_index()
|
||||||
|
autoeat.eating = true
|
||||||
player:set_wield_index(8)
|
player:set_wield_index(8)
|
||||||
minetest.place_node(player:get_pos())
|
minetest.place_node(player:get_pos())
|
||||||
minetest.after("0.2",function()
|
minetest.after("0.2",function()
|
||||||
@ -12,10 +14,15 @@ function autoeat.eat()
|
|||||||
end)
|
end)
|
||||||
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()
|
minetest.register_on_damage_taken(function()
|
||||||
if not minetest.settings:get_bool("autoeat") then return end
|
if not minetest.settings:get_bool("autoeat") then return end
|
||||||
autoeat.eat()
|
autoeat.eat()
|
||||||
autoeat.eating = true
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_globalstep(function()
|
minetest.register_globalstep(function()
|
||||||
@ -25,6 +32,15 @@ minetest.register_globalstep(function()
|
|||||||
last_step_eating = true
|
last_step_eating = true
|
||||||
end
|
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)
|
end)
|
||||||
|
|
||||||
minetest.register_cheat("AutoEat", "Player", "autoeat")
|
minetest.register_cheat("AutoEat", "Player", "autoeat")
|
||||||
|
minetest.register_cheat("AutoEatTimed", "Player", "autoeat_timed")
|
||||||
|
@ -54,6 +54,7 @@ local storage = minetest.get_mod_storage()
|
|||||||
local wpr=false;
|
local wpr=false;
|
||||||
local twpname=nil
|
local twpname=nil
|
||||||
local oldpm=false
|
local oldpm=false
|
||||||
|
local lpos={x=0,y=0,z=0}
|
||||||
local info=minetest.get_server_info()
|
local info=minetest.get_server_info()
|
||||||
local stprefix="autofly-".. info['address'] .. '-'
|
local stprefix="autofly-".. info['address'] .. '-'
|
||||||
|
|
||||||
@ -87,11 +88,13 @@ end
|
|||||||
|
|
||||||
minetest.register_globalstep(function()
|
minetest.register_globalstep(function()
|
||||||
autofly.checkfall()
|
autofly.checkfall()
|
||||||
if minetest.settings:get_bool("autosprint") 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)
|
|
||||||
elseif minetest.settings:get_bool("continuous_forward") and minetest.settings:get_bool("autofsprint") then
|
|
||||||
core.set_keypress("special1", true)
|
core.set_keypress("special1", true)
|
||||||
|
else
|
||||||
|
core.set_keypress("special1", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if not minetest.localplayer then return end
|
if not minetest.localplayer then return end
|
||||||
if not twpname then
|
if not twpname then
|
||||||
autofly.set_hud_info("")
|
autofly.set_hud_info("")
|
||||||
@ -117,6 +120,7 @@ minetest.register_globalstep(function()
|
|||||||
if lpos then
|
if lpos then
|
||||||
local dst=vector.distance(minetest.localplayer:get_pos(),lpos)
|
local dst=vector.distance(minetest.localplayer:get_pos(),lpos)
|
||||||
speed=round2(dst,1)
|
speed=round2(dst,1)
|
||||||
|
autofly.speed=speed
|
||||||
end
|
end
|
||||||
lpos=minetest.localplayer:get_pos()
|
lpos=minetest.localplayer:get_pos()
|
||||||
end)
|
end)
|
||||||
@ -216,6 +220,8 @@ function autofly.goto_waypoint(name)
|
|||||||
oldpm=minetest.settings:get_bool("pitch_move")
|
oldpm=minetest.settings:get_bool("pitch_move")
|
||||||
minetest.settings:set_bool("pitch_move",true)
|
minetest.settings:set_bool("pitch_move",true)
|
||||||
minetest.settings:set_bool("continuous_forward",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_coords = autofly.get_waypoint(name)
|
||||||
autofly.last_name = name
|
autofly.last_name = name
|
||||||
autofly.set_hud_info(name)
|
autofly.set_hud_info(name)
|
||||||
@ -228,7 +234,9 @@ end
|
|||||||
function autofly.arrived()
|
function autofly.arrived()
|
||||||
minetest.settings:set("continuous_forward", "false")
|
minetest.settings:set("continuous_forward", "false")
|
||||||
minetest.settings:set_bool("pitch_move",oldpm)
|
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")
|
autofly.set_hud_info("Arrived at destination")
|
||||||
minetest.localplayer:hud_change(hud_info,'text',twpname .. "\n" .. "Arrived at destination.")
|
minetest.localplayer:hud_change(hud_info,'text',twpname .. "\n" .. "Arrived at destination.")
|
||||||
wpr=false
|
wpr=false
|
||||||
|
@ -26,7 +26,6 @@ function autofly.display_formspec()
|
|||||||
'button[2.125,7.5;1.2,0.5;warpae;w+e]' ..
|
'button[2.125,7.5;1.2,0.5;warpae;w+e]' ..
|
||||||
'button[2.625,7.5;1.3,0.5;rename;Rename]' ..
|
'button[2.625,7.5;1.3,0.5;rename;Rename]' ..
|
||||||
'button[3.9375,7.5;1.3,0.5;delete;Delete]' ..
|
'button[3.9375,7.5;1.3,0.5;delete;Delete]' ..
|
||||||
'image[50,50;100,100;"test"]'..
|
|
||||||
'textlist[0,0.75;5,6;marker;'
|
'textlist[0,0.75;5,6;marker;'
|
||||||
|
|
||||||
-- Iterate over all the waypoints
|
-- Iterate over all the waypoints
|
||||||
|
@ -6,6 +6,7 @@ core.cheats = {
|
|||||||
["AttachmentFloat"] = "float_above_parent",
|
["AttachmentFloat"] = "float_above_parent",
|
||||||
["CrystalPvP"] = "crystal_pvp",
|
["CrystalPvP"] = "crystal_pvp",
|
||||||
["AutoTotem"] = "autototem",
|
["AutoTotem"] = "autototem",
|
||||||
|
["GoddessMode"] = "goddess",
|
||||||
["ThroughWalls"] = "dont_point_nodes",
|
["ThroughWalls"] = "dont_point_nodes",
|
||||||
},
|
},
|
||||||
["Movement"] = {
|
["Movement"] = {
|
||||||
@ -38,7 +39,8 @@ core.cheats = {
|
|||||||
["ScaffoldPlus"] = "scaffold_plus",
|
["ScaffoldPlus"] = "scaffold_plus",
|
||||||
["BlockWater"] = "block_water",
|
["BlockWater"] = "block_water",
|
||||||
["PlaceOnTop"] = "autotnt",
|
["PlaceOnTop"] = "autotnt",
|
||||||
["Replace"] = "replace"
|
["Replace"] = "replace",
|
||||||
|
["Random SC"] = "randomsc"
|
||||||
},
|
},
|
||||||
["Exploit"] = {
|
["Exploit"] = {
|
||||||
["EntitySpeed"] = "entity_speed",
|
["EntitySpeed"] = "entity_speed",
|
||||||
|
@ -30,7 +30,7 @@ core.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
core.register_list_command("eject", "Configure AutoEject", "eject_items")
|
--core.register_list_command("eject", "Configure AutoEject", "eject_items")
|
||||||
|
|
||||||
-- AutoTool
|
-- AutoTool
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user