forked from farrongoth/langton-ant-minetest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchatcommands.lua
39 lines (33 loc) · 1021 Bytes
/
chatcommands.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
minetest.register_privilege("langton_ant","Can use langton_ant commands");
minetest.register_privilege("langton_ant_global","Can use langton_ant commands");
minetest.register_chatcommand("lant_start", {
params = "",
description = "Start langton_ant process",
privs = {langton_ant=true},
func = function(name,params)
local player = minetest.get_player_by_name(name)
if not player then
return false, "Player not found"
end
langton_ant.register_new_ant(player)
end
})
minetest.register_chatcommand("lant_stop", {
params = "",
description = "Stop langton_ant process",
privs = {langton_ant=true},
func = function(name,params)
local player = minetest.get_player_by_name(name)
if not player then
return false, "Player not found"
end
langton_ant.unregister_ant(player)
end
})
minetest.register_chatcommand("lant_set", {
params = "",
description = "Stop langton_ant process",
privs = {langton_ant_global=true},
func = function(name,params)
end
})