CosmosisT's TinyChat Script (CTS V1.4.8)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-02-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.4.8)
  3. // @version 1.4.8
  4. // @description Modified TinyChat - Best Scripts; prepare to be amazed.
  5. // @author CosmosisT
  6. // @url https://gist.github.com/CosmosisT
  7. // @license Copyright (C) 2019-2020 CosmosisT
  8. // @icon https://tinychat.com/webrtc/2.0.0-81/images/favicon.png
  9. // @match https://tinychat.com/room/*
  10. // @match https://tinychat.com/*
  11. // @exclude https://tinychat.com/settings/*
  12. // @exclude https://tinychat.com/subscription/*
  13. // @exclude https://tinychat.com/promote/*
  14. // @exclude https://tinychat.com/coins/*
  15. // @exclude https://tinychat.com/gifts0
  16. // @grant none
  17. // @run-at document-start
  18. // jshint esversion: 6
  19. // @namespace https://greasyfork.org/users/395685
  20. // ==/UserScript==
  21. (function() {
  22. "use strict";
  23. //CTS
  24. var CTS = {
  25. DebugClear: true,
  26. Version: "1.4.8",
  27. Me: [],
  28. Room: "",
  29. ScriptInit: false,
  30. Storage: "CTS_",
  31. MainBackground: undefined,
  32. MainBackgroundColorCounter: 0,
  33. FontSize: 20,
  34. ChatStyleCounter: 0,
  35. ChatHeight: 30,
  36. ChatWidth: 0,
  37. ChatDisplay: true,
  38. UserListDisplay: true,
  39. ChatStyles: 10,
  40. NameColors: 22,
  41. MainBackgroundCounter: 0,
  42. ChatCSS: [],
  43. ChatLimit: 1000,
  44. NotificationLimit: 150,
  45. ChatScroll: true,
  46. NotificationScroll: true,
  47. NoGreet: false,
  48. Featured: true,
  49. Bot: true,
  50. AutoKick: false,
  51. AutoBan: false,
  52. GreetMode: false,
  53. CanTTS: false,
  54. Popups: true,
  55. Avatar: true,
  56. Reminder: true,
  57. imgur: true,
  58. Notification: true,
  59. UserYT: true,
  60. AutoMicrophone: false,
  61. Radio: {station: [["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],["HOT899", "https://newcap.leanstream.co/CIHTFM"],["chillstep.info", "https://chillstep.info/listen.ogg"],["HOT997", "https://ice5.securenetsystems.net/KHHK"],["Dance365", "https://edge1-b.exa.live365.net/a93720"],["kexp.org", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3"],["Classic Deep Cuts", "https://edge1-b.exa.live365.net/a72496"],["Divas Hustle Radio", "https://edge1-b.exa.live365.net/a72972"],["Retro 8089", "https://edge1-b.exa.live365.net/a53202"],["Paragon Broadcasting", "https://edge1-b.exa.live365.net/a49350"],["Teerex Radio Teerex", "https://edge1-b.exa.live365.net/a74387"],["NGI Radio", "https://edge1-b.exa.live365.net/a24650"],["BYB Network", "https://edge1-b.exa.live365.net/a60276"],["Legend Oldies", "https://edge1-b.exa.live365.net/a88135"],["Music City Roadhouse", "https://edge1-b.exa.live365.net/a73754"],["Mashrup Reggae Radio", "https://edge1-b.exa.live365.net/a00564"],["97.5 Dance Hits", "https://edge1-b.exa.live365.net/a50365"]]},
  62. EightBall: ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most Likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."],
  63. TTS: {synth: undefined,voices: undefined},
  64. Host: 0,
  65. HostAttempt: 0,
  66. HostWaiting: false,
  67. YouTube: {XHR: new XMLHttpRequest(),Playing: false,QueueList: [],NotPlayable: ["Private video", "Deleted video"],VideoID: undefined,Busy: false,DataReady: false,Clear: false,VideoReturn: false,SearchReturn: false,ListBuilt: true,PlayListCount: undefined,ShowQueue: false,CurrentTrack: {ID: undefined,duration: undefined,title: undefined,thumbnail: undefined},},
  68. UserList: [],
  69. MentionList: [],
  70. IgnoreList: [],
  71. BanList: [],
  72. KickList: [],
  73. BotOPList: [],
  74. TTSList: [],
  75. BanKeywordList: [],
  76. KickKeywordList: [],
  77. HighlightList: [],
  78. GreetList: [],
  79. ReminderList: [],
  80. ReminderSetList: [],
  81. Favorited: [],
  82. SafeList: [],
  83. WatchList: [],
  84. MessageCallback: [],
  85. Message: [[]],
  86. LastMessage: new Date(),
  87. SendQueue: [],
  88. MissedMsg: 0,
  89. ActiveMessage: 0,
  90. NotificationTimeOut: [],
  91. Sound: {highlight: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"), mention: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"), MSG: new Audio("https://tinychat.com/webrtc/2.0.20-420/sound/pop.mp3"), PVTMSG: new Audio("https://tinychat.com/webrtc/2.0.20-420/sound/pop.mp3")},
  92. Welcomes: ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "]
  93. },
  94. MainElement, ChatLogElement, VideoListElement, SideMenuElement, TitleElement, UserListElement, ModerationListElement, ChatListElement, UserContextElement, MicrophoneElement;
  95. window.RADIO_STATIONS = CTS.Radio.station;
  96. //CTS SETTINGS
  97. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", 0));
  98. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  99. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  100. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/RC3bKe7.jpg)");
  101. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  102. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  103. CTS.Notification = JSON.parse(Load("Notification", JSON.stringify(true)));
  104. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  105. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  106. CTS.Favorited = JSON.parse(Load("Favorited", JSON.stringify([
  107. ["stonercircle", "https://avatars.tinychat.com/da/838b96/5f/medium/phpKXAdEn.jpeg"], null, null, null, null
  108. ])));
  109. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  110. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  111. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  112. CTS.FontSize = JSON.parse(Load("FontSize", 20));
  113. CTS.SafeList = JSON.parse(Load("SafeList", JSON.stringify([])));
  114. CTS.KickList = JSON.parse(Load("KickList", JSON.stringify([])));
  115. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  116. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  117. CTS.BanList = JSON.parse(Load("BanList", JSON.stringify([])));
  118. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  119. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  120. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  121. CTS.imgur = JSON.parse(Load("imgur", JSON.stringify(true)));
  122. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  123. //ROOM CSS
  124. var NameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  125. var Colors = ["#CD5C5C", "#F08080", "#FA8072", "#E9967A", "#DC143C", "#FF0000", "#B22222", "#8B0000", "#000000", "#FFFFFF", "#FFC0CB", "#FFB6C1", "#FF69B4", "#FF1493", "#C71585", "#DB7093", "#000000", "#FFFFFF", "#FFA07A", "#FF7F50", "#FF6347", "#FF4500", "#FF8C00", "#FFA500", "#000000", "#FFFFFF", "#FFD700", "#FFFF00", "#FFFFE0", "#FFFACD", "#FAFAD2", "#FFEFD5", "#FFE4B5", "#FFDAB9", "#EEE8AA", "#F0E68C", "#BDB76B", "#000000", "#FFFFFF", "#E6E6FA", "#D8BFD8", "#DDA0DD", "#EE82EE", "#DA70D6", "#FF00FF", "#BA55D3", "#9370DB", "#9966CC", "#8A2BE2", "#9400D3", "#9932CC", "#8B008B", "#800080", "#4B0082", "#6A5ACD", "#483D8B", "#7B68EE", "#000000", "#FFFFFF", "#ADFF2F", "#7FFF00", "#7CFC00", "#00FF00", "#32CD32", "#98FB98", "#90EE90", "#00FA9A", "#00FF7F", "#3CB371", "#2E8B57", "#228B22", "#008000", "#006400", "#9ACD32", "#6B8E23", "#808000", "#556B2F", "#66CDAA", "#8FBC8F", "#20B2AA", "#008B8B", "#008080", "#000000", "#FFFFFF", "#00FFFF", "#E0FFFF", "#AFEEEE", "#7FFFD4", "#40E0D0", "#48D1CC", "#00CED1", "#5F9EA0", "#4682B4", "#B0C4DE", "#B0E0E6", "#ADD8E6", "#87CEEB", "#87CEFA", "#00BFFF", "#1E90FF", "#6495ED", "#4169E1", "#0000FF", "#0000CD", "#00008B", "#000080", "#191970", "#000000", "#FFFFFF", "#FFF8DC", "#FFEBCD", "#FFE4C4", "#FFDEAD", "#F5DEB3", "#DEB887", "#D2B48C", "#BC8F8F", "#F4A460", "#DAA520", "#B8860B", "#CD853F", "#D2691E", "#8B4513", "#A0522D", "#A52A2A", "#800000", "#000000", "#FFFFFF", "#FFFFFF", "#FFFAFA", "#F0FFF0", "#F5FFFA", "#F0FFFF", "#F0F8FF", "#F8F8FF", "#F5F5F5", "#FFF5EE", "#F5F5DC", "#FDF5E6", "#FFFAF0", "#FFFFF0", "#FAEBD7", "#FAF0E6", "#FFF0F5", "#FFE4E1", "#000000", "#FFFFFF", "#DCDCDC", "#D3D3D3", "#C0C0C0", "#A9A9A9", "#808080", "#696969", "#778899", "#708090", "#2F4F4F", "#000000", "#FFFFFF"];
  126. var Images = ["https://i.imgur.com/8M0NPCv.png", "https://i.imgur.com/6IAL4aM.png", "https://i.imgur.com/QdOTqIR.jpg", "https://i.imgur.com/qqFsein.jpg", "https://i.imgur.com/vVD5pUb.jpg", "https://i.imgur.com/Sux2Age.jpg", "https://i.imgur.com/cIKznlf.jpg", "https://i.imgur.com/iEMP5I6.jpg", "https://i.imgur.com/rEGy1tK.jpg", "https://i.imgur.com/JR6Ped5.jpg", "https://i.imgur.com/m3dX7yn.jpg", "https://i.imgur.com/2cJqV1K.jpg", "https://i.imgur.com/QL1M4yG.jpg", "https://i.imgur.com/Syy1mUU.jpg", "https://i.imgur.com/sRpDOp3.jpg", "https://i.imgur.com/Im7dWdM.jpg", "https://i.imgur.com/9uCdYyq.png", "https://i.imgur.com/X9Kp6ka.jpg", "https://i.imgur.com/TOZTx1M.jpg", "https://i.imgur.com/wcjxVjk.png", "https://i.imgur.com/UZfmih9.png", "https://i.imgur.com/mkauZUT.jpg", "https://i.imgur.com/GfPqv7d.jpg", "https://i.imgur.com/R7AOtjV.jpg", "https://i.imgur.com/Qso6n8k.jpg", "https://i.imgur.com/vVfj23z.jpg", "https://i.imgur.com/BYPsShX.jpg", "https://i.imgur.com/1EWYBQw.jpg", "https://i.imgur.com/Oaq0eip.jpg", "https://i.imgur.com/HVHaJ1r.jpg", "https://i.imgur.com/SImcSc2.png", "https://i.imgur.com/CgRDCdy.jpg", "https://i.imgur.com/VMtXsES.png", "https://i.imgur.com/oxHz9un.jpg", "https://i.imgur.com/VN6x9QA.jpg", "https://i.imgur.com/9KhjWvW.jpg", "https://i.imgur.com/fu0eiv4.jpg", "https://i.imgur.com/QgcvxZf.jpg", "https://i.imgur.com/2kz8Roz.jpg", "https://i.imgur.com/A2AdQd8.jpg", "https://i.imgur.com/zuNUJ4J.jpg", "https://i.imgur.com/CW4mVWE.jpg", "https://i.imgur.com/0NGecGX.jpg", "https://i.imgur.com/4IEcVlr.jpg", "https://i.imgur.com/JDnQzF4.jpg", "https://i.imgur.com/Ye6iIrw.jpg", "https://i.imgur.com/DVlwQFN.jpg", "https://i.imgur.com/G6Oa9s6.jpg", "https://i.imgur.com/cXpEHvX.jpg", "https://i.imgur.com/ANXRz54.jpg", "https://i.imgur.com/i7KvpAf.jpg", "https://i.imgur.com/kJ44IQQ.jpg", "https://i.imgur.com/5ONal5c.jpg", "https://i.imgur.com/nWuC5FK.jpg", "https://i.imgur.com/ZYNsEN6.jpg", "https://i.imgur.com/C3aVnBq.jpg", "https://i.imgur.com/8Kts9t7.jpg", "https://i.imgur.com/QiaDx3C.jpg", "https://i.imgur.com/wrt6zBN.jpg", "https://i.imgur.com/3YgGoV0.jpg", "https://i.imgur.com/HPsbhiF.jpg", "https://i.imgur.com/X4wSs8f.jpg", "https://i.imgur.com/cqeMox0.jpg", "https://i.imgur.com/apNgmSO.jpg", "https://i.imgur.com/YjYcyCn.jpg", "https://i.imgur.com/2hUFTDv.png", "https://i.imgur.com/7lDQKff.jpg", "https://i.imgur.com/yuQTkOy.png", "https://i.imgur.com/7zvCOpV.jpg", "https://i.imgur.com/L5v6bcs.jpg", "https://i.imgur.com/5h3N2HY.jpg", "https://i.imgur.com/AvhrIcv.jpg", "https://i.imgur.com/DsAMAG1.jpg", "https://i.imgur.com/dDvOwXi.jpg", "https://i.imgur.com/ii00Lnl.jpg",
  127. "https://i.imgur.com/vHDQY7N.jpg", "https://i.imgur.com/czfeyXQ.jpg", "https://i.imgur.com/pHEAee2.jpg", "https://i.imgur.com/txu4z7B.jpg", "https://i.imgur.com/NOapG69.jpg", "https://i.imgur.com/cxA4ist.jpg", "https://i.imgur.com/2keIszu.jpg", "https://i.imgur.com/q2Kpinf.jpg", "https://i.imgur.com/nDiFD2D.jpg", "https://i.imgur.com/Lvk0Lql.jpg", "https://i.imgur.com/QcRIeBr.jpg", "https://i.imgur.com/GlBONNB.jpg", "https://i.imgur.com/jVmJ9Iz.jpg", "https://i.imgur.com/9h2N288.png", "https://i.imgur.com/q0Rm3dS.jpg", "https://i.imgur.com/1tTKfKM.png", "https://i.imgur.com/nEwJBan.jpg", "https://i.imgur.com/NgE4lXY.jpg", "https://i.imgur.com/I4Pv5Zc.jpg", "https://i.imgur.com/QVDBSEm.jpg", "https://i.imgur.com/N9KfkgT.jpg", "https://i.imgur.com/mLIDP8a.jpg", "https://i.imgur.com/C8fAtMn.jpg", "https://i.imgur.com/e2Pubr3.jpg", "https://i.imgur.com/6drF4lG.jpg", "https://i.imgur.com/JcFhmPT.jpg", "https://i.imgur.com/wQQlX06.jpg", "https://i.imgur.com/qPTFnVp.jpg", "https://i.imgur.com/KWto7ab.jpg", "https://i.imgur.com/DHEdXnE.jpg", "https://i.imgur.com/49vqbrB.jpg", "https://i.imgur.com/TK4I9DI.jpg", "https://i.imgur.com/o5QNrcQ.jpg", "https://i.imgur.com/49adw4l.jpg", "https://i.imgur.com/vyYOZkE.jpg", "https://i.imgur.com/sBaXCoY.jpg", "https://i.imgur.com/dH0M8aN.png", "https://i.imgur.com/aqZ4VDh.jpg", "https://i.imgur.com/hMpMR84.jpg", "https://i.imgur.com/5zR2i8W.jpg", "https://i.imgur.com/oUPXbGf.jpg", "https://i.imgur.com/YW5tv1t.jpg", "https://i.imgur.com/JgKwHXs.jpg", "https://i.imgur.com/2k9JihV.jpg", "https://i.imgur.com/V5MUGj4.jpg", "https://i.imgur.com/3dUgoAf.jpg", "https://i.imgur.com/Q6aJgBM.jpg", "https://i.imgur.com/gRSmljE.jpg", "https://i.imgur.com/nkhsbE9.jpg", "https://i.imgur.com/I6LMqZq.jpg", "https://i.imgur.com/7OzdeRk.jpg", "https://i.imgur.com/wW94Pvc.jpg", "https://i.imgur.com/jQrTdv2.jpg", "https://i.imgur.com/UDgQ2Fh.jpg", "https://i.imgur.com/qjdMmPf.jpg", "https://i.imgur.com/yh7QoUN.jpg", "https://i.imgur.com/XchwuKo.jpg", "https://i.imgur.com/fdPaQbz.jpg", "https://i.imgur.com/zNfKy8I.jpg", "https://i.imgur.com/TaOf7dX.jpg", "https://i.imgur.com/bZxfyu8.jpg", "https://i.imgur.com/ccZRfsA.jpg", "https://i.imgur.com/wlbmT74.jpg", "https://i.imgur.com/29ffHeU.jpg", "https://i.imgur.com/30HbBAA.jpg", "https://i.imgur.com/4pO8b0B.jpg", "https://i.imgur.com/kD6BveQ.jpg", "https://i.imgur.com/LrCsiQj.jpg", "https://i.imgur.com/QN5NcXK.jpg", "https://i.imgur.com/MWW5cOv.jpg", "https://i.imgur.com/7LvskAH.jpg", "https://i.imgur.com/S7kLNct.jpg", "https://i.imgur.com/rL0olge.jpg", "https://i.imgur.com/0Apm59C.jpg", "https://i.imgur.com/ZMRBVvO.jpg",
  128. "https://i.imgur.com/xFNZTwS.jpg", "https://i.imgur.com/iqq8ECW.jpg", "https://i.imgur.com/xEth2qp.jpg", "https://i.imgur.com/8ijIZMj.jpg", "https://i.imgur.com/zSB1DOw.jpg", "https://i.imgur.com/6TzjZSd.jpg", "https://i.imgur.com/Gf9yAwP.jpg", "https://i.imgur.com/u5ifVZy.jpg", "https://i.imgur.com/4ibO4FN.jpg", "https://i.imgur.com/bDCygo7.jpg", "https://i.imgur.com/lqktMar.jpg", "https://i.imgur.com/b2jAXiC.jpg", "https://i.imgur.com/oPE32ni.jpg", "https://i.imgur.com/YRjfPjP.jpg", "https://i.imgur.com/1FRwNEb.jpg", "https://i.imgur.com/dzgvlEx.jpg", "https://i.imgur.com/3FCAMiu.jpg", "https://i.imgur.com/wF5k6Ux.jpg", "https://i.imgur.com/mkuNYYa.jpg", "https://i.imgur.com/Y2Yu3yA.jpg", "https://i.imgur.com/Zchlast.jpg", "https://i.imgur.com/2FbH2jq.jpg", "https://i.imgur.com/Bb4iyy0.jpg", "https://i.imgur.com/7rjAtTt.jpg", "https://i.imgur.com/g1rNC8Z.jpg", "https://i.imgur.com/RC3bKe7.jpg", "https://i.imgur.com/qloc683.jpg", "https://i.imgur.com/irmzqz7.jpg", "https://i.imgur.com/pvmhbwL.jpg", "https://i.imgur.com/Xti1aEf.jpg", "https://i.imgur.com/FqFYows.jpg", "https://i.imgur.com/92zz2Zu.jpg", "https://i.imgur.com/jWrqBga.jpg", "https://i.imgur.com/OMSQsDe.jpg", "https://i.imgur.com/bvTtaLQ.jpg", "https://i.imgur.com/vxt6B7Y.jpg", "https://i.imgur.com/siw7Ipn.jpg", "https://i.imgur.com/paQsmXk.jpg", "https://i.imgur.com/VLHs9cT.png", "https://i.imgur.com/6VSxbJY.jpg", "https://i.imgur.com/C3Xn1WD.jpg", "https://i.imgur.com/d6BBFfS.jpg", "https://i.imgur.com/HyK1BFP.jpg", "https://i.imgur.com/2InicOt.jpg", "https://i.imgur.com/IVM4luE.jpg", "https://i.imgur.com/VLE0zNA.jpg", "https://i.imgur.com/rfgwqVI.jpg", "https://i.imgur.com/GsTMYfk.jpg", "https://i.imgur.com/yMEdYBN.jpg", "https://i.imgur.com/LvrO8oB.jpg", "https://i.imgur.com/1VBNkJP.jpg", "https://i.imgur.com/beuJiKd.jpg", "https://i.imgur.com/61h9Twq.jpg", "https://i.imgur.com/mnszrZ3.jpg", "https://i.imgur.com/He8K7kF.jpg", "https://i.imgur.com/id5BSLh.jpg", "https://i.imgur.com/huazhWL.jpg", "https://i.imgur.com/ttc4EYq.jpg", "https://i.imgur.com/HTO5tGy.jpg", "https://i.imgur.com/Pg1NrT1.jpg", "https://i.imgur.com/HEubZeG.jpg", "https://i.imgur.com/yk4XVVu.jpg", "https://i.imgur.com/Q6xqV8U.jpg", "https://i.imgur.com/ROTOMPV.jpg", "https://i.imgur.com/5DBP49J.jpg", "https://i.imgur.com/1pafkRu.jpg", "https://i.imgur.com/ZYJW79s.jpg", "https://i.imgur.com/5hJnezu.jpg", "https://i.imgur.com/LHRwsur.jpg", "https://i.imgur.com/858hMb9.jpg", "https://i.imgur.com/WOtpN81.jpg", "https://i.imgur.com/ITCxNl1.jpg", "https://i.imgur.com/OvXfe6w.jpg", "https://i.imgur.com/EVYKONX.jpg", "https://i.imgur.com/9nP4KwW.jpg",
  129. "https://i.imgur.com/1SaESYp.jpg", "https://i.imgur.com/xBQlQKh.jpg", "https://i.imgur.com/yonFqV5.jpg", "https://i.imgur.com/go0xMSw.png", "https://i.imgur.com/jJhFpGw.jpg", "https://i.imgur.com/fcULcZq.jpg", "https://i.imgur.com/66l2lHM.jpg", "https://i.imgur.com/bujMfoQ.jpg", "https://i.imgur.com/JdbenHz.jpg", "https://i.imgur.com/merXbme.jpg", "https://i.imgur.com/ogrqxoQ.jpg", "https://i.imgur.com/fCstr3I.jpg", "https://i.imgur.com/t4d6ngW.jpg", "https://i.imgur.com/QzTlCSw.png", "https://i.imgur.com/CjrvvRI.jpg", "https://i.imgur.com/Du0abK6.jpg", "https://i.imgur.com/fZxRbtq.jpg", "https://i.imgur.com/zJB8VZc.jpg", "https://i.imgur.com/5lFG1Bf.jpg", "https://i.imgur.com/hvGzGNb.png", "https://i.imgur.com/UHZ8gC6.jpg", "https://i.imgur.com/ZIlJIIZ.png", "https://i.imgur.com/H7SjU1N.jpg", "https://i.imgur.com/yxxQsmf.jpg", "https://i.imgur.com/1TBkVzd.jpg", "https://i.imgur.com/3WffDw4.jpg", "https://i.imgur.com/XQU3W19.png", "https://i.imgur.com/2YxUgbQ.jpg", "https://i.imgur.com/8TVSB7D.jpg", "https://i.imgur.com/lNfEZwF.jpg", "https://i.imgur.com/2CgZewR.jpg", "https://i.imgur.com/ZJMFXGM.jpg", "https://i.imgur.com/9pZLYVF.jpg", "https://i.imgur.com/i9KaWdK.jpg", "https://i.imgur.com/X0hUxMg.jpg", "https://i.imgur.com/cWNLBLC.jpg", "https://i.imgur.com/oVQ1qmK.jpg", "https://i.imgur.com/MFa4WPr.jpg", "https://i.imgur.com/QalYWeA.png", "https://i.imgur.com/bLAlVzX.jpg", "https://i.imgur.com/OEXO2kT.jpg", "https://i.imgur.com/MnK5lmL.jpg", "https://i.imgur.com/dVMdMZh.jpg", "https://i.imgur.com/nNfOFvX.png", "https://i.imgur.com/yzoTLrK.jpg", "https://i.imgur.com/b1mTB58.jpg", "https://i.imgur.com/uWMQpMV.jpg", "https://i.imgur.com/TVGqTdH.jpg", "https://i.imgur.com/GFfZk0L.jpg", "https://i.imgur.com/aS5RCaX.jpg", "https://i.imgur.com/TTWYjDg.png", "https://i.imgur.com/OKUbuLl.jpg", "https://i.imgur.com/FyIJb7S.jpg", "https://i.imgur.com/KVTNHKB.jpg", "https://i.imgur.com/G9cpqNM.jpg", "https://i.imgur.com/cFf5e30.jpg", "https://i.imgur.com/1Nok0ho.jpg", "https://i.imgur.com/ozEWuPz.jpg", "https://i.imgur.com/QhHTLxc.jpg", "https://i.imgur.com/YYto1AX.jpg", "https://i.imgur.com/1THGvEA.jpg", "https://i.imgur.com/Rt3mp6H.jpg", "https://i.imgur.com/M2tiiNS.jpg", "https://i.imgur.com/lRtAxDM.jpg", "https://i.imgur.com/dlqkyFg.jpg", "https://i.imgur.com/lSLHeHM.png", "https://i.imgur.com/wKBOEof.png", "https://i.imgur.com/0aF2Si4.jpg", "https://i.imgur.com/bPDtdqH.jpg", "https://i.imgur.com/wZ08FwN.jpg", "https://i.imgur.com/gEtlvpr.jpg", "https://i.imgur.com/sTrwc9U.jpg", "https://i.imgur.com/nPEjErr.png", "https://i.imgur.com/bRaK26l.jpg", "https://i.imgur.com/vwJe85N.jpg",
  130. "https://i.imgur.com/F8RFA5t.jpg", "https://i.imgur.com/M08DwfB.jpg", "https://i.imgur.com/gvF4hmM.jpg", "https://i.imgur.com/vINAgNJ.jpg", "https://i.imgur.com/ZzIHnk7.png", "https://i.imgur.com/IaYE1SA.png", "https://i.imgur.com/h3uA809.jpg", "https://i.imgur.com/uSxy1TH.jpg", "https://i.imgur.com/ihUpL67.jpg", "https://i.imgur.com/JA5pSwV.jpg", "https://i.imgur.com/S5PaNRb.jpg", "https://i.imgur.com/vPKxrIj.jpg", "https://i.imgur.com/Zb2vtPA.jpg", "https://i.imgur.com/uUkxBYp.jpg", "https://i.imgur.com/fpsAui6.jpg", "https://i.imgur.com/Ns5gM3Y.jpg", "https://i.imgur.com/qUFLtvX.jpg", "https://i.imgur.com/JsVmBaH.jpg", "https://i.imgur.com/DUFEeDG.jpg", "https://i.imgur.com/VkT9WNe.jpg", "https://i.imgur.com/7rHa1t1.jpg", "https://i.imgur.com/6rt4Xsc.jpg", "https://i.imgur.com/1woJRNz.jpg", "https://i.imgur.com/DZizgSe.jpg", "https://i.imgur.com/WcPkq2p.jpg", "https://i.imgur.com/FWgshWM.jpg", "https://i.imgur.com/ce28KTw.jpg", "https://i.imgur.com/Z1kgLE9.jpg", "https://i.imgur.com/qmTDbVf.jpg", "https://i.imgur.com/Glfmlwk.jpg", "https://i.imgur.com/1ZlA3eI.jpg", "https://i.imgur.com/FyY9zQB.jpg", "https://i.imgur.com/5vION1i.jpg", "https://i.imgur.com/GN8VSLo.jpg", "https://i.imgur.com/fMHj9aD.png", "https://i.imgur.com/AZKVqlm.jpg", "https://i.imgur.com/N6yrNAp.jpg", "https://i.imgur.com/mzfGu1K.jpg", "https://i.imgur.com/PbDAvp8.jpg", "https://i.imgur.com/PeKxWNd.png", "https://i.imgur.com/q6HucmK.jpg", "https://i.imgur.com/PcpoEr9.jpg", "https://i.imgur.com/m8MKD34.jpg", "https://i.imgur.com/rEfHYFj.png", "https://i.imgur.com/YOnQC7m.jpg", "https://i.imgur.com/IKZ1dnz.png", "https://i.imgur.com/7dKl6GR.jpg", "https://i.imgur.com/7QTdYyC.jpg", "https://i.imgur.com/VY6CRU9.jpg", "https://i.imgur.com/JbbTXGZ.jpg", "https://i.imgur.com/LiWognc.jpg", "https://i.imgur.com/lAlCmCS.jpg", "https://i.imgur.com/tuoVfDz.jpg", "https://i.imgur.com/jDtr7VV.jpg", "https://i.imgur.com/Fmq1w0x.jpg", "https://i.imgur.com/SW9tEby.jpg", "https://i.imgur.com/OIeGtF1.jpg", "https://i.imgur.com/y28VX6l.jpg", "https://i.imgur.com/SmN01pH.jpg", "https://i.imgur.com/pYIHV3V.jpg", "https://i.imgur.com/4mefbZJ.jpg", "https://i.imgur.com/CrnksCn.jpg", "https://i.imgur.com/DqdQHU5.jpg", "https://i.imgur.com/Kyp7Mrq.jpg", "https://i.imgur.com/5uUI0FK.jpg", "https://i.imgur.com/nYyKnjc.jpg", "https://i.imgur.com/8yngY9r.png", "https://i.imgur.com/LXTztRk.jpg", "https://i.imgur.com/YW9f04H.jpg", "https://i.imgur.com/VEOTdF4.jpg", "https://i.imgur.com/CNcnljn.jpg", "https://i.imgur.com/cVyPQRQ.jpg", "https://i.imgur.com/QVnisWP.jpg", "https://i.imgur.com/xkOmSt2.jpg", "https://i.imgur.com/OWqkrGA.jpg",
  131. "https://i.imgur.com/407ypHE.jpg", "https://i.imgur.com/q7CBMPA.jpg", "https://i.imgur.com/jLgvLEB.jpg", "https://i.imgur.com/ZgRybJZ.jpg", "https://i.imgur.com/BCiqZoY.jpg", "https://i.imgur.com/C4FCE08.jpg", "https://i.imgur.com/mwQMddH.jpg", "https://i.imgur.com/c9Na9m7.jpg", "https://i.imgur.com/rvkOyhW.jpg", "https://i.imgur.com/fXikj5n.jpg", "https://i.imgur.com/B9nwfN2.jpg", "https://i.imgur.com/NitZTxZ.jpg", "https://i.imgur.com/4U7Wc6E.jpg", "https://i.imgur.com/wk2byhf.jpg", "https://i.imgur.com/kmeF9zK.jpg", "https://i.imgur.com/fpOurZh.jpg", "https://i.imgur.com/A6t86N6.jpg", "https://i.imgur.com/CnGthdb.jpg", "https://i.imgur.com/FgCA3uK.jpg", "https://i.imgur.com/sCYYhqf.jpg", "https://i.imgur.com/2NopGqw.jpg", "https://i.imgur.com/fzYZGdC.jpg", "https://i.imgur.com/nZufx8p.jpg", "https://i.imgur.com/IjMMreD.jpg", "https://i.imgur.com/HEpf4Eb.jpg", "https://i.imgur.com/jZeIfAc.jpg", "https://i.imgur.com/ZxaX4j0.jpg", "https://i.imgur.com/DXetwFt.jpg", "https://i.imgur.com/euIXHlP.jpg", "https://i.imgur.com/U4Mo2Hn.jpg", "https://i.imgur.com/w4pR6Hp.jpg", "https://i.imgur.com/79GciEk.jpg", "https://i.imgur.com/WpDbcAA.jpg", "https://i.imgur.com/YODAe6Z.jpg", "https://i.imgur.com/4It1NIe.jpg", "https://i.imgur.com/ALkfNHF.jpg", "https://i.imgur.com/xJOaHZP.jpg", "https://i.imgur.com/nFCIuJo.jpg", "https://i.imgur.com/oXgFh2K.jpg", "https://i.imgur.com/Vcs3jXT.jpg", "https://i.imgur.com/XGtJE58.jpg", "https://i.imgur.com/q4WalQY.jpg", "https://i.imgur.com/WFIyruV.jpg", "https://i.imgur.com/sItJMKv.jpg", "https://i.imgur.com/LAQ3Wpl.jpg", "https://i.imgur.com/C64XPAR.jpg", "https://i.imgur.com/hyehxek.jpg", "https://i.imgur.com/4XYBWKu.jpg", "https://i.imgur.com/KU1adf4.jpg", "https://i.imgur.com/L3sbodb.png", "https://i.imgur.com/JPMfbL9.jpg", "https://i.imgur.com/ieae2zo.jpg", "https://i.imgur.com/VVswQpo.jpg", "https://i.imgur.com/fWUr6ic.jpg", "https://i.imgur.com/juRIj2L.jpg", "https://i.imgur.com/2Mq8ZR8.jpg", "https://i.imgur.com/ibC5gSl.jpg", "https://i.imgur.com/63uHgyR.jpg", "https://i.imgur.com/xs3yEut.jpg", "https://i.imgur.com/0SYzA7u.jpg", "https://i.imgur.com/hRKhVTS.jpg", "https://i.imgur.com/IGv4V1p.jpg", "https://i.imgur.com/hmlxgXG.jpg", "https://i.imgur.com/q97Z7Nc.jpg", "https://i.imgur.com/1A6NPKj.jpg", "https://i.imgur.com/y97L14a.jpg", "https://i.imgur.com/DPohLPu.jpg", "https://i.imgur.com/JvXJ74s.jpg", "https://i.imgur.com/mA5b8Y1.jpg", "https://i.imgur.com/FVNerO1.jpg", "https://i.imgur.com/KNsh665.jpg", "https://i.imgur.com/Z9b0Gme.jpg", "https://i.imgur.com/z90LZmp.jpg", "https://i.imgur.com/tfXYXr7.png", "https://i.imgur.com/atHkjXl.jpg",
  132. "https://i.imgur.com/u1l34Vi.jpg", "https://i.imgur.com/X0yROLr.jpg", "https://i.imgur.com/EpHkJZI.jpg", "https://i.imgur.com/TIKipWb.jpg", "https://i.imgur.com/Lq4qnDF.jpg", "https://i.imgur.com/N1KmzQo.jpg", "https://i.imgur.com/pAReFTB.jpg", "https://i.imgur.com/ZKMQwxk.jpg", "https://i.imgur.com/aSDE7i4.jpg", "https://i.imgur.com/kabITqS.jpg", "https://i.imgur.com/W7oaDNe.jpg", "https://i.imgur.com/VHYmth8.jpg",
  133. ];
  134. var FeaturedCSS = "#videos.column>.videos-items{background:#0000003b;height:20%}#videos.column>.videos-items+.videos-items{background:none;height:80%}#videos.row>.videos-items{background:#0000003b;width:20%}#videos.row>.videos-items+.videos-items{background:none;width:80%}#videos.row.featured-2>.videos-items{width:20%}#videos.row.featured-2>.videos-items+.videos-items{width:80%}#videos.column.featured-2>.videos-items{height:20%}#videos.column.featured-2>.videos-items+.videos-items{height:80%}#videos.row.featured-3>.videos-items{width:20%}#videos.row.featured-3>.videos-items+.videos-items{width:80%}#videos.column.featured-3>.videos-items{height:20%}#videos.column.featured-3>.videos-items+.videos-items{height:80%}";
  135. var VideoCSS = "#videolist.full-screen, #videolist.full-screen > #videos-header, #videolist.full-screen .videos-header-volume:before {background:unset;}.ctsdrop{position:fixed;display:inline-block;top:4px;right:4px;z-index:2;min-width: 46px;}.ctsdrop-content{position:absolute;top:28px;right:0px;background-color:#181d1e;min-width:46px;padding:0px;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{width:100%;height:28px;line-height:16px;z-index: 2;cursor: pointer;top: 4px;background-color: #0000008f;border: none;color: white;padding: 4px 8px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px}#youtube{padding: unset}#grab{left: 0;background:#2d373a;border-radius: 12px;visibility: hidden;top: -36px;position: absolute;display: flex}#videos-footer-broadcast-wrapper>.video{position: fixed;display: none;width: 5%;top: 0;left: 0}#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button:hover{background-color: #1f2223!important}#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button{background-color: #2d373a!important}#videos-footer #music-radio .music-radio-playpause{position:absolute;top:0;left:30px;height:100%;width:60px;}#videos-footer #music-radio .music-radio-vol{position: absolute;right: 0;top: 0;}#videos-footer #music-radio button{line-height: 14px;background: #181d1e;border: none;font-size: 18px;color: white;height: 50%;display: block;width: 30px;}#videos-footer #videos-footer-youtube{left: 120px;border-radius: 0;display:none;}#videos-footer #videos-footer-soundcloud{display:none;border-radius: 0;left: 240px}#videos-footer #videos-footer-youtube,#videos-footer #videos-footer-soundcloud,#videos-footer #music-radio{transition: .2s;line-height: 33px;bottom: 21px;visibility: hidden;height: 36px;margin: unset;width: 120px;position: absolute;z-index: 1;}#videos-footer-push-to-talk{border-radius: unset}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{border-radius: unset;}#videos-footer-broadcast-wrapper.moderation>#videos-footer-broadcast{padding: unset}#videos-footer #music-radio button:hover{background: #53b6ef;cursor: pointer;}#videos-footer #music-radio{left: 0px}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer{top: calc(30% + 119px);display:block;padding: 0 0 0 20px;text-shadow: -1px 0 black,0 1px black,1px 0 black,0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;left: unset;right: -70px;height: 22px;min-height: 22px;z-index: 2;width: 70px;position: absolute}#videos-footer-broadcast{border-radius: 0;z-index: 1;padding: unset!important;white-space: pre}#videos-footer-broadcast-wrapper{z-index: 1;visibility: visible;height: 50px;min-height: 50px;width: 400px;padding: unset;right: 0px;left: unset;position: fixed;top: calc(30% + 34px)}span[title=\"Settings\"]>svg{padding:4px;height:24px;width:24px}#seek-duration{pointer-events: none;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 600 20px sans-serif}#videos{bottom: 0px;left: 0px;right: 0px;top: 0px}:host,#videolist{background:unset;}.video:after{content: unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header{background:#181d1e;transition: none;left: unset;right: 0px;width: 400px;top: calc(30%);position: fixed;max-height: 34px;min-height: 34px;}#videos-header>span{line-height: unset;}#videos-header-sound>svg{padding: 4px}#videos-header-fullscreen > svg {padding: 7px 8px;}";
  136. var SideMenuCSS = "#sidemenu-wider{display:none;}#sidemenu-content::-webkit-scrollbar{width:0px;background:transparent;}#sidemenu{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:300 20px sans-serif;left:unset!important;right:0px!important;padding-bottom:0px;height:30%!important;min-width:400px!important;max-width:400px!important;}#sidemenu-content{scrollbar-width:none;padding-top:unset;min-height:calc(100% - 50px)!important;max-height:calc(100% - 50px)!important;}";
  137. var MainCSS = "body{background:" + CTS.MainBackground + " no-repeat center;background-size:cover;overflow:hidden;}#content{width:calc(100% - 400px);padding:0!important;}#nav-static-wrapper, #nav-fixed-wrapper{display:none;}";
  138. var RoomCSS = "tc-title{display:flex!important;}#room{padding:0px!important;}#room-content{background:unset!important;}";
  139. var TitleCSS = "#room-header{border:unset;z-index:1;min-height:36px!important;max-height:36px!important;min-width:400px!important;max-width:400px!important;top:calc(30% + 84px);right:0px;position:fixed;background: linear-gradient(0deg,rgb(19, 73, 104)0%,rgba(9, 27, 29, 0.94)50%,rgb(43, 109, 141)100%);}#room-header-info>h1{text-transform:uppercase;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:600 20px sans-serif;color:#FFFFFF;}#room-header-info>h1:after{content:unset;}#room-header-info{padding:7px 0 0 6px;}#room-header-info>span{right: 8px;position: absolute;top:7px;margin-top:0px!important;}";
  140. var ContextMenuCSS = ".context:after{content:unset;}.context>span{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:800 14px sans-serif;color:#FFFFFF;display:inline-block;padding:1px 1%;line-height:17px;height:17px;}.context{background-color:#20262870;position:unset;padding:0px;}";
  141. var ModeratorCSS = ".video{min-width: 114px;max-width: 114px;}#moderatorlist:after{right:5px;color:#FFFFFF;background:#53b6ef;}#moderatorlist>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist>#header>span>button{top:-2px;background-color: #20262870;}#moderatorlist.show>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist{max-height:60px;}#moderatorlist>#header{height:60px;font-size:16px;font-weight:600;font-family:sans-serif;color:#FFFFFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}#moderatorlist.show[data-videos-count=\"1\"], #moderatorlist.show[data-videos-count=\"2\"] {max-height:205px;}#moderatorlist.show[data-videos-count=\"3\"], #moderatorlist.show[data-videos-count=\"4\"] {max-height:290px;}#moderatorlist.show[data-videos-count=\"5\"], #moderatorlist.show[data-videos-count=\"6\"] {max-height:400px;}#moderatorlist.show[data-videos-count=\"7\"], #moderatorlist.show[data-videos-count=\"8\"] {max-height:460px;}#moderatorlist.show[data-videos-count=\"9\"], #moderatorlist.show[data-videos-count=\"10\"] {max-height:545px;}#moderatorlist.show[data-videos-count=\"11\"], #moderatorlist.show[data-videos-count=\"12\"] {max-height:630px;}";
  142. var UserListCSS = ".list-item>span>span[data-cam=\"1\"]:after{height:15px;width:15px;background-image:url(https://i.imgur.com/QKSbq8d.png);}.list-item>span>span[data-moderator=\"1\"]:before{margin-right:3px;width:15px;height:15px;background-image:url(https://i.imgur.com/CEA9aro.png);}.list-item>span>span{background-color:transparent;box-shadow:none;}.list-item>span>span>.send-gift{top:4px;}.list-item>span>img{top:6px;}#button-banlist{color:#53b6ef;transition:none;top:calc(30% + 89px);right:3px;position:fixed;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#userlist>div{height:22px;}#userlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#userlist>#header{height:40px;top:10px;}#contextmenu {top:calc(100% - 45px)!important;right:5px!important;left:5px!important;}";
  143. var ChatListCSS = ".list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background-color:transparent;visibility:hidden;}.list-item>span>span{top:-4px;background:transparent;box-shadow:none;}.list-item>span>span[data-messages]:before{background:#53b6ef;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#chatlist>#header>.list-item>span.active{background-color:#53b6ef;}#chatlist>#header{height:60px;top:30px}#chatlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#chatlist>div{height:22px;line-height:22px;}";
  144. var NotificationCSS = ".PMTime{display:inline-block;padding:0 6px 0 0;margin:0px 8px 0 0;border-right:4px groove #797979;}.PMName{display:inline-block;}#popup div{user-select: text;-webkit-user-select: text;-moz-user-select: text;color:#FFFFFF;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font-weight: 300;font-size: 18px;font-family: sans-serif;z-index:1;}.PMOverlay{height: calc(100% - 92px);overflow: hidden;pointer-events:none;position:absolute;padding-top:12px;top:0;bottom:0;left:0;right:0;visibility:visible;}.PMPopup{pointer-events:all;margin:5px auto;width:50%;position:relative;}.PMPopup a, .PMPopup a:visited, .PMPopup a:hover, .PMPopup a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.PMPopup a:hover{color:#FFFFFF;text-decoration:underline;}.PMPopup h2{border-radius:5px 5px 0px 0px;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0px;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0px 0px 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
  145. var ChatboxCSS = "#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #181d1e94;}#input-user:checked ~ #user-menu{display:inline-block;}#user-menu > a:hover #user-menu > span > a:hover{color: #FFFFFF}#user-menu > a, #user-menu > span > a {font-weight: 600;position: relative;display: inline-block;width:calc(100% - 30px);padding: 6px;box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;}#user-menu {position: absolute;display: none;bottom: 50px;right: 0;border: 1px solid rgba(0, 0, 0, .06);box-sizing: border-box;border-radius: 3px;color: #FFFFFF;background-color: #181d1e;line-height: 1;box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .09);z-index: 1;}#user-menu > span {display: inline-block;width: 100%;padding: 12px;box-sizing: border-box;font-size: 16px;font-weight: 500;white-space: nowrap;text-overflow: ellipsis;cursor: default;overflow: hidden;}#label-user > img {position: absolute;height: 100%;left: -8px;vertical-align: top;}#label-user{position: relative;display: inline-block;height: 48px;width: 48px;border-radius: 100%;overflow: hidden;cursor: pointer;}#header-user{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;position: absolute;top: 10px;right: 0;}#chat-wrapper.full-screen #chat-instant, #chatf-wrapper.full-screen #chat-instant>.avatar>.status-icon,#chat-wrapper.full-screen #chat-content>.message>.avatar>.status-icon {background-color:unset;}.cts-message-unread{display:block;border-radius:6px;padding:1px 6px 1px 6px;background:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font:bold 16px sans-serif;cursor:pointer}.ctstime{-webkit-box-shadow: 0 0 6px #53b6ef;-moz-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;position:absolute;right:3px;top:3px;background: #181d1e;border: 1px solid black;border-radius: 6px;padding: 1px 6px;}#chat-instant>.avatar>div>img,#cts-chat-content>.message>.avatar>div>img{position:relative;height:100%;left:-7px}.message{color:#FFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-family:sans-serif;font-weight:300;font-size:20px;white-space:pre-line;word-wrap:break-word}.message a, .message a:visited, .message a:hover, .message a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.message a:hover{color:#FFFFFF;text-decoration:underline;}#chat{will-change: transform;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:3px 3px;background:#1316177d;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#3b7494;-webkit-box-shadow: 0 0 20px #ffffff;-moz-box-shadow: 0 0 20px #ffffff;box-shadow: inset 0 0 20px 0px #ffffff;}#cts-chat-content>.message.common{padding:3px 3px 3px 50px;box-sizing:border-box;text-align:left}#chat-instant>.avatar,#cts-chat-content>.message>.avatar{position:absolute;height:40px;width:40px;top:3px;left:3px;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}#chat-instant>.avatar>div,#cts-chat-content>.message>.avatar>div{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden}#notification-content .nickname{border-radius:6px;padding:1px 6px 1px 6px}.notification{padding:1px 0 1px 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black}.time{position:absolute;right:5px}#notification-content{will-change: transform;top:0;position:relative;scrollbar-width:none;background:#181d1e;border-radius:12px 12px 0 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;min-height:80px;max-height:80px;font:bold 16px sans-serif;color:#FFF;overflow-y:scroll;overflow-wrap:break-word;padding:0 6px 0 6px}#notification-content::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#chat-instant>.avatar>.status-icon,#cts-chat-content>.message>.avatar>.status-icon{left:0!important}#chat-instant>.nickname{color:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-size: 20px;font-weight: 800;}#chat-position>#chat-instant>a{display:none;}#chat-instant{padding-left:50px;background-color:transparent!important;}#chat-instant::after{background:none;}.on-white-scroll{scrollbar-width: none;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{-webkit-box-shadow: 0 0 6px #ffffff;-moz-box-shadow: 0 0 6px #ffffff;box-shadow: 0 0 6px #ffffff;border:1px solid black;border-radius:6px;padding:1px 6px 1px 6px;word-wrap:break-word;max-width:calc(100% - 115px);font-weight:600;font-size:16px;color:#FFF;display:inline-block;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#input{padding-top:0}:host,#input>.waiting{background-color:#20262870}#input:before,#input:after{content:unset}#input>textarea::placeholder{color:#FFF}#input>textarea::-webkit-input-placeholder{color:#fff}#input>textarea:-moz-placeholder{color:#fff}#input>textarea{width: calc(100% - 57px);line-height:unset;min-height:65px;max-height:65px;border-radius:6px;scrollbar-width:none;background-color:#181d1e;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font-size:" + (CTS.FontSize - 4) + "px;font-family:sans-serif;font-weight:300;}#chat-wrapper{border:none;transition:none;bottom:0;right:0!important;max-height:calc(70% - 119px)!important;min-height:calc(70% - 119px)!important;position:fixed!important;min-width:400px;max-width:400px;}#chat-position{top:22px;left:6px;right:6px;bottom:5px;}.on-white-scroll::webkit-scrollbar{width:0;background:transparent;}";
  146. //CHATSTYLES
  147. for (var i = 0; i <= CTS.ChatStyles; i++) CTS.ChatCSS[i] = [];
  148. CTS.ChatCSS[0].push("#chat-wrapper{background:linear-gradient(0deg,rgba(32,38,40,0.59)0%,rgba(16,14,14,0.76)calc(100% - 62px),rgba(45,55,58,0.72)100%);}");
  149. CTS.ChatCSS[0].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}");
  150. CTS.ChatCSS[0].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}");
  151. CTS.ChatCSS[1].push("#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%);}");
  152. CTS.ChatCSS[1].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}");
  153. CTS.ChatCSS[1].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}");
  154. CTS.ChatCSS[2].push("#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)}");
  155. CTS.ChatCSS[2].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#7918bc;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#7918bc!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#460b6f!important;}#videos-footer-push-to-talk{background:#7918bc}#videos-footer-push-to-talk:hover{background:#460b6f}#videos-footer-broadcast:hover{background:#460b6f}#videos-footer-broadcast{background:#7918bc;}");
  156. CTS.ChatCSS[2].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}");
  157. CTS.ChatCSS[3].push("#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%);}");
  158. CTS.ChatCSS[3].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#c10101;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#c10101!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#6b0f0f!important;}#videos-footer-push-to-talk{background:#c10101}#videos-footer-push-to-talk:hover{background:#6b0f0f}#videos-footer-broadcast:hover{background:#6b0f0f}#videos-footer-broadcast{background:#c10101;}");
  159. CTS.ChatCSS[3].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}");
  160. CTS.ChatCSS[4].push("#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%);}");
  161. CTS.ChatCSS[4].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}");
  162. CTS.ChatCSS[4].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}");
  163. CTS.ChatCSS[5].push("#chat-wrapper{background:linear-gradient(0deg,rgb(225,0,211)0%,rgb(44,15,45)calc(100% - 62px),rgb(208,0,176)100%);}");
  164. CTS.ChatCSS[5].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#bc01a0;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#bc01a0!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#5a004d!important;}#videos-footer-push-to-talk{background:#bc01a0}#videos-footer-push-to-talk:hover{background:#5a004d}#videos-footer-broadcast:hover{background:#5a004d}#videos-footer-broadcast{background:#bc01a0;}");
  165. CTS.ChatCSS[5].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,14)8px,rgb(188,1,160)100%);}");
  166. CTS.ChatCSS[6].push("#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%);}");
  167. CTS.ChatCSS[6].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}");
  168. CTS.ChatCSS[6].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}");
  169. CTS.ChatCSS[7].push("#chat-wrapper{background:linear-gradient(0deg,rgba(0, 0, 0, 0.69)0%,rgba(0, 0, 0, 0.56)calc(100% - 62px),rgb(13, 179, 0)100%);}");
  170. CTS.ChatCSS[7].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}");
  171. CTS.ChatCSS[7].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}");
  172. CTS.ChatCSS[8].push("#chat-wrapper{background: linear-gradient(0deg,rgb(255, 255, 255)0%,rgba(255, 255, 255, 0.82)calc(100% - 62px),rgb(255, 255, 255)100%);}");
  173. CTS.ChatCSS[8].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}");
  174. CTS.ChatCSS[8].push("#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}");
  175. CTS.ChatCSS[9].push("#chat-wrapper{background: linear-gradient(0deg,rgba(255, 255, 0, 1)0%,rgba(255, 255, 0, 0.82)calc(100% - 62px),rgba(255, 255, 0, 1)100%);}");
  176. CTS.ChatCSS[9].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}");
  177. CTS.ChatCSS[9].push("#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}");
  178. CTS.ChatCSS[10].push("#chat-wrapper{background: linear-gradient(0deg,rgba(255, 125, 0, 1)0%,rgba(255, 125, 0, 0.82)calc(100% - 62px),rgba(255, 125, 0, 1)100%);}");
  179. CTS.ChatCSS[10].push("#videos-footer-broadcast-wrapper>.waiting{background-color:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}");
  180. CTS.ChatCSS[10].push("#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}");
  181. CTSInit();
  182.  
  183. function CTSInit() {
  184. //INITIATE CTS
  185. CTS.ScriptLoading = setInterval(function() {
  186. if (document.querySelector("tinychat-webrtc-app")) {
  187. if (document.querySelector("tinychat-webrtc-app").shadowRoot) {
  188. CTSRoomInject();
  189. }
  190. debug("TINYCHAT::LOAD", "ROOM");
  191. } else if (document.querySelector("#welcome-wrapper")) {
  192. CTSHomeInject();
  193. debug("TinyChat::LOAD", "HOME");
  194. }
  195. }, 100);
  196. //WEBSOCKET HOOK
  197. if (!document.URL.match(/^https:\/\/tinychat.com\/#/)) {
  198. new MutationObserver(function() {
  199. this.disconnect();
  200. CTSWebSocket();
  201. }).observe(document, {
  202. subtree: true,
  203. childList: true
  204. });
  205. }
  206. //FULLY LOADED -> RUNALL
  207. CTS.FullLoad = setInterval(function() {
  208. if (CTS.ScriptInit === true && CTS.SocketConnected === true) {
  209. clearInterval(CTS.FullLoad);
  210. Settings("<center><u>" + CTS.Room.Name.toUpperCase() + "</u>" + (CTS.Room.Avatar ? '\n<img src="' + CTS.Room.Avatar + '">' : "") + "\n" + CTS.Room.Bio + '\n<a href="' + CTS.Room.Website + '" target="_blank">' + CTS.Room.Website + "</a>\n\n</center>");
  211. AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
  212. if (CTS.Room.PTT === true) {
  213. VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
  214. if (e.which == 1) CTS.AutoMicrophone = false;
  215. if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  216. if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  217. }, {
  218. passive: true
  219. });
  220. }
  221. var favorited_rooms = "",
  222. len = CTS.Favorited.length,
  223. script = document.createElement("script"),
  224. elem = document.getElementsByTagName("script")[0];
  225. script.text = 'function AddFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Storage + 'Favorited"));\n val[index]=["' + CTS.Room.Name + '","' + CTS.Room.Avatar + '"];\n localStorage.setItem("' + CTS.Storage + 'Favorited", JSON.stringify(val));\n obj.href ="https://tinychat.com/room/' + CTS.Room.Name + '";\n obj.innerText = "' + CTS.Room.Name + '";\n obj.onclick = null;\n return false;\n}';
  226. elem.parentNode.insertBefore(script, elem);
  227. for (var i = 0; i < len; i++) favorited_rooms += CTS.Favorited[i] !== null ? "#" + (i + 1) + '<a href="https://tinychat.com/room/' + CTS.Favorited[i][0] + '">' + CTS.Favorited[i][0] + "</a>" : "#" + (i + 1) + '<a href="#" onclick="return AddFavorite(this,' + i + ');">ADD ROOM</a>';
  228. ChatLogElement.querySelector("#input").insertAdjacentHTML("afterbegin", '<div id="header-user"><label id="label-user" for="input-user"><img class="switcher" src="' + (CTS.Me.avatar ? CTS.Me.avatar : "https://i.imgur.com/4Q4Lgzf.png") + '"></label><input type="checkbox" id="input-user" hidden=""><div id="user-menu"><span id="nickname">FAVORITED ROOMS</span>' + favorited_rooms + '<span id="nickname">' + CTS.Me.username.toUpperCase() + '</span><a href="https://tinychat.com/settings/gifts"> My Gifts</a><a href="https://tinychat.com/settings/profile">Profile</a><a href="https://tinychat.com/room/' + CTS.Me.username + '">My Room</a><a href="https://tinychat.com/#">Directory</a></div></div>');
  229. }
  230. }, 25);
  231. }
  232.  
  233. function CTSHomeInject() {
  234. var HomeCSS = '.tile-header > img {transition:unset;}.tile-favroom-opt{cursor:pointer;position: absolute;right: 0;top: 0px;padding: 12px;background:#181d1e94;}.tile-favroom-opt:hover{background:#ff00008c;}#content{padding-bottom:unset;}.tile-content{height:180px;}.cts-footer-contents .tile-info{height:20px}.cts-footer-contents .tile-header>img{cursor:pointer;height: 220px;}.tile-header>img{height: 230px;width: 100%;max-width: 100%;}.cts-footer:hover .cts-footer-contents .tile{font-size: 18px;font-weight: 800;width:20%;display:inline-block;}.cts-footer-contents .tile {background: #00a2ff;text-align: center;border:unset;height:unset;display:none;margin: unset;}.cts-footer {background:#181d1e94;width: 100%;position: fixed;bottom: 0;left: 0;}#catalog > div {display: inline-block;padding: 5px;box-sizing: border-box;}.tile[data-status="pro"], .tile[data-status="extreme"], .tile[data-status="gold"] {margin-top: 12px;}.tile-header {border-radius: 12px 12px 0 0;}#promoted .tile-header > img{width:100%;}#navigation > label{border-radius:12px;}#welcome>div{padding-top:0px}.tile-statistic{padding-top:0;padding-bottom:4px;background: #000000a6;}.tile-name{padding-top:unset;}#promote-button{border-radius: 12px 12px 0 0;}tile-name{padding-top:unset;}.tile-info{bottom:unset;top:0;height:28px;}.cts-footer > h2, #promoted-wrapper > h2, #trended-wrapper > h2, #header-for-all{text-align: center;font-size: 30px;font-weight: 800;}body{background:' + CTS.MainBackground + ' no-repeat center;background-size:cover;background-attachment: fixed;}.tile-content-info-icon > img {display:none;}.tile-content-info{font-size: 14px;font-weight: 600;}#promoted .tile-content-info-text{word-break: break-word;max-height:95px;}.tile{border:2px solid #fff;margin-top: 13px;height:425px;}#loadmore-no-more {background-color:#181d1e;}.tile-content > img{display:none;}#welcome-wrapper{background: #181d1e94;border-bottom:unset;}#loadmore{background-color: #00a2ff;font-weight: 600;}#user-menu{background: #181d1e;}#nav-static-wrapper {-webkit-box-shadow: 0 0 20px 17px #53b6ef;-moz-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background:#181d1e;}#up-button:hover > #up-button-content {background-color: #181d1e59;}#nav-fixed{border-bottom:unset;}#nav-fixed-wrapper{-webkit-box-shadow: 0 0 20px 17px #53b6ef;-moz-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background: #181d1e;}#nav-static {border-bottom:unset;}#welcome{padding:12px 30px 24px;}.tile{border-radius: 12px;background-color: #181d1eb3;}div, span, a, h1, h2, h3, h4, h5, h6, p {text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color: #FFFFFF!important;}#promoted-wrapper > div, #trended-wrapper > div {background: #00a2ff;border-radius: 12px;}.tile-content-info-text {word-break: break-word;width:100%;}.tile-content-info.with-icon {display: contents;}#navigation > label:not([for="input-catalog-navigation"]) {font-weight:600;background: #000000;}';
  235. //INSERT HTML/CSS
  236. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  237. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  238. //INSERT SCRIPT
  239. var script = document.createElement("script"),
  240. elem = document.getElementsByTagName("script")[0];
  241. script.text = 'function RemoveFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Storage + 'Favorited"));\n val[index]=null;\n localStorage.setItem("' + CTS.Storage + 'Favorited", JSON.stringify(val));\n return obj.parentNode.parentNode.remove();\n}';
  242. elem.parentNode.insertBefore(script, elem);
  243. var len = CTS.Favorited.length;
  244. for (var i = 0; i < len; i++) document.body.querySelector(".cts-footer-contents").insertAdjacentHTML("beforeend", CTS.Favorited[i] !== null ? '<div class="tile" data-room-name="' + CTS.Favorited[i][0] + '">Favorite #' + (i + 1) + ' <div class="tile-header"><img id="tile-header-image" src="' + (CTS.Favorited[i][1] ? CTS.Favorited[i][1] : "https://i.imgur.com/VnVFEv7.png") + '" onload="MasonryTails.Refresh();" onclick="locationTo(\'/room/' + CTS.Favorited[i][0] + '\');"><div class="tile-info"><div class="tile-favroom-opt" onclick="RemoveFavorite(this,' + i + ')">X</div><div class="tile-name">' + CTS.Favorited[i][0] + '</div><div class="tile-statistic"><svg width="18" height="14" viewBox="0 0 18 14" xmlns="https://www.w3.org/2000/svg"><path d="M9.333 5.667c0-.367-.3-.667-.666-.667h-8C.3 5 0 5.3 0 5.667v6.666C0 12.7.3 13 .667 13h8c.366 0 .666-.3.666-.667V10L12 12.667V5.333L9.333 8V5.667z" transform="translate(3 -3)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span><svg width="20" height="16" viewBox="0 0 20 16" xmlns="https://www.w3.org/2000/svg"><path d="M57 4c-3.182 0-5.9 2.073-7 5 1.1 2.927 3.818 5 7 5s5.9-2.073 7-5c-1.1-2.927-3.818-5-7-5zm0 8.495c1.93 0 3.495-1.565 3.495-3.495 0-1.93-1.565-3.495-3.495-3.495-1.93 0-3.495 1.565-3.495 3.495 0 1.93 1.565 3.495 3.495 3.495zm0-1.51c1.096 0 1.985-.89 1.985-1.985 0-1.096-.89-1.985-1.985-1.985-1.096 0-1.985.89-1.985 1.985 0 1.096.89 1.985 1.985 1.985z" transform="translate(-47 -2)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span></div></div></div></div>' : '<div class="tile">Favorite #' + (i + 1) + "</div>");
  245. //SCRIPT INIT -> PREPARE()
  246. clearInterval(CTS.ScriptLoading);
  247. CTS.ScriptInit = true;
  248. CTSHomePrepare();
  249. }
  250.  
  251. function CTSHomePrepare() {
  252. //FUNCTION BYPASS
  253. window.ModalFreeTrialPro = function() {};
  254. //REMOVE
  255. Remove(document, "#footer");
  256. Remove(document, ".nav-logo");
  257. }
  258.  
  259. function CTSRoomInject() {
  260. //INSERT SCRIPT
  261. var script = document.createElement("script"),
  262. elem = document.getElementsByTagName("script")[0];
  263. script.text = 'var StationSelected = 0,\n StationPlay = false,\n StationVol = 0.2;\nfunction VolStation(elem, vol){\n var StationElem = elem.parentElement.nextSibling;\n StationVol += vol;\n if (StationVol < 0){\n StationVol = 0;\n } else if (StationVol > 1) {\n StationVol = 1.0;\n }\n StationElem.volume = StationVol;\n}\nfunction PlayPauseStation(elem) {\n var StationElem=elem.parentElement.nextSibling;\n StationPlay=!StationPlay;\n if (StationPlay) {\n StationElem.volume = StationVol;\n StationElem.play();\n } else {\n StationElem.pause();\n }\n}\nfunction SeekStation(elem, direction) {\n var StationElem = elem.parentElement.nextSibling;\n StationPlay = true;\n StationSelected += direction;\n \n if (StationSelected > window.RADIO_STATIONS.length-1) {\n StationSelected = 0;\n } else if (StationSelected < 0){\n StationSelected = window.RADIO_STATIONS.length-1;\n }\n StationElem.pause();\n StationElem.setAttribute("src", window.RADIO_STATIONS[StationSelected][1]);\n StationElem.load();\n StationElem.volume = StationVol;\n StationElem.play();\n}';
  264. elem.parentNode.insertBefore(script, elem);
  265. //LOCALSETTINGS
  266. CTS.enablePMs = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enablePMs : true;
  267. CTS.enableSound = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enableSound : true;
  268. //TTS
  269. if (CTS.enableSound === true && "speechSynthesis" in window) {
  270. CTS.TTS.synth = window.speechSynthesis;
  271. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  272. }
  273. //ELEMENT DEFINE
  274. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  275. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  276. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  277. MicrophoneElement = document.createEvent("MouseEvent");
  278. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  279. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  280. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  281. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  282. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  283. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  284. //INSERTHTML/CSS
  285. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  286. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  287. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  288. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  289. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  290. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  291. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  292. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  293. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  294. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  295. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  296. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  297. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  298. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  299. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  300. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("beforeend", '<div id="music-radio"><button class="music-radio-seek" onclick="SeekStation(this,-1);">←</button><button class="music-radio-seek" onclick="SeekStation(this,1);">→</button><button class="music-radio-playpause" onclick="PlayPauseStation(this);">▶❚❚</button><button class="music-radio-vol" onclick="VolStation(this,.05);">+</button><button class="music-radio-vol" style="top:50%" onclick="VolStation(this,-.05);">-</button></div><audio id="music-radio-audio" src="' + CTS.Radio.station[0][1] + '"></audio>');
  301. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  302. VideoListElement.querySelector("#videos-header").appendChild(TitleElement.querySelector('span[title="Settings"]'));
  303. VideoListElement.querySelector("#videolist").appendChild(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"));
  304. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  305. VideoListElement.querySelector("#videolist").insertAdjacentHTML("afterbegin", '<div class="ctsdrop"><button class="ctsoptions">⚙</button><div class="ctsdrop-content"><button id="BackgroundUpdateRight" class="ctsoptions">+</button><button id="BackgroundUpdateColor" class="ctsoptions">BG</button><button id="BackgroundUpdateLeft" class="ctsoptions">-</button><div style="height:6px;background:#624482;"></div><button id="FontSizeUpdate" class="ctsoptions">🗚</button><div style="height:6px;background:#624482;"></div><button id="ChatColor" class="ctsoptions">🖉</button><button id="FeaturedToggled" class="ctsoptions">⛶</button><button id="ChatWidthToggled" class="ctsoptions">↹</button><button id="ChatHeightToggled" class="ctsoptions">≡</button></div></div>');
  306. ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div>');
  307. ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
  308. ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
  309. //SCRIPT INIT -> PREPARE()
  310. clearInterval(CTS.ScriptLoading);
  311. CTS.ScriptInit = true;
  312. CTSRoomPrepare();
  313. }
  314.  
  315. function CTSRoomPrepare() {
  316. //FUNCTION BYPASS
  317. window.TinychatApp.BLL.SoundPlayer.playMessage = function() {};
  318. window.TinychatApp.BLL.SoundPlayer.playGift = function() {};
  319. window.TinychatApp.BLL.User.isSubscription = function() {return true;};
  320. window.TinychatApp.BLL.User.canUseFilters = function() {return true;};
  321. window.TinychatApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  322. var b = this,
  323. d = this.settings.getSettings();
  324. if (d.video === null) {
  325. return void this.app.MediaSettings(() => {
  326. this.BroadcastStart();
  327. });
  328. }
  329. this.videolist.AddingVideoSelf(this.self_handle);
  330. var e = {};
  331. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  332. e.audio = true;
  333. e.video = {
  334. width: {
  335. min: 320,
  336. max: 4096
  337. },
  338. height: {
  339. min: 240,
  340. max: 2160
  341. }
  342. };
  343. } else {
  344. navigator.mediaDevices.enumerateDevices().then(g => {
  345. var h = false;
  346. var len = g.length;
  347. for (var c = 0; c < len; c++) {
  348. if ("videoinput" === g[c].kind) {
  349. if (e.video === void 0) e.video = {width: {min: 320, max: 4096}, height: {min: 240, max: 2160}, frameRate: {min: 30, max: 60}};
  350. if (h) {
  351. d.video = g[c];
  352. h = false;
  353. this.settings.saveSettings(d);
  354. } else if (d.video === null) {
  355. d.video = g[c];
  356. this.settings.saveSettings(d);
  357. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  358. e.video.deviceId = {
  359. exact: d.video.deviceId
  360. };
  361. } else if (d.video.deviceId === a) {
  362. h = true;
  363. }
  364. }
  365. if (g[c].kind === "audioinput") {
  366. if (e.audio === void 0) {
  367. e.audio = {};
  368. }
  369. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) {
  370. e.audio.deviceId = {
  371. exact: d.audio.deviceId
  372. };
  373. }
  374. }
  375. }
  376. for (var z in i) {
  377. if (i.hasOwnProperty(z) && "echoCancellation" == z && e.audio) {
  378. e.audio[z] = c.isAcousticEchoCancelation();
  379. }
  380. }
  381. if (!(e.audio || e.video)) {
  382. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  383. } else if ("https:" === location.protocol || this.app.isDebug()) {
  384. debug("BROADCAST", "Initiating Media...");
  385. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  386. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  387. b.mediaLastConstraints = e;
  388. navigator.mediaDevices.getUserMedia(e).then(m => {
  389. b.onMediaSuccessCallback(m);
  390. });
  391. }
  392. }).catch(er => {
  393. debug("CAMERA::ERROR", er);
  394. });
  395. }
  396. };
  397.  
  398. //REMOVE
  399. Remove(ChatLogElement, 'span[id="input-unread"]');
  400. Remove(ChatLogElement, "#chat-content");
  401. Remove(ChatLogElement, "#chat-wider");
  402. Remove(ChatLogElement, "#chatlog-button");
  403. Remove(SideMenuElement, "#top-buttons-wrapper");
  404. Remove(SideMenuElement, "#user-info");
  405. Remove(SideMenuElement, "#close-users");
  406. Remove(TitleElement, "#room-header-avatar");
  407. Remove(TitleElement, "#room-header-gifts");
  408. Remove(TitleElement, "#room-header-info-text");
  409. Remove(TitleElement, "#room-header-info-details");
  410. Remove(TitleElement, "#room-header-mobile-button");
  411. Remove(TitleElement, 'span[title="Follow"]');
  412. Remove(TitleElement, 'span[title="Share room"]');
  413. Remove(VideoListElement, "#youtube-overlay");
  414. Remove(VideoListElement, "#videos-header-volume");
  415. Remove(document, "#menu-icon");
  416. Remove(document, "#users-icon");
  417. //PARAM REMOVE
  418. if (CTS.enablePMs === false) Remove(ChatListElement, "#chatlist");
  419. //LOAD
  420. CTSRoomLoad();
  421. }
  422.  
  423. function CTSRoomLoad() {
  424. //EVENT LISTENERS
  425. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  426. if (!CTS.ChatDisplay) {
  427. CTS.ChatWidth += 5;
  428. CTS.ChatDisplay = true;
  429. }
  430. CTS.ChatHeight -= 5;
  431. CTS.UserListDisplay = true;
  432. if (CTS.ChatHeight == 20) {
  433. CTS.ChatHeight = 45;
  434. CTS.UserListDisplay = false;
  435. }
  436. ChatLogElement.querySelector("#chat-wrapper").style.cssText = "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);" + (CTS.UserListDisplay ? "top:unset;min-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;max-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;" : "top:36px;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
  437. TitleElement.querySelector("#room-header").style.cssText = "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 84px);" : "0;");
  438. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.cssText = "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 34px);" : "unset;bottom:0;");
  439. VideoListElement.querySelector("#videos-header").style.cssText = "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + (CTS.UserListDisplay ? CTS.ChatHeight + "%;" : "unset;bottom:50px;");
  440. SideMenuElement.querySelector("#sidemenu").style.cssText = !CTS.UserListDisplay ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;height:" + CTS.ChatHeight + "%!important;";
  441. UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  442. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  443. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "36px;") + "right:-70px;display:block;";
  444. UpdateScroll(1, true);
  445. Resize();
  446. }, {
  447. passive: true
  448. });
  449. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  450. CTS.ChatWidth += 5;
  451. CTS.ChatDisplay = true;
  452. if (CTS.ChatWidth == 25) {
  453. CTS.ChatWidth = -5;
  454. CTS.ChatDisplay = false;
  455. }
  456. ChatLogElement.querySelector("#chat-wrapper").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);" + ((CTS.UserListDisplay) ? "top:unset;min-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;max-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;" : "top:36px;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
  457. TitleElement.querySelector("#room-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 84px);" : "0;");
  458. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 34px);" : "unset;bottom:0;");
  459. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + ((CTS.UserListDisplay) ? CTS.ChatHeight + "%;" : "unset;bottom:50px;");
  460. SideMenuElement.querySelector("#sidemenu").style.cssText = (!CTS.ChatDisplay || !CTS.UserListDisplay) ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;height:" + CTS.ChatHeight + "%!important;";
  461. UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  462. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  463. if (CTS.Me.mod) VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "36px;") + "right:-70px;display:block;";
  464. UpdateScroll(1, true);
  465. Resize();
  466. }, {
  467. passive: true
  468. });
  469. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  470. CTS.Featured = !CTS.Featured;
  471. if (CTS.Featured === true) {
  472. Remove(VideoListElement, "#SmallFTYT");
  473. } else {
  474. var node = document.createElement("style");
  475. node.appendChild(document.createTextNode(FeaturedCSS));
  476. node.setAttribute("id", "SmallFTYT");
  477. VideoListElement.appendChild(node);
  478. }
  479. Resize();
  480. }, {
  481. passive: true
  482. });
  483. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  484. CTS.ChatStyleCounter++;
  485. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  486. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  487. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  488. if (CTS.ChatStyleCounter > CTS.ChatStyles) CTS.ChatStyleCounter = 0;
  489. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  490. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  491. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  492. Save("ChatStyle", CTS.ChatStyleCounter);
  493. }, {
  494. passive: true
  495. });
  496. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  497. UpdateScroll(1, true);
  498. CheckUnreadMessage();
  499. }, {
  500. passive: true
  501. });
  502. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  503. var element = event.target;
  504. if (Math.floor(element.scrollTop + 25) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage();
  505. }, {
  506. passive: true
  507. });
  508. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  509. var element = event.target;
  510. if (Math.floor(element.scrollTop + 25) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  511. }, {
  512. passive: true
  513. });
  514. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  515. CTS.MainBackgroundCounter++;
  516. if (CTS.MainBackgroundCounter === Images.length) CTS.MainBackgroundCounter = 0;
  517. document.body.style.background = "#000000 url(" + Images[CTS.MainBackgroundCounter] + ") no-repeat center";
  518. document.body.style.backgroundSize = "cover";
  519. Save("MainBackground", "url(" + Images[CTS.MainBackgroundCounter] + ")");
  520. }, {
  521. passive: true
  522. });
  523. VideoListElement.querySelector("button[id=\"BackgroundUpdateColor\"]").addEventListener("click", function() {
  524. CTS.MainBackgroundColorCounter++;
  525. if (CTS.MainBackgroundColorCounter === Colors.length) CTS.MainBackgroundColorCounter = 0;
  526. document.body.style.background = Colors[CTS.MainBackgroundColorCounter];
  527. Save("MainBackground", Colors[CTS.MainBackgroundColorCounter]);
  528. }, {
  529. passive: true
  530. });
  531. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  532. CTS.MainBackgroundCounter--;
  533. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = Images.length - 1;
  534. document.body.style.background = "#000000 url(" + Images[CTS.MainBackgroundCounter] + ") no-repeat center";
  535. document.body.style.backgroundSize = "cover";
  536. Save("MainBackground", "url(" + Images[CTS.MainBackgroundCounter] + ")");
  537. }, {
  538. passive: true
  539. });
  540. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  541. CTS.FontSize += 5;
  542. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  543. Save("FontSize", CTS.FontSize);
  544. ChatLogElement.querySelector("#textarea").style.fontSize = (CTS.FontSize - 4) + "px";
  545. }, {
  546. passive: true
  547. });
  548. //MUTATION OBSERVERS
  549. new MutationObserver(function() {
  550. LoadMessage();
  551. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  552. attributes: true,
  553. attributeFilter: ["class"],
  554. childList: false,
  555. characterData: false
  556. });
  557. new MutationObserver(function() {
  558. Cameras();
  559. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  560. childList: true
  561. });
  562. new MutationObserver(function() {
  563. Cameras();
  564. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  565. childList: true
  566. });
  567. new MutationObserver(function() {
  568. if (CTS.AutoMicrophone) {
  569. OpenMicrophone();
  570. }
  571. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  572. attributes: true,
  573. attributeFilter: ["class"]
  574. });
  575. //REFRESH VIEW
  576. NotificationDisplay();
  577. Cameras();
  578. }
  579.  
  580. //YOUTUBE FUNCTIONS
  581. function CheckHost() {
  582. if (CTS.Host === 0) {
  583. Send("msg", "!whoisbot");
  584. CTS.HostAttempt = 0;
  585. CTS.HostWaiting = true;
  586. }
  587. }
  588.  
  589. function SetBot() {
  590. Send("msg", "!bot");
  591. CTS.HostWaiting = false;
  592. }
  593.  
  594. function CheckYouTube(link, type, token, isMod) {
  595. if (isMod === undefined) isMod = true;
  596. CTS.YouTube.XHR.type = type;
  597. var videoid = link.match(/http(?:s)?(?:\:\/\/)(?:w{1,3}\.)?(?:youtu(?:\.be|be.com))(?:\/v\/|\/)?(?:watch\?|playlist\?|embed\/|user\/|v\/|\/)(list\=[a-z0-9\-\_]{1,34}|(?:v\=)?[a-z0-9\-\_]{1,11})/i);
  598. if (videoid !== null) {
  599. videoid = videoid[1].replace(/v\=/g, "");
  600. if (videoid.match(/list\=/i)) {
  601. if (isMod) {
  602. videoid = videoid.replace(/list\=/, "");
  603. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  604. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/playlistItems?playlistId=" + videoid + "&part=snippet&maxResults=50" + ((token !== undefined) ? "&pageToken=" + token : "") + "&type=video&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  605. CTS.YouTube.XHR.playlistid = videoid;
  606. CTS.YouTube.XHR.send();
  607. }
  608. } else {
  609. CTS.YouTube.XHR.videoid = videoid;
  610. CTS.YouTube.VideoReturn = true;
  611. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.XHR.videoid + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  612. CTS.YouTube.XHR.send();
  613. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  614. }
  615. } else {
  616. if (CTS.YouTube.QueueList.length <= 0) {
  617. link = link.replace(/^(!yt )/, "");
  618. CTS.YouTube.SearchReturn = true;
  619. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/search?key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg&maxResults=1&q=" + encodeURI(link) + "&type=video&part=snippet");
  620. CTS.YouTube.XHR.send();
  621. debug("YOUTUBE::KEYWORD SEARCH", link);
  622. }
  623. }
  624. }
  625.  
  626. function YouTubePlayList(queue) {
  627. CTS.YouTube.ShowQueue = (queue !== undefined) ? true : false;
  628. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  629. }
  630.  
  631. function YouTubeTrackAdd() {
  632. if (CTS.YouTube.QueueList[0] !== undefined) {
  633. if (CTS.YouTube.Busy === false) {
  634. if (CTS.YouTube.QueueList.length > 0) {
  635. debug("YOUTUBE::ID", CTS.YouTube.QueueList[0].snippet.resourceId.videoId);
  636. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.QueueList[0].snippet.resourceId.videoId + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  637. CTS.YouTube.XHR.videoid = CTS.YouTube.QueueList[0].snippet.resourceId.videoId;
  638. CTS.YouTube.XHR.send();
  639. CTS.YouTube.QueueList.shift();
  640. }
  641. }
  642. }
  643. }
  644.  
  645. function YouTubePlayListItems(list) {
  646. var len = list.length;
  647. for (var i = 0; i < len; i++) {
  648. if (CTS.YouTube.NotPlayable.includes(list[i].snippet.title) === false) {
  649. CTS.YouTube.QueueList.push(list[i]);
  650. }
  651. }
  652. }
  653.  
  654. function YouTubePlayListRemove(list) {
  655. var len = list.length;
  656. for (var i = 0; i < len; i++) {
  657. setTimeout(Send("yut_playlist_remove", [list[i].id, list[i].duration, list[i].title, list[i].image]), (i * 5), list);
  658. }
  659. }
  660.  
  661. function YouTubeTimeConvert(time) {
  662. var a = time.match(/\d+/g);
  663. if (time.indexOf("M") >= 0 && time.indexOf("H") == -1 && time.indexOf("S") == -1) a = [0, a[0], 0];
  664. if (time.indexOf("H") >= 0 && time.indexOf("M") == -1) a = [a[0], 0, a[1]];
  665. if (time.indexOf("H") >= 0 && time.indexOf("M") == -1 && time.indexOf("S") == -1) a = [a[0], 0, 0];
  666. var len = a.length;
  667. time = 0;
  668. if (len == 3) {
  669. time = time + parseInt(a[0]) * 3600;
  670. time = time + parseInt(a[1]) * 60;
  671. time = time + parseInt(a[2]);
  672. }
  673. if (len == 2) {
  674. time = time + parseInt(a[0]) * 60;
  675. time = time + parseInt(a[1]);
  676. }
  677. if (len == 1) time = time + parseInt(a[0]);
  678. return time;
  679. }
  680.  
  681. CTS.YouTube.XHR.onload = function() {
  682. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  683. if (response.error) {
  684. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  685. } else {
  686. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  687. CTS.YouTube.ListBuilt = true;
  688. Send("msg", "🎵Found " + CTS.YouTube.QueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  689. CTS.YouTube.DataReady = true;
  690. CTS.YouTube.Busy = false;
  691. YouTubeTrackAdd();
  692. }
  693. CTS.YouTube.DataReady = false;
  694. if (response.items[0]) {
  695. CTS.YouTube.Busy = true;
  696. if (response.items[0].id) {
  697. if (response.kind == "youtube#playlistItemListResponse") {
  698. YouTubePlayListItems(response.items);
  699. } else {
  700. CTS.YouTube.VideoID = response.items[0].id.videoId;
  701. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.VideoID + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  702. CTS.YouTube.XHR.send();
  703. }
  704. } else if (response.items[0].contentDetails.duration) {
  705. CTS.YouTube.DataReady = true;
  706. }
  707. if (CTS.YouTube.DataReady === false) {
  708. CTS.YouTube.Busy = false;
  709. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  710. if (response.kind == "youtube#playlistItemListResponse") {
  711. if (response.nextPageToken !== undefined) {
  712. CTS.YouTube.ListBuilt = false;
  713. CheckYouTube("https://www.youtube.com/playlist?list=" + CTS.YouTube.XHR.playlistid, false, response.nextPageToken);
  714. CTS.YouTube.Busy = true;
  715. } else {
  716. CTS.YouTube.ListBuilt = true;
  717. Send("msg", "🎵Adding " + CTS.YouTube.QueueList.length + " track(s) to queue!🎵\nEnjoy!");
  718. CTS.YouTube.Busy = false;
  719. }
  720. }
  721. } else {
  722. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.QueueList[0].snippet.resourceId.videoId;
  723. if (CTS.YouTube.Playing === true) {
  724. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  725. Send("yut_playlist_add", [CTS.YouTube.VideoID, YouTubeTimeConvert(response.items[0].contentDetails.duration), ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), (response.items[0] === undefined) ? response.items.snippet.thumbnails.medium.url : response.items[0].snippet.thumbnails.medium.url]);
  726. CTS.YouTube.Busy = false;
  727. } else {
  728. if (response.items[0].snippet.title !== undefined) {
  729. Send("yut_play", [CTS.YouTube.VideoID, YouTubeTimeConvert(response.items[0].contentDetails.duration), response.items[0].snippet.title, response.items[0].snippet.thumbnails.medium.url, 0]);
  730. Send("yut_playlist_remove", [CTS.YouTube.XHR.videoid, YouTubeTimeConvert(response.items[0].contentDetails.duration), response.items[0].snippet.title, response.items[0].snippet.thumbnails.medium.url]);
  731. CTS.YouTube.Playing = true;
  732. }
  733. CTS.YouTube.Busy = false;
  734. }
  735. }
  736. }
  737. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  738. var title = "";
  739. CTS.YouTube.SearchReturn = false;
  740. CTS.YouTube.VideoReturn = false;
  741. if (response.items[0] !== undefined) {
  742. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  743. }
  744. if (response.items !== undefined) {
  745. if (response.items.length > 0) title = response.items[0].snippet.title;
  746. }
  747. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  748. }
  749. if (CTS.YouTube.QueueList.length > 0) YouTubeTrackAdd();
  750. }
  751. };
  752. // Message Functions
  753. function CreateMessage(time, namecolor, avatar, username, nickname, msg, selectedchat) {
  754. CheckUnreadMessage();
  755. msg = CheckImgur(msg);
  756. if (selectedchat == GetActiveChat()) ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(username.toUpperCase()) || CTS.HighlightList.includes(nickname.toUpperCase())) ? "highlight" : "") + "\" " + ((avatar === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + avatar + "\"></div></a>" : "") + "<div class=\"nickname\" style=\"-webkit-box-shadow: 0 0 6px " + namecolor + ";-moz-box-shadow: 0 0 6px " + namecolor + ";box-shadow: 0 0 6px " + namecolor + ";background:" + namecolor + ";\">" + nickname + "<div class=\"ctstime\"> " + time + " </div></div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\"style=\"font-size:" + CTS.FontSize + "px;\">" + msg + "</span></CTS-message-html></div></div>");
  757. var Chat = ChatLogElement.querySelectorAll("#cts-chat-content>.message");
  758. var len = Chat.length;
  759. if (len > CTS.ChatLimit + 50) {
  760. CTS.ChatScroll = true;
  761. len = Chat.length - CTS.ChatLimit;
  762. var ChatIndex = 0;
  763. for (ChatIndex; ChatIndex < len; ChatIndex++) {
  764. Chat[ChatIndex].parentNode.removeChild(Chat[ChatIndex]);
  765. CTS.Message[selectedchat].shift();
  766. }
  767. }
  768. UpdateScroll(1, false);
  769. }
  770.  
  771. function AKB() {
  772. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  773. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  774. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  775. } else {
  776. if (CTS.Me.mod) {
  777. if (CTS.AutoKick === true) {
  778. CTS.NoGreet = true;
  779. Send("kick", arguments[1]);
  780. } else if (CTS.AutoBan === true) {
  781. CTS.NoGreet = true;
  782. Send("ban", arguments[1]);
  783. }
  784. }
  785. }
  786. }
  787.  
  788. function AISB() {
  789. if (arguments[0].username !== "") {
  790. if (!CTS.SafeList.includes(arguments[0].username)) {
  791. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  792. if (CTS.SafeList.length < 2500) {
  793. CTS.SafeList.push(arguments[0].username);
  794. Save("SafeList", JSON.stringify(CTS.SafeList));
  795. debug("SAFELIST::ADDED", arguments[0].username + ":" + arguments[0].handle);
  796. }
  797. } else {
  798. if (arguments[0].lurker === false) {
  799. AKB(true, arguments[0].handle, arguments[0].username);
  800. } else {
  801. AKB(false, arguments[0].handle);
  802. }
  803. }
  804. }
  805. } else {
  806. AKB(false, arguments[0].handle);
  807. }
  808. }
  809.  
  810. function LoadMessage() {
  811. var ChatIndex, index, Chat = ChatLogElement.querySelector("#cts-chat-content");
  812. CTS.ChatScroll = true;
  813. if (!CTS.MessageCallback[CTS.ActiveMessage]) CTS.MessageCallback[CTS.ActiveMessage] = [];
  814. CTS.MessageCallback[CTS.ActiveMessage].html = Chat.innerHTML;
  815. CTS.MessageCallback[CTS.ActiveMessage].len = (Chat.innerHTML === "") ? 0 : CTS.Message[CTS.ActiveMessage].length;
  816. Chat.innerHTML = "";
  817. CheckUnreadMessage();
  818. CTS.ActiveMessage = GetActiveChat();
  819. if (CTS.Message[CTS.ActiveMessage]) {
  820. index = (CTS.MessageCallback[CTS.ActiveMessage]) ? CTS.MessageCallback[CTS.ActiveMessage].len : 0;
  821. if (index > 0) Chat.innerHTML = CTS.MessageCallback[CTS.ActiveMessage].html;
  822. var len = CTS.Message[CTS.ActiveMessage].length;
  823. for (ChatIndex = index; ChatIndex < len; ChatIndex++) ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(CTS.Message[CTS.ActiveMessage][ChatIndex].username.toUpperCase())) ? "highlight" : "") + "\" " + ((CTS.Message[CTS.ActiveMessage][ChatIndex].avatar === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + (CTS.Message[CTS.ActiveMessage][ChatIndex].avatar) + "\"></div></a>" : "") + "<div class=\"nickname\" style=\"-webkit-box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";-moz-box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";background:" + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";\">" + CTS.Message[CTS.ActiveMessage][ChatIndex].nick + "<div class=\"ctstime\"> " + CTS.Message[CTS.ActiveMessage][ChatIndex].time + " </div></div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\" style=\"font-size:" + CTS.FontSize + "px;\">" + CTS.Message[CTS.ActiveMessage][ChatIndex].msg + "</span></CTS-message-html></div></div>");
  824. } else {
  825. CTS.Message[CTS.ActiveMessage] = [];
  826. }
  827. UpdateScroll(1, false);
  828. }
  829.  
  830. function CheckUnreadMessage() {
  831. if (Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 25) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) {
  832. CTS.MissedMsg = 0;
  833. CTS.ChatScroll = true;
  834. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  835. } else {
  836. CTS.MissedMsg++;
  837. CTS.ChatScroll = false;
  838. if (ChatLogElement.querySelector(".cts-message-unread").style.display == "none") ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  839. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  840. }
  841. }
  842.  
  843. function GetActiveChat() {
  844. var elem = ChatListElement.querySelector(".active");
  845. if (elem) return elem.getAttribute("data-chat-id");
  846. return 0;
  847. }
  848.  
  849. function CheckImgur(msg) {
  850. if (CTS.imgur) {
  851. var i = msg.match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpg|gif|png|mp4)/);
  852. if (i !== null) {
  853. msg = (i[1] == "mp4") ? "<center>(Video Below)\n<video onclick=\"if (this.paused) {this.play();}else{this.pause();}\" oncontextmenu=\"return false;\" width=\"320px\" height=\"240px\"><source src=\"" + i[0] + "\" type=\"video/mp4\" /><source src=\"https://i.imgur.com/qLOIgom.mp4\" type=\"video/mp4\" /></video>\n<a href=\"" + i[0] + "\" target=\"_blank\">Direct Link</a></center>" : "<center><img src=\"" + i[0] + "\" width=\"320px\" height=\"240px\" />\n<a href=\"" + i[0] + "\" target=\"_blank\">Direct Link</a></center>";
  854. }
  855. }
  856. return msg;
  857. }
  858.  
  859. function TTS(msg) {
  860. var utter = new window.SpeechSynthesisUtterance(msg);
  861. utter.voice = CTS.TTS.voices[0];
  862. utter.rate = 1.0;
  863. utter.pitch = 0.5;
  864. CTS.TTS.synth.speak(utter);
  865. }
  866.  
  867. function RoomUsers() {
  868. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  869. }
  870.  
  871. function SpamPrevention(msg) {
  872. var LineBreaks = (msg.match(/\n|\r/g) || []).length;
  873. if (LineBreaks >= 10) return true;
  874. }
  875.  
  876. function UpdateScroll(box, force) {
  877. if (box === 1 && (CTS.ChatScroll || force === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  878. if (box === 2 && (CTS.NotificationScroll || force === true)) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  879. }
  880.  
  881. function DecodeTXT(html) {
  882. var txt = document.createElement("textarea");
  883. txt.innerHTML = html;
  884. return txt.value;
  885. }
  886.  
  887. function HTMLtoTXT(str) {
  888. var p = document.createElement("p");
  889. p.appendChild(document.createTextNode(str));
  890. return p.innerHTML.replace(/(?:(?:(?:https?|ftps?):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?/igm, "<a href=\"$&\" target=\"_blank\">$&</a>").replace(/[\u2680-\u2685]/g, "<span style=\"font-size:275%;\">$&</span>");
  891. }
  892.  
  893. function TimeToDate(time, date) {
  894. if (date === undefined) date = new Date();
  895. var match = time.trim().match(/(\d+):(\d+)\s?((am|AM|aM|Am)|(pm|PM|pM|Pm))/);
  896. var t = {
  897. hours: parseInt(match[1]),
  898. minutes: parseInt(match[2]),
  899. period: match[3].toLowerCase()
  900. };
  901. if (t.hours === 12) {
  902. if (t.period === "am") date.setHours(t.hours - 12, t.minutes, 0);
  903. if (t.period === "pm") date.setHours(t.hours, t.minutes, 0);
  904. } else {
  905. if (t.period === "am") date.setHours(t.hours, t.minutes, 0);
  906. if (t.period === "pm") date.setHours(t.hours + 12, t.minutes, 0);
  907. }
  908. return date;
  909. }
  910.  
  911. function PushPM(handle, text, user) {
  912. var list = (user !== undefined) ? CTS.UserList[user] : CTS.Me;
  913. CTS.Message[handle].push({
  914. "time": Time(),
  915. "namecolor": list.namecolor,
  916. "avatar": list.avatar,
  917. "username": list.username,
  918. "nick": list.nick,
  919. "msg": text
  920. });
  921.  
  922. if (handle == GetActiveChat()) {
  923. var msg = CTS.Message[handle][CTS.Message[handle].length - 1];
  924. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, HTMLtoTXT(msg.msg), handle);
  925. UpdateScroll(1, false);
  926. }
  927. }
  928.  
  929. function Time() {
  930. return (new Date().toLocaleString("en-US", {
  931. hour: "numeric",
  932. minute: "numeric",
  933. second: "numeric",
  934. hour12: true
  935. }));
  936. }
  937. // Features
  938. function MessagePopUp(user, msg, selectedchat, youtube) {
  939. if (CTS.Popups) {
  940. var push = false;
  941. if (user != -1) {
  942. if (ChatListElement.querySelector(".list-item .active")) {
  943. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[user].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  944. if (selectedchat) push = true;
  945. } else {
  946. push = true;
  947. }
  948. } else if (!selectedchat) {
  949. push = true;
  950. }
  951. }
  952. if (youtube) push = true;
  953. if (push) {
  954. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  955. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  956. clearTimeout(CTS.NotificationTimeOut[0]);
  957. CTS.NotificationTimeOut.shift();
  958. }
  959. VideoListElement.querySelector(".PMOverlay").insertAdjacentHTML("beforeend", "<div class=\"PMPopup\"><h2><div class=\"PMTime\">" + Time() + "</div><div class=\"PMName\">" + ((youtube) ? "YouTube Bot" : (CTS.UserList[user].nick + " in " + ((selectedchat) ? "Main" : "PM"))) + "</div></h2><div class=\"PMContent\"style=\"font-size:" + CTS.FontSize + "px\">" + msg + "</div></div>");
  960. CTS.NotificationTimeOut.push(setTimeout(function() {
  961. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  962. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  963. CTS.NotificationTimeOut.shift();
  964. }
  965. }, 11100));
  966. }
  967. }
  968. }
  969.  
  970. function Reminder() {
  971. var temp,
  972. i,
  973. len = CTS.ReminderSetList.length;
  974. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderSetList[i]);
  975. CTS.ReminderSetList = [];
  976. if (CTS.Reminder === true) {
  977. len = CTS.ReminderList.length;
  978. for (i = 0; i < len; i++) {
  979. temp = TimeToDate(CTS.ReminderList[i][0]);
  980. CTS.RecentTime = new Date();
  981. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  982. var OffsetTime = temp - CTS.RecentTime;
  983. CTS.ReminderSetList.push(setTimeout(AddReminder, OffsetTime, arguments[0], CTS.ReminderList[i][1], i));
  984. }
  985. }
  986. }
  987.  
  988. function AddReminder() {
  989. Send("msg", "🕬 " + arguments[1]);
  990. setTimeout(Reminder, 5000, arguments[0]);
  991. }
  992.  
  993. function NotificationDisplay() {
  994. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.Notification) ? "block" : "none") + ";";
  995. }
  996.  
  997. function Dice() {
  998. return String.fromCharCode("0x268" + Rand(0, 5));
  999. }
  1000.  
  1001. function Rand(min, max) {
  1002. min = Math.ceil(min);
  1003. max = Math.floor(max);
  1004. return Math.floor(Math.random() * (max - min + 1)) + min;
  1005. }
  1006.  
  1007. function OpenMicrophone() {
  1008. MicrophoneElement.initMouseEvent("mousedown");
  1009. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  1010. }
  1011.  
  1012. function Cameras() {
  1013. var Camera = VideoListElement.querySelectorAll(".videos-items:first-child>.js-video");
  1014. for (var featured = 1; featured < Camera.length; featured++) {
  1015. if (!Camera[featured].querySelector("tc-video-item").shadowRoot.querySelector(".video #fixed")) {
  1016. Camera[featured].querySelector("tc-video-item").shadowRoot.querySelector(".video").insertAdjacentHTML("afterbegin", "<style id=\"fixed\">.video.large{position: absolute;left:calc(50% - 30%);top: 0px;z-index: 2;width: 60%;}.video{padding:0px;}.video>div>.overlay{box-shadow:unset!important;}.video:after{content:unset;}</style>");
  1017. }
  1018. }
  1019. Camera = VideoListElement.querySelectorAll(".videos-items:last-child>.js-video");
  1020. for (var normal = 0; normal < Camera.length; normal++) {
  1021. if (!Camera[normal].querySelector("tc-video-item").shadowRoot.querySelector(".video #fixed")) {
  1022. Camera[normal].querySelector("tc-video-item").shadowRoot.querySelector(".video").insertAdjacentHTML("afterbegin", "<style id=\"fixed\">.video.large{position: absolute;left:calc(50% - 30%);top: 0px;z-index: 2;width: 60%;}.video{padding:0px;}.video>div>.overlay{box-shadow:unset!important;}.video:after{content:unset;}</style>");
  1023. }
  1024. }
  1025. Resize();
  1026. }
  1027.  
  1028. function Resize() {
  1029. window.dispatchEvent(new Event("resize"));
  1030. }
  1031.  
  1032. function Command(cmd, inpm) {
  1033. var UserCommand = cmd.match(/^!([a-zA-Z0-9]*)(?:\s?)(.*)/);
  1034. if (UserCommand) {
  1035. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  1036. debug("COMMAND::" + ((inpm) ? "PM" : "MAIN"), UserCommand[1]);
  1037. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], inpm);
  1038. }
  1039. }
  1040. }
  1041. // Alert Functions
  1042. function Settings(msg) {
  1043. Alert(GetActiveChat(), ((msg !== undefined) ? msg : "") + "<center>CTS BOT CONFIGURATION:\nBot Mode: " + ((CTS.Bot) ? "AUTO" : "OFF") + "\nOperator Mode: " + ((CTS.UserYT) ? "ON" : "OFF") + "\nReminder Mode: " + ((CTS.Reminder) ? "ON" : "OFF") + "\n\nAvatar Display: " + ((CTS.Avatar) ? "SHOW" : "HIDE") + "\nNotification Display: " + ((CTS.Notification) ? "SHOW" : "HIDE") + "\nPopup Display: " + ((CTS.Popups) ? "SHOW" : "HIDE") + "\nFont Size: " + CTS.FontSize + "PX\n\nFOR LIST OF COMMANDS:\n!cts</center>");
  1044. }
  1045.  
  1046. function Alert(activechat, msg) {
  1047. CTS.Message[activechat].push({
  1048. "time": Time(),
  1049. "namecolor": "#3f69c0",
  1050. "avatar": "https://i.imgur.com/S09irS7.png",
  1051. "username": "",
  1052. "nick": ("CTS Version: " + CTS.Version),
  1053. "msg": msg
  1054. });
  1055. var len = CTS.Message[activechat].length - 1;
  1056. msg = CTS.Message[activechat][len];
  1057. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, activechat);
  1058. }
  1059.  
  1060. function AddUserNotification(type, namecolor, nickname, username, state, newnickname) {
  1061. if (CTS.ScriptInit) {
  1062. var chat = ChatLogElement.querySelector("#notification-content"),
  1063. Notification;
  1064. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  1065. if (type == 1) {
  1066. Notification = username + ((state) ? " is " : " has stopped ") + "broadcasting!";
  1067. } else if (type == 2) {
  1068. Notification = username + " has " + ((!state) ? "joined!" : "left");
  1069. } else if (type == 3) {
  1070. Notification = nickname + "has mentioned you!";
  1071. ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span style=\"background:" + namecolor + "\" class=\"nickname\">" + nickname + "</span><span class=\"time\"> " + Time() + " </span><br/> has mentioned you.</div></div>");
  1072. UpdateScroll(2, true);
  1073. } else if (type == 4) {
  1074. Notification = "with the account name " + username + " changed their name to " + newnickname;
  1075. }
  1076. if (type != 3) ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span class=\"nickname\" style=\"background:" + namecolor + ";\">" + nickname + "</span><span class=\"time\"> " + Time() + " </span><br/>" + Notification + "</div></div>");
  1077. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(nickname.toUpperCase()) || CTS.TTSList.includes(username.toUpperCase()) || CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(nickname + ((type == 4) ? " " : "as ") + Notification);
  1078. UpdateScroll(2, false);
  1079. var Notifications = ChatLogElement.querySelectorAll(".notification");
  1080. if (Notifications.length > CTS.NotificationLimit + 10) {
  1081. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  1082. }
  1083. }
  1084. }
  1085.  
  1086. function AddSystemNotification(msg) {
  1087. if (CTS.ScriptInit) {
  1088. ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><span class=\"nickname\"style=\"background:#F00\">SYSTEM</span><span class=\"time\"> " + Time() + " </span><br/>" + msg + "</div>");
  1089. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(msg);
  1090. UpdateScroll(2, false);
  1091. }
  1092. }
  1093. // User Functions
  1094. function AddUser(handle, mod, namecolor, avatar, nickname, username) {
  1095. CTS.UserList.push({
  1096. "handle": handle,
  1097. "mod": mod,
  1098. "namecolor": namecolor,
  1099. "avatar": avatar,
  1100. "nick": nickname,
  1101. "username": username
  1102. });
  1103. AddUserNotification(2, namecolor, nickname, username, false);
  1104. }
  1105.  
  1106. function User(handle) {
  1107. for (var user = 0; user < CTS.UserList.length; user++) {
  1108. if (CTS.UserList[user].handle == handle) return user;
  1109. }
  1110. return -1;
  1111. }
  1112.  
  1113. function UsernameToHandle(username) {
  1114. for (var user = 0; user < CTS.UserList.length; user++) {
  1115. if (CTS.UserList[user].username.toUpperCase() == username || CTS.UserList[user].nick.toUpperCase() == username) return CTS.UserList[user].handle;
  1116. }
  1117. return -1;
  1118. }
  1119.  
  1120. function CheckUserListSafe(arg) {
  1121. var len = CTS.UserList.length;
  1122. for (var user = 0; user < len; user++) {
  1123. if (!CTS.SafeList.includes(CTS.UserList[user].username)) {
  1124. Send(arg, CTS.UserList[user].handle);
  1125. }
  1126. }
  1127. }
  1128.  
  1129. function CheckUserIgnore(user) {
  1130. if (CTS.IgnoreList.includes(CTS.UserList[user].username.toUpperCase()) || CTS.IgnoreList.includes(CTS.UserList[user].nick.toUpperCase())) return true;
  1131. return false;
  1132. }
  1133.  
  1134. function CheckUserAbuse(handle, username, nickname) {
  1135. if (CTS.Me.mod) {
  1136. if ((CTS.KickList.includes(username) || CTS.KickList.includes(nickname))) {
  1137. CTS.NoGreet = true;
  1138. Send("kick", handle);
  1139. }
  1140. if ((CTS.BanList.includes(username) || CTS.BanList.includes(nickname))) {
  1141. CTS.NoGreet = true;
  1142. Send("ban", handle);
  1143. }
  1144. }
  1145. }
  1146.  
  1147. function CheckUserKeywordAbuse(handle, msg) {
  1148. if (handle != CTS.Me.handle) {
  1149. var len = CTS.KickKeywordList.length;
  1150. for (var i = 0; i < len; i++) {
  1151. if (msg.includes(CTS.KickKeywordList[i])) Send("kick", handle);
  1152. }
  1153. len = CTS.BanKeywordList.length;
  1154. for (i = 0; i < len; i++) {
  1155. if (msg.includes(CTS.BanKeywordList[i])) Send("ban", handle);
  1156. }
  1157. }
  1158. }
  1159.  
  1160. function CheckUserStream(handle, published) {
  1161. var user = User(handle);
  1162. if (user != -1) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, published);
  1163. }
  1164.  
  1165. function UserRegex(text) {
  1166. return text.match(/^(-all|[a-z0-9_]){1,32}$/i);
  1167. }
  1168. // Load/Save Function
  1169. function Load(aKey, aDefault) {
  1170. var val = localStorage.getItem(CTS.Storage + aKey);
  1171. if (null === val && "undefined" != typeof aDefault) {
  1172. Save(aKey, aDefault);
  1173. return aDefault;
  1174. }
  1175. return val;
  1176. }
  1177.  
  1178. function Save(aKey, aVal) {
  1179. localStorage.setItem(CTS.Storage + aKey, aVal);
  1180. }
  1181. // Socket functions
  1182. function CTSWebSocket() {
  1183. if (window.Proxy === undefined) return;
  1184. var handler = {
  1185. set: function(Target, prop, value) {
  1186. if (prop == "onmessage") {
  1187. var oldMessage = value;
  1188. value = function(event) {
  1189. var parse = JSON.parse(event.data);
  1190. ServerMsg(parse, Target);
  1191. oldMessage(event);
  1192. };
  1193. }
  1194. return (Target[prop] = value);
  1195. },
  1196. get: function(Target, prop) {
  1197. var value = Target[prop];
  1198. if (prop == "send") {
  1199. value = function(event) {
  1200. var parse = JSON.parse(event);
  1201. ClientMsg(parse, Target);
  1202. Target.send(event);
  1203. };
  1204. }
  1205. return value;
  1206. }
  1207. };
  1208. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  1209. construct: function(Target, args) {
  1210. CTS.SocketTarget = new Target(args[0]);
  1211. debug("SOCKET::CONNECTING", args[0]);
  1212. return new window.Proxy(CTS.SocketTarget, handler);
  1213. }
  1214. });
  1215. window.WebSocket = WebSocketProxy;
  1216. }
  1217.  
  1218. function BotOperator() {
  1219. var len = CTS.YouTube.QueueList.length;
  1220. if (len <= 0) {
  1221. // Moderator Control
  1222. if (CTS.UserList[arguments[1]].mod) {
  1223. if (arguments[0] == 2) {
  1224. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1225. CTS.YouTube.Clear = true;
  1226. YouTubePlayList();
  1227. }
  1228. }
  1229. if (arguments[0] == 5) SetBot();
  1230. }
  1231. // User and Moderator Control
  1232. if ((CTS.UserYT && (CTS.BotOPList.includes(CTS.UserList[arguments[1]].username.toUpperCase()) || CTS.BotOPList.includes("-ALL"))) || CTS.UserList[arguments[1]].mod) {
  1233. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  1234. if (arguments[0] == 4) YouTubePlayList(true);
  1235. if (arguments[0] == 6) {
  1236. if (CTS.UserList[arguments[1]].mod) {
  1237. var videoid = arguments[2].match(/http(?:s)?(?:\:\/\/)(?:w{1,3}\.)?(?:youtu(?:\.be|be.com))(?:\/v\/|\/)?(?:watch\?|embed\/|user\/|v\/|\/)(?:v\=)?([a-z0-9\-\_]{1,11})/i);
  1238. if (videoid !== null) {
  1239. CTS.SocketTarget.send(JSON.stringify({
  1240. "tc": "yut_play",
  1241. "item": {
  1242. "id": videoid[1],
  1243. "duration": 3600,
  1244. "offset": 0,
  1245. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1246. }
  1247. }));
  1248. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1249. }
  1250. } else {
  1251. Send("msg", "Ask a moderator to play your request.");
  1252. }
  1253. }
  1254. if (arguments[0] == 3) {
  1255. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1256. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  1257. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  1258. }
  1259. }
  1260. }
  1261. } else {
  1262. if (CTS.YouTube.ListBuilt === false) {
  1263. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.QueueList.length + " tracks found.");
  1264. } else {
  1265. Send("msg", "🎵 Playlist items are being added, please wait! 🎵\n" + CTS.YouTube.QueueList.length + " tracks remaining.");
  1266. }
  1267. }
  1268. }
  1269.  
  1270. function ServerMsg(parse) {
  1271. if (typeof SetList[parse.tc] == "function") {
  1272. debug(("SERVER::" + parse.tc.toUpperCase()), parse);
  1273. SetList[parse.tc](parse);
  1274. }
  1275. }
  1276.  
  1277. function ClientMsg(parse) {
  1278. if (typeof GetList[parse.tc] == "function") {
  1279. debug(("CLIENT::" + parse.tc.toUpperCase()), parse);
  1280. GetList[parse.tc](parse);
  1281. }
  1282. }
  1283.  
  1284. function Send(set, arg, activepm) {
  1285. SendList[set](set, arg, activepm);
  1286. if (arg === undefined) arg = "Open Request";
  1287. debug(("CLIENT::SEND::" + set.toUpperCase()), arg);
  1288. }
  1289.  
  1290. // List Functions
  1291. var UnicodeConversionList = {
  1292. convert: function(string) {
  1293. return this.numerical(string).replace(/[A-Za-z]/g, this.alphabet);
  1294. },
  1295. alphabet: function(string) {
  1296. return String.fromCodePoint(string.codePointAt(0) + ((/[A-Z]/.test(string)) ? "𝗔".codePointAt(0) - "A".codePointAt(0) : "𝗮".codePointAt(0) - "a".codePointAt(0)));
  1297. },
  1298. numerical: function(string) {
  1299. return string.replace(/\d/g, function(c) {
  1300. return String.fromCodePoint(0x1D79E + c.charCodeAt(0));
  1301. });
  1302. }
  1303. };
  1304. var CommandList = {
  1305. cts: function(arg, inpm) {
  1306. Alert(GetActiveChat(), "Command List:\n<b style=\"color:#ee3636;\">Moderator Commands:</b>\n!whoisbot\n!bot\n!bottoggle\n!autokick (be careful!)\n!autoban (be careful!)\n\n!ytbypass <b style=\"color:#ffff00;\">link (no playlists)</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytclear\n\n!banlist\n!banlistclear\n!banadd <b style=\"color:#ffff00;\">user | nick</b>\n!banremove <b style=\"color:#ffff00;\">#</b>\n\n!bankeywordlist\n!bankeywordlistclear\n!bankeywordadd <b style=\"color:#ffff00;\">keyword</b>\n!bankeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!kicklist\n!kicklistclear\n!kickadd <b style=\"color:#ffff00;\">user | nick</b>\n!kickremove <b style=\"color:#ffff00;\">#</b>\n\n!kickkeywordlist\n!kickkeywordlistclear\n!kickkeywordadd <b style=\"color:#ffff00;\">keyword</b>\n!kickkeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!oplist\n!oplistclear\n!opadd <b style=\"color:#ffff00;\">user | nick | -all</b>\n!opremove <b style=\"color:#ffff00;\">#</b>\n!optoggle\n\n<b style=\"color:#ee3636;\">User Commands:</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytskip\n!ytqueue\n\n!mentionlist\n!mentionlistclear\n!mentionadd <b style=\"color:#ffff00;\">keyword</b>\n!mentionremove <b style=\"color:#ffff00;\">#</b>\n\n!ignorelist\n!ignorelistclear\n!ignoreadd <b style=\"color:#ffff00;\">user | nick</b>\n!ignoreremove <b style=\"color:#ffff00;\">#</b>\n\n!greetlist\n!greetlistclear\n!greetadd <b style=\"color:#ffff00;\">user | nick | -all</b>\n!greetremove <b style=\"color:#ffff00;\">#</b>\n\n!ttslist\n!ttslistclear\n!ttsadd <b style=\"color:#ffff00;\">user | nick | -all | -event</b>\n!ttsremove <b style=\"color:#ffff00;\">#</b>\n\n!highlightlist\n!highlightlistclear\n!highlightadd <b style=\"color:#ffff00;\">user | nick</b>\n!highlightremove <b style=\"color:#ffff00;\">#</b>\n\n!reminderlist\n!reminderlistclear\n!reminderadd <b style=\"color:#ffff00;\">user | nick</b>\n!reminderremove <b style=\"color:#ffff00;\">#</b>\n!remindertoggle\n\n!safelist\n!safelistclear\n!safelistremove <b style=\"color:#ffff00;\">#</b>\n\n!lists\n!listsclear\n\n!greetmode\n!imgurtoggle\n!avatartoggle\n!notificationtoggle\n!popuptoggle\n\n!8ball <b style=\"color:#ffff00;\">question</b>\n!roll <b style=\"color:#ffff00;\">#</b>\n\n!clr\n!settings\n!share");
  1307. },
  1308. mentionadd: function(arg, inpm) {
  1309. if (arg === "") {
  1310. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1311. } else {
  1312. if (UserRegex(arg)) {
  1313. CTS.MentionList.push(arg.toUpperCase());
  1314. Save("MentionList", JSON.stringify(CTS.MentionList));
  1315. Alert(GetActiveChat(), "🗹Command Accepted!");
  1316. }
  1317. }
  1318. },
  1319. mentionremove: function(arg, inpm) {
  1320. if (arg === "" || isNaN(arg)) {
  1321. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1322. } else {
  1323. if (CTS.MentionList[arg] !== undefined) {
  1324. CTS.MentionList.splice(arg, 1);
  1325. Save("MentionList", JSON.stringify(CTS.MentionList));
  1326. Alert(GetActiveChat(), "🗹Command Accepted!");
  1327. } else {
  1328. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1329. }
  1330. }
  1331. },
  1332. mentionlistclear: function() {
  1333. CTS.MentionList = [];
  1334. Save("MentionList", JSON.stringify(CTS.MentionList));
  1335. Alert(GetActiveChat(), "🗹Command Accepted!");
  1336. },
  1337. mentionlist: function() {
  1338. Alert(GetActiveChat(), SettingsList.MentionList());
  1339. },
  1340. ignoreadd: function(arg, inpm) {
  1341. if (arg === "") {
  1342. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1343. } else {
  1344. if (UserRegex(arg)) {
  1345. CTS.IgnoreList.push(arg.toUpperCase());
  1346. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1347. Alert(GetActiveChat(), "🗹Command Accepted!");
  1348. }
  1349. }
  1350. },
  1351. ignoreremove: function(arg, inpm) {
  1352. if (arg === "" || isNaN(arg)) {
  1353. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1354. } else {
  1355. if (CTS.IgnoreList[arg] !== undefined) {
  1356. CTS.IgnoreList.splice(arg, 1);
  1357. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1358. Alert(GetActiveChat(), "🗹Command Accepted!");
  1359. } else {
  1360. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1361. }
  1362. }
  1363. },
  1364. ignorelistclear: function() {
  1365. CTS.IgnoreList = [];
  1366. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1367. Alert(GetActiveChat(), "🗹Command Accepted!");
  1368. },
  1369. ignorelist: function() {
  1370. Alert(GetActiveChat(), SettingsList.IgnoreList());
  1371. },
  1372. banadd: function(arg, inpm) {
  1373. if (arg === "") {
  1374. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1375. } else {
  1376. if (UserRegex(arg)) {
  1377. CTS.BanList.push(arg.toUpperCase());
  1378. Save("BanList", JSON.stringify(CTS.BanList));
  1379. Alert(GetActiveChat(), "🗹Command Accepted!");
  1380. var check = UsernameToHandle(arg.toUpperCase());
  1381. if (check != -1 && CTS.Me.mod) Send("ban", check);
  1382. }
  1383. }
  1384. },
  1385. banremove: function(arg, inpm) {
  1386. if (arg === "" || isNaN(arg)) {
  1387. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1388. } else {
  1389. if (CTS.BanList[arg] !== undefined) {
  1390. CTS.BanList.splice(arg, 1);
  1391. Save("BanList", JSON.stringify(CTS.BanList));
  1392. Alert(GetActiveChat(), "🗹Command Accepted!");
  1393. } else {
  1394. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1395. }
  1396. }
  1397. },
  1398. banlistclear: function() {
  1399. CTS.BanList = [];
  1400. Save("BanList", JSON.stringify(CTS.BanList));
  1401. Alert(GetActiveChat(), "🗹Command Accepted!");
  1402. },
  1403. banlist: function() {
  1404. Alert(GetActiveChat(), SettingsList.BanList());
  1405. },
  1406. kickadd: function(arg, inpm) {
  1407. if (arg === "") {
  1408. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1409. } else {
  1410. if (UserRegex(arg)) {
  1411. CTS.KickList.push(arg.toUpperCase());
  1412. Save("KickList", JSON.stringify(CTS.KickList));
  1413. Alert(GetActiveChat(), "🗹Command Accepted!");
  1414. var check = UsernameToHandle(arg.toUpperCase());
  1415. if (check != -1 && CTS.Me.mod) Send("kick", check);
  1416. }
  1417. }
  1418. },
  1419. kickremove: function(arg, inpm) {
  1420. if (arg === "" || isNaN(arg)) {
  1421. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1422. } else {
  1423. if (CTS.KickList[arg] !== undefined) {
  1424. CTS.KickList.splice(arg, 1);
  1425. Save("KickList", JSON.stringify(CTS.KickList));
  1426. Alert(GetActiveChat(), "🗹Command Accepted!");
  1427. } else {
  1428. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1429. }
  1430. }
  1431. },
  1432. kicklistclear: function() {
  1433. CTS.KickList = [];
  1434. Save("KickList", JSON.stringify(CTS.KickList));
  1435. Alert(GetActiveChat(), "🗹Command Accepted!");
  1436. },
  1437. kicklist: function() {
  1438. Alert(GetActiveChat(), SettingsList.KickList());
  1439. },
  1440. bankeywordadd: function(arg, inpm) {
  1441. if (arg === "") {
  1442. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1443. } else {
  1444. CTS.BanKeywordList.push(arg);
  1445. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  1446. Alert(GetActiveChat(), "🗹Command Accepted!");
  1447. }
  1448. },
  1449. bankeywordremove: function(arg, inpm) {
  1450. if (arg === "" || isNaN(arg)) {
  1451. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1452. } else {
  1453. if (CTS.BanKeywordList[arg] !== undefined) {
  1454. CTS.BanKeywordList.splice(arg, 1);
  1455. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  1456. Alert(GetActiveChat(), "🗹Command Accepted!");
  1457. } else {
  1458. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1459. }
  1460. }
  1461. },
  1462. bankeywordlistclear: function() {
  1463. CTS.BanKeywordList = [];
  1464. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  1465. Alert(GetActiveChat(), "🗹Command Accepted!");
  1466. },
  1467. bankeywordlist: function() {
  1468. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  1469. },
  1470. kickkeywordadd: function(arg, inpm) {
  1471. if (arg === "") {
  1472. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1473. } else {
  1474. CTS.KickKeywordList.push(arg);
  1475. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  1476. Alert(GetActiveChat(), "🗹Command Accepted!");
  1477. }
  1478. },
  1479. kickkeywordremove: function(arg, inpm) {
  1480. if (arg === "" || isNaN(arg)) {
  1481. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1482. } else {
  1483. if (CTS.KickKeywordList[arg] !== undefined) {
  1484. CTS.KickKeywordList.splice(arg, 1);
  1485. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  1486. Alert(GetActiveChat(), "🗹Command Accepted!");
  1487. } else {
  1488. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1489. }
  1490. }
  1491. },
  1492. kickkeywordlistclear: function() {
  1493. CTS.KickKeywordList = [];
  1494. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  1495. Alert(GetActiveChat(), "🗹Command Accepted!");
  1496. },
  1497. kickkeywordlist: function() {
  1498. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  1499. },
  1500. greetadd: function(arg, inpm) {
  1501. if (arg === "") {
  1502. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1503. } else {
  1504. if (UserRegex(arg)) {
  1505. CTS.GreetList.push(arg.toUpperCase());
  1506. Save("GreetList", JSON.stringify(CTS.GreetList));
  1507. Alert(GetActiveChat(), "🗹Command Accepted!");
  1508. }
  1509. }
  1510. },
  1511. greetremove: function(arg, inpm) {
  1512. if (arg === "" || isNaN(arg)) {
  1513. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1514. } else {
  1515. if (CTS.GreetList[arg] !== undefined) {
  1516. CTS.GreetList.splice(arg, 1);
  1517. Save("GreetList", JSON.stringify(CTS.GreetList));
  1518. Alert(GetActiveChat(), "🗹Command Accepted!");
  1519. } else {
  1520. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1521. }
  1522. }
  1523. },
  1524. greetlistclear: function() {
  1525. CTS.GreetList = [];
  1526. Save("GreetList", JSON.stringify(CTS.GreetList));
  1527. Alert(GetActiveChat(), "🗹Command Accepted!");
  1528. },
  1529. greetlist: function() {
  1530. Alert(GetActiveChat(), SettingsList.GreetList());
  1531. },
  1532. highlightadd: function(arg, inpm) {
  1533. if (arg === "") {
  1534. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1535. } else {
  1536. if (UserRegex(arg)) {
  1537. CTS.HighlightList.push(arg.toUpperCase());
  1538. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  1539. Alert(GetActiveChat(), "🗹Command Accepted!");
  1540. }
  1541. }
  1542. },
  1543. highlightremove: function(arg, inpm) {
  1544. if (arg === "" || isNaN(arg)) {
  1545. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1546. } else {
  1547. if (CTS.HighlightList[arg] !== undefined) {
  1548. CTS.HighlightList.splice(arg, 1);
  1549. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  1550. Alert(GetActiveChat(), "🗹Command Accepted!");
  1551. } else {
  1552. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1553. }
  1554. }
  1555. },
  1556. highlightlistclear: function() {
  1557. CTS.HighlightList = [];
  1558. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  1559. Alert(GetActiveChat(), "🗹Command Accepted!");
  1560. },
  1561. highlightlist: function() {
  1562. Alert(GetActiveChat(), SettingsList.HighlightList());
  1563. },
  1564. opadd: function(arg, inpm) {
  1565. if (arg === "") {
  1566. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1567. } else {
  1568. if (UserRegex(arg)) {
  1569. CTS.BotOPList.push(arg.toUpperCase());
  1570. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  1571. Alert(GetActiveChat(), "🗹Command Accepted!");
  1572. }
  1573. }
  1574. },
  1575. opremove: function(arg, inpm) {
  1576. if (arg === "" || isNaN(arg)) {
  1577. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1578. } else {
  1579. if (CTS.BotOPList[arg] !== undefined) {
  1580. CTS.BotOPList.splice(arg, 1);
  1581. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  1582. Alert(GetActiveChat(), "🗹Command Accepted!");
  1583. } else {
  1584. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1585. }
  1586. }
  1587. },
  1588. oplistclear: function(arg, inpm) {
  1589. CTS.BotOPList = [];
  1590. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  1591. Alert(GetActiveChat(), "🗹Command Accepted!");
  1592. },
  1593. oplist: function() {
  1594. Alert(GetActiveChat(), SettingsList.BotOPList());
  1595. },
  1596. ttsadd: function(arg, inpm) {
  1597. if (arg === "") {
  1598. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1599. } else {
  1600. if (arg.match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  1601. CTS.TTSList.push(arg.toUpperCase());
  1602. Save("TTSList", JSON.stringify(CTS.TTSList));
  1603. Alert(GetActiveChat(), "🗹Command Accepted!");
  1604. }
  1605. }
  1606. },
  1607. ttsremove: function(arg, inpm) {
  1608. if (arg === "" || isNaN(arg)) {
  1609. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1610. } else {
  1611. if (CTS.TTSList[arg] !== undefined) {
  1612. CTS.TTSList.splice(arg, 1);
  1613. Save("TTSList", JSON.stringify(CTS.TTSList));
  1614. Alert(GetActiveChat(), "🗹Command Accepted!");
  1615. } else {
  1616. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1617. }
  1618. }
  1619. },
  1620. ttslistclear: function(arg, inpm) {
  1621. CTS.TTSList = [];
  1622. Save("TTSList", JSON.stringify(CTS.TTSList));
  1623. Alert(GetActiveChat(), "🗹Command Accepted!");
  1624. },
  1625. ttslist: function() {
  1626. Alert(GetActiveChat(), SettingsList.TTSList());
  1627. },
  1628. reminderadd: function(arg, inpm) {
  1629. if (arg === "") {
  1630. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1631. } else {
  1632. var reminder = arg.match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9])\s?(?:[AaPp][Mm]))\s(.*)/);
  1633. if (reminder === null) {
  1634. Alert(GetActiveChat(), "🗷Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  1635. } else {
  1636. CTS.ReminderList.push([reminder[1], reminder[2]]);
  1637. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  1638. Alert(GetActiveChat(), "🗹Command Accepted!");
  1639. Reminder();
  1640. }
  1641. }
  1642. },
  1643. reminderremove: function(arg, inpm) {
  1644. if (arg === "" || isNaN(arg)) {
  1645. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1646. } else {
  1647. if (CTS.ReminderList[arg] !== undefined) {
  1648. CTS.ReminderList.splice(arg, 1);
  1649. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  1650. Reminder();
  1651. Alert(GetActiveChat(), "🗹Command Accepted!");
  1652. } else {
  1653. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1654. }
  1655. }
  1656. },
  1657. reminderlistclear: function() {
  1658. CTS.ReminderList = [];
  1659. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  1660. Alert(GetActiveChat(), "🗹Command Accepted!");
  1661. },
  1662. reminderlist: function() {
  1663. Alert(GetActiveChat(), SettingsList.ReminderList());
  1664. },
  1665. remindertoggle: function() {
  1666. CTS.Reminder = !CTS.Reminder;
  1667. Save("Reminder", JSON.stringify(CTS.Reminder));
  1668. Reminder();
  1669. Settings();
  1670. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  1671. },
  1672. safelistremove: function(arg, inpm) {
  1673. if (arg === "" || isNaN(arg)) {
  1674. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1675. } else {
  1676. if (CTS.SafeList[arg] !== undefined) {
  1677. CTS.SafeList.splice(arg, 1);
  1678. Save("SafeList", JSON.stringify(CTS.SafeList));
  1679. Alert(GetActiveChat(), "🗹Command Accepted!");
  1680. } else {
  1681. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1682. }
  1683. }
  1684. },
  1685. safelistclear: function(arg, inpm) {
  1686. CTS.SafeList = [];
  1687. Save("SafeList", JSON.stringify(CTS.SafeList));
  1688. Alert(GetActiveChat(), "🗹Command Accepted!");
  1689. },
  1690. safelist: function() {
  1691. Alert(GetActiveChat(), SettingsList.SafeList());
  1692. },
  1693. optoggle: function() {
  1694. CTS.UserYT = !CTS.UserYT;
  1695. Save("UserYT", JSON.stringify(CTS.UserYT));
  1696. Settings();
  1697. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  1698. },
  1699. avatartoggle: function() {
  1700. CTS.Avatar = !CTS.Avatar;
  1701. Save("Avatar", JSON.stringify(CTS.Avatar));
  1702. Settings();
  1703. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  1704. },
  1705. popuptoggle: function() {
  1706. CTS.Popups = !CTS.Popups;
  1707. Save("Popups", JSON.stringify(CTS.Popups));
  1708. Settings();
  1709. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  1710. },
  1711. notificationtoggle: function() {
  1712. CTS.Notification = !CTS.Notification;
  1713. Save("Notification", JSON.stringify(CTS.Notification));
  1714. NotificationDisplay();
  1715. Alert(GetActiveChat(), "🗹Command Accepted!");
  1716. },
  1717. greetmode: function() {
  1718. CTS.GreetMode = !CTS.GreetMode;
  1719. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  1720. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  1721. },
  1722. imgurtoggle: function() {
  1723. CTS.imgur = !CTS.imgur;
  1724. Save("imgur", JSON.stringify(CTS.imgur));
  1725. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  1726. },
  1727. clr: function() {
  1728. CTS.MessageCallback = [];
  1729. CTS.Message = [];
  1730. CTS.Message[0] = [];
  1731. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  1732. },
  1733. autokick: function(arg, inpm) {
  1734. if (inpm === false && CTS.Me.mod) {
  1735. CTS.AutoKick = !CTS.AutoKick;
  1736. CTS.AutoBan = false;
  1737. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  1738. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  1739. }
  1740. },
  1741. autoban: function(arg, inpm) {
  1742. if (inpm === false && CTS.Me.mod) {
  1743. CTS.AutoBan = !CTS.AutoBan;
  1744. CTS.AutoKick = false;
  1745. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  1746. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  1747. }
  1748. },
  1749. bottoggle: function() {
  1750. CTS.Bot = !CTS.Bot;
  1751. Save("Bot", JSON.stringify(CTS.Bot));
  1752. Settings();
  1753. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  1754. },
  1755. bot: function(arg, inpm) {
  1756. if (inpm === false && CTS.Me.mod) Alert(0, "🗹Command Accepted!\nBot bypass was called!");
  1757. },
  1758. share: function() {
  1759. var msg = "CosmosisT's TinyChat Script:\n(CTS Link)\nhttps://greasyfork.org/en/scripts/392086\nOR\n(CTS Lite Link)\nhttps://greasyfork.org/en/scripts/396295\n(Tamper Monkey Link)\nhttps://www.tampermonkey.net/";
  1760. if (GetActiveChat() !== 0) {
  1761. Send("pvtmsg", msg, GetActiveChat());
  1762. PushPM(GetActiveChat(), msg);
  1763. } else {
  1764. Send("msg", msg);
  1765. }
  1766. },
  1767. roll: function(arg, inpm) {
  1768. var dice,
  1769. msg = "";
  1770. dice = (arg === "" || isNaN(arg)) ? 1 : (arg < 12) ? arg : 12;
  1771. for (var i = 0; i < dice; i++) msg += Dice();
  1772. if (GetActiveChat() !== 0) {
  1773. Send("pvtmsg", msg, GetActiveChat());
  1774. PushPM(GetActiveChat(), msg);
  1775. } else {
  1776. Send("msg", msg);
  1777. }
  1778. },
  1779. "8ball": function(arg) {
  1780. if (arg === "") {
  1781. Alert(GetActiveChat(), "That's not a question!");
  1782. } else {
  1783. var msg = CTS.EightBall[Rand(0, CTS.EightBall.length - 1)];
  1784. if (GetActiveChat() !== 0) {
  1785. Send("pvtmsg", msg, GetActiveChat());
  1786. } else {
  1787. Send("msg", msg);
  1788. }
  1789. }
  1790. },
  1791. settings: function() {
  1792. Settings();
  1793. },
  1794. lists: function() {
  1795. Alert(GetActiveChat(), SettingsList.BanList() + SettingsList.BanKeywordList() + SettingsList.KickList() + SettingsList.KickKeywordList() + SettingsList.BotOPList() + SettingsList.MentionList() + SettingsList.IgnoreList() + SettingsList.GreetList() + SettingsList.TTSList() + SettingsList.HighlightList() + SettingsList.ReminderList());
  1796. },
  1797. listsclear: function() {
  1798. CTS.MentionList = [];
  1799. CTS.IgnoreList = [];
  1800. CTS.BanList = [];
  1801. CTS.KickList = [];
  1802. CTS.BanKeywordList = [];
  1803. CTS.KickKeywordList = [];
  1804. CTS.GreetList = [];
  1805. CTS.HighlightList = [];
  1806. CTS.ReminderList = [];
  1807. CTS.TTSList = [];
  1808. CTS.BotOPList = [];
  1809. Save("MentionList", JSON.stringify(CTS.MentionList));
  1810. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1811. Save("BanList", JSON.stringify(CTS.BanList));
  1812. Save("KickList", JSON.stringify(CTS.KickList));
  1813. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  1814. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  1815. Save("GreetList", JSON.stringify(CTS.GreetList));
  1816. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  1817. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  1818. Save("TTSList", JSON.stringify(CTS.TTSList));
  1819. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  1820. Alert(GetActiveChat(), "🗹Command Accepted!");
  1821. },
  1822. ytqueue: function() {},
  1823. ytclear: function() {},
  1824. ytskip: function() {},
  1825. yt: function() {},
  1826. ytbypass: function() {}
  1827. };
  1828. var SettingsList = {
  1829. BanList: function() {
  1830. var index,
  1831. msg,
  1832. len = CTS.BanList.length;
  1833. msg = "<b style=\"color:#ee3636;\"><u>Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1834. for (index = 0; index < len; index++) msg += index + " : " + CTS.BanList[index] + "\n";
  1835. return msg;
  1836. },
  1837. BanKeywordList: function() {
  1838. var index,
  1839. msg,
  1840. len = CTS.BanKeywordList.length;
  1841. msg = "<b style=\"color:#ee3636;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1842. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  1843. return msg;
  1844. },
  1845. KickList: function() {
  1846. var index,
  1847. msg,
  1848. len = CTS.KickList.length;
  1849. msg = "<b style=\"color:#ee3636;\"><u>Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1850. for (index = 0; index < len; index++) msg += index + " : " + CTS.KickList[index] + "\n";
  1851. return msg;
  1852. },
  1853. KickKeywordList: function() {
  1854. var index,
  1855. msg,
  1856. len = CTS.KickKeywordList.length;
  1857. msg = "<b style=\"color:#ee3636;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1858. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  1859. return msg;
  1860. },
  1861. BotOPList: function() {
  1862. var index,
  1863. msg,
  1864. len = CTS.BotOPList.length;
  1865. msg = "<b style=\"color:#ee3636;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1866. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  1867. return msg;
  1868. },
  1869. MentionList: function() {
  1870. var index,
  1871. msg,
  1872. len = CTS.MentionList.length;
  1873. msg = "<b style=\"color:#ee3636;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1874. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  1875. return msg;
  1876. },
  1877. IgnoreList: function() {
  1878. var index,
  1879. msg,
  1880. len = CTS.IgnoreList.length;
  1881. msg = "<b style=\"color:#ee3636;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1882. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  1883. return msg;
  1884. },
  1885. GreetList: function() {
  1886. var index,
  1887. msg,
  1888. len = CTS.GreetList.length;
  1889. msg = "<b style=\"color:#ee3636;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1890. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  1891. return msg;
  1892. },
  1893. TTSList: function() {
  1894. var index,
  1895. msg,
  1896. len = CTS.TTSList.length;
  1897. msg = "<b style=\"color:#ee3636;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1898. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  1899. return msg;
  1900. },
  1901. HighlightList: function() {
  1902. var index,
  1903. msg,
  1904. len = CTS.HighlightList.length;
  1905. msg = "<b style=\"color:#ee3636;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1906. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  1907. return msg;
  1908. },
  1909. ReminderList: function() {
  1910. var index,
  1911. msg,
  1912. len = CTS.ReminderList.length;
  1913. msg = "<b style=\"color:#ee3636;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1914. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  1915. return msg;
  1916. },
  1917. SafeList: function() {
  1918. var index,
  1919. msg,
  1920. len = CTS.SafeList.length;
  1921. msg = "<b style=\"color:#ee3636;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  1922. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  1923. return msg;
  1924. }
  1925. };
  1926. var QueueList = {
  1927. add: function(item) {
  1928. CTS.SendQueue.push(item);
  1929. QueueList.run();
  1930. },
  1931. run: function() {
  1932. var SendInterval = setInterval(function() {
  1933. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  1934. var temp = new Date();
  1935. var OffsetTime = temp - CTS.LastMessage;
  1936. if (OffsetTime >= 1500) {
  1937. CTS.LastMessage = new Date();
  1938. CTS.SocketTarget.send(CTS.SendQueue[0]);
  1939. CTS.SendQueue.shift();
  1940. }
  1941. } else {
  1942. clearInterval(SendInterval);
  1943. }
  1944. }, 1500, CTS.LastMessage);
  1945. }
  1946. };
  1947. var SendList = {
  1948. msg: function() {
  1949. var obj = {
  1950. "tc": arguments[0]
  1951. };
  1952. if (arguments[2] !== undefined) {
  1953. obj.handle = arguments[1];
  1954. CTS.SocketTarget.send(JSON.stringify(obj));
  1955. } else {
  1956. if (arguments[1] !== undefined) {
  1957. obj.text = arguments[1];
  1958. QueueList.add(JSON.stringify(obj));
  1959. } else {
  1960. CTS.SocketTarget.send(JSON.stringify(obj));
  1961. }
  1962. }
  1963. },
  1964. pvtmsg: function() {
  1965. var obj = {
  1966. "tc": arguments[0],
  1967. "text": arguments[1],
  1968. "handle": Number(arguments[2])
  1969. };
  1970. CTS.SocketTarget.send(JSON.stringify(obj));
  1971. },
  1972. kick: function() {
  1973. SendList.msg(arguments[0], arguments[1], "kick");
  1974. },
  1975. ban: function() {
  1976. SendList.msg(arguments[0], arguments[1], "ban");
  1977. },
  1978. yut_playlist_add: function() {
  1979. var obj = {
  1980. "tc": arguments[0],
  1981. "item": {
  1982. "id": arguments[1][0],
  1983. "duration": arguments[1][1],
  1984. "title": arguments[1][2],
  1985. "image": arguments[1][3]
  1986. }
  1987. };
  1988. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  1989. CTS.SocketTarget.send(JSON.stringify(obj));
  1990. },
  1991. yut_playlist_remove: function() {
  1992. SendList.yut_playlist_add(arguments[0], arguments[1]);
  1993. },
  1994. yut_stop: function() {
  1995. SendList.yut_playlist_add(arguments[0], arguments[1]);
  1996. },
  1997. yut_play: function() {
  1998. SendList.yut_playlist_add(arguments[0], arguments[1]);
  1999. },
  2000. yut_playlist: function() {
  2001. SendList.msg("yut_playlist");
  2002. }
  2003. };
  2004. var SetList = {
  2005. joined: function(parse) {
  2006. debug();
  2007. CTS.Me = {
  2008. "handle": parse.self.handle,
  2009. "namecolor": NameColor[Rand(0, CTS.NameColors)],
  2010. "avatar": parse.self.avatar,
  2011. "username": parse.self.username,
  2012. "nick": parse.self.nick,
  2013. "mod": parse.self.mod
  2014. };
  2015. CTS.Room = {
  2016. "Avatar": parse.room.avatar,
  2017. "Bio": parse.room.biography,
  2018. "Name": parse.room.name,
  2019. "PTT": parse.room.pushtotalk,
  2020. "Website": parse.room.website
  2021. };
  2022. CTS.SocketConnected = true;
  2023. var modcall = setInterval(function() {
  2024. if (CTS.ScriptInit === true) {
  2025. if (CTS.Me.mod) {
  2026. if (CTS.Bot) CheckHost();
  2027. VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  2028. VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:none;";
  2029. }
  2030. clearInterval(modcall);
  2031. }
  2032. }, 200);
  2033. Reminder();
  2034. },
  2035. userlist: function(parse) {
  2036. var len = parse.users.length;
  2037. for (var user = 0; user < len; user++) {
  2038. AISB(parse.users[user]);
  2039. CheckUserAbuse(parse.users[user].handle, (parse.users[user].username === "") ? "GUEST" : parse.users[user].username.toUpperCase(), parse.users[user].nick.toUpperCase());
  2040. CTS.UserList.push({
  2041. "handle": parse.users[user].handle,
  2042. "mod": parse.users[user].mod,
  2043. "namecolor": NameColor[Rand(0, CTS.NameColors)],
  2044. "avatar": parse.users[user].avatar,
  2045. "username": (parse.users[user].username === "") ? "GUEST" : parse.users[user].username,
  2046. "nick": parse.users[user].nick
  2047. });
  2048. }
  2049. RoomUsers();
  2050. },
  2051. join: function(parse) {
  2052. AISB(parse);
  2053. var user = (parse.username === "") ? "GUEST" : parse.username.toUpperCase();
  2054. CheckUserAbuse(parse.handle, user, parse.nick.toUpperCase());
  2055. if (CTS.HighlightList.includes(user) || CTS.HighlightList.includes(parse.nick.toUpperCase())) {
  2056. if (CTS.enableSound === true) CTS.Sound.highlight.play();
  2057. }
  2058. if ((CTS.GreetList.includes(user) || CTS.GreetList.includes(parse.nick.toUpperCase()) || (CTS.Me.mod && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  2059. Send("msg", UnicodeConversionList.convert(((CTS.Welcomes[Rand(0, CTS.Welcomes.length - 1)] + parse.nick.toUpperCase()) + ((CTS.GreetMode) ? ".\n" + (((user != "GUEST") ? "You are signed in as " + user : "You are not signed in") + ".\nWelcome to the room!") : "!"))));
  2060. if (CTS.enableSound === true) CTS.Sound.highlight.play();
  2061. }
  2062. CTS.NoGreet = false;
  2063. AddUser(parse.handle, parse.mod, NameColor[Rand(0, CTS.NameColors)], (parse.avatar === "") ? "https://i.imgur.com/4Q4Lgzf.png" : parse.avatar, parse.nick, user);
  2064. RoomUsers();
  2065. },
  2066. sysmsg: function(parse) {
  2067. AddSystemNotification(HTMLtoTXT(parse.text));
  2068. },
  2069. nick: function(parse) {
  2070. var user = User(parse.handle);
  2071. if (user != -1) {
  2072. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, parse.nick);
  2073. CTS.UserList[user].nick = parse.nick;
  2074. if (CTS.Me.handle == parse.handle) CTS.Me.nick = parse.nick;
  2075. }
  2076. },
  2077. stream_connected: function() {
  2078. debug();
  2079. },
  2080. stream_closed: function(parse) {
  2081. debug();
  2082. },
  2083. ping: function() {
  2084. debug();
  2085. if (CTS.WatchList.length > 0) {
  2086. var verify = new Date() - CTS.WatchList[0][2];
  2087. debug("WATCHLIST::LIST", CTS.WatchList);
  2088. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/900000");
  2089. if (verify > 900000) {
  2090. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/900000");
  2091. CTS.SafeList.push(CTS.WatchList[0][0]);
  2092. CTS.WatchList.shift();
  2093. }
  2094. }
  2095. },
  2096. quit: function(parse) {
  2097. if (CTS.ScriptInit) {
  2098. if (CTS.WatchList.length > 0) {
  2099. var len = CTS.WatchList.length;
  2100. for (var i = 0; i < len; i++) {
  2101. if (CTS.WatchList[i][1] == parse.handle) {
  2102. CTS.WatchList.splice(i, 1);
  2103. break;
  2104. }
  2105. }
  2106. }
  2107. var user = User(parse.handle);
  2108. if (user != -1) {
  2109. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  2110. CTS.UserList.splice(user, 1);
  2111. }
  2112. RoomUsers();
  2113. if (CTS.Host == parse.handle && CTS.Me.mod && CTS.Bot) {
  2114. setTimeout(function(handle) {
  2115. if (handle == CTS.Host) SetBot();
  2116. }, (Rand(10, 60) * 1000), parse.handle);
  2117. }
  2118. }
  2119. },
  2120. msg: function(parse) {
  2121. if (CTS.ScriptInit) {
  2122. var user = User(parse.handle);
  2123. if (user != -1) {
  2124. if (!SpamPrevention(parse.text)) {
  2125. if (!CheckUserIgnore(user)) {
  2126. var text = HTMLtoTXT(parse.text);
  2127. if (CTS.Me.mod) {
  2128. if (CTS.Host == CTS.Me.handle) {
  2129. if (text.match(/^!play$/i)) YouTubePlayList();
  2130. if (text.match(/^!whoisbot$/i)) BotOperator(5, user);
  2131. if (text.match(/^!yt\s/)) BotOperator(1, user, text);
  2132. if (text.match(/^!ytbypass\s/)) BotOperator(6, user, text);
  2133. if (text.match(/^!ytclear$/)) BotOperator(2, user);
  2134. if (text.match(/^!ytskip$/)) BotOperator(3, user);
  2135. if (text.match(/^!ytqueue$/)) BotOperator(4, user);
  2136. }
  2137. CheckUserKeywordAbuse(parse.handle, parse.text);
  2138. }
  2139. if (CTS.UserList[user].mod && text.match(/^!bot$/)) {
  2140. CTS.Host = parse.handle;
  2141. CTS.HostWaiting = false;
  2142. if (CTS.Me.handle == parse.handle) YouTubePlayList();
  2143. } else if (CTS.HostWaiting === true) {
  2144. CTS.HostAttempt++;
  2145. if (CTS.HostAttempt == 1) {
  2146. setTimeout(function() {
  2147. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot();
  2148. }, 6000);
  2149. }
  2150. if (CTS.HostAttempt == 10) SetBot();
  2151. }
  2152. CTS.Message[0].push({
  2153. "time": Time(),
  2154. "namecolor": CTS.UserList[user].namecolor,
  2155. "avatar": CTS.UserList[user].avatar,
  2156. "username": CTS.UserList[user].username,
  2157. "nick": CTS.UserList[user].nick,
  2158. "msg": text
  2159. });
  2160.  
  2161. if (GetActiveChat() === 0) {
  2162. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  2163. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, 0);
  2164. }
  2165. if (CTS.Me.handle !== parse.handle) {
  2166. if (CTS.UserList[user].mod && (text.match(/^!autokick$/) || text.match(/^!autoban$/))) {
  2167. Alert(GetActiveChat(), "🗹AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  2168. CTS.AutoKick = false;
  2169. CTS.AutoBan = false;
  2170. }
  2171. if (CTS.enableSound === true) {
  2172. CTS.Sound.MSG.play();
  2173. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username.toUpperCase()) || CTS.TTSList.includes(CTS.UserList[user].nick.toUpperCase()) || CTS.TTSList.includes("-ALL"))) TTS(CTS.UserList[user].nick + ((!text.match(/(?:^\!)|(?:https?|www|\uD83C\uDFB5)/gim)) ? " said, " + text : "is box banging!"));
  2174. }
  2175. var len = CTS.MentionList.length;
  2176. for (var i = 0; i < len; i++) {
  2177. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  2178. if (CTS.enableSound === true) {
  2179. CTS.Sound.mention.play();
  2180. }
  2181. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  2182. }
  2183. }
  2184. }
  2185. MessagePopUp(user, text, true, false);
  2186. }
  2187. } else {
  2188. if (CTS.Me.mod) Send("kick", parse.handle);
  2189. }
  2190. }
  2191. }
  2192. },
  2193. pvtmsg: function(parse) {
  2194. if (CTS.ScriptInit) {
  2195. if (CTS.enablePMs === true) {
  2196. if (parse.handle != CTS.Me.handle) {
  2197. var user = User(parse.handle);
  2198. if (user != -1) {
  2199. if (!SpamPrevention(parse.text)) {
  2200. if (!CheckUserIgnore(user)) {
  2201. var text = HTMLtoTXT(parse.text);
  2202. if (CTS.Me.mod) CheckUserKeywordAbuse(parse.handle, parse.text);
  2203. if (!CTS.Message[parse.handle]) CTS.Message[parse.handle] = [];
  2204. PushPM(parse.handle, text, user);
  2205. if (CTS.enableSound === true) {
  2206. CTS.Sound.PVTMSG.play();
  2207. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username.toUpperCase()) || CTS.TTSList.includes(CTS.UserList[user].nick.toUpperCase()) || CTS.TTSList.includes("-ALL"))) TTS(CTS.UserList[user].nick + ((!text.match(/(?:^\!)|(?:https?|www)/gim)) ? " said, " + text : "is box banging!"));
  2208. }
  2209. MessagePopUp(user, text, false, false);
  2210. }
  2211. } else {
  2212. if (CTS.Me.mod) Send("kick", parse.handle);
  2213. }
  2214. }
  2215. }
  2216. }
  2217. }
  2218. },
  2219. yut_playlist_add: function(parse) {
  2220. if (CTS.ScriptInit) {
  2221. if (!CTS.YouTube.Playing) {
  2222. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  2223. if (CTS.Host != CTS.Me.handle) {
  2224. Send("msg", "!play");
  2225. } else {
  2226. YouTubePlayList();
  2227. }
  2228. }
  2229. }
  2230. },
  2231. yut_playlist: function(parse) {
  2232. if (CTS.ScriptInit) {
  2233. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  2234. if (CTS.YouTube.Clear === true) {
  2235. if (parse.items !== null) YouTubePlayListRemove(parse.items);
  2236. CTS.YouTube.QueueList = [];
  2237. Send("msg", "🎵YouTube cleared!🎵");
  2238. CTS.YouTube.Clear = false;
  2239. } else {
  2240. if (parse.items === null) {
  2241. CTS.PlayListStart = true;
  2242. } else {
  2243. CTS.YouTube.PlayListCount = parse.items.length;
  2244. CTS.PlayListStart = false;
  2245. if (CTS.YouTube.ShowQueue === true) {
  2246. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  2247. for (var i = 0; i < 3; i++) {
  2248. if (parse.items[i] === undefined) break;
  2249. msg = msg + "\n" + (i + 1) + ": " + parse.items[i].title + "\n[" + Math.floor(parse.items[i].duration / 60) + "M" + (parse.items[i].duration % 60) + "S]";
  2250. }
  2251. Send("msg", msg);
  2252. }
  2253. }
  2254. if (parse.items !== null && CTS.Host == CTS.Me.handle && CTS.YouTube.Playing === false) CheckYouTube("https://www.youtube.com/watch?v=" + parse.items[0].id, false);
  2255. }
  2256. CTS.YouTube.ShowQueue = false;
  2257. }
  2258. }
  2259. },
  2260. yut_play: function(parse) {
  2261. if (CTS.ScriptInit) {
  2262. if (CTS.YouTube.CurrentTrack.ID != parse.item.id) {
  2263. CTS.YouTube.CurrentTrack.ID = parse.item.id;
  2264. CTS.YouTube.CurrentTrack.duration = parse.item.duration;
  2265. CTS.YouTube.CurrentTrack.title = parse.item.title;
  2266. CTS.YouTube.CurrentTrack.thumbnail = parse.item.image;
  2267. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  2268. }
  2269. CTS.YouTube.Playing = true;
  2270. YouTubePlayList();
  2271. }
  2272. },
  2273. yut_stop: function(parse) {
  2274. if (CTS.ScriptInit) {
  2275. CTS.YouTube.CurrentTrack.ID = undefined;
  2276. CTS.YouTube.CurrentTrack.duration = undefined;
  2277. CTS.YouTube.CurrentTrack.title = undefined;
  2278. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  2279. CTS.YouTube.Playing = false;
  2280. YouTubePlayList();
  2281. }
  2282. },
  2283. publish: function(parse) {
  2284. if (CTS.ScriptInit) {
  2285. CheckUserStream(parse.handle, true);
  2286. }
  2287. },
  2288. unpublish: function(parse) {
  2289. if (CTS.ScriptInit) {
  2290. CheckUserStream(parse.handle, false);
  2291. }
  2292. }
  2293. };
  2294. var GetList = {
  2295. pvtmsg: function(parse) {
  2296. if (CTS.ScriptInit) {
  2297. Command(parse.text, true);
  2298. var text = parse.text;
  2299. if (!CTS.Message[parse.handle]) CTS.Message[parse.handle] = [];
  2300. PushPM(parse.handle, text);
  2301. }
  2302. },
  2303. msg: function(parse) {
  2304. if (CTS.ScriptInit) {
  2305. CTS.LastMessage = new Date();
  2306. Command(parse.text, false);
  2307. }
  2308. }
  2309. };
  2310. // Misc Functions
  2311. function debug(e, parse) {
  2312. if (CTS.DebugClear === false) {
  2313. if (e !== undefined) {
  2314. var msg = "%cCTS::" + e;
  2315. if (parse) msg = msg + "\n%c" + JSON.stringify(parse);
  2316. console.log(msg, "background: #000000; color: #53b6ef;", "color:#FFF;");
  2317. }
  2318. } else {
  2319. console.clear();
  2320. console.log(" ( \n ( * ))\ ) \n )\ \` ) /(()/( \n (((_) ( )(_)/(_)) \n )\___(_(_()(_)) \n((/ __|_ _/ __| \n | (__ | | \__ \ /\n \___| |_| |___/ \nCosmosisT's TinyChat Script\nCREATOR: COSMOSIST\nVERSION: " + CTS.Version + "\nCONSOLE DEBUG: FALSE\n\nJoin the discord today!\nhttps://discord.gg/84xqc6r");
  2321. }
  2322. }
  2323.  
  2324. function Remove(query, element) {
  2325. return (element !== undefined) ? query.querySelector(element).parentNode.removeChild(query.querySelector(element)) : query.parentNode.removeChild(query);
  2326. }
  2327. })();