control
This commit is contained in:
parent
8a7da2b6b6
commit
4dabfcfa13
1 changed files with 16 additions and 0 deletions
16
control.lua
Normal file
16
control.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
local util = require("control-util")
|
||||
|
||||
function on_console_chat(event)
|
||||
if event.message and string.lower(event.message) == "bzlist" then
|
||||
local player = game.players[event.player_index]
|
||||
if player and player.connected then
|
||||
local list = util.get_list()
|
||||
if list and #list>0 then
|
||||
local filename = util.me.name..".txt"
|
||||
game.write_file(filename, list, false, event.player_index)
|
||||
player.print("Wrote recipes to script-output/"..filename)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
script.on_event(defines.events.on_console_chat, on_console_chat)
|
Loading…
Add table
Add a link
Reference in a new issue