Advertisement
BobMe

Anti Chat Capitalization Abuse (ACCA)

Apr 22nd, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.02 KB | None | 0 0
  1. --[[
  2.     To all of the hotel roleplay developers who are too lazy to make their own anti-capitilzation abuse message system.  I've made one for you. If you're smart enough to figure out how to plug this in into chat service, i'll pat you on the back myself because my expectations for hotel roleplay developers are extremely low considering 90% of all hotel roleplay developers are very dumb in the brain.  Anyway...
  3.  
  4.     What even is this script?  Like i stated above if you have the brain cells to read from top to bottom, but if you do not.. I'll explain again.  This is a smart anti-captilization function designed to stop players from "abusing caps".  So that chat moderators can stop taking away the freedom of speech from normal respectful human beings.  Chat moderators shouldn't even fucking exist in a roleplay game, i mean for chirst's sake, It's a roleplay game.  Like how many brain cells do roleplay game devs and staff lack? If you mute your players in a roleplay game it defeats the purpose of the game overall, and the fact that if you're a hotel roleplay developer and are still reading this, proves my point in how brain cell deficient you people actually are.  Anyway, enough of me being rude to disgusting hotel roleplay devs, I just thought I'd make an argument.
  5.  
  6.     Developers who actually would like to use this, plug the function into your chat service, the place that sends messages through the C# server to get filtered.  I'm sure you'll figure it out.  If you do manage to find what i'm talking about, look at how the chat service works, and think of ways you can use it to your advantage, you know, like making fun chat commands? (maybe even a gamepass for chat commands?)
  7.  
  8. ]]
  9.  
  10. function capmessage(mtbs)
  11.    
  12.     PERCENT_MUTIPLIER_FOR_CAPPED_MESSAGES = 80 --[[ 80 is reccomended, set to 100 if you would like to make all messages lowercased ]]    /100
  13.  
  14.     local countup = 0
  15.    
  16.     local countup2 = 0
  17.  
  18.     for i=1,#mtbs do
  19.         if string.sub(mtbs,i,i) == " " then countup = countup + 1 end
  20.     end
  21.    
  22.     for i=1,#mtbs do
  23.         if string.sub(mtbs,i,i) == string.sub(mtbs,i,i):upper() and string.sub(mtbs,i,i) ~= " " then
  24.             countup2 = countup2 + 1
  25.         elseif string.sub(mtbs,i,i) ~= " " and string.sub(mtbs,i,i) == string.sub(mtbs,i,i):lower() and countup2 - 1 ~= -1 then
  26.             countup2 = countup2 - 1
  27.         end
  28.     end
  29.    
  30.     heck = PERCENT_MUTIPLIER_FOR_CAPPED_MESSAGES
  31.     heck = 1-heck
  32.    
  33.     if (countup2 / #mtbs) >= heck and #mtbs > 6 then
  34.         local str = ""
  35.         local aos = 0
  36.         mtbs = mtbs:lower()
  37.         --[[for i=1,#mtbs do
  38.             if string.sub(mtbs,i,i) == " " then
  39.                 aos = aos + 1
  40.                 while string.sub(mtbs,i+aos,i+aos) == " " do
  41.                     aos = aos + 1
  42.                 end
  43.             else
  44.                 aos = 0
  45.             end
  46.            
  47.             if i+aos == 1+aos then
  48.                
  49.     ]]
  50.     end
  51.    
  52.     return mtbs
  53. end
  54.  
  55. g = capmessage("ANtI CaptiLIZED LETTERS is GOOD...APPARently")
  56.  
  57. print(g)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement