4 local cpos
=vector
.new(0,0,0)
6 local zz
=vector
.new(42,42,42)
7 local badnodes
={'mcl_tnt:tnt','mcl_fire:basic_flame','mcl_fire:fire','mcl_banners:hanging_banner','mcl_banners:standing_banner','mcl_fire:fire_charge','mcl_sponges:sponge','mcl_sponges:sponge_wet','mcl_nether:soul_sand','mcl_heads:wither_skeleton'}
8 local badobs
={'mcl_end_crystal','arrow_box','mobs_mc_wither.png'}
13 local function set_kwp(name
,pos
)
15 minetest
.localplayer
:hud_change(hud_wp
, 'world_pos', pos
)
16 minetest
.localplayer
:hud_change(hud_wp
, 'name', name
)
18 hud_wp
= minetest
.localplayer
:hud_add({
19 hud_elem_type
= 'waypoint',
28 local function randomzz()
29 if nextzz
> os
.clock() then return false end
30 math
.randomseed(os
.time())
31 zz
.x
=math
.random(-128,129)
32 zz
.y
=math
.random(0,searchheight
)
33 zz
.z
=math
.random(-128,128)
36 local function find_ob(txts
)
39 local obs
=minetest
.localplayer
.get_nearby_objects(500)
40 for k
, v
in ipairs(obs
) do
41 for kk
,txt
in pairs(txts
) do
42 if ( v
:get_item_textures():find(txt
) ) then
43 local npos
=v
:get_pos()
44 local dst
=vector
.distance(npos
,minetest
.localplayer
:get_pos())
46 searchtxt
=v
:get_item_textures()
48 set_kwp(searchtxt
,v
:get_pos())
60 local function find_nd(names
)
61 local lp
=minetest
.localplayer
:get_pos()
62 local epos
=minetest
.find_nodes_near(lp
,60,names
,true)
66 for k
,v
in pairs(epos
) do
67 local node
=minetest
.get_node_or_nil(v
)
68 local lp
=minetest
.localplayer
:get_pos()
69 local dst
=vector
.distance(lp
,v
)
82 local function find_bad_things()
83 if fnd
then return true end
84 local lp
=minetest
.localplayer
:get_pos()
85 local ob
=find_ob(badobs
)
86 if not ob
then ob
=find_nd(badnodes
) end
88 set_kwp('nothing found',zz
)
98 local function flythere()
99 if not minetest
.localplayer
then return end
100 if not cpos
then return end
102 minetest
.settings
:set_bool("killaura",false)
103 if incremental_tp
.tpactive
then return end
104 local lp
=minetest
.localplayer
:get_pos()
105 local dst
=vector
.distance(lp
,cpos
)
106 if tob
and tob
:get_item_textures() == searchtxt
then
107 dst
=vector
.distance(lp
,tob
:get_pos())
109 set_kwp(searchtxt
,cpos
)
111 minetest
.settings
:set_bool("continuous_forward",true)
115 local function stopflight()
116 local lp
= minetest
.localplayer
:get_pos()
117 local dst
=vector
.distance(lp
,cpos
)
118 minetest
.settings
:set_bool("continuous_forward",false)
119 if tob
and tob
:get_item_textures():find(searchtxt
) then
120 if searchtxt
== 'mcl_end_crystal.png' then
121 minetest
.dig_node(cpos
)
123 minetest
.interact('start_digging')
127 minetest
.settings
:set_bool("killaura",true)
136 ws
.rg('Kamikaze','Bots','kamikaze', function()
137 local lp
= minetest
.localplayer
:get_pos()
138 local dst
=vector
.distance(lp
,cpos
)
140 if not find_bad_things() then
141 if vector
.distance(lp
,zz
) < 1 then
153 -- ws.dignodes(minetest.find_nodes_near(minetest.localplayer:get_pos(),5,badnodes,true))
155 minetest
.dig_node(cpos
)
156 --minetest.interact('start_digging')
161 core
.set_keypress("special1", true)
164 kamikaze
.active
=false
165 core
.set_keypress("special1", false)
168 minetest
.localplayer
:hud_remove(hud_wp
)
171 end,{"noclip","pitch_move","dighead","digbadnodes"})
175 minetest
.register_on_death(function()
176 if not minetest
.settings
:get_bool("kamikaze") then return end
178 -- incremental_tp.tpactive=false
179 minetest
.after("5.0",function()
184 ws
.on_connect(function()
185 minetest
.settings
:set_bool("kamikaze",false)
186 --if minetest.localplayer and minetest.localplayer:get_name():find("kamikaze") then
187 -- minetest.settings:set_bool("kamikaze",true)
188 --else minetest.settings:set_bool("kamikaze",false)
192 minetest
.register_cheat('KamiCrystals','Bots','kamikaze_crystals')