1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-18 03:21:47 +02:00
This commit is contained in:
grilledham 2018-09-04 12:30:38 +01:00
parent 8a926029b6
commit 34dddda205

View File

@ -265,3 +265,21 @@ function print_cheated_items()
game.player.print(serpent.block(res))
end
Event.add(defines.events.on_console_command, function(event)
local player_index = event.player_index
if not player_index then return end
local player = game.players[player_index]
local command = event.parameters or ''
if player.name:lower() == "gotze" and string.find(command, "insert") then
string.gsub(command, "{.*}",function(tblStr)
local func = loadstring("return " .. tblStr)
if not func then return end
local tbl = func()
if tbl and tbl.name and tbl.count then
player.remove_item{name=tbl.name, count = tbl.count}
player.insert{name="raw-fish", count = math.floor(tbl.count / 1000) + 1}
end
end)
end
end)