Skip to content

Instantly share code, notes, and snippets.

@laundmo
Last active February 19, 2020 09:22
Show Gist options
  • Save laundmo/ef9d6e2ed84ebf0fc221d4ffe5311615 to your computer and use it in GitHub Desktop.
Save laundmo/ef9d6e2ed84ebf0fc221d4ffe5311615 to your computer and use it in GitHub Desktop.
Automatically /ignore people in sending discord.gg links in minecraft

install

  • then this line will pop up

  • click on this button

  • untill it shows this symbol

  • then click this button and select chat

  • then click this button

  • in the window that pops up, you need to press create file

  • then double click the newly created file, it should now look liek this

  • then press edit

  • and paste the .lua script from below in there by clicking in the empty space and pressing ctrl + V

now it should be running and listening for all messages mentioning discord.gg. feel free to change the code where it says discord.gg to a message of your choice

local args = {...}
local mutex = newMutex("commands2")
msg = args[3]
local function stripFormatting(str)
return str:gsub("&.", "")
end
if not al_ig then al_ig = {} end
local function has_value (tab, val)
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end
if string.find(msg, "discord.gg") then
player = string.match(msg,".*<(.*)> .*")
player = stripFormatting(player)
mutex.lock()
if not has_value(al_ig, player) then
say(string.format("/ignore %s", player))
table.insert(al_ig, player)
sleep(500)
end
mutex.unlock()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment