2017-06-13 13:16:07 +02:00
|
|
|
require "util"
|
|
|
|
require "locale/utils/event"
|
|
|
|
require "config"
|
|
|
|
require "locale/utils/utils"
|
2017-09-02 14:58:18 +02:00
|
|
|
require "locale/utils/list_utils"
|
2017-06-13 13:16:07 +02:00
|
|
|
require "base_data"
|
2017-07-09 15:20:01 +02:00
|
|
|
require "user_groups"
|
2017-06-13 13:16:07 +02:00
|
|
|
require "info"
|
2017-06-30 17:10:19 +02:00
|
|
|
require "player_list"
|
2017-06-13 13:16:07 +02:00
|
|
|
require "poll"
|
|
|
|
require "band"
|
|
|
|
require "fish_market"
|
|
|
|
require "train_station_names"
|
|
|
|
require "score"
|
|
|
|
require "map_layout"
|
2017-07-08 22:24:24 +02:00
|
|
|
require "nuke_control"
|
2017-07-19 02:04:41 +02:00
|
|
|
require "walk_distance"
|
2017-07-21 18:43:34 +02:00
|
|
|
require "on_tick"
|
2017-07-25 01:20:59 +02:00
|
|
|
require "follow"
|
2017-09-02 15:42:37 +02:00
|
|
|
require "wells"
|
|
|
|
require "custom_commands"
|
2017-09-24 14:17:10 +02:00
|
|
|
require "tasklist"
|
2017-10-01 15:58:10 +02:00
|
|
|
require "autodeconstruct"
|
2017-11-25 23:11:19 +02:00
|
|
|
require "corpse_util"
|
2017-12-21 17:37:02 +02:00
|
|
|
require "reactor_meltdown"
|
2017-06-13 13:16:07 +02:00
|
|
|
|
2017-09-25 16:12:26 +02:00
|
|
|
local function player_joined(event)
|
2017-06-13 13:16:07 +02:00
|
|
|
local player = game.players[event.player_index]
|
2017-09-30 15:49:04 +02:00
|
|
|
player.insert { name = "raw-fish", count = 4 }
|
|
|
|
player.insert { name = "iron-gear-wheel", count = 8 }
|
|
|
|
player.insert { name = "iron-plate", count = 16 }
|
2017-11-28 17:00:08 +02:00
|
|
|
player.print("Welcome to our Server. You can join our Discord at: redmew.com/discord")
|
2017-09-30 15:49:04 +02:00
|
|
|
player.print("And remember.. Keep Calm And Spaghetti!")
|
2017-06-13 13:16:07 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function walkabout(player_name, distance)
|
2017-09-30 15:49:04 +02:00
|
|
|
game.player.print("This command moved to /walkabout.")
|
|
|
|
end
|
|
|
|
|
|
|
|
local hodor_messages = {{"Hodor.", 16}, {"Hodor?", 16},{"Hodor!", 16}, {"Hodor! Hodor! Hodor! Hodor!", 4}, {"Hodor :(",4}, {"Hodor :)",4}, {"HOOOODOOOR!", 4}, {"( ͡° ͜ʖ ͡°)",1}, {"☉ ‿ ⚆",1}}
|
|
|
|
local message_weight_sum = 0
|
2017-10-01 15:58:10 +02:00
|
|
|
for _,w in pairs(hodor_messages) do
|
2017-09-30 15:49:04 +02:00
|
|
|
message_weight_sum = message_weight_sum + w[2]
|
|
|
|
end
|
|
|
|
|
|
|
|
function hodor(event)
|
|
|
|
local message = event.message:lower()
|
|
|
|
if message:match("hodor") then
|
|
|
|
local index = math.random(1, message_weight_sum)
|
2017-10-01 15:58:10 +02:00
|
|
|
local message_weight_sum = 0
|
2017-09-30 15:49:04 +02:00
|
|
|
for _,m in pairs(hodor_messages) do
|
|
|
|
message_weight_sum = message_weight_sum + m[2]
|
2017-10-01 15:58:10 +02:00
|
|
|
if message_weight_sum >= index then
|
2017-09-30 15:49:04 +02:00
|
|
|
game.print("Hodor: " .. m[1])
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2017-11-28 17:00:08 +02:00
|
|
|
if message:match("discord") then
|
2017-11-02 18:41:54 +02:00
|
|
|
if game.player then
|
|
|
|
game.player.print("Did you ask about our discord server?")
|
2017-11-28 17:00:08 +02:00
|
|
|
game.player.print("You can find it here: redmew/discord")
|
2017-11-02 18:41:54 +02:00
|
|
|
end
|
|
|
|
end
|
2017-06-13 13:16:07 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Event.register(defines.events.on_player_created, player_joined)
|
2017-09-30 15:49:04 +02:00
|
|
|
Event.register(defines.events.on_console_chat, hodor)
|