CosmosisT's TinyChat Script (CTS V1.6.74)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-06-03 提交的版本,查看 最新版本

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