Make commands display in game chat (#297)

* Update friendly-fire.lua

* Update research.lua

* Update friendly-fire.lua

* Update speed.lua

* Update cheat-mode.lua

* Update bot-queue.lua

* Update train.lua

* Update pollution.lua

* Update commands.cfg

* Update commands.cfg

* Update commands.cfg

* Update cheat-mode.lua

* Update research.lua

* Update commands.cfg

* Update commands.cfg

* Update commands.cfg
This commit is contained in:
2024-06-06 03:33:56 +09:00
committed by GitHub
parent 8638504550
commit 779adff212
10 changed files with 48 additions and 36 deletions

View File

@@ -113,26 +113,27 @@ results-item=__1__) __2__ has __3__ items. (__4__)
results-none=No players have [item=__1__]
[expcom-speed]
result=The game speed is now __1__
result=__1__ set the game speed to __2__
[expcom-bot-queue]
result=The successful attempts are currently __1__ and failed attempts are __2__.
result=__1__ set the bot queue to __1__ successful attempts and __2__ failed attempts
[expcom-pol]
clr=The server had pollution **REMOVED** by __1__. Please @staff on the discord if this was done by mistake.
off=The server had pollution **DISABLED** by __1__. Please @staff on the discord if this was done by mistake.
clr=__1__ removed the pollution.
off=__1__ disabled the pollution.
[expcom-train]
manual-result=Set __1__ trains into automatic mode.
manual-result=__1__ put __2__ trains into automatic mode
[expcom-cheat]
day=Always day is set to __1__
res=__1__ has enabled all technologies
day=__1__ set always day to __2__
[expcom-ff]
ff=Friendly fire is set to __1__
ff=__1__ set friendly fire to __2__
[expcom-res]
res=Auto Research is set to __1__
res=__1__ set auto research to __2__
msg=[color=255, 255, 255] Research Completed at __1__ - [technology=__2__][/color]
inf=[color=255, 255, 255] Research Completed at __1__ - [technology=__2__] - __3__[/color]
inf-q=[color=255, 255, 255] Research Added to Queue - [technology=__1__] - __2__[/color]

View File

@@ -113,26 +113,27 @@ results-item=__1__) __2__ 有 __3__ 個. (__4__)
results-none=沒用戶有 [item=__1__]
[expcom-speed]
result=The game speed is now __1__
result=__1__ set the game speed to __2__
[expcom-bot-queue]
result=The successful attempts are currently __1__ and failed attempts are __2__
result=__1__ set the bot queue to __1__ successful attempts and __2__ failed attempts
[expcom-pol]
clr=The server had pollution **REMOVED** by __1__. Please @staff on the discord if this was done by mistake.
off=The server had pollution **DISABLED** by __1__. Please @staff on the discord if this was done by mistake.
clr=__1__ removed the pollution.
off=__1__ disabled the pollution.
[expcom-train]
manual-result=Set __1__ train into automatic mode.
manual-result=__1__ put __2__ trains into automatic mode
[expcom-cheat]
day=Always day is set to __1__
res=__1__ has enabled all technologies
day=__1__ set always day to __2__
[expcom-ff]
ff=Friendly fire is set to __1__
ff=__1__ set friendly fire to __2__
[expcom-res]
res=Auto Research is set to __1__
res=__1__ set auto research to __2__
msg=[color=255, 255, 255] Research Completed at __1__ - [technology=__2__][/color]
inf=[color=255, 255, 255] Research Completed at __1__ - [technology=__2__] - __3__[/color]
inf-q=[color=255, 255, 255] Research Added to Queue - [technology=__1__] - __2__[/color]

View File

@@ -113,26 +113,27 @@ results-item=__1__) __2__ 有 __3__ 個. (__4__)
results-none=沒用戶有 [item=__1__]
[expcom-speed]
result=The game speed is now __1__
result=__1__ set the game speed to __2__
[expcom-bot-queue]
result=The successful attempts are currently __1__ and failed attempts are __2__
result=__1__ set the bot queue to __1__ successful attempts and __2__ failed attempts
[expcom-pol]
clr=The server had pollution **REMOVED** by __1__. Please @staff on the discord if this was done by mistake.
off=The server had pollution **DISABLED** by __1__. Please @staff on the discord if this was done by mistake.
clr=__1__ removed the pollution.
off=__1__ disabled the pollution.
[expcom-train]
manual-result=Set __1__ train into automatic mode.
manual-result=__1__ put __2__ trains into automatic mode
[expcom-cheat]
day=Always day is set to __1__
res=__1__ has enabled all technologies
day=__1__ set always day to __2__
[expcom-ff]
ff=Friendly fire is set to __1__
ff=__1__ set friendly fire to __2__
[expcom-res]
res=Auto Research is set to __1__
res=__1__ set auto research to __2__
msg=[color=255, 255, 255] Research Completed at __1__ - [technology=__2__][/color]
inf=[color=255, 255, 255] Research Completed at __1__ - [technology=__2__] - __3__[/color]
inf-q=[color=255, 255, 255] Research Added to Queue - [technology=__1__] - __2__[/color]

View File

@@ -20,5 +20,6 @@ Commands.new_command('bot-queue-set', 'Set bot queue')
:register(function(player, amount)
player.force.max_successful_attempts_per_tick_per_construction_queue = 3 * amount
player.force.max_failed_attempts_per_tick_per_construction_queue = 1 * amount
return Commands.success{'expcom-bot-queue.result', 3 * amount, 1 * amount}
game.print{'expcom-bot-queue.result', player.name, 3 * amount, 1 * amount}
return Commands.success
end)

View File

@@ -26,8 +26,9 @@ Commands.new_command('research-all', 'Set all research for your force.')
:set_defaults{force=function(player)
return player.force
end}
:register(function(_, force)
:register(function(player, force)
force.research_all_technologies()
game.print{'expcom-cheat.res', player.name}
return Commands.success
end)
@@ -37,7 +38,8 @@ Commands.new_command('toggle-always-day', 'Toggles always day in surface')
:set_defaults{surface=function(player)
return player.surface
end}
:register(function(_, surface)
:register(function(player, surface)
surface.always_day = not surface.always_day
return Commands.success{'expcom-cheat.day', surface.always_day}
game.print{'expcom-cheat.day', player.name, surface.always_day}
return Commands.success
end)

View File

@@ -12,7 +12,8 @@ Commands.new_command('toggle-friendly-fire', 'Toggle Friendly Fire')
:set_defaults{force=function(player)
return player.force
end}
:register(function(_, force)
:register(function(player, force)
force.friendly_fire = not force.friendly_fire
return Commands.success{'expcom-ff.ff', force.friendly_fire}
game.print{'expcom-ff.ff', player.name, force.friendly_fire}
return Commands.success
end)

View File

@@ -15,7 +15,8 @@ Commands.new_command('pollution-clear', 'Clear pollution')
end}
:register(function(player, surface)
surface.clear_pollution()
return Commands.success{'expcom-pol.clr', player.name}
game.print{'expcom-pol.clr', player.name}
return Commands.success
end)
Commands.new_command('pollution-off', 'Disable pollution')
@@ -28,5 +29,6 @@ Commands.new_command('pollution-off', 'Disable pollution')
v.clear_pollution()
end
return Commands.success{'expcom-pol.off', player.name}
game.print{'expcom-pol.off', player.name}
return Commands.success
end)

View File

@@ -103,5 +103,6 @@ Commands.new_command('auto-research', 'Automatically queue up research')
res_queue(player.force)
end
return game.print{'expcom-res.res', research.res_queue_enable}
game.print{'expcom-res.res', player.name, research.res_queue_enable}
return Commands.success
end)

View File

@@ -9,7 +9,8 @@ require 'config.expcore.command_general_parse'
Commands.new_command('game-speed', 'Set game speed')
:add_param('amount', 'number-range', 0.2, 1)
:set_flag('admin_only')
:register(function(_, amount)
:register(function(player, amount)
game.speed = math.round(amount, 3)
return Commands.success{'expcom-speed.result', string.format('%.3f', amount)}
game.print{'expcom-speed.result', player.name, string.format('%.3f', amount)}
return Commands.success
end)

View File

@@ -18,5 +18,6 @@ Commands.new_command('set-trains-to-automatic', 'Set All Trains to Automatic')
end
end
return Commands.success{'expcom-train.manual-result', format_number(count)}
game.print{'expcom-train.manual-result', player.name, format_number(count)}
return Commands.success
end)