Advertisement
LDDestroier

Untitled

Oct 12th, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --DLC = Dark_Lord_Chat
  2. --DLA = Dark_Lord_Announcer
  3.  
  4. restrictedPlayers = {
  5.     osmarks = true,
  6.     Keanu73 = true,
  7. }
  8.  
  9. restricted = false
  10. ignoreRestricted = true
  11.  
  12. rednet.open("top")
  13.  
  14. function returnBanned(player)
  15.   return restrictedPlayers[player] or false
  16. end
  17.  
  18. function mainLoop()
  19.   while true do
  20.     _, info = rednet.receive("DLC")
  21.  
  22.     if info ~= nil then
  23.       text = info[2]
  24.       usr = info[1]
  25.  
  26.       if ignoreRestricted == true and usr == "osmarks" then
  27.         restricted = true
  28.       else
  29.         restricted = false
  30.       end
  31.  
  32.       chat_string = string.sub(text, 1, (-string.len(text)) + 1)
  33.       command = string.sub(text, 3)
  34.    
  35.       if gollark == false and chat_string == "+ " then
  36.         if command == "support" then
  37.           rednet.broadcast("support is on the way.", "DLA")
  38.         elseif command == "help" then
  39.           rednet.broadcast("help is on the way.", "DLA")
  40.         elseif command == "ignoreGollark" then
  41.           ignoreGollarkArgs = string.sub(chat_string, (string.len(chat_string)-7))
  42.           if ignoreGollarkArgs == "off" then
  43.             ignoreGollark = false
  44.         elseif
  45.             ignoreGollarkArgs == "on" then
  46.             ignoreGollark = true
  47.           end
  48.         end
  49.       elseif gollark == true and ignoreGollark == false and chat_string == "+ " then
  50.         if command == "support" then
  51.           rednet.broadcast("support is on the way.", "DLA")
  52.         elseif command == "help" then
  53.           rednet.broadcast("help is on the way.", "DLA")
  54.         elseif command == "ignoreGollark" then
  55.           ignoreGollarkArgs = string.sub(chat_string, (string.len(chat_string)-7))
  56.           if ignoreGollarkArgs == "disable" then
  57.             ignoreGollark = false
  58.             rednet.broadcast("Ignore gollark is now Disabled","DLA")
  59.           elseif ignoreGollarkArgs == "enable" then
  60.             ignoreGollark = true
  61.             rednet.broadcast("Ignore gollark is now Enabled","DLA")
  62.           end
  63.         end
  64.       elseif gollark == true and ignoreGollark == true and chat_string == "+ " then
  65.         rednet.broadcast("The Dark Lord will not allow me to process your request gollark", "DLA")
  66.       end
  67.     end
  68.   end
  69. end
  70.  
  71. parallel.waitForAll(mainLoop)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement