Add IPC to templates and handle helper function server

This commit is contained in:
Cooldude2606 committed 2024-01-24 00:40:22 +00:00
1 parent 2916dcc58c
commit 58231cc02c
11 files changed
+78 -19

No files matched your search

@@ -14,7 +14,10 @@ MyModule.events[clusterio_api.events.on_server_startup] = function(event)
end
MyModule.events[defines.events.on_player_crafted_item] = function(event)
game.print(game.table_to_json(event))
game.print(game.table_to_json(event))// [instance] //
clusterio_api.send_json("// plugin_name //-plugin_example_ipc", {
tick = game.tick, player_name = game.get_player(event.player_index).name
})// [] //
end
MyModule.on_nth_tick[300] = function()
@@ -4,7 +4,7 @@
"control.lua"
],
"require": [
// [instance] //"module_exports.lua"// [] //
],
"dependencies": [
@@ -1,2 +1,7 @@
local MyModule = require("./control")// [instance] //
return require("./control")
-- Can contain anything you plan to use with send_rcon from functions, modules, or data
ipc_// plugin_name // = MyModule// [] //
-- Can contain anything you want to allow other plugins to have access to, this example exposes the whole module
return MyModule