Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-------------------------------------------------------------------------------------------------------------------------
- Derp Chat something
- -------------------------------------------------------------------------------------------------------------------------*/
- local PLUGIN = {}
- PLUGIN.Title = "Derp Chat"
- PLUGIN.Description = "Serverside Derpy chat!"
- PLUGIN.Author = "Matt/Lucas Longley/Overv"
- PLUGIN.ChatCommand = "derpchat"
- PLUGIN.Usage = "[1/0]"
- PLUGIN.Privileges = { "Derp Chat" }
- local On = false
- function translateText(text)
- text = string.upper(text)
- local textArray = string.Explode(" ", text)
- local output = ""
- local arrayLength = table.Count(textArray)
- local wordLength
- for i=1, arrayLength do
- wordLength = string.len(textArray[i])
- if (textArray[i] == ("YOUR") and wordLength == 4) or (textArray[i] == ("YOU'RE") and wordLength == 6) then
- output = output .. "UR"
- end
- if(textArray[i] == ("YOUR")) then
- output = output .. "U"
- end
- if(table.Count(textArray) >= 3 and (textArray[i] .. " " .. textArray[i+1] .. " " .. textArray[i+2]) == ("GOT TA GO") and i == 1) then
- output = output .. "G2G"
- i = i + 2
- end
- if(table.Count(textArray) >= 2 and (textArray[i] .. " " .. textArray[i+1]) == ("GOTTA GO") and i == 1) then
- output = output .. "G2G"
- i = i + 1
- end
- if(table.Count(textArray) >= 2 and (textArray[i] .. " " .. textArray[i+1]) == ("WHAT THE") and i == 1) then
- output = output .. "WT"
- if table.Count(textArray) >= 3 and (textArray[i+2] == "FUCK") and i == 1 then
- output = output .. "F"
- end
- end
- if table.Count(textArray) >= 3 and (textArray[i+2] == "HECK") or (textArray[i+2] == "HELL") and i == 1 then
- output = output .. "H"
- end
- if(textArray[i] == ("WHAT")) then
- output = output .. "WUT"
- end
- if (textArray[i] == ("ARE")) or (textArray[i] == (ARE) and 3 == wordLength) then
- output = output .. "R"
- end
- if(textArray[i] == ("WHY")) then
- output = output .. "Y"
- end
- if(table.Count(textArray) >= 3 and (textArray[i] .. " " .. textArray[i+1] .. " " .. textArray[i+2]) == ("BE RIGHT BACK") and i == 1) then
- output = output .. "BRB"
- i = i + 2
- end
- if(textArray[i] == ("BECAUSE")) then
- output = output .. "B/C"
- end
- if(table.Count(textArray) >= 3 and (textArray[i] .. " " .. textArray[i+1] .. " " .. textArray[i+2]) == ("OH MY GOD") and i == 1) then
- output = output .. "OMG"
- i = i + 2
- end
- if (textArray[i] == ("THE")) then
- if (math.floor(math.random() * 100) % 2) then
- output = output .. "TEH"
- else
- output = output .. "DA"
- end
- end
- if(textArray[i] == ("MY")) then
- output = output .. "MAH"
- end
- if(textArray[i] == ("NEW")) then
- output = output .. "NU"
- end
- if(textArray[i] == ("WITH")) then
- output = output .. "WIT"
- end
- if(textArray[i] == ("REALLY")) then
- output = output .. "RILLY"
- end
- if(textArray[i] == ("PLEASE")) then
- output = output .. "PLZ"
- end
- if(textArray[i] == ("THANKS")) then
- output = output .. "THX"
- end
- if(textArray[i] == ("THIS")) then
- output = output .. "THES"
- end
- if(textArray[i] == ("IS")) then
- output = output .. "SI"
- end
- if(textArray[i] == ("LOVE")) then
- output = output .. "LUV"
- end
- if (textArray[i] == ("THERE")) then
- if (math.floor(math.random() * 100) % 2) then
- output = output .. "THEIR"
- else
- output = output .. "THEYRE"
- end
- end
- if (textArray[i] == ("THEIR")) then
- if (math.floor(math.random() * 100) % 2) then
- output = output .. "THERE"
- else
- output = output .. "THEYRE"
- end
- end
- if (textArray[i] == ("THEY'RE")) then
- if (math.floor(math.random() * 100) % 2) then
- output = output .. "THEIR"
- else
- output = output .. "THERE"
- end
- end
- if(textArray[i] == ("OK")) then
- output = output .. "K"
- end
- if(textArray[i] == ("OKAY")) then
- output = output .. "K"
- end
- if(textArray[i] == ("LIBRARY")) then
- output = output .. "LIBERRY"
- end
- end // line 322
- if not wordLength then wordLength = string.len(textArray[1]) end
- print("Text = " .. text)
- PrintTable(textArray)
- print("arrayLength = " .. arrayLength)
- print("wordLength = " .. wordLength)
- print("Output = " .. output)
- for j=0,j < wordLength do
- if (string.sub(textArray[i], j, j)) == (string.sub(textArray[i], j+1, j+1)) then
- output = output .. (string.sub(textArray[i], j, j))
- j = j + 1
- end
- if (string.sub(textArray[i], j, j) == "B") then
- if (string.sub(textArray[i], j+1, j+1) == "E") then
- output = output .. "B"
- j = j + 1
- end
- end
- if (string.sub(textArray[i], j, j) == "C") then
- if (string.sub(textArray[i], j+1, j+1) == "K") then
- if (string.sub(textArray[i], j+2, j+2) == "S") then
- output = output .. "X"
- j = j + 2
- else
- output = output .. "K"
- j = j + 1
- end
- if (string.sub(textArray[i], j+1, j+1) == "S") then
- if (string.sub(textArray[i], j+2, j+2) == "S") then
- output = output .. "X"
- j = j + 1
- end
- end
- //
- else
- output = output .. "C"
- end
- end
- if (string.sub(textArray[i], j, j == "E")) then
- if (Math.floor(Math.random() * 100) % 3 == 2) then
- output = output .. "3"
- else
- if (Math.floor(Math.random() * 100) % 3 == 1) then
- output = output .. "A"
- else
- output = output .. "E"
- end
- end
- end
- if (string.sub(textArray[i], j, j == "I")) then
- if ((string.sub(textArray[i], j+1, j+1)) .. (string.sub(textArray[i], j+2, j+2)) == "NG") then
- output = output .. "NG"
- j = j + 2
- end
- end
- // Line 500
- if (string.sub(textArray[i], j+2, j+2) == "E") then
- output = output .. "IE" .. string.sub(textArray[i], j+1, j+1)
- j = j + 2
- end
- if (string.sub(textArray[i], j+1, j+1) == "E") then
- output = output .. "EI"
- j = j + 1
- end
- if (string.sub(textArray[i], j, j == "I")) then // Do stuff with I's
- if (string.sub(textArray[i], j+1, j+1) == "'") then
- if (string.sub(textArray[i], j+2, j+2) == "M") then
- if (textArray[i+1] .. " " .. textArray[i+2] == "GOING TO") then
- output = output .. "IMA"
- i = i + 2
- j = j + 2
- else
- output = output .. "IM"
- end
- end
- end
- end
- if (textArray[i+1] == "AM") then
- if (textArray[i+2] .. " " .. textArray[i+3] == "GOING TO") then
- output = output .. "IMA"
- i = i + 3
- else
- output = output .. "IM"
- i = i + 1
- end
- else
- output = output .. "I"
- end
- if (string.sub(textArray[i], j, j == "A")) then
- if (string.sub(textArray[i], j, j == "M")) then
- output = output .. "M"
- j = j + 1
- end
- end
- if (string.sub(textArray[i], j+1, j+1) == "I") then
- output = output .. "A" .. string.sub(textArray[i], j+2, j+2) .. "E"
- j = j + 2
- end
- if (string.sub(textArray[i], j+1, j+1) == "I") .. (string.sub(textArray[i], j+2, j+2) == "I") .. (string.sub(textArray[i], j+3, j+3) == "I") == "TER" then
- output = output .. "8R"
- j = j + 3
- end
- if (string.sub(textArray[i], j+2, j+2) == "E") then
- output = output .. "AE"
- j = j + 2
- else
- output = output .. "A"
- end
- if (string.sub(textArray[i], j, j) == "S") then
- if (string.sub(textArray[i], j+1, j+1)) .. (string.sub(textArray[i], j+2, j+2)) .. (string.sub(textArray[i], j+3, j+3)) .. (string.sub(textArray[i], j+4, j+4)) .. (string.sub(textArray[i], j+5, j+5)) == "CHOOL" then
- output = output .. "SKOOL"
- j = j + 5
- end
- end
- //line 720
- if (string.sub(textArray[i], j+1, j+1)) .. (string.sub(textArray[i], j+2, j+2)) .. " " .. (string.sub(textArray[i], 1, 1)) .. (string.sub(textArray[i], 2, 2)) .. (string.sub(textArray[i], 3, 3)) == "SEE YOU" then
- output = output .. "CYA"
- j = j + 5
- end
- if (string.sub(textArray[i], j+1, j+1)) .. (string.sub(textArray[i], j+2, j+2)) .. " " .. (string.sub(textArray[i], 1, 1)) .. (string.sub(textArray[i], 2, 2)) == "SEE YA" then
- output = output .. "CYA"
- j = j + 5
- else
- output = output .. "S"
- end
- if (string.sub(textArray[i], j, j)) == "O" then
- if (string.sub(textArray[i], j+1, j+1)) == "O" then
- output = output .. "U"
- j = j + 1
- end
- if (string.sub(textArray[i], j+1, j+1)) == "U" and (string.sub(textArray[i], j+2, j+2)) == "L" then
- output = output .. "U"
- j = j + 2
- end
- if (string.sub(textArray[i], j+1, j+1)) == "H" then
- output = output .. "O"
- j = j + 1
- end
- if (string.sub(textArray[i], j+1, j+1)) .. (string.sub(textArray[i], j+2, j+2)) == "US" and (string.sub(textArray[i], j+3, j+3)) != "E" then
- output = output .. "OS"
- j = j + 2
- else
- output = output .. "O"
- end
- end
- // line 830
- if (string.sub(textArray[i], j, j)) .. (string.sub(textArray[i], j+1, j+1)) == "LY" and
- j .. 2 == wordLength or (string.sub(textArray[i], j+2, j+2)) == "." or (string.sub(textArray[i], j+2, j+2)) == "!" or (string.sub(textArray[i], j+2, j+2)) == "?" or (string.sub(textArray[i], j+2, j+2)) == "'" or (string.sub(textArray[i], j+2, j+2)) == ";" or (string.sub(textArray[i], j+2, j+2)) == "," or (string.sub(textArray[i], j+2, j+2)) == ":" or (string.sub(textArray[i], j+2, j+2)) == "\"" or (string.sub(textArray[i], j+2, j+2)) == "`" or (string.sub(textArray[i], j+2, j+2)) == "~" then
- output = output .. "LEY"
- j = j + 2
- end
- if (string.sub(textArray[i], j, j)) .. (string.sub(textArray[i], j+1, j+1)) .. (string.sub(textArray[i], j+2, j+2)) == "USE" then
- output = output .. "UES"
- j = j + 2
- end
- if (string.sub(textArray[i], j, j)) == "T" then
- if (string.sub(textArray[i], j+1, j+1)) == "O" then
- output = output .. "2"
- if (string.sub(textArray[i], j+2, j+2)) == "O" then
- j = j + 2
- end
- else
- j = j + 1
- end
- end
- // line 911
- if (string.sub(textArray[i], j+1, j+1)) .. (string.sub(textArray[i], j+2, j+2)) .. (string.sub(textArray[i], j+3, j+3)) == "HAT" then
- output = output .. "TAHT"
- j = j + 3
- else
- output = output .. "T"
- end
- // line 942
- if (string.sub(textArray[i], j, j)) != "." and (string.sub(textArray[i], j, j)) != "!" and (string.sub(textArray[i], j, j)) != "?" and (string.sub(textArray[i], j, j)) != "'" and (string.sub(textArray[i], j, j)) != ";" and (string.sub(textArray[i], j, j)) != "," and (string.sub(textArray[i], j, j)) != ":" and (string.sub(textArray[i], j, j)) != "\"" and (string.sub(textArray[i], j, j)) != "`" and (string.sub(textArray[i], j, j)) == "~" then
- output = output .. string.sub(textArray[i], j, j)
- end
- end
- // line 960
- if string.find(textArray[i],".") or string.find(textArray[i],"!") or string.find(textArray[i],"?") then
- local placeInWord
- end
- if string.find(textArray[i],"!") then
- local firstCharacter = "!"
- end
- if string.find(textArray[i],".") then
- local firstCharacter = "."
- end
- if string.find(textArray[i],"?") then
- local firstCharacter = "?"
- end
- if string.find(textArray[i],".") < string.find(textArray[i],firstCharacter) and string.find(textArray[i],".") then
- firstCharacter = "."
- end
- if string.find(textArray[i],"?") < string.find(textArray[i],firstCharacter) and string.find(textArray[i],"?") then
- firstCharacter = "!"
- end
- placeInWord = string.find(textArray[i],firstCharacter)
- if string.find(textArray[i],"?") then
- output = output .. "?"
- else
- output = output .. "!"
- end
- // Line 1055
- if string.find(placeInWord,"!") or string.find(placeInWord,".") then
- for var=1,math.random(1,5) do
- if (math.floor(math.random() * 100) % 2) then
- output = output .. "!"
- else
- output = output .. "1"
- end
- end
- end
- if string.find(placeInWord,"?") then
- for var=1,math.random(1,5) do
- if (math.floor(math.random() * 100) % 2) then
- output = output .. "?"
- else
- output = output .. "!"
- end
- end
- end
- //line 1120
- if (math.floor(math.random() * 100) % 2) then
- output = output .. " OMG";
- end
- if (math.floor(math.random() * 100) % 2) then
- output = output .. " WTF";
- end
- if (math.floor(math.random() * 100) % 2) then
- output = output .. " LOL";
- end
- if (table.Count(textArray) >= 2 and i != arrayLength - 1 and textArray[i+1] != "") and i == 1 then
- output = output .. " "
- end
- return output
- end
- function ISaid( ply, text, public )
- if On == true then
- print("DerpChat is on!")
- return translateText(text)
- else
- print("DerpChat is off!")
- return text
- end
- end
- function PLUGIN:Call( ply, args )
- if ply:EV_HasPrivilege( "Derp Chat" ) then
- if args[1] == "0" then
- On = false
- evolve:Notify( evolve.colors.white, "Derpchat is now Off." )
- else
- On = true
- evolve:Notify( evolve.colors.white, "Derpchat is now On." )
- end
- else
- evolve:Notify( ply, evolve.colors.red, evolve.constants.notallowed )
- end
- end
- hook.Add( "PlayerSay", "ISaid", ISaid );
- evolve:RegisterPlugin( PLUGIN )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement