mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-26 03:52:00 +02:00
Brought hodor back. Again
This commit is contained in:
parent
5c27ab6013
commit
0d85e7994a
34
control.lua
34
control.lua
@ -24,15 +24,37 @@ require "tasklist"
|
|||||||
|
|
||||||
local function player_joined(event)
|
local function player_joined(event)
|
||||||
local player = game.players[event.player_index]
|
local player = game.players[event.player_index]
|
||||||
player.insert { name = "raw-fish", count = 4 }
|
player.insert { name = "raw-fish", count = 4 }
|
||||||
player.insert { name = "iron-gear-wheel", count = 8 }
|
player.insert { name = "iron-gear-wheel", count = 8 }
|
||||||
player.insert { name = "iron-plate", count = 16 }
|
player.insert { name = "iron-plate", count = 16 }
|
||||||
player.print("Welcome to our Server. You can join our Discord at: discord.me/redmew")
|
player.print("Welcome to our Server. You can join our Discord at: discord.me/redmew")
|
||||||
player.print("And remember.. Keep Calm And Spaghetti!")
|
player.print("And remember.. Keep Calm And Spaghetti!")
|
||||||
end
|
end
|
||||||
|
|
||||||
function walkabout(player_name, distance)
|
function walkabout(player_name, distance)
|
||||||
game.player.print("This command moved to /walkabout.")
|
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
|
||||||
|
for _,w in pairs(hodor_messages) do
|
||||||
|
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)
|
||||||
|
local message_weight_sum = 0
|
||||||
|
for _,m in pairs(hodor_messages) do
|
||||||
|
message_weight_sum = message_weight_sum + m[2]
|
||||||
|
if message_weight_sum >= index then
|
||||||
|
game.print("Hodor: " .. m[1])
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Event.register(defines.events.on_player_created, player_joined)
|
Event.register(defines.events.on_player_created, player_joined)
|
||||||
|
Event.register(defines.events.on_console_chat, hodor)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user