CosmosisT's TinyChat Script (CTS V1.6.41)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-05-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.6.41)
  3. // @version 1.6.41
  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/gifts*
  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. //DEBUGGER
  24. window.DebugClear = true; // TRUE = CLEARS || FALSE = SHOWS
  25. window.CTSVersion = {
  26. Major: 1,
  27. Minor: 6,
  28. Patch: 41
  29. };
  30. //CTS
  31. //ELEMENT VARIABLES
  32. var MainElement,
  33. ChatLogElement,
  34. VideoListElement,
  35. SideMenuElement,
  36. TitleElement,
  37. UserListElement,
  38. ModerationListElement,
  39. ChatListElement,
  40. UserContextElement,
  41. MicrophoneElement,
  42. //CSS VARIABLES
  43. FeaturedCSS,
  44. VideoCSS,
  45. SideMenuCSS,
  46. MainCSS,
  47. RoomCSS,
  48. TitleCSS,
  49. ContextMenuCSS,
  50. ModeratorCSS,
  51. UserListCSS,
  52. ChatListCSS,
  53. NotificationCSS,
  54. ChatboxCSS,
  55. //CTS MAIN VARIABLES
  56. CTS = {
  57. Project: {
  58. Name: "CTS",
  59. Storage: "CTS_"
  60. },
  61. Chuck: {
  62. XHR: new XMLHttpRequest(),
  63. bot: false,
  64. activepm: undefined,
  65. chat: undefined
  66. },
  67. Urb: {
  68. XHR: new XMLHttpRequest(),
  69. bot: false,
  70. activepm: undefined,
  71. chat: undefined
  72. },
  73. Dad: {
  74. XHR: new XMLHttpRequest(),
  75. bot: false,
  76. activepm: undefined,
  77. chat: undefined
  78. },
  79. Advice: {
  80. XHR: new XMLHttpRequest(),
  81. bot: false,
  82. activepm: undefined,
  83. chat: undefined
  84. },
  85. //API_KEY FOR YOUTUBE CAN BE INSERTED BELOW (NO WHERE ELSE)
  86. YouTube: {
  87. API_KEY: "AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs",
  88. XHR: new XMLHttpRequest(),
  89. Playing: false,
  90. MessageQueueList: [],
  91. NotPlayable: ["Private video", "Deleted video"],
  92. VideoID: undefined,
  93. Busy: false,
  94. DataReady: false,
  95. Clear: false,
  96. VideoReturn: false,
  97. SearchReturn: false,
  98. ListBuilt: true,
  99. PlayListCount: undefined,
  100. ShowQueue: false,
  101. CurrentTrack: {
  102. ID: undefined,
  103. duration: undefined,
  104. title: undefined,
  105. thumbnail: undefined
  106. }
  107. },
  108. Me: [],
  109. Room: "",
  110. ScriptInit: false,
  111. MainBackground: undefined,
  112. OGStyle: {
  113. HeightCounter: 3,
  114. WidthCounter: 1,
  115. SavedHeight: undefined,
  116. SavedWidth: undefined
  117. },
  118. NormalStyle: {
  119. ChatHide: false
  120. },
  121. FontSize: 20,
  122. ChatStyleCounter: 0,
  123. ChatHeight: 30,
  124. ChatWidth: 0,
  125. ChatDisplay: true,
  126. UserListDisplay: true,
  127. ChatStyles: undefined,
  128. MainBackgroundCounter: 0,
  129. ChatCSS: [],
  130. ChatLimit: 750,
  131. NotificationLimit: 100,
  132. ChatScroll: true,
  133. NotificationScroll: true,
  134. NoGreet: false,
  135. Featured: true,
  136. Bot: true,
  137. AutoKick: false,
  138. AutoBan: false,
  139. GreetMode: false,
  140. PerformanceMode: false,
  141. CanTTS: false,
  142. VoteSystem: false,
  143. Popups: true,
  144. Avatar: true,
  145. Reminder: true,
  146. CanSeeGames: true,
  147. CanHostGames: false,
  148. imgur: true,
  149. Notification: true,
  150. UserYT: true,
  151. ThemeChange: true,
  152. TimeStampToggle: true,
  153. AutoMicrophone: false,
  154. GreenRoomToggle: true,
  155. PublicCommandToggle: true,
  156. Game: {
  157. NoReset: false,
  158. Fish: {
  159. HighScore: ["CosmosisT", 13337],
  160. StartTimeout: undefined,
  161. RestockTimeout: undefined,
  162. ReCastTimeout: undefined,
  163. NotEnoughTimeout: undefined,
  164. Round: 0,
  165. Player: [],
  166. Multiplier: 10,
  167. TypesOfFish: [
  168. ["frog", 1, true],
  169. ["sunfish", 2, true],
  170. ["goldfish", 3, true],
  171. ["fish swollowed hook", 4, false],
  172. ["family of sardine", 5, true],
  173. ["catfish", 6, true],
  174. ["spotted bass", 7, true],
  175. ["largemouth bass", 8, true],
  176. ["family of shrimp", 9, true],
  177. ["it pays to not drink,\ncrazy night however!", 10, false],
  178. ["cisco", 11, true],
  179. ["seaweed, still edible", 12, true],
  180. ["snagged a tire and lost rod", 13, false],
  181. ["snagged a tire and lost hook", 14, false],
  182. ["lost their rod to a shark", 15, false],
  183. ["rainbow trout", 16, true],
  184. ["It's your turn for dinner", 80, false],
  185. ["parrot fish", 17, true],
  186. ["snagged a plastic bag,\n their hook is gone", 18, false],
  187. ["walleye", 19, true],
  188. ["Round Whitefish", 20, true],
  189. ["family of clams", 21, true],
  190. ["family of oyster", 22, true],
  191. ["Round blackfish", 23, true],
  192. ["dolphin", 24, true],
  193. ["seagull,\n not a fish but will do", 25, true],
  194. ["pufferfish", 26, true],
  195. ["fined for smuggling\nmore than fish", 27, false],
  196. ["lobster", 28, true],
  197. ["tuna", 29, true],
  198. ["electric eel", 30, true],
  199. ["Eel electricuted you,\nrod is toast", 31, false],
  200. ["swordfish", 32, true],
  201. ["had bills at home to pay", 33, false],
  202. ["slipped and lost equipment", 34, false],
  203. ["bike, still good too", 35, true],
  204. ["great white", 36, true],
  205. ["octopus", 37, true],
  206. ["serpeant", 38, true],
  207. ["sea turtle", 39, true],
  208. ["cleaned garbage from the lake", 40, true],
  209. ["fined for capturing,\n a female whale", 41, false],
  210. ["male whale", 42, true],
  211. ["barracuda", 43, true],
  212. ["pike", 44, true],
  213. ["lochiness monster", 45, true],
  214. ["anglerfish", 46, true],
  215. ["small treasure chest", 47, true],
  216. ["golden tuna", 48, true],
  217. ["family of beautiful rims", 49, true],
  218. ["red snapper", 50, true],
  219. ["jaws", 51, true],
  220. ["mermaid", 52, true],
  221. ["holy grail,\nhow'd that get there?", 75, true],
  222. ["secret formula", 100, true]
  223. ]
  224. }
  225. },
  226. TTS: {
  227. synth: undefined,
  228. voices: undefined
  229. },
  230. hasGreetedWC: false,
  231. hasGreetedOwner: false,
  232. Host: 0,
  233. HostAttempt: 0,
  234. HostWaiting: false,
  235. WaitToVoteList: [],
  236. UserList: [],
  237. MentionList: [],
  238. TempIgnoreList: [],
  239. IgnoreList: [],
  240. BanList: [],
  241. KickList: [],
  242. BotOPList: [],
  243. BotModList: [],
  244. TTSList: [],
  245. BanKeywordList: [],
  246. KickKeywordList: [],
  247. HighlightList: [],
  248. GreetList: [],
  249. ReminderList: [],
  250. ReminderServerInList: [],
  251. Favorited: [],
  252. SafeList: [],
  253. GreenRoomTempBlackList: [],
  254. WatchList: [],
  255. KBQueue: [],
  256. MessageCallback: [],
  257. Message: [
  258. []
  259. ],
  260. LastMessage: new Date(),
  261. ShowedSettings: false,
  262. SendQueue: [],
  263. MissedMsg: 0,
  264. ActiveMessage: 0,
  265. Camera: {
  266. List: [],
  267. Sweep: false,
  268. SweepTimer: 5,
  269. clearRandom: undefined
  270. },
  271. NotificationTimeOut: [],
  272. };
  273. //API_KEY SAVE (PLEASE ENTER YOUR KEY ABOVE NOT HERE)
  274. if (CTS.YouTube.API_KEY !== "") Save("YouTubeAPI", CTS.YouTube.API_KEY);
  275. //CTS SETTINGS
  276. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
  277. CTS.PublicCommandToggle = JSON.parse(Load("PublicCommandToggle", JSON.stringify(true)));
  278. CTS.CameraBorderToggle = JSON.parse(Load("CameraBorderToggle", JSON.stringify(true)));
  279. CTS.OGStyle.SavedHeight = JSON.parse(Load("OGStyleHeight", "3"));
  280. CTS.OGStyle.SavedWidth = JSON.parse(Load("OGStyleWidth", "1"));
  281. CTS.NotificationToggle = JSON.parse(Load("NotificationToggle", "1"));
  282. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", "0"));
  283. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  284. CTS.TimeStampToggle = JSON.parse(Load("TimeStampToggle", JSON.stringify(true)));
  285. //API_KEY SAVE (PLEASE ENTER YOUR KEY ABOVE NOT HERE)
  286. CTS.YouTube.API_KEY = Load("YouTubeAPI", "");
  287. CTS.GreenRoomToggle = JSON.parse(Load("GreenRoomToggle", JSON.stringify(true)));
  288. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  289. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/RC3bKe7.jpg) rgb(0, 0, 0) no-repeat");
  290. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  291. CTS.CanHostGames = JSON.parse(Load("CanHostGames", JSON.stringify(false)));
  292. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  293. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  294. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  295. CTS.ThemeChange = JSON.parse(Load("ThemeChange", JSON.stringify(true)));
  296. CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
  297. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  298. CTS.Favorited = JSON.parse(Load("Favorited", JSON.stringify([
  299. ["stonercircle", "https://avatars.tinychat.com/da/838b96/5f/medium/phpKXAdEn.jpeg"], null, null, null, null
  300. ])));
  301. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  302. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  303. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  304. CTS.FontSize = JSON.parse(Load("FontSize", 20));
  305. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  306. CTS.Featured = JSON.parse(Load("Featured", JSON.stringify(false)));
  307. CTS.KickList = JSON.parse(Load("KickList", JSON.stringify([])));
  308. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  309. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  310. CTS.BanList = JSON.parse(Load("BanList", JSON.stringify([])));
  311. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  312. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  313. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  314. CTS.imgur = JSON.parse(Load("imgur", JSON.stringify(true)));
  315. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  316.  
  317. if (CTS.ThemeChange) {
  318. 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%}";
  319. ChatListCSS = "#chatlist{background:#00000075;}.list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background: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:#53b6ef;}#chatlist>#header{height:60px;top:30px}#chatlist>div>span{font-weight: 600;border-radius:unset;color:#FFFFFF;height:22px;line-height:22px;}#chatlist>div{height:22px;line-height:22px;}";
  320. ChatboxCSS = "@media screen and (max-width: 1200px){#chat-hide{top: -46px!important;left: -1px!important;width: 100%!important;background-color: black!important;border-radius: 0!important;}}#chat-hide{top: calc(50% - 18px);position: absolute;display: block;height: 16px;width: 16px;left: -8px;margin-top: -20px;border-radius: 16px;font-size: 0;background-color: #000000;cursor: pointer;z-index: 1;-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;z-index: 2;}#chat-instant.show{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(25, 29, 32)100%)!important;}#chat-wider:before{margin: -4px 0 0 -4px;border-width: 6px 6px 6px 0;border-color: transparent #ffffff!important;}#chat-wider{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;z-index: 2;background:#000000!important}#chat-wrapper{transition:none;}#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #10131494;}#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: #101314;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: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{position:absolute;right:3px;top:3px;background: #101314;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>#system_user{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgba(0, 0, 0, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.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{text-decoration:underline;}#chat{will-change: transform;min-height:unset;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:3px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#e24c05;-webkit-box-shadow: inset 0 0 20px #000000;box-shadow: inset 0 0 20px 0 #000000;}#cts-chat-content>.message.common{min-height: 50px;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);pointer-events:none;}#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}.notifbtn:hover{background:linear-gradient(0deg,rgb(0, 135, 186)0%,rgba(0, 49, 64, 0.94)75%,rgba(0, 172, 255, 0.6)100%);}.notifbtn{cursor: pointer;border-radius: 0 0 12px 12px;outline: none;background:linear-gradient(0deg,rgba(0, 0, 0, 0)0%,rgba(37, 37, 37, 0.32)75%,rgba(255, 255, 255, 0.6)100%);border: none;color: white;width: 100%;}#notification-content.large{height:50%;}#notification-content{will-change: transform;top:0;position:relative;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height:20%;min-height:38px;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;} nm#chat-instant::after{background:none;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{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:#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:#101314;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-position{top:22px;left:6px;right:6px;bottom:5px;}.on-white-scroll::webkit-scrollbar{width:0;background:transparent;}";
  321. MainCSS = "html{background:rgba(0,0,0,1);}#menu-icon{display:none;}body{background:" + CTS.MainBackground + ";background-position: center!important;background-size:cover!important;overflow:hidden;}#nav-static-wrapper {display:none;}#content{padding:0!important;}";
  322. VideoCSS = "#videos-footer-broadcast-wrapper{padding-top:16px;}#youtube.video > div > .overlay, .video > div > .overlay{display:block!important}.tcsettings{display:none}#videos-header{background:#101314;}#videos-footer-broadcast-wrapper.active>#videos-footer-broadcast,#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button,#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button:focus{background-color:#2d373a!important;}.js-video.broken{display:none;}.videos-header-volume {border-color:#202627;}@media screen and (max-width: 600px) {#videos-footer-broadcast, #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast {height: 50px;line-height: 50px;text-align: center;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;}#videos-header > span {background-color: unset;line-height: unset;}}.tcsettings:hover{background:#008cda;}.tcsettings{cursor: pointer;outline: none;background:#101314;border: none;color: white;}.music-radio-info>.description{cursor:default;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.music-radio-info>.volume{bottom: 0;position: absolute;background: #2a6a89;height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.music-radio-info{top: -50px;position: absolute;background: #071c19f0;height: 50px;width: 336px;line-height: 24px;}.ctsdrop{position:fixed;display:inline-block;top:3px;left:4px;z-index:4;min-width: 46px;}.ctsdrop-content{position:absolute;top:28px;right:0;background:#101314;min-width:46px;width: 46px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #10131475;border: none;padding: 5% 0;display: inline-block;}#youtube{padding: unset}#grab{left: 0;background:#2d373a;border-radius: 12px;visibility: hidden;top: -36px;position: absolute;display: flex}#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: #101314;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: -64px;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: 0;border-radius: 12px;background: #101314;}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer:hover{background:linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgb(83, 182, 239)100%);}#videos-footer{background: linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgba(200, 200, 200, 0.26)100%);cursor:pointer;top:0;display:block;padding: 2px 0 0 11px;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:unset;z-index: 1;padding: unset!important;white-space: pre}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: 0;left: 0;right: 0;top: 0}:host,#videolist{background:unset!important;}.video:after{content: unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header>span{display:block;}#videos-header-sound>svg{padding: 4px}#videos-header-fullscreen > svg {padding: 7px 8px;}";
  323. RoomCSS = "tc-title{display:flex!important;}#room-content{padding-top:0!important;background:unset!important;}";
  324. TitleCSS = "#room-header-avatar{display:none}#room-header-gifts{display:none}#room-header-info-text{display:none}#room-header-info-details{display:none}#room-header-mobile-button{display:none}#room-header{display:none;}";
  325. SideMenuCSS = "#sidemenu.full-screen{left:0;}#user-info{display:none;}#top-buttons-wrapper{display:none;}#sidemenu-content{scrollbar-width:none;padding-top:unset;}#sidemenu-wider:before{margin: -4px 0 0 -4px;border-width: 6px 6px 6px 0;border-color: transparent #ffffff;}#sidemenu-wider{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;z-index: 2;display:block;background-color: #000000;}#sidemenu-content::-webkit-scrollbar{display: none;}@media screen and (max-width: 1000px){#sidemenu {left: -270px!important;}}#sidemenu{left:0;}#sidemenu.wider {left: -270px;}";
  326. NotificationCSS = ".PMTime{display:inline-block;padding:0 6px 0 0;margin:0 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;color: #FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}.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 0 0;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0 0 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
  327. UserListCSS = ".list-item>span>span{padding: 0 8px;top:-2px}.list-item > span:hover > span{background-color:unset;box-shadow:unset;}#userlist{background: #00000075;}.js-user-list-item{background: linear-gradient(0deg,rgb(0, 0, 0) 2px,rgba(0, 0, 0, 0.25) 2px,rgba(0, 0, 0, 0.59) 32%);}.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:transparent;box-shadow:none;}.list-item>span>span>.send-gift{top:5px;}.list-item>span>img{top:6px;}#button-banlist{border-radius:unset;top:-1px;right:10px;}.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{font-weight: 600;color:#FFFFFF;height:22px;line-height:22px;}#userlist>#header{height:40px;top:10px;}";
  328. 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: #20262870;}#moderatorlist.show>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist{max-height:60px;background: #00000075;}#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;}";
  329. } else {
  330. //OG CTS
  331. 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%}";
  332. VideoCSS = "#youtube.video > div > .overlay, .video > div > .overlay{display:block!important}.js-video.broken{display:none;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-submenu{right:0;}#videos-footer-submenu{width: calc(100% - 14px);right:0;bottom:-2px;}.videos-header-volume {border-color:#202627;}@media screen and (max-width: 600px) {#videos-footer-broadcast, #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast {height: 50px;line-height: 50px;text-align: center;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;}#videos-header > span {background-color: unset;line-height: unset;}}.tcsettings:hover{background:#008cda;}.tcsettings{cursor: pointer;outline: none;background:#101314;border: none;color: white;}.music-radio-info>.description{cursor:default;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.music-radio-info>.volume{bottom: 0;position: absolute;background: #2a6a89;height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.music-radio-info{top: -50px;position: absolute;background: #071c19f0;height: 50px;width: 336px;line-height: 24px;}.ctsdrop{position:fixed;display:inline-block;top:3px;right:4px;z-index:4;min-width: 46px;}.ctsdrop-content{position:absolute;top:28px;right:0;background:#101314;min-width:46px;width: 46px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #101314;border: none;padding: 5% 0;display: inline-block;}#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: #1f2223!important}#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button{background: #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: #101314;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: 0;border-radius: 12px;background: #101314;}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer:hover{background:linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgb(83, 182, 239)100%);}#videos-footer{background: linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgba(200, 200, 200, 0.26)100%);cursor:pointer;top: calc(30% + 119px);display:block;padding: 2px 0 0 11px;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:unset;z-index: 1;padding: unset!important;white-space: pre}#videos-footer-broadcast-wrapper{z-index: 0;visibility: visible;height: 50px;min-height: 50px;width: 400px;padding: unset;right: 0;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: 0;left: 0;right: 0;top: 0}:host,#videolist{background:unset!important;}.video:after{content: unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header{z-index: 3;background:#101314;transition: none;left: unset;right: 0;width: 400px;top: calc(30%);position: fixed;max-height: 34px;min-height: 34px;}#videos-header>span{display:block;line-height: unset;}#videos-header-sound>svg{padding: 4px}#videos-header-fullscreen > svg {padding: 7px 8px;}";
  333. SideMenuCSS = "#close-users{display:none!important;}#user-info{display:none;}#top-buttons-wrapper{display:none;}@media screen and (max-width: 600px) {#sidemenu {top:unset;z-index:2;padding-bottom:0;margin-top:0;}}#sidemenu-wider{display:none;}#sidemenu-content::-webkit-scrollbar{width:0;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:0!important;padding-bottom:0;height:30%!important;min-width:400px;max-width:400px;}#sidemenu-content{scrollbar-width:none;padding-top:unset;}";
  334. MainCSS = "html{background:rgba(0,0,0,1);}#menu-icon{display:none;}body{background:" + CTS.MainBackground + ";background-position: center!important;background-size:cover!important;overflow:hidden;}#content{width:calc(100% - 400px);padding:0!important;}#nav-static-wrapper, #nav-fixed-wrapper{display:none;}";
  335. RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{padding-top:0!important;background:unset!important;}";
  336. TitleCSS = "#room-header-avatar{display:none}#room-header-gifts{display:none}#room-header-info-text{display:none}#room-header-info-details{display:none}#room-header-mobile-button{display:none}#room-header{border:unset;z-index:1;min-height:36px!important;max-height:36px!important;min-width:400px;max-width:400px;top:calc(30% + 84px);right:0;position:fixed;background: linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(9, 41, 57)100%);}#room-header-info>h1{height:100%;top: unset;left: unset;right: unset;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!important;box-sizing: border-box;width: 100%!important;top: 0!important;left: 0!important;right: 0!important;}#room-he#room-header-info>span{right: 8px;position: absolute;top:7px;margin-top:0!important;}";
  337. ContextMenuCSS = ".context.show{height:100%;}.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:#101314;position:unset;padding:0;height:0;transition:.25s;}";
  338. 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: #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;}";
  339. UserListCSS = "#userlist{padding-bottom:40px;}.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: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:unset!important;bottom:0!important;right:0!important;left:0!important;}";
  340. ChatListCSS = ".list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background: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:#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;}";
  341. NotificationCSS = ".PMTime{display:inline-block;padding:0 6px 0 0;margin:0 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;color: #FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}.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 0 0;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0 0 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
  342. ChatboxCSS = "#chat-instant.show{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(25, 29, 32)100%)!important;}#chat-wider{display:none;}#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #10131494;}#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: #101314;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: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{position:absolute;right:3px;top:3px;background: #101314;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>#system_user{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgba(0, 0, 0, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.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{text-decoration:underline;}#chat{will-change: transform;min-height:unset;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:3px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#e24c05;-webkit-box-shadow:inset 0 0 20px #ffffff;box-shadow: inset 0 0 20px 0 #ffffff;}#cts-chat-content>.message.common{min-height: 50px;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);pointer-events:none;}#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}.notifbtn:hover{background:linear-gradient(0deg,rgb(0, 135, 186)0%,rgba(0, 49, 64, 0.94)75%,rgba(0, 172, 255, 0.6)100%);}.notifbtn{cursor: pointer;border-radius: 0 0 12px 12px;outline: none;background:linear-gradient(0deg,rgba(0, 0, 0, 0)0%,rgba(37, 37, 37, 0.32)75%,rgba(255, 255, 255, 0.6)100%);border: none;color: white;width: 100%;}#notification-content.large{height:50%;}#notification-content{will-change: transform;top:0;position:relative;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height: 15%;min-height:38px;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-instant::after{background:none;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{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:#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:#101314;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;}";
  343. }
  344. // PUBLIC / ADDON GRABBERS
  345. window.CTSEightBall = ["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."];
  346. window.CTSWelcomes = ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "];
  347. window.CTSSound = {
  348. C: new Audio("https://media.vocaroo.com/mp3/e3VIvvFqdHe"),
  349. HIGHLIGHT: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  350. GREET: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  351. MENTION: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"),
  352. MSG: new Audio("https://tinychat.com/webrtc/2.0.20-420/sound/pop.mp3"),
  353. PVTMSG: new Audio("https://media.vocaroo.com/mp3/1eX3L752VdQ")
  354. };
  355. window.CTSRadioStations = [
  356. ["Flex 98.5FM", "https://edge1-b.exa.live365.net/a23768"],
  357. ["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],
  358. ["HOT899", "https://newcap.leanstream.co/CIHTFM"],
  359. ["chillstep.info", "https://chillstep.info/listen.ogg"],
  360. ["HOT997", "https://ice5.securenetsystems.net/KHHK"],
  361. ["Dance365", "https://edge1-b.exa.live365.net/a93720"],
  362. ["kexp.org", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3"],
  363. ["Classic Deep Cuts", "https://edge1-b.exa.live365.net/a72496"],
  364. ["Divas Hustle Radio", "https://edge1-b.exa.live365.net/a72972"],
  365. ["Retro 8089", "https://edge1-b.exa.live365.net/a53202"],
  366. ["Teerex Radio Teerex", "https://edge1-b.exa.live365.net/a74387"],
  367. ["NGI Radio", "https://edge1-b.exa.live365.net/a24650"],
  368. ["Legend Oldies", "https://edge1-b.exa.live365.net/a88135"],
  369. ["Music City Roadhouse", "https://edge1-b.exa.live365.net/a73754"],
  370. ["Mashrup Reggae Radio", "https://edge1-b.exa.live365.net/a00564"],
  371. ["97.5 Dance Hits", "https://edge1-b.exa.live365.net/a50365"]
  372. ];
  373. window.CTSNameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  374. window.CTSImages = ["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",
  375. "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",
  376. "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",
  377. "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",
  378. "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",
  379. "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",
  380. "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",
  381. ];
  382. window.CTSChatCSS = [
  383. [
  384. //STYLE #0
  385. ["#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%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  386. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  387. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  388. ],
  389. [ //STYLE #1
  390. ["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  391. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(58, 58, 58)8px,rgb(30, 30, 30)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  392. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
  393. ],
  394. [ //STYLE #2
  395. ["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  396. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(83, 17, 128)8px,rgb(68, 15, 103)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  397. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
  398. ],
  399. [ //STYLE #3
  400. ["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  401. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(121, 3, 3)8px,rgb(176, 2, 2)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  402. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
  403. ],
  404. [ //STYLE #4
  405. ["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  406. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(26, 59, 75)8px,rgb(59, 130, 170)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  407. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
  408. ],
  409. [ //STYLE #5
  410. ["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  411. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  412. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
  413. ],
  414. [ //STYLE #6
  415. ["#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%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  416. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  417. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
  418. ],
  419. [ //STYLE #7
  420. ["#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%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  421. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  422. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
  423. ],
  424. [ //STYLE #8
  425. ["#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%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  426. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(234, 236, 5)8px,rgb(180, 187, 15)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  427. ["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
  428. ],
  429. [ //STYLE #9
  430. ["#chat-wrapper{background: linear-gradient(0deg,rgb(119, 45, 2) 0%,rgb(24, 29, 30) 52%,rgb(234, 129, 38) 100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  431. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(226, 92, 19)8px,rgb(158, 73, 16)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  432. ["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
  433. ],
  434. [ //STYLE #10
  435. ["#chat-wrapper{background: linear-gradient(0deg,rgb(141, 36, 95)0%,rgba(191, 0, 255, 0.82)calc(100% - 62px),rgb(255, 0, 202)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  436. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(150, 0, 175)8px,rgb(176, 0, 226)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  437. ["#sidemenu{background: linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)100%);}"]
  438. ],
  439. [ //STYLE #11
  440. ["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  441. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  442. ["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}"]
  443. ],
  444. [ //STYLE #12
  445. ["#chat-wrapper{background: #fff!important;}.message>#system_user{color:#FFFFFF}#cts-chat-content>.message{background:#00000000}.message{color:#000000;text-shadow: unset;}"],
  446. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  447. ["#sidemenu{background: #2d373a;}"]
  448. ],
  449. [ //STYLE #13
  450. ["#chat-wrapper{background: url(https://i.imgur.com/ek4TEsz.jpg)!important;}#cts-chat-content>.message{background:#17951a8c;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  451. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(37, 101, 27)8px,rgb(36, 98, 25)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  452. ["#sidemenu{background: url(https://i.imgur.com/LCOulGB.png) repeat-x bottom;}"]
  453. ],
  454. [ //STYLE #14
  455. ["#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%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  456. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  457. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  458. ],
  459. [ //STYLE #14
  460. ["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  461. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(58, 58, 58)8px,rgb(30, 30, 30)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  462. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  463. ],
  464. [ //STYLE #15
  465. ["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  466. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(83, 17, 128)8px,rgb(68, 15, 103)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  467. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  468. ],
  469. [ //STYLE #16
  470. ["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  471. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(121, 3, 3)8px,rgb(176, 2, 2)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  472. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  473. ],
  474. [ //STYLE #17
  475. ["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  476. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(26, 59, 75)8px,rgb(59, 130, 170)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  477. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  478. ],
  479. [ //STYLE #18
  480. ["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  481. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  482. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  483. ],
  484. [ //STYLE #19
  485. ["#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%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  486. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  487. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  488. ],
  489. [ //STYLE #20
  490. ["#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%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  491. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(234, 236, 5)8px,rgb(180, 187, 15)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  492. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  493. ],
  494. [ //STYLE #21
  495. ["#chat-wrapper{background: linear-gradient(0deg,rgb(119, 45, 2) 0%,rgb(24, 29, 30) 52%,rgb(234, 129, 38) 100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  496. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(226, 92, 19)8px,rgb(158, 73, 16)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  497. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  498. ],
  499. [ //STYLE #22
  500. ["#chat-wrapper{background: linear-gradient(0deg,rgb(141, 36, 95)0%,rgba(191, 0, 255, 0.82)calc(100% - 62px),rgb(255, 0, 202)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  501. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(150, 0, 175)8px,rgb(176, 0, 226)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  502. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  503. ],
  504. [ //STYLE #23
  505. ["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  506. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}#videos-footer-broadcast-wrapper>.waiting{background:#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;}"],
  507. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  508. ]
  509. ];
  510. //INITIATE
  511. CTSInit();
  512.  
  513. function CTSInit() {
  514. //INITIATE CTS
  515. CTS.ScriptLoading = setInterval(function() {
  516. if (document.querySelector("tinychat-webrtc-app")) {
  517. if (document.querySelector("tinychat-webrtc-app").shadowRoot) {
  518. CTSRoomInject();
  519. }
  520. debug("TINYCHAT::LOAD", "ROOM");
  521. } else if (document.querySelector("#welcome-wrapper")) {
  522. CTSHomeInject();
  523. debug("TinyChat::LOAD", "HOME");
  524. }
  525. }, 500);
  526. //WEBSOCKET HOOK
  527. if (!document.URL.match(/^https:\/\/tinychat.com(\/$|\/#)/i)) {
  528. new MutationObserver(function() {
  529. this.disconnect();
  530. CTSWebSocket();
  531. }).observe(document, {
  532. subtree: true,
  533. childList: true
  534. });
  535. }
  536. //FULLY LOADED -> RUNALL
  537. CTS.FullLoad = setInterval(function() {
  538. if (CTS.ScriptInit === true && CTS.SocketConnected === true) {
  539. clearInterval(CTS.FullLoad);
  540. if (CTS.Me.mod) {
  541. if (CTS.Bot) CheckHost();
  542. if (CTS.Room.YT_ON) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  543. //VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
  544. }
  545. //PTT AUTO
  546. if (CTS.Room.PTT === true) {
  547. VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
  548. if (e.which == 1) CTS.AutoMicrophone = false;
  549. if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  550. if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  551. }, {
  552. passive: true
  553. });
  554. }
  555. //FAVORITE ROOM
  556. var favorited_rooms = "",
  557. len = CTS.Favorited.length,
  558. script = document.createElement("script"),
  559. elem = document.getElementsByTagName("script")[0];
  560. script.text = 'function AddFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'Favorited"));\n val[index]=["' + CTS.Room.Name + '","' + CTS.Room.Avatar + '"];\n localStorage.setItem("' + CTS.Project.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}';
  561. elem.parentNode.insertBefore(script, elem);
  562. 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>';
  563. 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://avatars.tinychat.com/standart/small/eyePink.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 + '</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>');
  564. //RECENT GIFTS
  565. var recent_gifts = "\n";
  566. for (var g = 0; g < CTS.Room.Recent_Gifts.length; g++) recent_gifts += "<img src=\""+CTS.Room.Recent_Gifts[g]+"\" />";
  567. //ALERT
  568. 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>"+((recent_gifts!="")?recent_gifts:"")+"\n\nROOM CONFIGURATION:\nYouTube Mode: " + ((CTS.Room.YT_ON) ? "ON" : "OFF") + "\n\n</center>");
  569. CTS.ShowedSettings = true;
  570. AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
  571. //FEATURE LAUNCH
  572. SoundMeter();
  573. Reminder();
  574. }
  575. }, 500);
  576. }
  577.  
  578. function CTSHomeInject() {
  579. var HomeCSS = '@media screen and (max-width: 1000px){.nav-menu {background-color: #181e1f;}}.nav-sandwich-menu-button{background-color:unset;}#modalfree-wrapper{display: none;}.tile-header > img {transition:unset;}.tile-favroom-opt{cursor:pointer;position: absolute;right: 0;top: 0;padding: 1px;background:#10131494;}.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:#10131494;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:0}.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 + ';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:#101314;}.tile-content > img{display:none;}#welcome-wrapper{background: #10131494;border-bottom:unset;}#loadmore{background: #00a2ff;font-weight: 600;}#user-menu{background: #101314;}#nav-static-wrapper {-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background:#101314;}#up-button:hover > #up-button-content {background: #10131459;}#nav-fixed{border-bottom:unset;}#nav-fixed-wrapper{-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background: #101314;}#nav-static {border-bottom:unset;}#welcome{padding:12px 30px 24px;}.tile{border-radius: 12px;background: #101314b3;}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;}';
  580. //INSERT HTML/CSS
  581. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  582. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  583. //INSERT SCRIPT
  584. var script = document.createElement("script"),
  585. elem = document.getElementsByTagName("script")[0];
  586. script.text = 'function RemoveFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'Favorited"));\n val[index]=null;\n localStorage.setItem("' + CTS.Project.Storage + 'Favorited", JSON.stringify(val));\n return obj.parentNode.parentNode.remove();\n}';
  587. elem.parentNode.insertBefore(script, elem);
  588. var len = CTS.Favorited.length;
  589. 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") + '" 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></div></div>' : '<div class="tile">Favorite #' + (i + 1) + "</div>");
  590. //SCRIPT INIT -> PREPARE()
  591. clearInterval(CTS.ScriptLoading);
  592. CTS.ScriptInit = true;
  593. CTSHomePrepare();
  594. }
  595.  
  596. function CTSHomePrepare() {
  597. //FUNCTION BYPASS
  598. window.ModalFreeTrialPro = function() {};
  599. //REMOVE
  600. Remove(document, "#footer");
  601. Remove(document, ".nav-logo");
  602. }
  603.  
  604. function CTSRoomInject() {
  605. //INSERT SCRIPT
  606. var script = document.createElement("script"),
  607. elem = document.getElementsByTagName("script")[0];
  608. script.text = 'var StationSelected = 0,\n StationPlay = false,\n StationVol = 1;\nfunction VolStation(elem, vol){\n var StationElem = elem.parentElement.nextSibling;\n var StationVolElem = elem.parentElement.querySelector(".music-radio-info>.volume");\nStationVol += vol;\n if (StationVol < 0){\n StationVol = 0;\n } else if (StationVol > 1) {\n StationVol = 1.0;\n }\n StationElem.volume = StationVol;\nStationVolElem.style.width=((StationVol * 100)+"%");}\nfunction PlayPauseStation(elem) {\n var StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n var StationElem=elem.parentElement.nextSibling;\nvar StationDescElem=elem.parentElement.querySelector(".music-radio-info>.description");\n StationPlay=!StationPlay;\n if (StationPlay) {\n StationElem.volume = StationVol;\n StationElem.play();\n StationPlayPauseBtn.innerText="❚❚"; StationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n} else {\n StationElem.pause();\nStationPlayPauseBtn.innerText="▶";\n StationDescElem.innerText = ("Paused: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);}\n}\nfunction SeekStation(elem, direction) {\n var StationElem = elem.parentElement.nextSibling;\n var StationDescElem = elem.parentElement.querySelector(".music-radio-info>.description");\nvar StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n StationPlay = true;\n StationSelected += direction;\n \n if (StationSelected > window.CTSRadioStations.length-1) {\n StationSelected = 0;\n } else if (StationSelected < 0){\n StationSelected = window.CTSRadioStations.length-1;\n }\n StationElem.pause();\n StationElem.setAttribute("src", window.CTSRadioStations[StationSelected][1]);\n StationElem.load();\n StationElem.volume = StationVol;\nStationPlayPauseBtn.innerText="❚❚";\n StationElem.play();\nStationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n}';
  609. elem.parentNode.insertBefore(script, elem);
  610. //LOCALSETTINGS
  611. CTS.enablePMs = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enablePMs : true;
  612. CTS.enableSound = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enableSound : true;
  613. //TTS (TEXT-TO-SPEECH)
  614. if (CTS.enableSound === true && "speechSynthesis" in window) {
  615. CTS.TTS.synth = window.speechSynthesis;
  616. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  617. }
  618. //ELEMENT DEFINE
  619. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  620. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  621. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  622. MicrophoneElement = document.createEvent("MouseEvent");
  623. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  624. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  625. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  626. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  627. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  628. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  629. //INSERTHTML/CSS
  630. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  631. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + window.CTSChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  632. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + window.CTSChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  633. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + window.CTSChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  634. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  635. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  636. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  637. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  638. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  639. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  640. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  641. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  642. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  643. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  644. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  645. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("beforeend", '<div id="music-radio"><div class="music-radio-info"><div class="description">Playing: None<br>URL: None</div><div class="volume"></div></div><button class="music-radio-seek" onclick="SeekStation(this,-1);">&#8592;</button><button class="music-radio-seek" onclick="SeekStation(this,1);">&#8594;</button><button class="music-radio-playpause" onclick="PlayPauseStation(this);">&#9654;</button><button class="music-radio-vol" onclick="VolStation(this,.05);">&#43;</button><button class="music-radio-vol" style="top:50%" onclick="VolStation(this,-.05);">&#45;</button></div><audio id="music-radio-audio" src="' + window.CTSRadioStations[0][1] + '"></audio>');
  646. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  647. VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin", "<button class=\"tcsettings\">⯇</button>");
  648. VideoListElement.querySelector("#videos-header").appendChild(TitleElement.querySelector('span[title="Settings"]'));
  649. VideoListElement.querySelector("#videolist").appendChild(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"));
  650. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  651. VideoListElement.querySelector("#videolist").insertAdjacentHTML("afterbegin", '<div class="ctsdrop"><button class="ctsoptions" title="CTS Options"><img src="https://i.imgur.com/nvr9FjM.png" /></button><div class="ctsdrop-content"><div style="height:6px;background:#624482;"></div><button id="BackgroundUpdateRight" class="ctsoptions" title="Background"><img src="https://i.imgur.com/Zn97vqS.png" /></button><button id="BackgroundUpdateLeft" class="ctsoptions" title="Background"><img src="https://i.imgur.com/OAcfZRy.png" /></button><div style="height:6px;background:#624482;"></div><button id="FontSizeUpdate" class="ctsoptions" title="Font Size"><img src="https://i.imgur.com/eVc0N5A.png" /></button><div style="height:6px;background:#624482;"></div><button id="ChatColor" class="ctsoptions" title="Chat Style"><img src="https://i.imgur.com/62jpRbt.png" /></button><button id="CameraBorderToggled" class="ctsoptions" title="Camera Border"><img src="https://i.imgur.com/BXK3MR2.png" /></button><button id="FeaturedToggled" class="ctsoptions" title="YouTube/Featured Resize"><img src="https://i.imgur.com/u8mBZYJ.png" /></button>' + ((!CTS.ThemeChange) ? '<button id="ChatWidthToggled" class="ctsoptions" title="Chat Resize"><img src="https://i.imgur.com/G95jVFI.png" /></button><button id="ChatHeightToggled" class="ctsoptions" title="Chat Resize"><img src="https://i.imgur.com/AGc7mLN.png" /></button><div style="height:6px;background:#624482;"></div><button id="PerformanceModeToggled" class="ctsoptions" title="Performance Mode"><img src="https://i.imgur.com/qoKTU4y.png" /></button>' : '') + '<div style="height:6px;background:#624482;"></div><button id="ThemeChange" class="ctsoptions" title="Switch CTS Theme Mode"><img src="https://i.imgur.com/NF6U3Us.png" /></button></div></div>');
  652. ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div><button class="notifbtn">▼</button>');
  653. ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
  654. ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
  655. //SCRIPT INIT -> PREPARE()
  656. clearInterval(CTS.ScriptLoading);
  657. CTS.ScriptInit = true;
  658. CTSRoomPrepare();
  659. }
  660.  
  661. function CTSRoomPrepare() {
  662. var TCApp = window.TinychatApp;
  663. //FUNCTION BYPASS
  664. TCApp.BLL.Videolist.prototype.blurOtherVids = function() {};
  665. TCApp.BLL.SoundPlayer.playMessage = function() {};
  666. TCApp.BLL.SoundPlayer.playGift = function() {};
  667. TCApp.BLL.User.isSubscription = function() {
  668. return true;
  669. };
  670. TCApp.BLL.User.canUseFilters = function() {
  671. return true;
  672. };
  673. TCApp.BLL.MediaConnection.prototype.Close = function() {
  674. RTC(this);
  675. };
  676. TCApp.BLL.ChatRoom.prototype.onGuestSessTimeout = function() {};
  677. TCApp.BLL.ChatRoom.prototype.sendPushForUnreadPrivateMessage = function() {};
  678. TCApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  679. var b = this,
  680. d = this.settings.getSettings();
  681. if (d.video === null) {
  682. return void this.app.MediaSettings(() => {
  683. this.BroadcastStart();
  684. });
  685. }
  686. this.videolist.AddingVideoSelf(this.self_handle);
  687. var e = {};
  688. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  689. e.audio = true;
  690. e.video = {
  691. width: {
  692. min: 320,
  693. max: 4096
  694. },
  695. height: {
  696. min: 240,
  697. max: 2160
  698. },
  699. frameRate: {
  700. min: 15,
  701. ideal: 30,
  702. max: 60
  703. }
  704. };
  705. } else {
  706. navigator.mediaDevices.enumerateDevices().then(g => {
  707. var h = false;
  708. var len = g.length;
  709. for (var c = 0; c < len; c++) {
  710. if (g[c].kind === "videoinput") {
  711. if (e.video === void 0) {
  712. e.video = {
  713. width: {
  714. min: 320,
  715. max: 4096
  716. },
  717. height: {
  718. min: 240,
  719. max: 2160
  720. },
  721. frameRate: {
  722. min: 15,
  723. ideal: 30,
  724. max: 60
  725. }
  726. };
  727. }
  728. if (h) {
  729. d.video = g[c];
  730. h = false;
  731. this.settings.saveSettings(d);
  732. } else if (d.video === null) {
  733. d.video = g[c];
  734. this.settings.saveSettings(d);
  735. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  736. e.video.deviceId = {
  737. exact: d.video.deviceId
  738. };
  739. } else if (d.video.deviceId === a) {
  740. h = true;
  741. }
  742. }
  743. if (g[c].kind === "audioinput") {
  744. if (e.audio === void 0) e.audio = {};
  745. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) {
  746. e.audio = {
  747. deviceId: {
  748. exact: d.audio.deviceId
  749. },
  750. };
  751. }
  752. }
  753. }
  754. if (e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
  755. let i = navigator.mediaDevices.getSupportedConstraints();
  756. for (let a in i) {
  757. if (i.hasOwnProperty(a) && "echoCancellation" == a && e.audio) e.audio[a] = this.settings.isAcousticEchoCancelation();
  758. }
  759. if (!(e.audio || e.video)) {
  760. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  761. } else if ("https:" === location.protocol || this.app.isDebug()) {
  762. debug("BROADCAST", "Initiating Media...");
  763. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  764. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  765. b.mediaLastConstraints = e;
  766. navigator.mediaDevices.getUserMedia(e).then(m => {
  767. b.onMediaSuccessCallback(m);
  768. });
  769. }
  770. }).catch(er => {
  771. debug("CAMERA::ERROR", er);
  772. });
  773. }
  774. };
  775. TCApp.BLL.Userlist.prototype.ignore = function(a) {
  776. var b = a.isUsername ? a.username : a.nickname;
  777. if (this.isIgnored(a) || this.ignored.push(b)) {
  778. var c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  779. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
  780. this.app.showToast(b + " ignored successfully till they leave or you refresh!");
  781. CTS.TempIgnoreList.push(b.toUpperCase());
  782. Cameras();
  783. }
  784. };
  785. TCApp.BLL.Userlist.prototype.unignore = function(a) {
  786. var b = a.isUsername ? a.username : a.nickname,
  787. len = this.ignored.length;
  788. for (var TI = 0; TI < len; TI++) {
  789. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  790. this.ignored.splice(TI, 1);
  791. break;
  792. }
  793. }
  794. len = CTS.TempIgnoreList.length;
  795. for (TI = 0; TI < len; TI++) {
  796. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  797. CTS.TempIgnoreList.splice(TI, 1);
  798. break;
  799. }
  800. }
  801. var e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  802. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
  803. this.app.showToast(a.username + " unignored");
  804. };
  805. //REMOVE
  806. Remove(ChatLogElement, 'span[id="input-unread"]');
  807. Remove(ChatLogElement, "#chat-content");
  808. Remove(ChatLogElement, "#chatlog-button");
  809. Remove(TitleElement, 'span[title="Follow"]');
  810. Remove(TitleElement, 'span[title="Share room"]');
  811. Remove(document, "#users-icon");
  812. //PARAM REMOVE
  813. if (CTS.enablePMs === false) Remove(ChatListElement, "#chatlist");
  814. //LOAD
  815. CTSRoomLoad();
  816. }
  817.  
  818. function CTSRoomLoad() {
  819. //EVENT LISTENERS
  820. if (!CTS.ThemeChange) {
  821. // BOOT UP OG THEME
  822. var finishoff = false;
  823. while (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter || CTS.OGStyle.SavedWidth !== CTS.OGStyle.WidthCounter) {
  824. if (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter) {
  825. ChatHeightToggled();
  826. } else {
  827. finishoff = true;
  828. }
  829. if (CTS.OGStyle.SaveWidth !== CTS.OGStyle.WidthCounter && finishoff) ChatWidthToggled();
  830. }
  831. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  832. ChatHeightToggled();
  833. Save("OGStyleHeight", CTS.OGStyle.HeightCounter);
  834. }, {
  835. passive: true
  836. });
  837. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  838. ChatWidthToggled();
  839. Save("OGStyleWidth", JSON.stringify(CTS.OGStyle.WidthCounter));
  840. }, {
  841. passive: true
  842. });
  843. VideoListElement.querySelector("#PerformanceModeToggled").addEventListener("click", function() {
  844. if (CTS.ChatDisplay) {
  845. CTS.PerformanceMode = !CTS.PerformanceMode;
  846. PerformanceModeInit(CTS.PerformanceMode);
  847. }
  848. }, {
  849. passive: true
  850. });
  851. } else {
  852. ChatLogElement.querySelector("#chat-wider").insertAdjacentHTML("beforebegin", "<div id=\"chat-hide\"></div>");
  853. ChatLogElement.querySelector("#chat-hide").addEventListener("click", function() {
  854. ChatHide();
  855. }, {
  856. passive: true
  857. });
  858. }
  859. VideoListElement.querySelector("#ThemeChange").addEventListener("click", function() {
  860. CTS.ThemeChange = !CTS.ThemeChange;
  861. Save("ThemeChange", JSON.stringify(CTS.ThemeChange));
  862. location.reload();
  863. }, {
  864. passive: true
  865. });
  866. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  867. CTS.Featured = !CTS.Featured;
  868. Save("Featured", JSON.stringify(CTS.Featured));
  869. FeaturedCameras(CTS.Featured);
  870. Resize();
  871. }, {
  872. passive: true
  873. });
  874. VideoListElement.querySelector("#CameraBorderToggled").addEventListener("click", function() {
  875. CTS.CameraBorderToggle = !CTS.CameraBorderToggle;
  876. Save("CameraBorderToggle", JSON.stringify(CTS.CameraBorderToggle));
  877. Cameras();
  878. Resize();
  879. }, {
  880. passive: true
  881. });
  882. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  883. CTS.ChatStyleCounter++;
  884. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  885. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  886. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  887. var len = window.CTSChatCSS.length - 1;
  888. if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
  889. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + window.CTSChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  890. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + window.CTSChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  891. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + window.CTSChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  892. Save("ChatStyle", CTS.ChatStyleCounter);
  893. }, {
  894. passive: true
  895. });
  896. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  897. UpdateScroll(1, true);
  898. CheckUnreadMessage();
  899. }, {
  900. passive: true
  901. });
  902. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  903. var element = event.target;
  904.  
  905. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage(true);
  906. }, {
  907. passive: true
  908. });
  909. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  910. var element = event.target;
  911. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  912. }, {
  913. passive: true
  914. });
  915. if (CTS.NotificationToggle === 0) {
  916. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  917. passive: true
  918. });
  919. }
  920. VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
  921. var arg;
  922. if (this.innerText === "⯈") {
  923. this.innerText = "⯇";
  924. arg = "block";
  925. } else {
  926. this.innerText = "⯈";
  927. arg = "none";
  928. }
  929. VideoListElement.querySelector("#videos-header-sound").style.display = arg;
  930. if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
  931. //VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
  932. VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
  933. VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
  934. }, {
  935. passive: true
  936. });
  937. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  938. if (!Addon.active("BGIMG")) {
  939. CTS.MainBackgroundCounter++;
  940. if (CTS.MainBackgroundCounter === window.CTSImages.length) CTS.MainBackgroundCounter = 0;
  941. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  942. document.body.style.background = background;
  943. Save("MainBackground", background);
  944. }
  945. }, {
  946. passive: true
  947. });
  948. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  949. if (!Addon.active("BGIMG")) {
  950. CTS.MainBackgroundCounter--;
  951. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = window.CTSImages.length - 1;
  952. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  953. document.body.style.background = background;
  954. Save("MainBackground", background);
  955. }
  956. }, {
  957. passive: true
  958. });
  959. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  960. CTS.FontSize += 5;
  961. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  962. Save("FontSize", CTS.FontSize);
  963. ChatLogElement.querySelector("#textarea").style.fontSize = (CTS.FontSize - 4) + "px";
  964. }, {
  965. passive: true
  966. });
  967. //MUTATION OBSERVERS
  968. new MutationObserver(function() {
  969. LoadMessage();
  970. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  971. attributes: true,
  972. attributeFilter: ["class"],
  973. childList: false,
  974. characterData: false
  975. });
  976. new MutationObserver(function() {
  977. Cameras();
  978. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  979. childList: true
  980. });
  981. new MutationObserver(function() {
  982. Cameras();
  983. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  984. childList: true
  985. });
  986. new MutationObserver(function() {
  987. if (CTS.AutoMicrophone) {
  988. OpenMicrophone();
  989. }
  990. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  991. attributes: true,
  992. attributeFilter: ["class"]
  993. });
  994. //BOOT UP - FIRST START
  995. NotificationDisplay();
  996. FeaturedCameras(CTS.Featured);
  997. Cameras();
  998. }
  999. //YOUTUBE FUNCTIONS
  1000. function CheckHost() {
  1001. if (CTS.Host === 0) {
  1002. Send("msg", "!whoisbot");
  1003. CTS.HostAttempt = 0;
  1004. CTS.HostWaiting = true;
  1005. }
  1006. }
  1007.  
  1008. function SetBot() {
  1009. if (arguments[0]) CTS.Game.NoReset = true;
  1010. Send("msg", "!bot");
  1011. CTS.HostWaiting = false;
  1012. }
  1013.  
  1014. function CheckYouTube() {
  1015. //CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
  1016. if (arguments[3] === undefined) arguments[3] = true;
  1017. CTS.YouTube.XHR.type = arguments[1];
  1018. var videoid = arguments[0].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);
  1019. if (videoid !== null) {
  1020. videoid = videoid[1].replace(/v\=/g, "");
  1021. //LINK IS PLAYLIST
  1022. if (videoid.match(/list\=/i)) {
  1023. if (arguments[3]) {
  1024. videoid = videoid.replace(/list\=/, "");
  1025. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  1026. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/playlistItems?playlistId=" + videoid + "&part=snippet&maxResults=25" + ((arguments[2] !== undefined) ? "&pageToken=" + arguments[2] : "") + "&type=video&eventType=completed&key=" + CTS.YouTube.API_KEY);
  1027. CTS.YouTube.XHR.playlistid = videoid;
  1028. CTS.YouTube.XHR.send();
  1029. }
  1030. } else {
  1031. //LINK IS REGULAR
  1032. CTS.YouTube.XHR.videoid = videoid;
  1033. CTS.YouTube.VideoReturn = true;
  1034. 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=" + CTS.YouTube.API_KEY);
  1035. CTS.YouTube.XHR.send();
  1036. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  1037. }
  1038. } else {
  1039. //KEYWORD SEARCH
  1040. if (CTS.YouTube.MessageQueueList.length <= 0) {
  1041. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  1042. CTS.YouTube.SearchReturn = true;
  1043. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/search?key=" + CTS.YouTube.API_KEY + "&maxResults=1&q=" + encodeURI(arguments[0]) + "&type=video&part=snippet");
  1044. CTS.YouTube.XHR.send();
  1045. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  1046. }
  1047. }
  1048. }
  1049.  
  1050. function YouTubePlayList() {
  1051. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  1052. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  1053. }
  1054.  
  1055. function YouTubeTrackAdd() {
  1056. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  1057. if (CTS.YouTube.Busy === false) {
  1058. if (CTS.YouTube.MessageQueueList.length > 0) {
  1059. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  1060. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.MessageQueueList[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=" + CTS.YouTube.API_KEY);
  1061. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  1062. CTS.YouTube.XHR.send();
  1063. CTS.YouTube.MessageQueueList.shift();
  1064. }
  1065. }
  1066. }
  1067. }
  1068.  
  1069. function YouTubePlayListItems() {
  1070. var len = arguments[0].length;
  1071. for (var i = 0; i < len; i++) {
  1072. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  1073. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  1074. }
  1075. }
  1076. }
  1077.  
  1078. function YouTubeTimeConvert() {
  1079. //TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
  1080. var a = arguments[0].match(/\d+/g);
  1081. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  1082. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  1083. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  1084. var len = a.length;
  1085. arguments[0] = 0;
  1086. if (len == 3) {
  1087. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  1088. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  1089. arguments[0] = arguments[0] + parseInt(a[2]);
  1090. }
  1091. if (len == 2) {
  1092. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  1093. arguments[0] = arguments[0] + parseInt(a[1]);
  1094. }
  1095. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  1096. return arguments[0];
  1097. }
  1098.  
  1099. function BotCommandCheck() {
  1100. //USER COMMANDS TO HOST
  1101. if (isCommand(arguments[1])) {
  1102. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  1103. if (arguments[1].match(/^!vote\s/i)) Vote(arguments[0], arguments[1]);
  1104. // PUBLIC COMMANDS
  1105. if (CTS.PublicCommandToggle) {
  1106. if (arguments[1].match(/^!8ball\s.*\??/i)) Send("msg", "[8BALL]\n" + window.CTSEightBall[Rand(0, window.CTSEightBall.length - 1)]);
  1107. if (arguments[1].match(/^!coin$/i)) Send("msg", "[COIN FLIP]\nThe coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!");
  1108. if (arguments[1].match(/^!chuck$/i)) Chuck();
  1109. if (arguments[1].match(/^!urb\s/i)) Urb(arguments[1]);
  1110. if (arguments[1].match(/^!dad$/i)) Dad();
  1111. if (arguments[1].match(/^!advice$/i)) Advice();
  1112. }
  1113. //MOD/JR.MOD
  1114. if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
  1115. if (arguments[1].match(/^!kick\s/i)) ModCommand("kick", arguments[1]);
  1116. if (arguments[1].match(/^!ban\s/i)) ModCommand("ban", arguments[1]);
  1117. if (arguments[1].match(/^!close\s/i)) ModCommand("stream_moder_close", arguments[1]);
  1118. }
  1119. //ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
  1120. if (CTS.Room.YT_ON) {
  1121. if (arguments[1].match(/^!play$/i)) YouTubePlayList();
  1122. if (arguments[1].match(/^!yt\s/i)) BotCommand(1, arguments[0], arguments[1]);
  1123. if (arguments[1].match(/^!ytbypass\s/i)) BotCommand(6, arguments[0], arguments[1]);
  1124. if (arguments[1].match(/^!ytclear$/i)) BotCommand(2, arguments[0]);
  1125. if (arguments[1].match(/^!ytskip$/i)) BotCommand(3, arguments[0]);
  1126. if (arguments[1].match(/^!ytqueue$/i)) BotCommand(4, arguments[0]);
  1127. }
  1128. }
  1129. //USER CAN GAME THEY'VE BEEN VERIFIED
  1130. if (CTS.UserList[arguments[0]].canGame) FishCommandCheck(arguments[0], arguments[1]);
  1131. }
  1132.  
  1133. function BotCheck() {
  1134. if (CTS.UserList[arguments[0]].mod) {
  1135. //CHECK HOST
  1136. if (arguments[1].match(/^!bot$/i)) {
  1137. //SET HOST
  1138. CTS.Host = arguments[2].handle;
  1139. CTS.HostWaiting = false;
  1140. //RESET GAMES
  1141. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  1142. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  1143. if (CTS.Me.handle !== arguments[2].handle) {
  1144. CTS.Game.Fish.GameStart = false;
  1145. CTS.Game.NoReset = false;
  1146. Fish.reset(true);
  1147. }
  1148. }
  1149. //IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
  1150. if (CTS.Me.handle == arguments[2].handle && CTS.Room.YT_ON) YouTubePlayList();
  1151. //ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
  1152. } else if (CTS.HostWaiting === true) {
  1153. CTS.HostAttempt++;
  1154. //SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
  1155. if (CTS.HostAttempt == 1) {
  1156. setTimeout(function() {
  1157. //CHECK WAITING STATE OR IF HOST HAS CHANGED
  1158. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  1159. }, 10000);
  1160. }
  1161. //SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
  1162. if (CTS.HostAttempt == 10) SetBot(false);
  1163. }
  1164. }
  1165. }
  1166.  
  1167. function Chuck() {
  1168. //OPEN REQUEST
  1169. CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
  1170. CTS.Chuck.XHR.send();
  1171. }
  1172.  
  1173. function Urb() {
  1174. //CHECK TERM
  1175. var urban = arguments[0].match(/\!urb\s(.*)/i);
  1176. if (urban !== null) {
  1177. //OPEN REQUEST
  1178. CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
  1179. CTS.Urb.XHR.send();
  1180. }
  1181. }
  1182.  
  1183. function Dad() {
  1184. //OPEN REQUEST
  1185. CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
  1186. CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
  1187. CTS.Dad.XHR.send();
  1188. }
  1189.  
  1190. function Advice() {
  1191. //OPEN REQUEST
  1192. CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
  1193. CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
  1194. CTS.Advice.XHR.send();
  1195. }
  1196. //MESSAGE FUNCTION
  1197. function CreateMessage() {
  1198. //SCROLLED UP? MISSED A MESSAGE?
  1199. CheckUnreadMessage();
  1200. // POST NEW CHAT ITEM AND IF ACTIVECHAT IS OUR CURRENT
  1201. if (arguments[7] == GetActiveChat()) ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(arguments[3]) || arguments[6]) ? "highlight" : "") + "\" " + ((arguments[2] === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((arguments[2]=="")?"":((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + arguments[2] + "\"></div></a>" : "")) + "<div class=\"nickname\" style=\"background:" + arguments[1] + ";\">" + arguments[4] + (CTS.TimeStampToggle ? "<div class=\"ctstime\"> " + arguments[0] + " </div>" : "") + "</div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\"style=\"font-size:" + CTS.FontSize + "px;\">" + arguments[5] + "</span></CTS-message-html></div></div>");
  1202. //CHAT CLEANUP
  1203. var Chat = ChatLogElement.querySelectorAll("#cts-chat-content>.message");
  1204. var len = Chat.length;
  1205. if (len > CTS.ChatLimit + 50) {
  1206. CTS.ChatScroll = true;
  1207. //REMOVE 50 MESSAGES (CAN BE DONE CLEANER BUT NO BIG DEAL FOR OUR USE)
  1208. len = Chat.length - CTS.ChatLimit;
  1209. var ChatIndex = 0;
  1210. for (ChatIndex; ChatIndex < len; ChatIndex++) {
  1211. Chat[ChatIndex].parentNode.removeChild(Chat[ChatIndex]);
  1212. CTS.Message[arguments[7]].shift();
  1213. //CLEANING TC ITEMS THAT FILL UP OVERTIME
  1214. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  1215. }
  1216. }
  1217. UpdateScroll(1, false);
  1218. }
  1219.  
  1220. function AKB() {
  1221. //WATCH OR REMOVE USERS
  1222. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  1223. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  1224. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  1225. } else {
  1226. if (CTS.Me.mod) {
  1227. if (CTS.AutoKick === true) {
  1228. CTS.NoGreet = true;
  1229. Send("kick", arguments[1]);
  1230. } else if (CTS.AutoBan === true) {
  1231. CTS.NoGreet = true;
  1232. Send("ban", arguments[1]);
  1233. }
  1234. }
  1235. }
  1236. }
  1237.  
  1238. function AKBS() {
  1239. if (arguments[0].username !== "") {
  1240. //EXTENDED SAFELIST
  1241. var temp = [];
  1242. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1243. //DEFAULT SAFELIST
  1244. if (!isSafeListed(arguments[0].username.toUpperCase())) {
  1245. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  1246. if (CTS.SafeList.length < 2500) {
  1247. CTS.SafeList.push(arguments[0].username.toUpperCase());
  1248. Save("AKB", JSON.stringify(CTS.SafeList));
  1249. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1250. }
  1251. } else {
  1252. if (arguments[0].lurker === false) {
  1253. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1254. } else {
  1255. AKB(false, arguments[0].handle);
  1256. }
  1257. }
  1258. }
  1259. } else {
  1260. AKB(false, arguments[0].handle);
  1261. }
  1262. }
  1263.  
  1264. function CheckSafeList() {
  1265. var target = User(arguments[0]);
  1266. if (target !== -1) {
  1267. //TEMPORARY DISREGARD THEIR CAMERA ABILITIES IF THEY JOIN BACK TILL ALLOWED MANUALLY
  1268. var msg = "temporarily blacklisted.\nRefresh to clear blacklist!";
  1269. CTS.GreenRoomTempBlackList.push(CTS.UserList[target].username);
  1270. var a = CTS.SafeList.indexOf(CTS.UserList[target].username);
  1271. if (a !== -1) {
  1272. //REMOVE
  1273. if (arguments[1]) {
  1274. debug("SAFELIST::", "REMOVE USER " + CTS.UserList[target].username);
  1275. CommandList.saferemove(a);
  1276. msg = "User has been removed from safelist and" + msg;
  1277. } else {
  1278. //GETID
  1279. return a;
  1280. }
  1281. } else {
  1282. msg = "User has been " + msg;
  1283. }
  1284. Alert(0, msg);
  1285. }
  1286. }
  1287.  
  1288. function LoadMessage() {
  1289. var ChatIndex, index, Chat = ChatLogElement.querySelector("#cts-chat-content");
  1290. CTS.ChatScroll = true;
  1291. if (!CTS.MessageCallback[CTS.ActiveMessage]) CTS.MessageCallback[CTS.ActiveMessage] = [];
  1292. CTS.MessageCallback[CTS.ActiveMessage].html = Chat.innerHTML;
  1293. CTS.MessageCallback[CTS.ActiveMessage].len = (Chat.innerHTML === "") ? 0 : CTS.Message[CTS.ActiveMessage].length;
  1294. Chat.innerHTML = "";
  1295. CheckUnreadMessage();
  1296. CTS.ActiveMessage = GetActiveChat();
  1297. if (CTS.Message[CTS.ActiveMessage]) {
  1298. index = (CTS.MessageCallback[CTS.ActiveMessage]) ? CTS.MessageCallback[CTS.ActiveMessage].len : 0;
  1299. if (index > 0) Chat.innerHTML = CTS.MessageCallback[CTS.ActiveMessage].html;
  1300. var len = CTS.Message[CTS.ActiveMessage].length;
  1301. 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) || CTS.Message[CTS.ActiveMessage][ChatIndex].mention) ? "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 + ";box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";background:" + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";\">" + CTS.Message[CTS.ActiveMessage][ChatIndex].nick + (CTS.TimeStampToggle ? "<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>");
  1302. } else {
  1303. CTS.Message[CTS.ActiveMessage] = [];
  1304. }
  1305. UpdateScroll(1, false);
  1306. UpdateScroll(2, false);
  1307. }
  1308.  
  1309. function CheckUnreadMessage() {
  1310. if ((Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) || arguments[0] !== undefined) {
  1311. CTS.MissedMsg = 0;
  1312. CTS.ChatScroll = true;
  1313. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1314. } else {
  1315. CTS.MissedMsg++;
  1316. CTS.ChatScroll = false;
  1317. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1318. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1319. }
  1320. }
  1321.  
  1322. function GetActiveChat() {
  1323. var elem = ChatListElement.querySelector(".active");
  1324. if (elem) return elem.getAttribute("data-chat-id");
  1325. return 0;
  1326. }
  1327.  
  1328. function CheckImgur() {
  1329. if (CTS.imgur) {
  1330. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpeg|jpg|gif|png|mp4)/);
  1331. if (i !== null) {
  1332. arguments[0] = (i[1] == "mp4") ? "<center>(Video Below)\n<video onclick=\"if (this.paused) {this.play();}else{this.pause();}\" oncontextmenu=\"return false;\" width=\"288px\" height=\"162px\"><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>";
  1333. }
  1334. }
  1335. return arguments[0];
  1336. }
  1337.  
  1338. function TTS() {
  1339. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1340. utter.voice = CTS.TTS.voices[0];
  1341. utter.rate = 1.0;
  1342. utter.pitch = 0.5;
  1343. CTS.TTS.synth.speak(utter);
  1344. }
  1345.  
  1346. function isCommand() {
  1347. return arguments[0].match(/^!/);
  1348. }
  1349.  
  1350. function RoomUsers() {
  1351. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  1352. }
  1353.  
  1354. function SpamPrevention() {
  1355. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  1356. if (LineBreaks >= 14 && arguments[1] === false) return true;
  1357. return false;
  1358. }
  1359.  
  1360. function GamePrevention() {
  1361. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(?:FISHING\sBOAT)\]/i)) return false;
  1362. return true;
  1363. }
  1364.  
  1365. function UpdateScroll() {
  1366. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  1367. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true) && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  1368. }
  1369.  
  1370. function DecodeTXT() {
  1371. var txt = document.createElement("textarea");
  1372. txt.innerHTML = arguments[0];
  1373. return txt.value;
  1374. }
  1375.  
  1376. function HTMLtoTXT() {
  1377. var p = document.createElement("p");
  1378. p.appendChild(document.createTextNode(arguments[0]));
  1379. 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>");
  1380. }
  1381.  
  1382. function IgnoreText() {
  1383. if (arguments[0] !== "") {
  1384. if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
  1385. return true;
  1386. }
  1387. }
  1388.  
  1389. function TimeToDate() {
  1390. if (arguments[1] === undefined) arguments[1] = new Date();
  1391. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((am|AM|aM|Am)|(pm|PM|pM|Pm))/);
  1392. var t = {
  1393. hours: parseInt(match[1]),
  1394. minutes: parseInt(match[2]),
  1395. period: match[3].toLowerCase()
  1396. };
  1397. if (t.hours === 12) {
  1398. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  1399. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  1400. } else {
  1401. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  1402. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  1403. }
  1404. return arguments[1];
  1405. }
  1406.  
  1407. function PushPM() {
  1408. var list = (arguments[2] !== undefined) ? CTS.UserList[arguments[2]] : CTS.Me;
  1409.  
  1410. CTS.Message[arguments[0]].push({
  1411. "time": Time(),
  1412. "namecolor": list.namecolor,
  1413. "avatar": list.avatar,
  1414. "username": list.username,
  1415. "nick": list.nick,
  1416. "msg": CheckImgur(HTMLtoTXT(arguments[1])),
  1417. "mention": false
  1418. });
  1419.  
  1420. if (arguments[0] == GetActiveChat()) {
  1421. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1422. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, msg.mention, arguments[0]);
  1423. UpdateScroll(1, false);
  1424. }
  1425. }
  1426.  
  1427. function Time() {
  1428. return (new Date().toLocaleString("en-US", {
  1429. hour: "numeric",
  1430. minute: "numeric",
  1431. second: "numeric",
  1432. hour12: true
  1433. }));
  1434. }
  1435. //FEATURES
  1436. function ChatHeightToggled() {
  1437. CTS.OGStyle.HeightCounter++;
  1438. if (!CTS.ChatDisplay) {
  1439. CTS.ChatWidth += 5;
  1440. CTS.ChatDisplay = true;
  1441. }
  1442. CTS.ChatHeight -= 5;
  1443. CTS.UserListDisplay = true;
  1444. if (CTS.ChatHeight == 20) {
  1445. CTS.ChatHeight = 45;
  1446. CTS.UserListDisplay = false;
  1447. CTS.OGStyle.HeightCounter = 0;
  1448. }
  1449.  
  1450. 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;" : "bottom:0;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
  1451. 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);" : "84px;");
  1452. 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;top:34px;");
  1453. VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
  1454. 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;";
  1455. UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  1456. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  1457. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  1458. PerformanceModeInit(CTS.PerformanceMode);
  1459. UpdateScroll(1, true);
  1460. UpdateScroll(2, true);
  1461. Resize();
  1462. }
  1463.  
  1464. function ChatWidthToggled() {
  1465. CTS.OGStyle.WidthCounter++;
  1466. CTS.ChatWidth += 5;
  1467. CTS.ChatDisplay = true;
  1468. if (CTS.ChatWidth == 25) {
  1469. CTS.ChatWidth = -5;
  1470. CTS.ChatDisplay = false;
  1471. CTS.OGStyle.WidthCounter = 0;
  1472. }
  1473. 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;" : "bottom:0;;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
  1474. 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);" : "84px;");
  1475. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.cssText = (!CTS.ChatDisplay) ? "bottom:0;top:unset;width:100%;position:relative;" : "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 34px);" : "34px;bottom:unset;");
  1476. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
  1477. 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;";
  1478. UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  1479. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  1480. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  1481. CTS.PerformanceMode = false;
  1482. PerformanceModeInit(CTS.PerformanceMode);
  1483. UpdateScroll(1, true);
  1484. UpdateScroll(2, true);
  1485. Resize();
  1486. }
  1487.  
  1488. function ChatHide() {
  1489. CTS.NormalStyle.ChatHide = !CTS.NormalStyle.ChatHide;
  1490. ChatLogElement.querySelector("#chat-wrapper").style.display = (CTS.NormalStyle.ChatHide ? "none" : "block");
  1491. UpdateScroll(1, true);
  1492. UpdateScroll(2, true);
  1493. Resize();
  1494. }
  1495.  
  1496. function SoundMeter() {
  1497. //MICROPHONE INDICATOR
  1498. setTimeout(function() {
  1499. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  1500. Featured = VideoListElement.querySelectorAll(".videos-items:first-child tc-video-item"),
  1501. TCCameraList = window.TinychatApp.getInstance().defaultChatroom._videolist.items.length,
  1502. CameraLen = Camera.length,
  1503. users;
  1504. if (Featured.length > 0) {
  1505. for (var x = 0; x < TCCameraList; x++) {
  1506. if (CameraLen < 1) break;
  1507. for (users = 0; users < CameraLen; users++) {
  1508. if (Camera[users].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id") == window.TinychatApp.getInstance().defaultChatroom._videolist.items[x].userentity.path) {
  1509. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", window.TinychatApp.getInstance().defaultChatroom._videolist.items[x].audiolevel);
  1510. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  1511. break;
  1512. }
  1513. }
  1514. }
  1515. } else {
  1516. for (users = 0; users < CameraLen; users++) {
  1517. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", window.TinychatApp.getInstance().defaultChatroom._videolist.items[users].audiolevel);
  1518. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  1519. }
  1520. }
  1521. //REPEAT
  1522. SoundMeter();
  1523. }, 200);
  1524. }
  1525.  
  1526. function RTC() {
  1527. if (null != arguments[0].rtc) {
  1528. let a = arguments[0].rtc;
  1529. arguments[0].rtc = null;
  1530. MS(arguments[0], a);
  1531. }
  1532. }
  1533.  
  1534. function Vote() {
  1535. var ChecksOut = CTS.VoteSystem,
  1536. len = CTS.WaitToVoteList.length;
  1537. if (len > 0 && ChecksOut) {
  1538. for (var i = 0; i < len; i++) {
  1539. if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
  1540. Send("msg", "Please wait several minutes till you can cast your vote again!");
  1541. ChecksOut = false;
  1542. break;
  1543. }
  1544. }
  1545. }
  1546. if (ChecksOut) {
  1547. if (isSafeListed(CTS.UserList[arguments[0]].username.toUpperCase())) {
  1548. var targetname = arguments[1].match(/\!vote\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
  1549. if (targetname !== null) {
  1550. var Target = UsernameToUser(targetname[1].toUpperCase());
  1551. if (Target !== -1) {
  1552. if (CTS.UserList[Target].broadcasting) {
  1553. if (CTS.Me.owner || !CTS.UserList[Target].mod) {
  1554. Send("msg", "Your vote has been cast, you may vote again shortly!");
  1555. CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
  1556. CTS.UserList[Target].vote += 1;
  1557. if (CTS.UserList[Target].vote === 3) {
  1558. CTS.UserList[Target].vote = 0;
  1559. Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
  1560. Send("stream_moder_close", CTS.UserList[Target].handle);
  1561. }
  1562. } else {
  1563. Send("msg", "I cannot do that!");
  1564. }
  1565. }
  1566. } else {
  1567. Send("msg", "The user is not broadcasting...");
  1568. }
  1569. } else {
  1570. Send("msg", "The nickname or username does not exist!");
  1571. }
  1572. }
  1573. }
  1574. }
  1575.  
  1576. function MessagePopUp() {
  1577. if (CTS.Popups) {
  1578. var push = false;
  1579. if (arguments[0] != -1) {
  1580. if (ChatListElement.querySelector(".list-item .active")) {
  1581. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  1582. if (arguments[2]) push = true;
  1583. } else {
  1584. push = true;
  1585. }
  1586. } else if (!arguments[2]) {
  1587. push = true;
  1588. }
  1589. }
  1590. if (arguments[3]) push = true;
  1591. if (push || !CTS.ChatDisplay) {
  1592. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  1593. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1594. clearTimeout(CTS.NotificationTimeOut[0]);
  1595. CTS.NotificationTimeOut.shift();
  1596. }
  1597. VideoListElement.querySelector(".PMOverlay").insertAdjacentHTML("beforeend", "<div class=\"PMPopup\"><h2><div class=\"PMTime\">" + Time() + "</div><div class=\"PMName\">" + ((arguments[3]) ? "YouTube Bot" : (CTS.UserList[arguments[0]].nick + " in " + ((arguments[2]) ? "Main" : "PM"))) + "</div></h2><div class=\"PMContent\"style=\"font-size:" + CTS.FontSize + "px\">" + arguments[1] + "</div></div>");
  1598. CTS.NotificationTimeOut.push(setTimeout(function() {
  1599. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  1600. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1601. CTS.NotificationTimeOut.shift();
  1602. }
  1603. }, 11100));
  1604. }
  1605. }
  1606. }
  1607.  
  1608. function Reminder() {
  1609. var temp,
  1610. i,
  1611. len = CTS.ReminderServerInList.length;
  1612. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  1613. CTS.ReminderServerInList = [];
  1614. if (CTS.Reminder === true) {
  1615. var OffsetTime;
  1616. len = CTS.ReminderList.length;
  1617. for (i = 0; i < len; i++) {
  1618. temp = TimeToDate(CTS.ReminderList[i][0]);
  1619. CTS.RecentTime = new Date();
  1620. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  1621. OffsetTime = temp - CTS.RecentTime;
  1622. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, CTS.ReminderList[i][1]));
  1623. }
  1624. if (Addon.active("ReminderList")) {
  1625. len = Addon.get("ReminderList").length;
  1626. for (i = 0; i < len; i++) {
  1627. temp = TimeToDate(Addon.get("ReminderList")[i][0]);
  1628. CTS.RecentTime = new Date();
  1629. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  1630. OffsetTime = temp - CTS.RecentTime;
  1631. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, Addon.get("ReminderList")[i][1]));
  1632. }
  1633. }
  1634. }
  1635. }
  1636.  
  1637. function AddReminder() {
  1638. Send("msg", "🕬 " + arguments[0]);
  1639. setTimeout(Reminder, 5000);
  1640. }
  1641.  
  1642. function NotificationDisplay() {
  1643. var isNotificationDisplay = (CTS.NotificationToggle == 0 || CTS.NotificationToggle == 1);
  1644. console.log("hmm:" + isNotificationDisplay);
  1645.  
  1646. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  1647. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  1648. if (CTS.NotificationToggle == 0) {
  1649. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  1650. passive: true
  1651. });
  1652. } else {
  1653. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
  1654. passive: true
  1655. });
  1656. }
  1657. UpdateScroll(1, true);
  1658. UpdateScroll(2, true);
  1659. }
  1660.  
  1661. function NotificationResize() {
  1662. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  1663. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  1664. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  1665. ChatLogElement.querySelector("#chat").style.height = "50%%";
  1666. } else {
  1667. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  1668. ChatLogElement.querySelector("#chat").style.height = "100%";
  1669. }
  1670. UpdateScroll(1, false);
  1671. UpdateScroll(2, true);
  1672. }
  1673.  
  1674. function Dice() {
  1675. return String.fromCharCode("0x268" + Rand(0, 5));
  1676. }
  1677.  
  1678. function Rand() {
  1679. arguments[0] = Math.ceil(arguments[0]);
  1680. arguments[1] = Math.floor(arguments[1]);
  1681. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  1682. }
  1683.  
  1684. function OpenMicrophone() {
  1685. MicrophoneElement.initMouseEvent("mousedown");
  1686. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  1687. }
  1688.  
  1689. function Cameras() {
  1690. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  1691. Len = Camera.length;
  1692. for (var user = 0; user < Len; user++) {
  1693. var isIgnored = User(Camera[user].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id"));
  1694. if (CheckUserIgnore(isIgnored) || CheckUserTempIgnore(isIgnored) && !Camera[user].shadowRoot.querySelector(".not-visible")) Camera[user].shadowRoot.querySelector("button[class=\"icon-visibility\"]").click();
  1695. Camera[user].shadowRoot.querySelector(".video").style.padding = (CTS.CameraBorderToggle) ? "5px" : "0";
  1696. if (!Camera[user].shadowRoot.querySelector(".video #fixed")) Camera[user].shadowRoot.querySelector(".video").insertAdjacentHTML("afterbegin", "<style id=\"fixed\">.video.large{position: absolute;left:20%;top: 0;z-index: 2;width: 60%;}.video>div>.overlay[data-mic-level=\"1\"] {-webkit-box-shadow: inset 0 0 2px 3px #53b6ef;box-shadow: inset 0 0 2px 3px #53b6ef;}.video>div>.overlay[data-mic-level=\"2\"] {-webkit-box-shadow: inset 0 0 4px 3px #53b6ef;box-shadow: inset 0 0 4px 3px #53b6ef;}.video>div>.overlay[data-mic-level=\"3\"],.video>div>.overlay[data-mic-level=\"4\"], .video>div>.overlay[data-mic-level=\"5\"], .video>div>.overlay[data-mic-level=\"6\"], .video>div>.overlay[data-mic-level=\"7\"], .video>div>.overlay[data-mic-level=\"8\"], .video>div>.overlay[data-mic-level=\"9\"], .video>div>.overlay[data-mic-level=\"10\"] {-webkit-box-shadow: inset 0 0 6px 3px #53b6ef;box-shadow: inset 0 0 6px 3px #53b6ef;}.video:after{content:unset;}</style>");
  1697. }
  1698. Resize();
  1699. }
  1700.  
  1701. function FeaturedCameras() {
  1702. if (arguments[0] === true) {
  1703. if (VideoListElement.querySelector("#SmallFTYT")) {
  1704. Remove(VideoListElement, "#SmallFTYT");
  1705. }
  1706. } else {
  1707. var node = document.createElement("style");
  1708. node.appendChild(document.createTextNode(FeaturedCSS));
  1709. node.setAttribute("id", "SmallFTYT");
  1710. VideoListElement.appendChild(node);
  1711. }
  1712. }
  1713.  
  1714. function Resize() {
  1715. window.dispatchEvent(new Event("resize"));
  1716. }
  1717.  
  1718. function PerformanceModeInit() {
  1719. var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
  1720. ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
  1721. ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
  1722. ChatLogElement.querySelector("#chat-wrapper").style.width = value;
  1723. TitleElement.querySelector("#room-header").style.minWidth = value;
  1724. TitleElement.querySelector("#room-header").style.maxWidth = value;
  1725. TitleElement.querySelector("#room-header").style.width = value;
  1726. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  1727. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  1728. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
  1729. VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1730. VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1731. VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1732. SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
  1733. SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
  1734. SideMenuElement.querySelector("#sidemenu").style.width = value;
  1735. document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
  1736. VideoListElement.querySelector("#videos").style.display = ((!arguments[0]) ? "block!important" : "none!important");
  1737. UpdateScroll(1, true);
  1738. UpdateScroll(2, true);
  1739. Resize();
  1740. }
  1741.  
  1742. function OwnerCommand() {
  1743. //MESSAGE FROM OWNER
  1744. if (isCommand(arguments[1])) {
  1745. if (CTS.UserList[arguments[0]].owner) {
  1746. if (!CTS.Me.owner) {
  1747. //PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
  1748. if (arguments[1].match(/^!raid\s/i)) {
  1749. var raid = arguments[1].match(/^(?:\!raid\s)(https?:\/\/tinychat.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?(?:[a-z0-9_]){1,32})/i);
  1750. if (raid !== undefined) window.location.replace(raid[1]);
  1751. }
  1752. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + Ver(), CTS.UserList[arguments[0]].handle);
  1753. } else {
  1754. if (arguments[1].match(/^!closeall$/i)) {
  1755. for (var a = 0; a < CTS.Camera.List.length; a++) {
  1756. if (CTS.Me.handle !== CTS.Camera.List[a]) {
  1757. Send("stream_moder_close", CTS.Camera.List[a]);
  1758. }
  1759. }
  1760. }
  1761. if (arguments[1].match(/^!kickall$/i)) {
  1762. for (var b = 0; b < CTS.UserList.length; b++) {
  1763. if (CTS.Me.handle !== CTS.UserList[b].handle) {
  1764. Send("kick", CTS.UserList[b].handle);
  1765. }
  1766. }
  1767. }
  1768. }
  1769. }
  1770. }
  1771. }
  1772.  
  1773. function Command() {
  1774. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?:\s?)(.*)/i);
  1775. if (UserCommand) {
  1776. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  1777. debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
  1778. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  1779. }
  1780. }
  1781. }
  1782. //ALERT FUNCTIONS
  1783. function Settings() {
  1784. Alert(GetActiveChat(), ((arguments[0] !== undefined) ? arguments[0] : "") + "<center>CTS BOT CONFIGURATION:\nBot Mode: " + ((CTS.Bot) ? "ON" : "OFF") + "\nOperator Mode: " + ((CTS.UserYT) ? "ON" : "OFF") + "\nPublic Command Mode: " + ((CTS.PublicCommandToggle) ? "ON" : "OFF") + "\nGreen Room Mode:\n" + ((CTS.GreenRoomToggle) ? "AUTO ALLOW" : "MANUAL") + "\nReminder Mode: " + ((CTS.Reminder) ? "ON" : "OFF") + "\nGame View: " + ((CTS.CanSeeGames) ? "ON" : "OFF") + "\nGame Host: " + ((CTS.CanHostGames) ? "ON" : "OFF") + "\n\nAvatar Display: " + ((CTS.Avatar) ? "SHOW" : "HIDE") + "\nNotification Display: " + ((CTS.NotificationToggle != 2) ? "SHOW("+CTS.NotificationToggle+")" : "HIDE") + "\nPopup Display: " + ((CTS.Popups) ? "SHOW" : "HIDE") + "\nFont Size: " + CTS.FontSize + "PX\n\nFOR LIST OF COMMANDS:\n!CTS</center>");
  1785. }
  1786.  
  1787. function Alert() {
  1788. CTS.Message[arguments[0]].push({
  1789. "time": Time(),
  1790. "namecolor": (arguments[2] !== undefined) ? "#000000" : "#3f69c0",
  1791. "avatar": (arguments[2] !== undefined) ? ("") : ("https://i.imgur.com/S09irS7.png"),
  1792. "username": "",
  1793. "nick": (arguments[2] !== undefined) ? (arguments[2]) : ("CTS Version: " + Ver()),
  1794. "msg": ((arguments[2] !== undefined) ? ("<div id=\"system_user\">" + arguments[1] + "</div>") : arguments[1]),
  1795. "mention": ((arguments[2] !== undefined) ? false : true)
  1796. });
  1797. var len = CTS.Message[arguments[0]].length - 1;
  1798. arguments[1] = CTS.Message[arguments[0]][len];
  1799. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[1].mention, arguments[0]);
  1800. }
  1801.  
  1802. function Ver() {
  1803. return window.CTSVersion.Major + "." + window.CTSVersion.Minor + "." + window.CTSVersion.Patch;
  1804. }
  1805.  
  1806. function AddUserNotification() {
  1807. if (CTS.FullLoad && CTS.ShowedSettings) {
  1808. var chat = ChatLogElement.querySelector("#notification-content"),
  1809. Notification;
  1810. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  1811. if (arguments[0] == 1) {
  1812. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  1813. } else if (arguments[0] == 2) {
  1814. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left");
  1815. } else if (arguments[0] == 3) {
  1816. Notification = arguments[2] + "has mentioned you!";
  1817. if (CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span style=\"background:" + arguments[1] + "\" class=\"nickname\">" + arguments[2] + "</span><span class=\"time\"> " + Time() + " </span><br/> has mentioned you.</div></div>");
  1818. UpdateScroll(2, true);
  1819. } else if (arguments[0] == 4) {
  1820. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  1821. }
  1822. if (arguments[0] != 3 && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span class=\"nickname\" style=\"background:" + arguments[1] + ";\">" + arguments[2] + "</span><span class=\"time\"> " + Time() + " </span><br/>" + Notification + "</div></div>");
  1823. if (CTS.NotificationToggle == 1) Alert(0, Notification, arguments[2]);
  1824. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(arguments[2].toUpperCase()) || CTS.TTSList.includes(arguments[3]) || CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[2] + ((arguments[0] == 4) ? " " : "as ") + Notification);
  1825. UpdateScroll(2, false);
  1826. var Notifications = ChatLogElement.querySelectorAll(".notification");
  1827. if (Notifications.length > CTS.NotificationLimit + 10) {
  1828. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  1829. }
  1830. }
  1831. }
  1832.  
  1833. function AddSystemNotification() {
  1834. if (CTS.FullLoad && CTS.ShowedSettings) {
  1835. if (CTS.NotificationToggle == 0) {
  1836. ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><span class=\"nickname\"style=\"background:#F00\">SYSTEM</span><span class=\"time\"> " + Time() + " </span><br/>" + arguments[0] + "</div>");
  1837. } else {
  1838. if (CTS.NotificationToggle == 1) {
  1839. Alert(0, arguments[0], "SYSTEM");
  1840. }
  1841. }
  1842. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  1843. UpdateScroll(2, false);
  1844. }
  1845. }
  1846. //USER FUNCTION
  1847. function AddUser() {
  1848. CTS.UserList.push({
  1849. "handle": arguments[0],
  1850. "username": arguments[5],
  1851. "nick": arguments[4],
  1852. "owner": arguments[7],
  1853. "mod": arguments[1],
  1854. "namecolor": arguments[2],
  1855. "avatar": arguments[3],
  1856. "canGame": arguments[6],
  1857. "broadcasting": false,
  1858. "vote": 0
  1859. });
  1860. if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  1861. }
  1862.  
  1863. function User() {
  1864. for (var user = 0; user < CTS.UserList.length; user++) {
  1865. if (CTS.UserList[user].handle == arguments[0]) return user;
  1866. }
  1867. return -1;
  1868. }
  1869.  
  1870. function UsernameToHandle() {
  1871. for (var user = 0; user < CTS.UserList.length; user++) {
  1872. if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  1873. }
  1874. return -1;
  1875. }
  1876.  
  1877. function UsernameToUser() {
  1878. for (var user = 0; user < CTS.UserList.length; user++) {
  1879. if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  1880. }
  1881. return -1;
  1882. }
  1883.  
  1884. function CheckUserListSafe() {
  1885. var len = CTS.UserList.length;
  1886. var temp = [];
  1887. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1888. for (var user = 0; user < len; user++) {
  1889. if (!CTS.UserList[user].mod && !isSafeListed(CTS.UserList[user].username)) {
  1890. CTS.KBQueue.push(CTS.UserList[user].handle);
  1891. }
  1892. }
  1893. len = CTS.KBQueue.length;
  1894. for (var kb = 0; kb < len; kb++) {
  1895. Send(arguments[0], CTS.KBQueue[kb]);
  1896. }
  1897. CTS.KBQueue = [];
  1898. }
  1899.  
  1900. function isSafeListed(username) {
  1901. var temp = [];
  1902. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1903. return (CTS.SafeList.includes(username) || temp.includes(username));
  1904. }
  1905.  
  1906. function CheckUserTempIgnore() {
  1907. if (CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1908. return false;
  1909. }
  1910.  
  1911. function CheckUserIgnore() {
  1912. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.IgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1913. return false;
  1914. }
  1915.  
  1916. function CheckUserAbuse() {
  1917. var action = false;
  1918. if (CTS.Me.mod) {
  1919. if ((CTS.KickList.includes(arguments[1]) || CTS.KickList.includes(arguments[2]))) {
  1920. CTS.NoGreet = true;
  1921. Send("kick", arguments[0]);
  1922. action = true;
  1923. }
  1924. if (!action) {
  1925. if ((CTS.BanList.includes(arguments[1]) || CTS.BanList.includes(arguments[2]))) {
  1926. CTS.NoGreet = true;
  1927. Send("ban", arguments[0]);
  1928. }
  1929. }
  1930. }
  1931. }
  1932.  
  1933. function CheckUserWordAbuse() {
  1934. if (CTS.UserList[arguments[0]].handle != CTS.Me.handle && !CTS.UserList[arguments[0]].mod) {
  1935. var action = false; //LETS NOT REPEAT/KICK
  1936. var len = CTS.KickKeywordList.length;
  1937. for (var i = 0; i < len; i++) {
  1938. if (arguments[1].includes(CTS.KickKeywordList[i])) {
  1939. Send("kick", CTS.UserList[arguments[0]].handle);
  1940. action = true;
  1941. break;
  1942. }
  1943. }
  1944.  
  1945. if (!action) {
  1946. len = CTS.BanKeywordList.length;
  1947. for (i = 0; i < len; i++) {
  1948. if (arguments[1].includes(CTS.BanKeywordList[i])) {
  1949. Send("ban", CTS.UserList[arguments[0]].handle);
  1950. break;
  1951. }
  1952. }
  1953. }
  1954. }
  1955. }
  1956.  
  1957. function RemoveUserCamera() {
  1958. var len = CTS.Camera.List.length;
  1959. if (len > 0) {
  1960. for (var i = 0; i < len; i++) {
  1961. if (CTS.Camera.List[i] === arguments[0]) {
  1962. CTS.Camera.List.splice(i, 1);
  1963. clearTimeout(CTS.Camera.clearRandom);
  1964. break;
  1965. }
  1966. }
  1967. }
  1968. }
  1969.  
  1970. function CheckUserStream() {
  1971. if (CTS.Me.mod) {
  1972. var user = User(arguments[0]);
  1973. if (user != -1) {
  1974. if (arguments[1]) {
  1975. CTS.Camera.List.push(CTS.UserList[user].handle);
  1976. CTS.UserList[user].broadcasting = true;
  1977. var len = CTS.Camera.List.length;
  1978. //CLEAR TIMERS
  1979. clearTimeout(CTS.Camera.clearRandom);
  1980. //CAMERA SWEEP FUNCTION
  1981. if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
  1982. CTS.Camera.clearRandom = setTimeout(function() {
  1983. var rand = Rand(0, len - 1);
  1984. if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
  1985. var target = User(CTS.Camera.List[rand]);
  1986. if (CTS.Me.owner || !CTS.UserList[target].mod) {
  1987. Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
  1988. Send("stream_moder_close", CTS.Camera.List[rand]);
  1989. CTS.Camera.List.splice(rand, 1);
  1990. }
  1991. }
  1992. }, CTS.Camera.SweepTimer * 60000);
  1993. }
  1994. } else {
  1995. clearTimeout(CTS.Camera.clearRandom);
  1996. RemoveUserCamera(CTS.UserList[user].handle);
  1997. CTS.UserList[user].broadcasting = false;
  1998. }
  1999. CTS.UserList[user].broadcasting = arguments[1];
  2000. if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  2001. }
  2002. }
  2003. }
  2004.  
  2005. function CheckUserName() {
  2006. return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
  2007. }
  2008.  
  2009. function CheckUserNameStrict() {
  2010. return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
  2011. }
  2012.  
  2013. function MSR() {
  2014. if (arguments[0]) {
  2015. arguments[1].videolist.RemoveVideoRemote(arguments[1].handle);
  2016. } else {
  2017. arguments[1].mediaStream.stop();
  2018. arguments[1].mediaStream = null;
  2019. }
  2020. }
  2021.  
  2022. function MS() {
  2023. if (arguments[0].mediaStream !== null) {
  2024. if (arguments[0].mediaStream.active && arguments[1].signalingState !== "closed" && typeof arguments[1].removeStream === "function" && arguments[1].removeStream(arguments[0].mediaStream)) MSR(false, arguments[0]);
  2025. } else {
  2026. MSR(true, arguments[0]);
  2027. }
  2028. if (arguments[1].signalingState !== "closed" && arguments[1].close());
  2029. }
  2030. //LOAD/SAVE FUNCTION
  2031. function Load() {
  2032. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  2033. if (null === val && "undefined" != typeof arguments[1]) {
  2034. Save(arguments[0], arguments[1]);
  2035. return arguments[1];
  2036. }
  2037. return val;
  2038. }
  2039.  
  2040. function Save() {
  2041. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  2042. }
  2043. //SOCKET FUNCTION
  2044. function CTSWebSocket() {
  2045. if (window.Proxy === undefined) return;
  2046. var handler = {
  2047. set: function(Target, prop, value) {
  2048. if (prop == "onmessage") {
  2049. var oldMessage = value;
  2050. value = function(event) {
  2051. var parse = JSON.parse(event.data);
  2052. ServerMsg(parse, Target);
  2053. oldMessage(event);
  2054. };
  2055. }
  2056. return (Target[prop] = value);
  2057. },
  2058. get: function(Target, prop) {
  2059. var value = Target[prop];
  2060. if (prop == "send") {
  2061. value = function(event) {
  2062. var parse = JSON.parse(event);
  2063. ClientMsg(parse, Target);
  2064. Target.send(event);
  2065. };
  2066. }
  2067. return value;
  2068. }
  2069. };
  2070. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  2071. construct: function(Target, args) {
  2072. CTS.SocketTarget = new Target(args[0]);
  2073. debug("SOCKET::CONNECTING", args[0]);
  2074. return new window.Proxy(CTS.SocketTarget, handler);
  2075. }
  2076. });
  2077. window.WebSocket = WebSocketProxy;
  2078. }
  2079.  
  2080. function ModCommand() {
  2081. var name = arguments[1].match(/\!(?:kick|ban|close)\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
  2082. if (name !== null) {
  2083. var target = UsernameToUser(name[1].toUpperCase());
  2084. if (target != -1) { // USER ONLINE
  2085. if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
  2086. //IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
  2087. if (arguments[0] === "stream_moder_close") {
  2088. if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
  2089. } else {
  2090. Send(arguments[0], CTS.UserList[target].handle);
  2091. }
  2092. } else {
  2093. Send("msg", "This users authorization is similar or above yours!");
  2094. }
  2095. }
  2096. }
  2097. }
  2098.  
  2099. function BotCommand() {
  2100. var len = CTS.YouTube.MessageQueueList.length;
  2101. if (len <= 0) {
  2102. // Moderator Control
  2103. if (CTS.UserList[arguments[1]].mod) {
  2104. if (arguments[0] == 2) {
  2105. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2106. CTS.YouTube.Clear = true;
  2107. YouTubePlayList();
  2108. }
  2109. }
  2110. if (arguments[0] == 5) SetBot(true);
  2111. }
  2112. // User and Moderator Control
  2113. if ((CTS.UserYT && (CTS.BotOPList.includes(CTS.UserList[arguments[1]].username) || CTS.BotOPList.includes("-ALL"))) || CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
  2114. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  2115. if (arguments[0] == 4) YouTubePlayList(true);
  2116. if (arguments[0] == 6) {
  2117. if (CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
  2118. 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);
  2119. if (videoid !== null) {
  2120. CTS.SocketTarget.send(JSON.stringify({
  2121. "tc": "yut_play",
  2122. "item": {
  2123. "id": videoid[1],
  2124. "duration": 7200,
  2125. "offset": 0,
  2126. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  2127. }
  2128. }));
  2129. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  2130. }
  2131. } else {
  2132. Send("msg", "Ask a moderator to play your request.");
  2133. }
  2134. }
  2135. if (arguments[0] == 3) {
  2136. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2137. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  2138. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  2139. }
  2140. }
  2141. }
  2142. } else {
  2143. if (CTS.YouTube.ListBuilt === false) {
  2144. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  2145. } else {
  2146. Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  2147. }
  2148. }
  2149. }
  2150.  
  2151. function ServerMsg() {
  2152. if (typeof ServerInList[arguments[0].tc] == "function") {
  2153. debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2154. ServerInList[arguments[0].tc](arguments[0]);
  2155. }
  2156. }
  2157.  
  2158. function ClientMsg() {
  2159. if (typeof ServerOutList[arguments[0].tc] == "function") {
  2160. debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2161. ServerOutList[arguments[0].tc](arguments[0]);
  2162. }
  2163. }
  2164.  
  2165. function Send() {
  2166. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  2167. if (arguments[1] === undefined) arguments[1] = "Open Request";
  2168. debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  2169. }
  2170. //GAME FUNCTION
  2171. //FISHING BOAT
  2172. function FishUpgradeStatus(playerExist, type) {
  2173. var msg = "[FISHING BOAT]\n";
  2174. if (type != 7) msg += playerExist.Nickname + ":\n";
  2175. if (type == 0 || type == 1) msg += "[NET]Lv. " + playerExist.Upgrades.Net + "\n" + ((playerExist.Upgrades.Net >= 10) ? "[MAXED]" : "[COSTS $" + Fish.pricelist(playerExist, 0) + " to UPGRADE]\n\n");
  2176. if (type == 0 || type == 2) msg += "[RADAR]Lv. " + playerExist.Upgrades.Radar + "\n" + ((playerExist.Upgrades.Radar >= 20) ? "[MAXED]" : "[COSTS $" + Fish.pricelist(playerExist, 1) + " to UPGRADE]") + "\n\n";
  2177. if (type == 0 || type == 3) msg += "[INSURANCE]\n" + ((playerExist.Upgrades.Insurance) ? "[OWNED]" : "[COSTS $" + Fish.pricelist(playerExist, 3) + " per ROUND]") + "\n\n";
  2178. if (type == 0 || type == 4) msg += "[SHOP]Lv. " + playerExist.Upgrades.Store + "\n" + ((playerExist.Upgrades.Store >= 6) ? "[MAXED]" : "[COSTS $" + Fish.pricelist(playerExist, 2) + " to UPGRADE]") + "\n\n";
  2179. if (type == 6) msg += "HELP:\n!fish\n!fishbank\n!fishsplit user|nick\n!fishgamble\n[COSTS $" + Fish.pricelist(playerExist, 6) + "]\n!fishrob user|nick\n[COSTS $" + Fish.pricelist(playerExist, 4) + "]\n!fishslap user|nick\n[COSTS $" + Fish.pricelist(playerExist, 5) + "]\n!fishupgrade\n!fishupgrade\n[Net|Radar|Insurance|Shop]\n\n";
  2180. Send("msg", msg);
  2181. }
  2182.  
  2183. function FishTimerCheck(playerExist) {
  2184. if (new Date() - playerExist.LastCheck >= 5000) {
  2185. playerExist.LastCheck = new Date();
  2186. return true;
  2187. }
  2188. return false;
  2189. }
  2190.  
  2191. function FishCommandCheck() {
  2192. var command,
  2193. playerExist = Fish.getPlayer(CTS.UserList[arguments[0]].handle, false, true),
  2194. FishCommand = arguments[1].match(/^\!(fish(?:rob|slap|split|help|upgrade)?)\s?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
  2195.  
  2196. if (FishCommand) {
  2197. if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
  2198. if (FishCommand[2] !== undefined) {
  2199. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  2200. }
  2201. } else {
  2202. command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
  2203. if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  2204. }
  2205. }
  2206. }
  2207.  
  2208. function FishTransfer(playerExist, target, cost, deduct, rob) {
  2209. if (target !== undefined && target !== -1) {
  2210. if (playerExist.Points > cost) {
  2211. if (rob) {
  2212. playerExist.Points -= cost;
  2213. if (target.Points <= deduct) {
  2214. deduct = target.Points;
  2215. target.Points -= deduct;
  2216. playerExist.Points += deduct;
  2217. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " destroyed " + target.Nickname + "\nMoney made $" + deduct + "!");
  2218. Fish.getPlayer(target.Handle, true);
  2219. } else {
  2220. target.Points -= deduct;
  2221. playerExist.Points += deduct;
  2222. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " robbed " + target.Nickname + " for $" + deduct + "!");
  2223. }
  2224. } else {
  2225. playerExist.Points = deduct;
  2226. target.Points += deduct;
  2227. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " split their money with " + target.Nickname + "!");
  2228. }
  2229. } else {
  2230. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " are you kidding me?\nTalk to me when you have money!");
  2231. }
  2232. }
  2233. }
  2234.  
  2235. function FishTransaction(playerExist, cost, status) {
  2236. if (playerExist.Points > cost) {
  2237. playerExist.Points -= cost;
  2238. return true;
  2239. } else {
  2240. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + ", are you kidding me?\nTalk to me when you have money!");
  2241. return false;
  2242. }
  2243. }
  2244. //SERVER/CLIENT LIST FUNCTION
  2245. var UnicodeConversionList = {
  2246. convert: function() {
  2247. return this.numerical(arguments[0]).replace(/[A-Za-z]/g, this.alphabet);
  2248. },
  2249. alphabet: function() {
  2250. return String.fromCodePoint(arguments[0].codePointAt(0) + ((/[A-Z]/.test(arguments[0])) ? "𝗔".codePointAt(0) - "A".codePointAt(0) : "𝗮".codePointAt(0) - "a".codePointAt(0)));
  2251. },
  2252. numerical: function() {
  2253. return arguments[0].replace(/\d/g, function(c) {
  2254. return String.fromCodePoint(0x1D79E + c.charCodeAt(0));
  2255. });
  2256. }
  2257. };
  2258. var CommandList = {
  2259. cts: function() {
  2260. Alert(GetActiveChat(), "<b style=\"color:#ee3636;\">Owner Commands:</b>\n!raid <b style=\"color:#ffff00;\">tc link</b>\n!closeall\n!kickall\n!version\n\n<b style=\"color:#ee3636;\">Moderator Commands:</b>\n!whoisbot\n!bot\n!bottoggle\n!greenroomtoggle\n!publiccommandtoggle\n!camsweep\n!votetoggle\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 | phrase</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 | phrase</b>\n!kickkeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!oplist\n!oplistclear\n!opadd <b style=\"color:#ffff00;\">user | -all</b>\n!opremove <b style=\"color:#ffff00;\">#</b>\n!optoggle\n\n<b style=\"color:#ee3636;\">Jr. Moderator Commands:</b>\n!ban <b style=\"color:#ffff00;\">user | nick</b>\n!kick <b style=\"color:#ffff00;\">user | nick</b>\n!close <b style=\"color:#ffff00;\">user | nick</b>\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!safeadd <b style=\"color:#ffff00;\">user</b>\n!saferemove <b style=\"color:#ffff00;\">#</b>\n\n!lists\n!listsclear\n\n!greetmode\n!imgurtoggle\n!avatartoggle\n!notificationtoggle\n!popuptoggle\n!timestamptoggle\n\n!coin\n!advice\n!8ball <b style=\"color:#ffff00;\">question</b>\n!roll <b style=\"color:#ffff00;\">#</b>\n!chuck\n!dad\n\n!vote <b style=\"color:#ffff00;\">user | nick</b>\n\n!clr\n!settings\n!share\n\n<b style=\"color:#ee3636;\">Game Commands:</b>\n!gamehost\n!gameview\n!fish");
  2261. },
  2262. help: function() {
  2263. this.cts();
  2264. },
  2265. mentionadd: function() {
  2266. if (arguments[0] === "") {
  2267. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2268. } else {
  2269. if (CheckUserNameStrict(arguments[0])) {
  2270. CTS.MentionList.push(arguments[0].toUpperCase());
  2271. Save("MentionList", JSON.stringify(CTS.MentionList));
  2272. Alert(GetActiveChat(), "🗹Command Accepted!");
  2273. } else {
  2274. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2275. }
  2276. }
  2277. },
  2278. mentionremove: function() {
  2279. if (arguments[0] === "" || isNaN(arguments[0])) {
  2280. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2281. } else {
  2282. if (CTS.MentionList[arguments[0]] !== undefined) {
  2283. CTS.MentionList.splice(arguments[0], 1);
  2284. Save("MentionList", JSON.stringify(CTS.MentionList));
  2285. Alert(GetActiveChat(), "🗹Command Accepted!");
  2286. } else {
  2287. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2288. }
  2289. }
  2290. },
  2291. mentionlistclear: function() {
  2292. CTS.MentionList = [];
  2293. Save("MentionList", JSON.stringify(CTS.MentionList));
  2294. Alert(GetActiveChat(), "🗹Command Accepted!");
  2295. },
  2296. mentionlist: function() {
  2297. Alert(GetActiveChat(), SettingsList.MentionList());
  2298. },
  2299. ignoreadd: function() {
  2300. if (arguments[0] === "") {
  2301. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2302. } else {
  2303. if (CheckUserNameStrict(arguments[0])) {
  2304. CTS.IgnoreList.push(arguments[0].toUpperCase());
  2305. Cameras();
  2306. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2307. Alert(GetActiveChat(), "🗹Command Accepted!");
  2308. } else {
  2309. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2310. }
  2311. }
  2312. },
  2313. ignoreremove: function() {
  2314. if (arguments[0] === "" || isNaN(arguments[0])) {
  2315. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2316. } else {
  2317. if (CTS.IgnoreList[arguments[0]] !== undefined) {
  2318. CTS.IgnoreList.splice(arguments[0], 1);
  2319. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2320. Alert(GetActiveChat(), "🗹Command Accepted!");
  2321. } else {
  2322. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2323. }
  2324. }
  2325. },
  2326. ignorelistclear: function() {
  2327. CTS.IgnoreList = [];
  2328. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2329. Alert(GetActiveChat(), "🗹Command Accepted!");
  2330. },
  2331. ignorelist: function() {
  2332. Alert(GetActiveChat(), SettingsList.IgnoreList());
  2333. },
  2334. banadd: function() {
  2335. if (arguments[0] === "") {
  2336. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2337. } else {
  2338. if (CheckUserNameStrict(arguments[0])) {
  2339. CTS.BanList.push(arguments[0].toUpperCase());
  2340. Save("BanList", JSON.stringify(CTS.BanList));
  2341. Alert(GetActiveChat(), "🗹Command Accepted!");
  2342. var check = UsernameToHandle(arguments[0].toUpperCase());
  2343. if (check != -1 && CTS.Me.mod) Send("ban", check);
  2344. } else {
  2345. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2346. }
  2347. }
  2348. },
  2349. banremove: function() {
  2350. if (arguments[0] === "" || isNaN(arguments[0])) {
  2351. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2352. } else {
  2353. if (CTS.BanList[arguments[0]] !== undefined) {
  2354. CTS.BanList.splice(arguments[0], 1);
  2355. Save("BanList", JSON.stringify(CTS.BanList));
  2356. Alert(GetActiveChat(), "🗹Command Accepted!");
  2357. } else {
  2358. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2359. }
  2360. }
  2361. },
  2362. banlistclear: function() {
  2363. CTS.BanList = [];
  2364. Save("BanList", JSON.stringify(CTS.BanList));
  2365. Alert(GetActiveChat(), "🗹Command Accepted!");
  2366. },
  2367. banlist: function() {
  2368. Alert(GetActiveChat(), SettingsList.BanList());
  2369. },
  2370. kickadd: function() {
  2371. if (arguments[0] === "") {
  2372. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2373. } else {
  2374. if (CheckUserNameStrict(arguments[0])) {
  2375. CTS.KickList.push(arguments[0].toUpperCase());
  2376. Save("KickList", JSON.stringify(CTS.KickList));
  2377. Alert(GetActiveChat(), "🗹Command Accepted!");
  2378. var check = UsernameToHandle(arguments[0].toUpperCase());
  2379. if (check != -1 && CTS.Me.mod) Send("kick", check);
  2380. } else {
  2381. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2382. }
  2383. }
  2384. },
  2385. kickremove: function() {
  2386. if (arguments[0] === "" || isNaN(arguments[0])) {
  2387. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2388. } else {
  2389. if (CTS.KickList[arguments[0]] !== undefined) {
  2390. CTS.KickList.splice(arguments[0], 1);
  2391. Save("KickList", JSON.stringify(CTS.KickList));
  2392. Alert(GetActiveChat(), "🗹Command Accepted!");
  2393. } else {
  2394. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2395. }
  2396. }
  2397. },
  2398. kicklistclear: function() {
  2399. CTS.KickList = [];
  2400. Save("KickList", JSON.stringify(CTS.KickList));
  2401. Alert(GetActiveChat(), "🗹Command Accepted!");
  2402. },
  2403. kicklist: function() {
  2404. Alert(GetActiveChat(), SettingsList.KickList());
  2405. },
  2406. bankeywordadd: function() {
  2407. if (arguments[0] === "") {
  2408. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2409. } else {
  2410. CTS.BanKeywordList.push(arguments[0]);
  2411. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2412. Alert(GetActiveChat(), "🗹Command Accepted!");
  2413. }
  2414. },
  2415. bankeywordremove: function() {
  2416. if (arguments[0] === "" || isNaN(arguments[0])) {
  2417. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2418. } else {
  2419. if (CTS.BanKeywordList[arguments[0]] !== undefined) {
  2420. CTS.BanKeywordList.splice(arguments[0], 1);
  2421. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2422. Alert(GetActiveChat(), "🗹Command Accepted!");
  2423. } else {
  2424. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2425. }
  2426. }
  2427. },
  2428. bankeywordlistclear: function() {
  2429. CTS.BanKeywordList = [];
  2430. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2431. Alert(GetActiveChat(), "🗹Command Accepted!");
  2432. },
  2433. bankeywordlist: function() {
  2434. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  2435. },
  2436. kickkeywordadd: function() {
  2437. if (arguments[0] === "") {
  2438. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2439. } else {
  2440. CTS.KickKeywordList.push(arguments[0]);
  2441. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2442. Alert(GetActiveChat(), "🗹Command Accepted!");
  2443. }
  2444. },
  2445. kickkeywordremove: function() {
  2446. if (arguments[0] === "" || isNaN(arguments[0])) {
  2447. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2448. } else {
  2449. if (CTS.KickKeywordList[arguments[0]] !== undefined) {
  2450. CTS.KickKeywordList.splice(arguments[0], 1);
  2451. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2452. Alert(GetActiveChat(), "🗹Command Accepted!");
  2453. } else {
  2454. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2455. }
  2456. }
  2457. },
  2458. kickkeywordlistclear: function() {
  2459. CTS.KickKeywordList = [];
  2460. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2461. Alert(GetActiveChat(), "🗹Command Accepted!");
  2462. },
  2463. kickkeywordlist: function() {
  2464. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  2465. },
  2466. greetadd: function() {
  2467. if (arguments[0] === "") {
  2468. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2469. } else {
  2470. if (CheckUserName(arguments[0])) {
  2471. CTS.GreetList.push(arguments[0].toUpperCase());
  2472. Save("GreetList", JSON.stringify(CTS.GreetList));
  2473. Alert(GetActiveChat(), "🗹Command Accepted!");
  2474. } else {
  2475. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2476. }
  2477. }
  2478. },
  2479. greetremove: function() {
  2480. if (arguments[0] === "" || isNaN(arguments[0])) {
  2481. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2482. } else {
  2483. if (CTS.GreetList[arguments[0]] !== undefined) {
  2484. CTS.GreetList.splice(arguments[0], 1);
  2485. Save("GreetList", JSON.stringify(CTS.GreetList));
  2486. Alert(GetActiveChat(), "🗹Command Accepted!");
  2487. } else {
  2488. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2489. }
  2490. }
  2491. },
  2492. greetlistclear: function() {
  2493. CTS.GreetList = [];
  2494. Save("GreetList", JSON.stringify(CTS.GreetList));
  2495. Alert(GetActiveChat(), "🗹Command Accepted!");
  2496. },
  2497. greetlist: function() {
  2498. Alert(GetActiveChat(), SettingsList.GreetList());
  2499. },
  2500. highlightadd: function() {
  2501. if (arguments[0] === "") {
  2502. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2503. } else {
  2504. if (CheckUserNameStrict(arguments[0])) {
  2505. CTS.HighlightList.push(arguments[0].toUpperCase());
  2506. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2507. Alert(GetActiveChat(), "🗹Command Accepted!");
  2508. } else {
  2509. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2510. }
  2511. }
  2512. },
  2513. highlightremove: function() {
  2514. if (arguments[0] === "" || isNaN(arguments[0])) {
  2515. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2516. } else {
  2517. if (CTS.HighlightList[arguments[0]] !== undefined) {
  2518. CTS.HighlightList.splice(arguments[0], 1);
  2519. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2520. Alert(GetActiveChat(), "🗹Command Accepted!");
  2521. } else {
  2522. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2523. }
  2524. }
  2525. },
  2526. highlightlistclear: function() {
  2527. CTS.HighlightList = [];
  2528. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2529. Alert(GetActiveChat(), "🗹Command Accepted!");
  2530. },
  2531. highlightlist: function() {
  2532. Alert(GetActiveChat(), SettingsList.HighlightList());
  2533. },
  2534. opadd: function() {
  2535. if (arguments[0] === "") {
  2536. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2537. } else {
  2538. if (CheckUserName(arguments[0])) {
  2539. CTS.BotOPList.push(arguments[0].toUpperCase());
  2540. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2541. Alert(GetActiveChat(), "🗹Command Accepted!");
  2542. } else {
  2543. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2544. }
  2545. }
  2546. },
  2547. opremove: function() {
  2548. if (arguments[0] === "" || isNaN(arguments[0])) {
  2549. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2550. } else {
  2551. if (CTS.BotOPList[arguments[0]] !== undefined) {
  2552. CTS.BotOPList.splice(arguments[0], 1);
  2553. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2554. Alert(GetActiveChat(), "🗹Command Accepted!");
  2555. } else {
  2556. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2557. }
  2558. }
  2559. },
  2560. oplistclear: function() {
  2561. CTS.BotOPList = [];
  2562. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2563. Alert(GetActiveChat(), "🗹Command Accepted!");
  2564. },
  2565. oplist: function() {
  2566. Alert(GetActiveChat(), SettingsList.BotOPList());
  2567. },
  2568. modadd: function() {
  2569. if (arguments[0] === "") {
  2570. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2571. } else {
  2572. if (CheckUserNameStrict(arguments[0])) {
  2573. CTS.BotModList.push(arguments[0].toUpperCase());
  2574. Save("BotModList", JSON.stringify(CTS.BotModList));
  2575. Alert(GetActiveChat(), "🗹Command Accepted!");
  2576. } else {
  2577. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2578. }
  2579. }
  2580. },
  2581. modremove: function() {
  2582. if (arguments[0] === "" || isNaN(arguments[0])) {
  2583. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2584. } else {
  2585. if (CTS.BotModList[arguments[0]] !== undefined) {
  2586. CTS.BotModList.splice(arguments[0], 1);
  2587. Save("BotModList", JSON.stringify(CTS.BotModList));
  2588. Alert(GetActiveChat(), "🗹Command Accepted!");
  2589. } else {
  2590. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2591. }
  2592. }
  2593. },
  2594. modlistclear: function() {
  2595. CTS.BotModList = [];
  2596. Save("BotModList", JSON.stringify(CTS.BotModList));
  2597. Alert(GetActiveChat(), "🗹Command Accepted!");
  2598. },
  2599. modlist: function() {
  2600. Alert(GetActiveChat(), SettingsList.BotModList());
  2601. },
  2602. ttsadd: function() {
  2603. if (arguments[0] === "") {
  2604. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2605. } else {
  2606. if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  2607. CTS.TTSList.push(arguments[0].toUpperCase());
  2608. Save("TTSList", JSON.stringify(CTS.TTSList));
  2609. Alert(GetActiveChat(), "🗹Command Accepted!");
  2610. } else {
  2611. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2612. }
  2613. }
  2614. },
  2615. ttsremove: function() {
  2616. if (arguments[0] === "" || isNaN(arguments[0])) {
  2617. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2618. } else {
  2619. if (CTS.TTSList[arguments[0]] !== undefined) {
  2620. CTS.TTSList.splice(arguments[0], 1);
  2621. Save("TTSList", JSON.stringify(CTS.TTSList));
  2622. Alert(GetActiveChat(), "🗹Command Accepted!");
  2623. } else {
  2624. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2625. }
  2626. }
  2627. },
  2628. ttslistclear: function() {
  2629. CTS.TTSList = [];
  2630. Save("TTSList", JSON.stringify(CTS.TTSList));
  2631. Alert(GetActiveChat(), "🗹Command Accepted!");
  2632. },
  2633. ttslist: function() {
  2634. Alert(GetActiveChat(), SettingsList.TTSList());
  2635. },
  2636. reminderadd: function() {
  2637. if (arguments[0] === "") {
  2638. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2639. } else {
  2640. var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9])\s?(?:[AaPp][Mm]))\s(.*)/);
  2641. if (reminder === null) {
  2642. Alert(GetActiveChat(), "🗷Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  2643. } else {
  2644. CTS.ReminderList.push([reminder[1], reminder[2]]);
  2645. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2646. Alert(GetActiveChat(), "🗹Command Accepted!");
  2647. Reminder();
  2648. }
  2649. }
  2650. },
  2651. reminderremove: function() {
  2652. if (arguments[0] === "" || isNaN(arguments[0])) {
  2653. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2654. } else {
  2655. if (CTS.ReminderList[arguments[0]] !== undefined) {
  2656. CTS.ReminderList.splice(arguments[0], 1);
  2657. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2658. Reminder();
  2659. Alert(GetActiveChat(), "🗹Command Accepted!");
  2660. } else {
  2661. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2662. }
  2663. }
  2664. },
  2665. reminderlistclear: function() {
  2666. CTS.ReminderList = [];
  2667. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2668. Alert(GetActiveChat(), "🗹Command Accepted!");
  2669. },
  2670. reminderlist: function() {
  2671. Alert(GetActiveChat(), SettingsList.ReminderList());
  2672. },
  2673. remindertoggle: function() {
  2674. CTS.Reminder = !CTS.Reminder;
  2675. Save("Reminder", JSON.stringify(CTS.Reminder));
  2676. Reminder();
  2677. Settings();
  2678. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  2679. },
  2680. timestamptoggle: function() {
  2681. CTS.TimeStampToggle = !CTS.TimeStampToggle;
  2682. Save("TimeStampToggle", JSON.stringify(CTS.TimeStampToggle));
  2683. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.TimeStampToggle) ? "Timestamps are now on!\n" : "Timestamps are now off\n "));
  2684. },
  2685. safeadd: function() {
  2686. if (arguments[0] === "" || arguments[0].toUpperCase() === "guest") { // Can't protect guests;
  2687. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2688. } else {
  2689. if (CheckUserNameStrict(arguments[0])) {
  2690. if (!CTS.SafeList.includes(arguments[0].toUpperCase())) {
  2691. CTS.SafeList.push(arguments[0].toUpperCase());
  2692. Save("AKB", JSON.stringify(CTS.SafeList));
  2693. Alert(GetActiveChat(), "🗹Command Accepted!");
  2694. } else {
  2695. Alert(GetActiveChat(), "🗷Name already exists!");
  2696. }
  2697. } else {
  2698. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2699. }
  2700. }
  2701. },
  2702. saferemove: function() {
  2703. if (arguments[0] === "" || isNaN(arguments[0])) {
  2704. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2705. } else {
  2706. if (CTS.SafeList[arguments[0]] !== undefined) {
  2707. CTS.SafeList.splice(arguments[0], 1);
  2708. Save("AKB", JSON.stringify(CTS.SafeList));
  2709. Alert(GetActiveChat(), "🗹Command Accepted!");
  2710. } else {
  2711. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2712. }
  2713. }
  2714. },
  2715. safelistclear: function() {
  2716. CTS.SafeList = [];
  2717. Save("AKB", JSON.stringify(CTS.SafeList));
  2718. Alert(GetActiveChat(), "🗹Command Accepted!");
  2719. },
  2720. safelist: function() {
  2721. Alert(GetActiveChat(), SettingsList.SafeList());
  2722. },
  2723. optoggle: function() {
  2724. CTS.UserYT = !CTS.UserYT;
  2725. Save("UserYT", JSON.stringify(CTS.UserYT));
  2726. Settings();
  2727. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  2728. },
  2729. avatartoggle: function() {
  2730. CTS.Avatar = !CTS.Avatar;
  2731. Save("Avatar", JSON.stringify(CTS.Avatar));
  2732. Settings();
  2733. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  2734. },
  2735. popuptoggle: function() {
  2736. CTS.Popups = !CTS.Popups;
  2737. Save("Popups", JSON.stringify(CTS.Popups));
  2738. Settings();
  2739. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  2740. },
  2741. notificationtoggle: function() {
  2742. CTS.NotificationToggle++;
  2743. if (CTS.NotificationToggle >= 3) CTS.NotificationToggle = 0;
  2744. Save("NotificationToggle", JSON.stringify(CTS.NotificationToggle));
  2745. NotificationDisplay();
  2746. Settings();
  2747. Alert(GetActiveChat(), "🗹Command Accepted!");
  2748. },
  2749. greetmode: function() {
  2750. CTS.GreetMode = !CTS.GreetMode;
  2751. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  2752. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  2753. },
  2754. imgurtoggle: function() {
  2755. CTS.imgur = !CTS.imgur;
  2756. Save("imgur", JSON.stringify(CTS.imgur));
  2757. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  2758. },
  2759. publiccommandtoggle: function() {
  2760. CTS.PublicCommandToggle = !CTS.PublicCommandToggle;
  2761. Save("PublicCommandToggle", JSON.stringify(CTS.PublicCommandToggle));
  2762. Settings();
  2763. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.PublicCommandToggle) ? "Public commands (8Ball, Advice, Chuck, Coin, Dad, Urb) are enabled." : "Public commands (8Ball, Advice, Chuck, Coin, Dad, Urb) are disabled."));
  2764. },
  2765. greenroomtoggle: function() {
  2766. CTS.GreenRoomToggle = !CTS.GreenRoomToggle;
  2767. Save("GreenRoomToggle", JSON.stringify(CTS.GreenRoomToggle));
  2768. Settings();
  2769. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreenRoomToggle) ? "Green Room Auto Allow ON!" : "Green Room Auto Allow OFF!"));
  2770. },
  2771. clr: function() {
  2772. CTS.MessageCallback = [];
  2773. CTS.Message = [];
  2774. CTS.Message[0] = [];
  2775. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  2776. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  2777. },
  2778. autokick: function() {
  2779. if (arguments[1] === false && CTS.Me.mod) {
  2780. CTS.AutoKick = !CTS.AutoKick;
  2781. CTS.AutoBan = false;
  2782. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  2783. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  2784. }
  2785. },
  2786. autoban: function() {
  2787. if (arguments[1] === false && CTS.Me.mod) {
  2788. CTS.AutoBan = !CTS.AutoBan;
  2789. CTS.AutoKick = false;
  2790. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  2791. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  2792. }
  2793. },
  2794. camsweep: function() {
  2795. if (CTS.Me.mod && CTS.Host === CTS.Me.handle) {
  2796. CTS.Camera.SweepTimer = arguments[0] === "" || isNaN(arguments[0]) ? 5 : (arguments[0] > 30) ? 30 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  2797. CTS.Camera.Sweep = !CTS.Camera.Sweep;
  2798. clearTimeout(CTS.Camera.clearRandom);
  2799. Settings();
  2800. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Camera.Sweep) ? "Camera sweep is now on!\nTime set: " + CTS.Camera.SweepTimer + "min(s)" : "Camera sweep is now off!"));
  2801. }
  2802. },
  2803. bottoggle: function() {
  2804. CTS.Bot = !CTS.Bot;
  2805. Save("Bot", JSON.stringify(CTS.Bot));
  2806. Settings();
  2807. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  2808. },
  2809. votetoggle: function() {
  2810. if (CTS.Me.mod) {
  2811. CTS.VoteSystem = !CTS.VoteSystem;
  2812. CTS.WaitToVoteList = [];
  2813. var len = CTS.UserList.length;
  2814. if (len > 0) {
  2815. for (var i = 0; i < len; i++) CTS.UserList[i].vote = 0;
  2816. }
  2817. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.VoteSystem) ? "VOTING IS NOW ON!" : "VOTING IS NOW OFF!"));
  2818. }
  2819. },
  2820. bot: function() {
  2821. if (arguments[1] === false && CTS.Me.mod) Alert(0, "🗹Command Accepted!\nBot bypass was called!");
  2822. },
  2823. share: function() {
  2824. var msg = "CosmosisT's TinyChat Script:\nInstall...\n1. (Tamper Monkey Link)\nhttps://www.tampermonkey.net/\n2. (CTS Link)\nhttps://greasyfork.org/en/scripts/392086\nCTS Discord:\nhttps://discord.gg/cHEf8z7";
  2825. if (GetActiveChat() !== 0) {
  2826. Send("pvtmsg", msg, GetActiveChat());
  2827. PushPM(GetActiveChat(), msg);
  2828. } else {
  2829. Send("msg", msg);
  2830. }
  2831. },
  2832. gameview: function() {
  2833. CTS.CanSeeGames = !CTS.CanSeeGames;
  2834. Save("CanSeeGames", JSON.stringify(CTS.CanSeeGames));
  2835. Settings();
  2836. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
  2837. },
  2838. gamehost: function() {
  2839. CTS.CanHostGames = !CTS.CanHostGames;
  2840. Save("CanHostGames", JSON.stringify(CTS.CanHostGames));
  2841. Fish.reset(true, true);
  2842. Settings();
  2843. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanHostGames) ? "GAME HOSTING IS NOW ON!" : "GAME HOSTING IS NOW OFF!"));
  2844. },
  2845. version: function() {
  2846. if (!CTS.Me.owner) {
  2847. var msg = "I am using " + CTS.Project.Name + "v" + Ver();
  2848. if (GetActiveChat() !== 0) {
  2849. Send("pvtmsg", msg, GetActiveChat());
  2850. PushPM(GetActiveChat(), msg);
  2851. } else {
  2852. Send("msg", msg);
  2853. }
  2854. }
  2855. },
  2856. roll: function() {
  2857. var dice,
  2858. msg = "";
  2859. dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
  2860. for (var i = 0; i < dice; i++) msg += Dice();
  2861. if (GetActiveChat() !== 0) {
  2862. Send("pvtmsg", msg, GetActiveChat());
  2863. PushPM(GetActiveChat(), msg);
  2864. } else {
  2865. Send("msg", msg);
  2866. }
  2867. },
  2868. coin: function() {
  2869. if (CTS.Host == 0 || GetActiveChat() !== 0) {
  2870. var msg = "The coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!";
  2871. if (GetActiveChat() !== 0) {
  2872. Send("pvtmsg", msg, GetActiveChat());
  2873. } else {
  2874. Send("msg", msg);
  2875. }
  2876. }
  2877. },
  2878. settings: function() {
  2879. Settings();
  2880. },
  2881. lists: function() {
  2882. Alert(GetActiveChat(), SettingsList.BanList() + SettingsList.BanKeywordList() + SettingsList.KickList() + SettingsList.KickKeywordList() + SettingsList.BotOPList() + SettingsList.BotModList() + SettingsList.MentionList() + SettingsList.IgnoreList() + SettingsList.GreetList() + SettingsList.TTSList() + SettingsList.HighlightList() + SettingsList.ReminderList());
  2883. },
  2884. listsclear: function() {
  2885. CTS.MentionList = [];
  2886. CTS.IgnoreList = [];
  2887. CTS.BanList = [];
  2888. CTS.KickList = [];
  2889. CTS.BanKeywordList = [];
  2890. CTS.KickKeywordList = [];
  2891. CTS.GreetList = [];
  2892. CTS.HighlightList = [];
  2893. CTS.ReminderList = [];
  2894. CTS.TTSList = [];
  2895. CTS.BotOPList = [];
  2896. CTS.BotModList = [];
  2897. Save("MentionList", JSON.stringify(CTS.MentionList));
  2898. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2899. Save("BanList", JSON.stringify(CTS.BanList));
  2900. Save("KickList", JSON.stringify(CTS.KickList));
  2901. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2902. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2903. Save("GreetList", JSON.stringify(CTS.GreetList));
  2904. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2905. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2906. Save("TTSList", JSON.stringify(CTS.TTSList));
  2907. Save("BotModList", JSON.stringify(CTS.BotModList));
  2908. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2909. Alert(GetActiveChat(), "🗹Command Accepted!");
  2910. },
  2911. ytqueue: function() {},
  2912. ytclear: function() {},
  2913. ytskip: function() {},
  2914. yt: function() {},
  2915. ytbypass: function() {}
  2916. };
  2917. var SettingsList = {
  2918. BanList: function() {
  2919. var index,
  2920. msg,
  2921. len = CTS.BanList.length;
  2922. msg = "<b style=\"color:#ee3636;\"><u>Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2923. for (index = 0; index < len; index++) msg += index + " : " + CTS.BanList[index] + "\n";
  2924. return msg;
  2925. },
  2926. BanKeywordList: function() {
  2927. var index,
  2928. msg,
  2929. len = CTS.BanKeywordList.length;
  2930. msg = "<b style=\"color:#ee3636;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2931. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  2932. return msg;
  2933. },
  2934. KickList: function() {
  2935. var index,
  2936. msg,
  2937. len = CTS.KickList.length;
  2938. msg = "<b style=\"color:#ee3636;\"><u>Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2939. for (index = 0; index < len; index++) msg += index + " : " + CTS.KickList[index] + "\n";
  2940. return msg;
  2941. },
  2942. KickKeywordList: function() {
  2943. var index,
  2944. msg,
  2945. len = CTS.KickKeywordList.length;
  2946. msg = "<b style=\"color:#ee3636;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2947. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  2948. return msg;
  2949. },
  2950. BotOPList: function() {
  2951. var index,
  2952. msg,
  2953. len = CTS.BotOPList.length;
  2954. msg = "<b style=\"color:#ee3636;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2955. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  2956. return msg;
  2957. },
  2958. BotModList: function() {
  2959. var index,
  2960. msg,
  2961. len = CTS.BotModList.length;
  2962. msg = "<b style=\"color:#ee3636;\"><u>Bot Mod list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2963. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotModList[index] + "\n";
  2964. return msg;
  2965. },
  2966. MentionList: function() {
  2967. var index,
  2968. msg,
  2969. len = CTS.MentionList.length;
  2970. msg = "<b style=\"color:#ee3636;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2971. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  2972. return msg;
  2973. },
  2974. IgnoreList: function() {
  2975. var index,
  2976. msg,
  2977. len = CTS.IgnoreList.length;
  2978. msg = "<b style=\"color:#ee3636;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2979. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  2980. return msg;
  2981. },
  2982. GreetList: function() {
  2983. var index,
  2984. msg,
  2985. len = CTS.GreetList.length;
  2986. msg = "<b style=\"color:#ee3636;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2987. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  2988. return msg;
  2989. },
  2990. TTSList: function() {
  2991. var index,
  2992. msg,
  2993. len = CTS.TTSList.length;
  2994. msg = "<b style=\"color:#ee3636;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2995. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  2996. return msg;
  2997. },
  2998. HighlightList: function() {
  2999. var index,
  3000. msg,
  3001. len = CTS.HighlightList.length;
  3002. msg = "<b style=\"color:#ee3636;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3003. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  3004. return msg;
  3005. },
  3006. ReminderList: function() {
  3007. var index,
  3008. msg,
  3009. len = CTS.ReminderList.length;
  3010. msg = "<b style=\"color:#ee3636;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3011. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  3012. return msg;
  3013. },
  3014. SafeList: function() {
  3015. var index,
  3016. msg,
  3017. len = CTS.SafeList.length;
  3018. msg = "<b style=\"color:#ee3636;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3019. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  3020. return msg;
  3021. }
  3022. };
  3023. var MessageQueueList = {
  3024. add: function() {
  3025. CTS.SendQueue.push(arguments[0]);
  3026. MessageQueueList.run();
  3027. },
  3028. run: function() {
  3029. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  3030. setTimeout(function() {
  3031. var temp = new Date();
  3032. var OffsetTime = temp - CTS.LastMessage;
  3033. if (OffsetTime >= 1500) {
  3034. CTS.LastMessage = new Date();
  3035. CTS.SocketTarget.send(CTS.SendQueue[0]);
  3036. CTS.SendQueue.shift();
  3037. }
  3038. MessageQueueList.run();
  3039. }, 1600, CTS.LastMessage);
  3040. }
  3041. }
  3042. };
  3043. var ServerSendList = {
  3044. msg: function() {
  3045. var obj = {
  3046. "tc": arguments[0]
  3047. };
  3048. if (arguments[2] !== undefined) {
  3049. obj.handle = arguments[1];
  3050. CTS.SocketTarget.send(JSON.stringify(obj));
  3051. } else {
  3052. if (arguments[1] !== undefined) {
  3053. obj.text = arguments[1];
  3054. MessageQueueList.add(JSON.stringify(obj));
  3055. } else {
  3056. CTS.SocketTarget.send(JSON.stringify(obj));
  3057. }
  3058. }
  3059. },
  3060. pvtmsg: function() {
  3061. var obj = {
  3062. "tc": arguments[0],
  3063. "text": arguments[1],
  3064. "handle": Number(arguments[2])
  3065. };
  3066. MessageQueueList.add(JSON.stringify(obj));
  3067. },
  3068. kick: function() {
  3069. CheckSafeList(arguments[1], true);
  3070. ServerSendList.msg(arguments[0], arguments[1], "kick");
  3071. },
  3072. ban: function() {
  3073. CheckSafeList(arguments[1], true);
  3074. ServerSendList.msg(arguments[0], arguments[1], "ban");
  3075. },
  3076. nick: function() {
  3077. var obj = {
  3078. "tc": "nick",
  3079. "nick": arguments[1]
  3080. };
  3081. CTS.SocketTarget.send(JSON.stringify(obj));
  3082. },
  3083. stream_moder_close: function() {
  3084. CheckSafeList(arguments[1], true);
  3085. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_close");
  3086. },
  3087. stream_moder_allow: function() {
  3088. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_allow");
  3089. },
  3090. yut_playlist_add: function() {
  3091. var obj = {
  3092. "tc": arguments[0],
  3093. "item": {
  3094. "id": arguments[1][0],
  3095. "duration": arguments[1][1] + 10,
  3096. "title": arguments[1][2],
  3097. "image": arguments[1][3]
  3098. }
  3099. };
  3100. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  3101. CTS.SocketTarget.send(JSON.stringify(obj));
  3102. },
  3103. yut_playlist_remove: function() {
  3104. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  3105. },
  3106. yut_stop: function() {
  3107. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  3108. },
  3109. yut_play: function() {
  3110. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  3111. },
  3112. yut_playlist: function() {
  3113. ServerSendList.msg("yut_playlist");
  3114. },
  3115. yut_playlist_clear: function() {
  3116. ServerSendList.msg("yut_playlist_clear");
  3117. }
  3118. };
  3119. var ServerInList = {
  3120. joined: function() {
  3121. debug();
  3122. CTS.Me = {
  3123. "handle": arguments[0].self.handle,
  3124. "username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
  3125. "nick": arguments[0].self.nick,
  3126. "owner": arguments[0].self.owner,
  3127. "mod": arguments[0].self.mod,
  3128. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  3129. "avatar": arguments[0].self.avatar
  3130. };
  3131. if (CTS.Me.nick.match(/^guest(?:\-[0-9]{1,10})?/i) && CTS.Me.username !== "GUEST") Send("nick", CTS.Me.username); //AUTO CORRECT NAME
  3132. CTS.Room = {
  3133. "Avatar": arguments[0].room.avatar,
  3134. "Bio": arguments[0].room.biography,
  3135. "Name": arguments[0].room.name,
  3136. "PTT": arguments[0].room.pushtotalk,
  3137. "Website": arguments[0].room.website,
  3138. "YT_ON": arguments[0].room.youtube_enabled,
  3139. "Recent_Gifts": arguments[0].room.recent_gifts
  3140. };
  3141. CTS.SocketConnected = true;
  3142. },
  3143. userlist: function() {
  3144. var len = arguments[0].users.length;
  3145. for (var user = 0; user < len; user++) {
  3146. AKBS(arguments[0].users[user]);
  3147. var username = (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase();
  3148. CheckUserAbuse(arguments[0].users[user].handle, username, arguments[0].users[user].nick.toUpperCase());
  3149. CTS.UserList.push({
  3150. "handle": arguments[0].users[user].handle,
  3151. "username": username,
  3152. "nick": arguments[0].users[user].nick,
  3153. "owner": arguments[0].users[user].owner,
  3154. "mod": arguments[0].users[user].mod,
  3155. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  3156. "avatar": (arguments[0].users[user].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].users[user].avatar,
  3157. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
  3158. "broadcasting": false,
  3159. "vote": 0
  3160. });
  3161. }
  3162. RoomUsers();
  3163. },
  3164. join: function() {
  3165. AKBS(arguments[0]);
  3166. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  3167. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick.toUpperCase());
  3168. if (CTS.HighlightList.includes(user) || CTS.HighlightList.includes(arguments[0].nick.toUpperCase())) {
  3169. if (CTS.enableSound === true) window.CTSSound.HIGHLIGHT.play();
  3170. }
  3171. if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
  3172. CTS.hasGreetedWC = true;
  3173. if (CTS.enableSound === true) window.CTSSound.C.play();
  3174. Send("msg", UnicodeConversionList.convert("HI! " + arguments[0].nick.toUpperCase()) + "!");
  3175. } else {
  3176. if ((CTS.GreetList.includes(user) || CTS.GreetList.includes(arguments[0].nick.toUpperCase()) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  3177. Send("msg", UnicodeConversionList.convert(((window.CTSWelcomes[Rand(0, window.CTSWelcomes.length - 1)] + arguments[0].nick.toUpperCase()) + ((CTS.GreetMode) ? ".\n" + (((user != "GUEST") ? "You are signed in as " + user : "You are not signed in") + ".\nWelcome to the room!") : "!"))));
  3178. if (CTS.enableSound === true) window.CTSSound.GREET.play();
  3179. }
  3180. }
  3181. CTS.NoGreet = false;
  3182. AddUser(arguments[0].handle, arguments[0].mod, window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)], (arguments[0].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].avatar, arguments[0].nick, user, ((user !== "GUEST") ? true : false), arguments[0].owner);
  3183. RoomUsers();
  3184. },
  3185. sysmsg: function() {
  3186. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  3187. },
  3188. nick: function() {
  3189. var user = User(arguments[0].handle);
  3190. if (user != -1) {
  3191.  
  3192. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  3193.  
  3194. if ((CTS.GreetList.includes(CTS.UserList[user].username) || CTS.GreetList.includes(CTS.UserList[user].nick.toUpperCase()) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  3195. Send("msg", UnicodeConversionList.convert(CTS.UserList[user].nick + "\nwith the account name " + CTS.UserList[user].username + " changed their name to " + arguments[0].nick));
  3196. if (CTS.enableSound === true) window.CTSSound.GREET.play();
  3197. }
  3198.  
  3199. CTS.UserList[user].nick = arguments[0].nick;
  3200. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  3201. }
  3202. },
  3203. stream_connected: function() {
  3204. if (CTS.Host === CTS.Me.handle && CTS.GreenRoomToggle) {
  3205. if (arguments[0].publish == false) {
  3206. if (CTS.Me.handle !== arguments[0].handle) {
  3207. if (!CTS.Camera.List.includes(arguments[0].handle)) {
  3208. //USER IS NOT ON CAMERA START AUTO ACCEPT PROCESS
  3209. var user = User(arguments[0].handle);
  3210. debug("CAMERA::WAITING", "nickname:" + CTS.UserList[user].nick);
  3211. if (!CTS.GreenRoomTempBlackList.includes(CTS.UserList[user].username)) {
  3212. if (isSafeListed(CTS.UserList[user].username)) Send("stream_moder_allow", CTS.UserList[user].handle);
  3213. }
  3214. }
  3215. }
  3216. }
  3217. }
  3218. debug();
  3219. },
  3220. stream_closed: function() {
  3221. debug();
  3222. },
  3223. publish: function() { //ADD GLOBAL CAMERA
  3224. CheckUserStream(arguments[0].handle, true);
  3225. },
  3226. unpublish: function() { //REMOVE GLOBAL CAMERA
  3227. CheckUserStream(arguments[0].handle, false);
  3228. },
  3229. ping: function() {
  3230. debug();
  3231. if (CTS.ScriptInit) {
  3232. var verify;
  3233. if (CTS.WatchList.length > 0) {
  3234. verify = new Date() - CTS.WatchList[0][2];
  3235. debug("WATCHLIST::LIST", CTS.WatchList);
  3236. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/600000");
  3237. if (CTS.SafeList.indexOf(CTS.WatchList[0][0]) === -1) { //LET'S NOT ADD TWICE
  3238. if (verify > 600000) {
  3239. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/600000");
  3240. CTS.SafeList.push(CTS.WatchList[0][0]);
  3241. CTS.WatchList.shift();
  3242. }
  3243. } else {
  3244. CTS.WatchList.shift();
  3245. }
  3246. }
  3247. if (CTS.WaitToVoteList.length > 0) {
  3248. verify = new Date() - CTS.WaitToVoteList[0][1];
  3249. debug("VOTE::LIST", CTS.WaitToVoteList);
  3250. debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  3251. if (verify > 300000) {
  3252. debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  3253. CTS.WaitToVoteList.shift();
  3254. }
  3255. }
  3256. }
  3257. //DISPOSE OF ITEMS
  3258. window.TinychatApp.getInstance().defaultChatroom.packetWorker.queue = {};
  3259. },
  3260.  
  3261. quit: function() {
  3262. if (CTS.ScriptInit) {
  3263. if (CTS.WatchList.length > 0) {
  3264. var len = CTS.WatchList.length;
  3265. for (var i = 0; i < len; i++) {
  3266. if (CTS.WatchList[i][1] == arguments[0].handle) {
  3267. CTS.WatchList.splice(i, 1);
  3268. break;
  3269. }
  3270. }
  3271. }
  3272. if (CTS.Me.mod) RemoveUserCamera(arguments[0].handle);
  3273. var user = User(arguments[0].handle);
  3274. if (user != -1) {
  3275. if (CTS.Me.handle === CTS.Host) {
  3276. if (Fish.getPlayer(arguments[0].handle, true, false)) {
  3277. Send("msg", CTS.Game.Fish.UserQuitLast + ", has slipped off the boat; I don't think we should look back.");
  3278. }
  3279. }
  3280. //SEND THEM OUT
  3281. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  3282. CTS.UserList.splice(user, 1);
  3283. }
  3284. RoomUsers();
  3285. if (CTS.Host == arguments[0].handle) {
  3286. CTS.Host = 0;
  3287. CTS.Camera.Sweep = false;
  3288. if (CTS.Me.mod && CTS.Bot) {
  3289. setTimeout(function(handle) {
  3290. if (CTS.Host == 0) SetBot(false);
  3291. }, (Rand(10, 30) * 1000), arguments[0].handle);
  3292. }
  3293. }
  3294. }
  3295. },
  3296. msg: function() {
  3297. if (CTS.ScriptInit) {
  3298. var user = User(arguments[0].handle);
  3299. if (user != -1) {
  3300. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3301. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3302. var text = HTMLtoTXT(arguments[0].text);
  3303. //ALL USERS REPORT
  3304. OwnerCommand(user, arguments[0].text);
  3305. BotCheck(user, text, arguments[0]);
  3306. //MODERATORS
  3307. if (CTS.Me.mod) {
  3308. if (CTS.Host == CTS.Me.handle) BotCommandCheck(user, text);
  3309. CheckUserWordAbuse(user, arguments[0].text);
  3310. }
  3311.  
  3312. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  3313. //PUSH MESSAGE
  3314. CTS.Message[0].push({
  3315. "time": Time(),
  3316. "namecolor": CTS.UserList[user].namecolor,
  3317. "avatar": CTS.UserList[user].avatar,
  3318. "username": CTS.UserList[user].username,
  3319. "nick": CTS.UserList[user].nick,
  3320. "msg": CheckImgur(text),
  3321. "mention": false
  3322. });
  3323. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  3324. if (CTS.Me.handle !== arguments[0].handle) {
  3325. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  3326. Alert(GetActiveChat(), "🗹AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  3327. CTS.AutoKick = false;
  3328. CTS.AutoBan = false;
  3329. }
  3330. if (CTS.enableSound === true) {
  3331. window.CTSSound.MSG.play();
  3332. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username) || 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!"));
  3333. }
  3334. var len = CTS.MentionList.length;
  3335. for (var i = 0; i < len; i++) {
  3336. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  3337. if (CTS.enableSound === true) window.CTSSound.MENTION.play();
  3338. msg.mention = true;
  3339. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  3340. }
  3341. }
  3342. }
  3343. if (GetActiveChat() === 0) CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  3344. MessagePopUp(user, text, true, false);
  3345. }
  3346. }
  3347. } else {
  3348. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  3349. }
  3350. }
  3351. }
  3352. },
  3353. pvtmsg: function() {
  3354. if (CTS.ScriptInit) {
  3355. if (CTS.enablePMs === true) {
  3356. if (arguments[0].handle != CTS.Me.handle) {
  3357. var user = User(arguments[0].handle);
  3358. if (user != -1) {
  3359. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3360. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3361. var text = arguments[0].text;
  3362. if (CTS.Me.mod) CheckUserWordAbuse(user, arguments[0].text);
  3363. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  3364. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  3365. PushPM(arguments[0].handle, text, user);
  3366. if (CTS.enableSound === true) {
  3367. window.CTSSound.PVTMSG.play();
  3368. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username) || 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!"));
  3369. }
  3370. MessagePopUp(user, CheckImgur(HTMLtoTXT(text)), false, false);
  3371. }
  3372. }
  3373. } else {
  3374. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  3375. }
  3376. }
  3377. }
  3378. }
  3379. }
  3380. },
  3381. gift: function(parse) {
  3382. console.log(parse);
  3383. Alert(GetActiveChat(), "USER HAS SENT A GIFT--CHECK PACKET OUT!!! :)");
  3384. },
  3385. yut_playlist_add: function() {
  3386. if (CTS.ScriptInit) {
  3387. if (!CTS.YouTube.Playing) {
  3388. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  3389. if (CTS.Host != CTS.Me.handle) {
  3390. Send("msg", "!play");
  3391. } else {
  3392. YouTubePlayList();
  3393. }
  3394. }
  3395. }
  3396. },
  3397. yut_playlist: function() {
  3398. if (CTS.ScriptInit) {
  3399. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  3400. if (CTS.YouTube.Clear === true) {
  3401. if (arguments[0].items !== null) Send("yut_playlist_clear");
  3402. CTS.YouTube.MessageQueueList = [];
  3403. Send("msg", "🎵YouTube cleared!🎵");
  3404. CTS.YouTube.Clear = false;
  3405. } else {
  3406. if (arguments[0].items === null) {
  3407. CTS.PlayListStart = true;
  3408. } else {
  3409. CTS.YouTube.PlayListCount = arguments[0].items.length;
  3410. CTS.PlayListStart = false;
  3411. if (CTS.YouTube.ShowQueue === true) {
  3412. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  3413. for (var i = 0; i < 3; i++) {
  3414. if (arguments[0].items[i] === undefined) break;
  3415. msg = msg + "\n" + (i + 1) + ": " + arguments[0].items[i].title + "\n[" + Math.floor(arguments[0].items[i].duration / 60) + "M" + (arguments[0].items[i].duration % 60) + "S]";
  3416. }
  3417. Send("msg", msg);
  3418. }
  3419. }
  3420. if (arguments[0].items !== null && CTS.Host == CTS.Me.handle && CTS.YouTube.Playing === false) CheckYouTube("https://www.youtube.com/watch?v=" + arguments[0].items[0].id, false);
  3421. }
  3422. CTS.YouTube.ShowQueue = false;
  3423. }
  3424. }
  3425. },
  3426. yut_play: function() {
  3427. if (CTS.ScriptInit) {
  3428. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  3429. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  3430. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  3431. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  3432. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  3433. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  3434. }
  3435. CTS.YouTube.Playing = true;
  3436. YouTubePlayList();
  3437. }
  3438. },
  3439. yut_stop: function() {
  3440. if (CTS.ScriptInit) {
  3441. CTS.YouTube.CurrentTrack.ID = undefined;
  3442. CTS.YouTube.CurrentTrack.duration = undefined;
  3443. CTS.YouTube.CurrentTrack.title = undefined;
  3444. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  3445. CTS.YouTube.Playing = false;
  3446. YouTubePlayList();
  3447. }
  3448. }
  3449. };
  3450. var ServerOutList = {
  3451. pvtmsg: function() {
  3452. if (CTS.ScriptInit) {
  3453. Command(arguments[0].text, true);
  3454. var text = arguments[0].text;
  3455. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  3456. PushPM(arguments[0].handle, text);
  3457. }
  3458. },
  3459. msg: function() {
  3460. if (CTS.ScriptInit) {
  3461. CTS.LastMessage = new Date();
  3462. Command(arguments[0].text, false);
  3463. }
  3464. },
  3465. ban: function() {
  3466. CheckSafeList(arguments[0].handle, true);
  3467. },
  3468. kick: function() {
  3469. CheckSafeList(arguments[0].handle, true);
  3470. },
  3471. stream_moder_close: function() {
  3472. CheckSafeList(arguments[0].handle, true);
  3473. }
  3474. };
  3475. //ADDON
  3476. var Addon = {
  3477. active: function() {
  3478. if (window.CTSAddon !== undefined) {
  3479. if (window.CTSAddon[arguments[0]] !== undefined) {
  3480. return true;
  3481. }
  3482. }
  3483. return false;
  3484. },
  3485. get: function() {
  3486. return window.CTSAddon[arguments[0]];
  3487. }
  3488. };
  3489. //XMLHttpRequest
  3490. CTS.YouTube.XHR.onload = function() {
  3491. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  3492. if (response.error) {
  3493. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  3494. } else {
  3495. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  3496. CTS.YouTube.ListBuilt = true;
  3497. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  3498. CTS.YouTube.DataReady = true;
  3499. CTS.YouTube.Busy = false;
  3500. YouTubeTrackAdd();
  3501. }
  3502. CTS.YouTube.DataReady = false;
  3503. if (response.items[0]) {
  3504. CTS.YouTube.Busy = true;
  3505. if (response.items[0].id) {
  3506. if (response.kind == "youtube#playlistItemListResponse") {
  3507. YouTubePlayListItems(response.items);
  3508. } else {
  3509. CTS.YouTube.VideoID = response.items[0].id.videoId;
  3510. 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=" + CTS.YouTube.API_KEY);
  3511. CTS.YouTube.XHR.send();
  3512. }
  3513. } else if (response.items[0].contentDetails.duration) {
  3514. CTS.YouTube.DataReady = true;
  3515. }
  3516. if (CTS.YouTube.DataReady === false) {
  3517. CTS.YouTube.Busy = false;
  3518. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  3519. if (response.kind == "youtube#playlistItemListResponse") {
  3520. CTS.YouTube.ListBuilt = true;
  3521. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  3522. CTS.YouTube.Busy = false;
  3523. }
  3524. } else {
  3525. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  3526. if (CTS.YouTube.Playing === true) {
  3527. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  3528. 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]);
  3529. CTS.YouTube.Busy = false;
  3530. } else {
  3531. if (response.items[0].snippet.title !== undefined) {
  3532. 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]);
  3533. 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]);
  3534. CTS.YouTube.Playing = true;
  3535. }
  3536. CTS.YouTube.Busy = false;
  3537. }
  3538. }
  3539. }
  3540. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  3541. var title = "";
  3542. CTS.YouTube.SearchReturn = false;
  3543. CTS.YouTube.VideoReturn = false;
  3544. if (response.items[0] !== undefined) {
  3545. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  3546. }
  3547. if (response.items !== undefined) {
  3548. if (response.items.length > 0) title = response.items[0].snippet.title;
  3549. }
  3550. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  3551. }
  3552. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  3553. }
  3554. };
  3555. //Chuck Norris Jokes API (https://api.chucknorris.io/)
  3556. CTS.Chuck.XHR.onload = function() {
  3557. var resp = JSON.parse(CTS.Chuck.XHR.responseText),
  3558. msg = "[CHUCK NORRIS]\n" + resp.value;
  3559. if (resp !== null) Send("msg", msg.substr(0, 499));
  3560. };
  3561. //https://api.Urb.com/
  3562. CTS.Urb.XHR.onload = function() {
  3563. var resp = JSON.parse(CTS.Urb.XHR.responseText),
  3564. msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
  3565. if (resp !== null) Send("msg", msg.substr(0, 499));
  3566. };
  3567. //icanhazdadjoke API (https://icanhazdadjoke.com/)
  3568. CTS.Dad.XHR.onload = function() {
  3569. var resp = JSON.parse(CTS.Dad.XHR.responseText),
  3570. msg = "[DAD JOKE]\n" + resp.joke;
  3571. if (resp !== null) Send("msg", msg.substr(0, 499));
  3572. };
  3573. //adviceslip API (https://api.adviceslip.com/advice)
  3574. CTS.Advice.XHR.onload = function() {
  3575. var resp = JSON.parse(CTS.Advice.XHR.responseText),
  3576. msg = "[ADVICE]\n" + resp.slip.advice;
  3577. if (resp !== null) Send("msg", msg.substr(0, 499));
  3578. };
  3579. //GAME LIST FUNCTION
  3580. var Fish = {
  3581. //INIT
  3582. init: function() {
  3583. if (CTS.Me.handle == CTS.Host && CTS.CanHostGames === true) {
  3584. Send("msg", "[FISH]\n!fish at any time and upgrade your way up!\n\n!gameview to show/hide game.\n\nRemember there's a five second delay for all commands, don't spam!\nFor commands type !fishhelp!");
  3585. CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
  3586. g.cast();
  3587. }, 5000, this);
  3588. }
  3589. },
  3590. //PLAYERS
  3591. addPlayer: function(handle, username, nickname) {
  3592. if (!this.getPlayer(handle, false, false) && CTS.CanHostGames === true) {
  3593. if (isSafeListed(username)) {
  3594. CTS.Game.Fish.Player.push({
  3595. Handle: handle,
  3596. Username: username,
  3597. Nickname: nickname,
  3598. LastCheck: new Date() - 5000,
  3599. Points: 5000,
  3600. Upgrades: {
  3601. Net: 1,
  3602. Store: 1,
  3603. Radar: 1,
  3604. Insurance: false
  3605. },
  3606. });
  3607. Send("msg", "[FISHING BOAT]\n" + nickname.substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  3608. if (this.getPlayer() == 0) this.init();
  3609. }
  3610. }
  3611. },
  3612.  
  3613. getPlayer: function(handle, del, exists) {
  3614. var len = CTS.Game.Fish.Player.length;
  3615. if (handle !== undefined) {
  3616. for (var player = 0; player < len; player++) {
  3617. if (CTS.Game.Fish.Player[player].Handle == handle) {
  3618. if (exists) return CTS.Game.Fish.Player[player];
  3619. if (del) {
  3620. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  3621. CTS.Game.Fish.Player.splice(player, 1);
  3622. }
  3623. if (!exists) return true;
  3624. }
  3625. }
  3626. if (!exists) {
  3627. return false;
  3628. } else {
  3629. return -1;
  3630. }
  3631. } else {
  3632. return len - 1;
  3633. }
  3634. },
  3635.  
  3636. listPlayers: function() {
  3637. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
  3638. place = 0;
  3639. for (var u = arguments[0]; u >= 0; u--) {
  3640. place++;
  3641. if (u < 5) {
  3642. msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
  3643. }
  3644. CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
  3645. CTS.Game.Fish.Player[u].Points += 10000;
  3646. }
  3647. Send("msg", msg);
  3648. },
  3649.  
  3650. winner: function() {
  3651. CTS.Game.Fish.Player.sort(function(a, b) {
  3652. return a.Points - b.Points;
  3653. });
  3654. if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
  3655. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
  3656. CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
  3657. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  3658. }
  3659. var len = CTS.Game.Fish.Player.length - 1;
  3660. Send("msg", "[FISHING BOAT HIGH SCORE]\nHIGH SCORE:\n" + CTS.Game.Fish.HighScore[0] + " : $" + CTS.Game.Fish.HighScore[1] + "\n\nROUND WINNER:\n" + CTS.Game.Fish.Player[len].Nickname + " : $" + CTS.Game.Fish.Player[len].Points + "!\n\nNext round will start in thirty seconds!");
  3661. this.listPlayers(len);
  3662. CTS.Game.Fish.RestockTimeout = setTimeout(function(g) {
  3663. g.reset(false, true);
  3664. }, 30000, this);
  3665. },
  3666. //PRICELIST
  3667. pricelist: function(playerExist, item) {
  3668. if (item == 0) { // net
  3669. return (1000 * playerExist.Upgrades.Net * playerExist.Upgrades.Net * playerExist.Upgrades.Net);
  3670. } else if (item == 1) { // radar
  3671. return (1000 * playerExist.Upgrades.Radar * 2) + 3500;
  3672. } else if (item == 2) { // shop
  3673. return (playerExist.Upgrades.Store * playerExist.Upgrades.Store * 25000);
  3674. } else if (item == 3) { // insurance
  3675. return (20000);
  3676. } else if (item == 4) { // rob
  3677. return (10000);
  3678. } else if (item == 5) { // slap
  3679. return (50000);
  3680. } else if (item == 6) { // split (min$) / gamble
  3681. return (1000);
  3682. }
  3683. },
  3684. //GAMEPLAY
  3685. cast: function() {
  3686. clearTimeout(CTS.Game.Fish.StartTimeout);
  3687. if (CTS.Host === CTS.Me.handle) {
  3688. if (this.getPlayer() >= 0) {
  3689. if (CTS.Game.Fish.Round < 10) {
  3690. CTS.Game.Fish.Round++;
  3691. var playerlen,
  3692. fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
  3693. id,
  3694. type,
  3695. handle,
  3696. eliminate = false,
  3697. msgeliminate,
  3698. value,
  3699. msg = "[FISHING BOAT]\n";
  3700. for (var cast = 0; cast <= 2; cast++) {
  3701. playerlen = this.getPlayer();
  3702. id = Rand(0, playerlen);
  3703. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  3704. if (Rand(0, 100) <= Rand(10, 70)) {
  3705. var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
  3706. value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
  3707. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  3708. CTS.Game.Fish.Player[id].Points += value;
  3709. msg += (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...[$" + CTS.Game.Fish.Player[id].Points + "]:\n🗹" + net + " x " + CTS.Game.Fish.TypesOfFish[type][0] + " +$" + value + "\n");
  3710. } else {
  3711. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  3712. CTS.Game.Fish.Player[id].Points -= value;
  3713. msg += (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "..." + ((CTS.Game.Fish.Player[id].Points < 0) ? "[broke]" : "[$" + CTS.Game.Fish.Player[id].Points + "]") + ":\n🗷" + CTS.Game.Fish.TypesOfFish[type][0] + " -$" + value + "\n");
  3714. } else {
  3715. msg += (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...[$" + CTS.Game.Fish.Player[id].Points + "]:\n🗹" + net + " x " + CTS.Game.Fish.TypesOfFish[type][0] + " -$0\n");
  3716. }
  3717. }
  3718. } else {
  3719. cast--;
  3720. }
  3721. if (this.getPlayer() == -1) break;
  3722. if (CTS.Game.Fish.Player[id].Points < 0) {
  3723. eliminate = true;
  3724. handle = CTS.Game.Fish.Player[id].Handle;
  3725. msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
  3726. CTS.Game.Fish.Player.splice(id, 1);
  3727. break;
  3728. }
  3729. }
  3730. if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
  3731. if (eliminate) {
  3732. eliminate = false;
  3733. Send("msg", msgeliminate);
  3734. }
  3735. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
  3736. g.cast();
  3737. }, Rand(90000, 120000), this);
  3738. } else {
  3739. this.winner();
  3740. }
  3741. } else {
  3742. //RESTART
  3743. CTS.Game.Fish.GameStart = false;
  3744. Fish.stop();
  3745. }
  3746. }
  3747. },
  3748. //STOPPERS
  3749. reset: function(stop, bypass) {
  3750. var get = this.getPlayer();
  3751. if (get !== undefined) {
  3752. if (get >= 0 && !CTS.Game.NoReset || bypass !== undefined) {
  3753. CTS.Game.Fish.Round = 0;
  3754. clearTimeout(CTS.Game.Fish.StartTimeout);
  3755. clearTimeout(CTS.Game.Fish.RestockTimeout);
  3756. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  3757. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  3758. if (!stop) {
  3759. this.init();
  3760. } else {
  3761. if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  3762. CTS.Game.Fish.Player = [];
  3763. }
  3764. }
  3765. }
  3766. },
  3767.  
  3768. stop: function() {
  3769. CTS.Game.NoReset = false;
  3770. this.reset(true, true);
  3771. }
  3772. };
  3773. var FishList = {
  3774. fish: function(playerExist, user) {
  3775. Fish.addPlayer(user.handle, user.username, user.nick);
  3776. },
  3777.  
  3778. fishbank: function(playerExist) {
  3779. if (playerExist !== -1 && FishTimerCheck(playerExist)) Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname.substr(0, 16) + ", you have $" + playerExist.Points + ".");
  3780. },
  3781.  
  3782. fishrob: function(playerExist, target) {
  3783. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3784. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  3785. FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 4), Rand(5000, 20000), true);
  3786. }
  3787. },
  3788. fishgamble: function(playerExist) {
  3789. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3790. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 6))) {
  3791. var winnings;
  3792. if (Rand(1, 10) === 7) { // 10% chance
  3793. winnings = Rand(1000, 25000);
  3794. playerExist.Points += winnings;
  3795. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
  3796. } else {
  3797. if (Rand(1, 7) === 4) { // 15%
  3798. winnings = Rand(1000, 5000);
  3799. playerExist.Points += winnings;
  3800. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
  3801. } else {
  3802. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " tough luck, you lost $1000!");
  3803. }
  3804. }
  3805. }
  3806. }
  3807. },
  3808. fishslap: function(playerExist, target) {
  3809. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3810. var user = UsernameToUser(target.toUpperCase());
  3811. if (user !== -1) {
  3812. if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle) {
  3813. if (CTS.Me.owner || !CTS.UserList[user].mod) {
  3814. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 5))) {
  3815. Send("stream_moder_close", CTS.UserList[user].handle);
  3816. Send("msg", playerExist.Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
  3817. }
  3818. } else {
  3819. Send("msg", "Cannot close moderator!");
  3820. }
  3821. } else {
  3822. Send("msg", "Cannot close user!");
  3823. }
  3824. }
  3825. }
  3826. },
  3827.  
  3828. fishsplit: function(playerExist, target) {
  3829. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3830. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  3831. FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 6), Math.round(playerExist.Points / 2), false);
  3832. }
  3833. },
  3834.  
  3835. fishupgrade: function(playerExist) {
  3836. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 0);
  3837. },
  3838.  
  3839. fishhelp: function(playerExist) {
  3840. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 6);
  3841. },
  3842.  
  3843. fishupgradenet: function(playerExist) {
  3844. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3845. if (playerExist.Upgrades.Net >= 10) {
  3846. Send("msg", playerExist.Nickname + ", you own all upgrades.");
  3847. } else {
  3848. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 0))) {
  3849. playerExist.Upgrades.Net += 1;
  3850. FishUpgradeStatus(playerExist, 1);
  3851. }
  3852. }
  3853. }
  3854. },
  3855.  
  3856. fishupgradeshop: function(playerExist) {
  3857. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3858. if (playerExist.Upgrades.Store >= 6) {
  3859. Send("msg", playerExist.Nickname + ", you own them all already!");
  3860. } else {
  3861. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 2))) {
  3862. playerExist.Upgrades.Store += 1;
  3863. FishUpgradeStatus(playerExist, 4);
  3864. }
  3865. }
  3866. }
  3867. },
  3868.  
  3869. fishupgraderadar: function(playerExist) {
  3870. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3871. if (playerExist.Upgrades.Radar >= 20) {
  3872. Send("msg", playerExist.Nickname + ", you own all upgrades.");
  3873. } else {
  3874. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 1))) {
  3875. playerExist.Upgrades.Radar += 5;
  3876. FishUpgradeStatus(playerExist, 2);
  3877. }
  3878. }
  3879. }
  3880. },
  3881.  
  3882. fishupgradeinsurance: function(playerExist) {
  3883. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3884. if (playerExist.Upgrades.Insurance === true) {
  3885. Send("msg", playerExist.Nickname + ", you already have insurance!");
  3886. } else {
  3887. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 3))) {
  3888. playerExist.Upgrades.Insurance = true;
  3889. FishUpgradeStatus(playerExist, 3);
  3890. }
  3891. }
  3892. }
  3893. }
  3894. };
  3895. //MISC FUNCTION
  3896. function debug() {
  3897. if (window.DebugClear === false) {
  3898. if (arguments[0] !== undefined) {
  3899. var msg = "CTS::" + arguments[0];
  3900. if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
  3901. console.log(msg);
  3902. }
  3903. } else {
  3904. console.clear();
  3905. console.log(" ( \n ( * ))\ ) \n )\ \` ) /(()/( \n (((_) ( )(_)/(_)) \n )\___(_(_()(_)) \n((/ __|_ _/ __| \n | (__ | | \__ \ /\n \___| |_| |___/ \nCosmosisT's TinyChat Script\nCREATOR: COSMOSIST\nVERSION: " + Ver() + "\nCONSOLE DEBUG: FALSE\n\nJoin the discord today!\nhttps://discord.gg/cHEf8z7");
  3906. }
  3907. }
  3908.  
  3909. function Remove() {
  3910. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  3911. }
  3912. })();