Differences From
Artifact [41dac58ae7]:
8 8 local dumpout = ''
9 9 for i=1,string.len(binary) do
10 10 dumpout = dumpout .. string.format('%x%s',string.byte(binary,i),(i%16==0 and '\n') or ' ')
11 11 end
12 12 print(dumpout)
13 13 end;
14 14 })
15 +
16 +minetest.register_chatcommand('leynet', {
17 + description = 'Dump information about the ley-net in front of you';
18 + privs = { debug = true };
19 + func = function(caller,params)
20 + local user = minetest.get_player_by_name(caller)
21 + local pos = user:get_pos()
22 + local dir = user:get_look_dir()
23 + local nodes = minetest.raycast(pos,pos + (dir*5), false, false)
24 + for pt in nodes do
25 + local node = minetest.get_node(pt.under)
26 + if node.name ~= 'air' then
27 + print('mapping',pt.under,node.name)
28 + local n = minetest.registered_nodes[node.name]
29 + if minetest.get_item_group(node.name, 'sorcery_ley_device') ~= 0 then
30 + local l = sorcery.ley.netcaps(pt.under, 1, nil, 0)
31 + print('ley netcaps for pos',pt.under,dump(l))
32 + minetest.chat_send_player(caller, 'ley netcaps:' .. dump({
33 + freepower = l.freepower;
34 + maxpower = l.maxpower;
35 + self = l.self;
36 + devs = l.net.devices.consume;
37 + }))
38 + break
39 + end
40 + end
41 + end
42 + end;
43 +})
44 +
45 +
46 +minetest.register_chatcommand('leyline', {
47 + description = 'See details about local ley force';
48 + privs = { debug = true };
49 + func = function(caller,params)
50 + local pos = minetest.get_player_by_name(caller):get_pos()
51 + local ley = sorcery.ley.estimate(pos)
52 + minetest.chat_send_player(caller, 'Leyline force ' .. tostring(ley.force) .. ' with affinities ' .. table.concat(ley.aff, ','))
53 + end;
54 +})
15 55
16 56 -- minetest.register_chatcommand('hover', {
17 57 -- description = 'Test hover effect';
18 58 -- privs = { fly = true };
19 59 -- func = function(caller,params)
20 60 -- local player = minetest.get_player_by_name(caller)
21 61 -- late.new_effect(player, {