CosmosisT's TinyChat Script (CTS V1.8.423)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.8.423)
  3. // @version 1.8.423
  4. // @description Modified TinyChat - Best Scripts; prepare to be amazed.
  5. // @author CosmosisT
  6. // @url https://gist.github.com/CosmosisT
  7. // @license Copyright (C) CosmosisT
  8. // @icon https://i.imgur.com/XlkFjOK.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.  
  22.  
  23. (function() {
  24. "use strict";
  25. //DEBUGGER
  26. window.DebugClear = true; // TRUE = CLEARS || FALSE = SHOWS
  27. window.CTSVersion = {
  28. Major: 1,
  29. Minor: 8,
  30. Patch: 423
  31. };
  32. var MainElement, ChatLogElement, VideoListElement, SideMenuElement, TitleElement, UserListElement, ModerationListElement, ChatListElement, UserContextElement, MicrophoneElement, TextAreaElement,
  33. FeaturedCSS, VideoCSS, SideMenuCSS, MainCSS, RoomCSS, TitleCSS, ContextMenuCSS, ModeratorCSS, UserListCSS, ChatListCSS, NotificationCSS, ChatboxCSS;
  34. //CTS MAIN VARIABLES
  35. var CTS = {
  36. Project: {
  37. Name: "CTS",
  38. Storage: "CTS_",
  39. isTouchScreen: false,
  40. },
  41. Chuck: {
  42. XHR: new XMLHttpRequest()
  43. },
  44. Urb: {
  45. XHR: new XMLHttpRequest()
  46. },
  47. Dad: {
  48. XHR: new XMLHttpRequest()
  49. },
  50. Advice: {
  51. XHR: new XMLHttpRequest()
  52. },
  53. YouTube: {
  54. API_KEY: "",
  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. AnimationFrameWorker: undefined,
  76. WorkersAllowed: (typeof(Worker) !== "undefined"),
  77. Me: {},
  78. Room: {},
  79. ScriptInit: false,
  80. MainBackground: "url(https://i.imgur.com/0E5d32a.png) rgb(0, 0, 0) no-repeat",
  81. MediaStreamFilter: "No Filter",
  82. OGStyle: {
  83. HeightCounter: 3,
  84. WidthCounter: 1,
  85. SavedHeight: undefined,
  86. SavedWidth: undefined
  87. },
  88. NormalStyle: {
  89. ChatHide: false
  90. },
  91. FontSize: 20,
  92. ChatStyleCounter: 0,
  93. ChatHeight: 30,
  94. ChatWidth: 0,
  95. ChatDisplay: true,
  96. UserListDisplay: true,
  97. ChatStyles: undefined,
  98. ChatType: true,
  99. MainBackgroundCounter: 0,
  100. NotificationLimit: 100,
  101. ChatScroll: true,
  102. CreateMessageLast: undefined,
  103. NotificationScroll: true,
  104. NoGreet: false,
  105. Featured: true,
  106. Bot: true,
  107. AutoKick: false,
  108. AutoBan: false,
  109. GreetMode: false,
  110. PerformanceMode: false,
  111. CanTTS: false,
  112. VoteSystem: false,
  113. Popups: true,
  114. Avatar: true,
  115. Reminder: true,
  116. CanSeeTips: true,
  117. CanSeeGames: true,
  118. CanHostFishGames: false,
  119. CanHostTriviaGames: false,
  120. isFullScreen: false,
  121. Imgur: true,
  122. ImgurWarning: 0,
  123. Notification: true,
  124. UserYT: true,
  125. RaidToggle: true,
  126. ThemeChange: true,
  127. SoundMeterToggle: true,
  128. TimeStampToggle: true,
  129. AutoMicrophone: false,
  130. GreenRoomToggle: true,
  131. PublicCommandToggle: true,
  132. Game: {
  133. NoReset: false,
  134. Trivia: {
  135. XHR: new XMLHttpRequest(),
  136. QuestionList: [],
  137. Timer: undefined,
  138. ANum: ["A", "B", "C", "D"],
  139. Correct: "",
  140. Attempts: 0,
  141. AttemptList: [],
  142. WaitCount: 0,
  143. Waiting: true,
  144. HighScore: ["CosmosisT", 2],
  145. Worth: 0,
  146. PlayerList: {},
  147. PriceList: {
  148. raid: 10000,
  149. spot: 500,
  150. ytbypass: 200
  151. }
  152. },
  153. Fish: {
  154. HighScore: ["CosmosisT", 13337],
  155. StartTimeout: undefined,
  156. RestockTimeout: undefined,
  157. ReCastTimeout: undefined,
  158. NotEnoughTimeout: undefined,
  159. Round: 0,
  160. Player: [],
  161. TypesOfFish: [
  162. ["frog", 1, true],
  163. ["sunfish", 2, true],
  164. ["goldfish", 3, true],
  165. ["fish swollowed hook", 4, false],
  166. ["family of sardine", 5, true],
  167. ["catfish", 6, true],
  168. ["spotted bass", 7, true],
  169. ["largemouth bass", 8, true],
  170. ["family of shrimp", 9, true],
  171. ["it pays to not drink,\ncrazy night however!", 10, false],
  172. ["cisco", 11, true],
  173. ["seaweed, still edible", 12, true],
  174. ["snagged a tire and lost rod", 13, false],
  175. ["snagged a tire and lost hook", 14, false],
  176. ["lost their rod to a shark", 15, false],
  177. ["rainbow trout", 16, true],
  178. ["It's your turn for dinner", 80, false],
  179. ["parrot fish", 17, true],
  180. ["snagged a plastic bag,\n their hook is gone", 18, false],
  181. ["walleye", 19, true],
  182. ["Round Whitefish", 20, true],
  183. ["family of clams", 21, true],
  184. ["family of oyster", 22, true],
  185. ["Round blackfish", 23, true],
  186. ["dolphin", 24, true],
  187. ["seagull,\n not a fish but will do", 25, true],
  188. ["pufferfish", 26, true],
  189. ["fined for smuggling\nmore than fish", 27, false],
  190. ["lobster", 28, true],
  191. ["tuna", 29, true],
  192. ["electric eel", 30, true],
  193. ["Eel electricuted you,\nrod is toast", 31, false],
  194. ["swordfish", 32, true],
  195. ["had bills at home to pay", 33, false],
  196. ["slipped and lost equipment", 34, false],
  197. ["bike, still good too", 35, true],
  198. ["great white", 36, true],
  199. ["octopus", 37, true],
  200. ["serpeant", 38, true],
  201. ["sea turtle", 39, true],
  202. ["cleaned garbage from the lake", 40, true],
  203. ["fined for capturing,\n a female whale", 41, false],
  204. ["male whale", 42, true],
  205. ["barracuda", 43, true],
  206. ["pike", 44, true],
  207. ["lochiness monster", 45, true],
  208. ["anglerfish", 46, true],
  209. ["small treasure chest", 47, true],
  210. ["golden tuna", 48, true],
  211. ["family of beautiful rims", 49, true],
  212. ["red snapper", 50, true],
  213. ["jaws", 51, true],
  214. ["mermaid", 52, true],
  215. ["holy grail,\nhow'd that get there?", 75, true],
  216. ["secret formula", 100, true]
  217. ]
  218. }
  219. },
  220. TTS: {
  221. synth: undefined,
  222. voices: undefined
  223. },
  224. hasGreetedWC: false,
  225. Host: 0,
  226. HostAttempt: 0,
  227. HostWaiting: false,
  228. StorageSupport: true,
  229. WaitToVoteList: [],
  230. UserList: [],
  231. MentionList: [],
  232. TempIgnoreNickList: [],
  233. TempIgnoreUserList: [],
  234. IgnoreList: [],
  235. UserBanList: [],
  236. NickBanList: [],
  237. UserKickList: [],
  238. NickKickList: [],
  239. BotOPList: [],
  240. BotModList: [],
  241. TTSList: [],
  242. BanKeywordList: [],
  243. KickKeywordList: [],
  244. HighlightList: [],
  245. GreetList: [],
  246. ReminderList: [],
  247. ReminderServerInList: [],
  248. Favorited: ["stonercircle", null, null, null, null],
  249. SafeList: [],
  250. GreenRoomIgnoreList: [],
  251. GreenRoomList: [],
  252. WatchList: [],
  253. HiddenCameraList: [],
  254. KBQueue: [],
  255. Message: [
  256. []
  257. ],
  258. Clipboard: {
  259. Message: [""],
  260. Typing: false,
  261. Log: "",
  262. MessageLen: 0,
  263. Counter: 0
  264. },
  265. LastMessage: new Date(),
  266. ShowedSettings: false,
  267. SendQueue: [],
  268. MissedMsg: 0,
  269. Camera: {
  270. List: [],
  271. Sweep: false,
  272. SweepTimer: 5,
  273. clearRandom: undefined
  274. },
  275. NotificationTimeOut: [],
  276. };
  277.  
  278. CTS.StorageSupport = StorageSupport();
  279. SetLocalValues();
  280.  
  281. //IS USER TOUCHSCREEN
  282. CheckUserTouchScreen();
  283. if (CTS.ThemeChange) {
  284. // TinyChat Style
  285. FeaturedCSS = "#videos.column>.videos-items{height:20%}#videos.column>.videos-items+.videos-items{background:none;height:80%}#videos.row>.videos-items{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%}";
  286. ChatListCSS = "#playerYT{background: black;border-radius: 3px;}.overlay .duration{background:#9a0000;}.overlay .volume{background: #2a6a89;}.overlay .volume, .overlay .duration{height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.overlay button:hover{background: #53b6ef;cursor: pointer;}.overlay button{outline: none;line-height: 14px;background: #101314;border: none;font-size: 18px;color: white;height: 28px;width: 34px;}.overlay{position: absolute;width: 100%;height: 25px;display: contents;}#player{pointer-events:none; width:100%; height:20%;}#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;}";
  287. ChatboxCSS = "#chat-import-label{text-align: center;height: 20px;right: 70px;width:35px;cursor:pointer;}#safelist-import-label{text-align: center;height: 20px;cursor:pointer;}#chat-import{opacity: 0;position: absolute;z-index: -1;}#safelist-import{opacity: 0;position: absolute;z-index: -1;}.stackmessage:hover > .ctstimehighlight{display:block;z-index:1;}.ctstimehighlight{font-weight: 600;font-size: 16px;color: #FFF;position: absolute;right: 3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;display:none;}.stackmessage{background: #00000085;border-radius: 6px;margin: 5px 0 0 -5px;padding: 5px;border: #7672729e 1px solid;}#chat-export{right:35px;width:35px;}#safelist-export{right:105px; width:35px;}#safelist-import-label{right:140px; width:35px;}#chat-download{right:0;width:35px;}#safelist-import-label:hover,#safelist-export:hover, #chat-import-label:hover, #chat-export:hover, #chat-download:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}.chat-button{outline:none;background: unset;border: unset;position: absolute;height: 22px;padding-top: 2px;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;}#chatlog-button{display:none!important;}@media screen and (max-width: 1200px){#chat-hide{top: -39px!important;left: 0!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}#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);box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;overflow:hidden;}#user-menu{border-radius: 6px;background: #000000b8;position: absolute;display: none;bottom: 50px;right: 0;box-sizing: border-box;border-radius: 6px;color: #FFFFFF;line-height: 1;z-index: 1;max-width:300px;padding:12px;}#user-menu > span {border-radius:6px;background:#000000c9;display: inline-block;width: 100%;padding: 6px;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>.systemuser{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:6px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#243584a1;-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 9px 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{transition: .2s;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;}#chat-instant::after{content:unset;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{cursor: pointer;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;}";
  288. 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;}";
  289. VideoCSS = "#button-banlist{color: white;cursor: pointer;background: #101314;border: none;}#button-banlist:hover{background:#53b6ef;}.overlay{display:none;}#youtube.video > div > .overlay > .icon-visibility{display:none;}@media screen and (min-width: 700px){#seek-duration{display:block!important;}}#seek-duration{display:none;}#youtube.video:hover > div > .overlay{opacity:1;}#youtube.video > div{margin-bottom:unset;}#youtube.video > div > .overlay{top: calc(100% - 57px);opacity: 0;transition: opacity .5s ease-out;-moz-transition: opacity .5s ease-out;-webkit-transition: opacity .5s ease-out;-o-transition: opacity .5s ease-out;background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}.video>div{border-radius:10px;}@media screen and (max-width: 600px){#videos{top:38px;}#videos-header{position: unset;height: unset;width: unset;top: unset;bottom: unset;padding: 0 2px 10px 15px;box-sizing: border-box;}}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{height:unset;}#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;}.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{top:28px;right:0;background:#101314;width: 92px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsdrop-content button.hidden{display:none;}.ctsdrop-content button:hover, .ctsoptions:hover{background:#53b6ef}.ctsdrop-content button, .ctsoptions{line-height: 22px;color: white;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-broadcast-wrapper.show-ptt > #videos-footer-push-to-talk {min-width: 170px; width: 170px;}#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{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}#videos-footer{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{height:unset;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;}";
  290. RoomCSS = "tc-title{display:flex;}#room-content{padding-top:0!important;background:unset!important;}";
  291. TitleCSS = "#room-header-info > h1:after{content:unset;}@media screen and (max-width: 600px){#room-header-info{left:unset;right:unset;}}#room-header-info > span + span,#room-header-info > span{display:none;}#room-header-info > h1{width:unset;max-width:unset; position: relative;top: 8px;left: 60px;}#room-header-info{padding:unset;}#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{width:100%;min-height:38px;max-height:38px;}";
  292. SideMenuCSS = "#sidemenu{left:0;z-index:3;}@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;}";
  293. NotificationCSS = "#youtube.video{min-height:unset;min-width:unset;}f@media screen and (max-width: 600px){#videos-header>span{line-height:50px;}}#videos-header > span {background-color: unset!important;}.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;}";
  294. UserListCSS = "#contextmenu {top:unset!important;bottom:0!important;right:0!important;left:0!important;}.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;}.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;}";
  295. ModeratorCSS = ".video{width:100%}.video > div > .overlay{background-color:unset;}.video:hover{max-width:unset;}#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{padding-left:unset;max-height:60px;background: #00000075;}#moderatorlist>#header{height: 60px;color: #FFFFFF;border-radius: unset;line-height: 22px;}#moderatorlist.show[data-videos-count=\"1\"], #moderatorlist.show[data-videos-count=\"2\"],#moderatorlist.show[data-videos-count=\"3\"],#moderatorlist.show[data-videos-count=\"4\"],#moderatorlist.show[data-videos-count=\"5\"],#moderatorlist.show[data-videos-count=\"6\"],#moderatorlist.show[data-videos-count=\"7\"],#moderatorlist.show[data-videos-count=\"8\"],#moderatorlist.show[data-videos-count=\"9\"],#moderatorlist.show[data-videos-count=\"10\"],#moderatorlist.show[data-videos-count=\"11\"],#moderatorlist.show[data-videos-count=\"12\"]{margin: 5px;max-height:100%}";
  296. ContextMenuCSS = ".context[data-mode=\"dark\"] > span:hover{background-color:#04caff;}.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;}";
  297. } else {
  298. //CTS Style
  299. 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%}";
  300. 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;}";
  301. ChatboxCSS = "#chat-import-label{text-align: center;height: 20px;right: 70px;width:35px;cursor:pointer;}#safelist-import{opacity: 0;position: absolute;z-index: -1;}#safelist-import-label{text-align: center;height: 20px;cursor:pointer;}#chat-import{display: none;position: absolute;z-index: -1;}.stackmessage:hover > .ctstimehighlight{display:block;z-index:1;}.ctstimehighlight{font-weight: 600;font-size: 16px;color: #FFF;position: absolute;right: 3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;display:none;}.stackmessage{background: #00000085;border-radius: 6px;margin: 5px 0 0 -5px;padding: 5px;border:#7672729e 1px solid;}#chat-export{right:35px;width:35px;}#safelist-export{right:105px; width:35px;}#safelist-import-label{right:140px; width:35px;}#chat-download{right:0;width:35px;}#safelist-import-label:hover,#safelist-export:hover, #chat-import-label:hover, #chat-export:hover, #chat-download:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}.chat-button{outline:none;background: unset;border: unset;position: absolute;height: 22px;padding-top: 2px;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;}#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);box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;overflow:hidden;}#user-menu {border-radius: 6px;background: #000000b8;position: absolute;display: none;bottom: 50px;right: 0;box-sizing: border-box;border-radius: 6px;color: #FFFFFF;line-height: 1;z-index: 1;max-width:300px;padding:12px;}#user-menu > span {border-radius:6px;background:#000000c9;display: inline-block;width: 100%;padding: 6px;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>.systemuser{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:6px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#243584a1;-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 9px 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{transition: .2s;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{content:unset;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{cursor: pointer;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;}";
  302. MainCSS = ".container{display:none;}#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;}";
  303. VideoCSS = "#button-banlist{color: white;cursor: pointer;background: #101314;border: none;}#button-banlist:hover{background:#53b6ef;}.overlay{display:none;}#youtube.video > div > .overlay > .icon-visibility{display:none;}#youtube.video:hover > div > .overlay{opacity:1;}@media screen and (min-width: 700px){#seek-duration{display:block!important;}}#seek-duration{display:none;}#youtube.video > div{margin-bottom:unset;}#youtube.video > div > .overlay{top: calc(100% - 57px);opacity: 0;transition: opacity .5s ease-out;-moz-transition: opacity .5s ease-out;-webkit-transition: opacity .5s ease-out;-o-transition: opacity .5s ease-out;background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}@media screen and (max-width: 600px){#videos-footer-broadcast{height:unset;text-align:center;line-height:50px;}}.video>div{border-radius:10px;}@media screen and (max-width: 600px){#videos{top:38px;}}#videolist[data-mode=\"dark\"]{background-color:unset;}.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;width: 92px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsdrop-content button.hidden{display:none;}.ctsdrop-content button:hover, .ctsoptions:hover{background:#53b6ef}.ctsdrop-content button, .ctsoptions{line-height: 22px;color: white;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-broadcast-wrapper.show-ptt > #videos-footer-push-to-talk {min-width: 170px; width: 170px;}#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{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}#videos-footer{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;}";
  304. RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{padding-top:0!important;background:unset!important;}";
  305. 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;}";
  306. SideMenuCSS = "#playerYT{background: black;border-radius: 3px;}:host, #videolist{z-index:0;}.overlay .volume{background: #2a6a89;}.overlay .volume, .overlay .duration{height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.overlay .duration{background:#9a0000;}.overlay button:hover{background: #53b6ef;cursor: pointer;}.overlay button{outline: none;line-height: 14px;background: #101314;border: none;font-size: 18px;color: white;height: 28px;width: 34px;}#player{pointer-events:none; width:100%;}#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;}";
  307. NotificationCSS = "#youtube.video{min-height:unset;min-width:unset;}#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;}";
  308. 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;}.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;}";
  309. ModeratorCSS = ".video{width:350px}.video > div > .overlay{background-color:unset;}.video:hover{max-width:unset;}#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{margin: 5px;max-height:60px;}#moderatorlist>#header{height: 60px;color: #FFFFFF;border-radius: unset;line-height: 22px;}#moderatorlist.show[data-videos-count=\"1\"], #moderatorlist.show[data-videos-count=\"2\"],#moderatorlist.show[data-videos-count=\"3\"],#moderatorlist.show[data-videos-count=\"4\"],#moderatorlist.show[data-videos-count=\"5\"],#moderatorlist.show[data-videos-count=\"6\"],#moderatorlist.show[data-videos-count=\"7\"],#moderatorlist.show[data-videos-count=\"8\"],#moderatorlist.show[data-videos-count=\"9\"],#moderatorlist.show[data-videos-count=\"10\"],#moderatorlist.show[data-videos-count=\"11\"],#moderatorlist.show[data-videos-count=\"12\"]{max-height:326px;max-width:350px;}";
  310. ContextMenuCSS = ".context[data-mode=\"dark\"] > span:hover{background-color:#04caff;}.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;}";
  311. }
  312. //INITIATE
  313. CTSInit();
  314.  
  315. function CTSInit() {
  316. //INITIATE CTS
  317. var err_out = 0;
  318. CTS.ScriptLoading = setInterval(function() {
  319. err_out++;
  320. if (document.querySelector("tinychat-webrtc-app")) {
  321. if (document.querySelector("tinychat-webrtc-app").shadowRoot) CTSRoomInject();
  322. debug("TINYCHAT::LOAD", "ROOM");
  323. } else if (document.querySelector("#welcome-wrapper")) {
  324. CTSHomeInject();
  325. debug("TinyChat::LOAD", "HOME");
  326. } else {
  327. err_out++;
  328. }
  329. if (err_out == 50) {
  330. clearInterval(CTS.ScriptLoading);
  331. clearInterval(CTS.FullLoad);
  332. }
  333. }, 200);
  334. //WEBSOCKET HOOK
  335. if (!document.URL.match(/^https:\/\/tinychat\.com\/(?:$|#)/i)) {
  336. new MutationObserver(function() {
  337. this.disconnect();
  338. CTSWebSocket();
  339. }).observe(document, {
  340. subtree: true,
  341. childList: true
  342. });
  343. }
  344. //FULLY LOADED -> RUNALL
  345. CTS.FullLoad = setInterval(function() {
  346. if (CTS.ScriptInit && CTS.SocketConnected) {
  347. clearInterval(CTS.FullLoad);
  348. if (CTS.Me.mod) {
  349. if (CTS.Bot) CheckHost();
  350. if (CTS.Room.YT_ON) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  351. if (CTS.Room.YT_ON && CTS.Project.isTouchScreen) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").classList.toggle("hidden");
  352. //VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
  353. }
  354. //PTT AUTO
  355. if (CTS.Room.PTT) {
  356. VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
  357. e = e || window.event;
  358. if (e.which == 1) CTS.AutoMicrophone = false;
  359. if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  360. if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  361. }, {
  362. passive: true
  363. });
  364. }
  365. //FAVORITE ROOM
  366. var favorited_rooms = "",
  367. len = CTS.FavoritedRooms.length,
  368. script = document.createElement("script"),
  369. elem = document.getElementsByTagName("script")[0];
  370. script.text = 'function AddFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'FavoritedRooms"));\n val[index]=["' + CTS.Room.Name + '"];\n localStorage.setItem("' + CTS.Project.Storage + 'FavoritedRooms", 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}';
  371. elem.parentNode.insertBefore(script, elem);
  372. for (var i = 0; i < len; i++) favorited_rooms += CTS.FavoritedRooms[i] !== null ? "<span>#" + (i + 1) + ' <a href="https://tinychat.com/room/' + CTS.FavoritedRooms[i] + '">' + CTS.FavoritedRooms[i] + "</a></span>" : "<span>#" + (i + 1) + ' <a href="#" onclick="return AddFavorite(this,' + i + ');">ADD ROOM</a></span>';
  373. 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="title">' + CTS.Me.username + '</span><span><a href="https://tinychat.com/settings/gifts"> My Gifts</a></span><span><a href="https://tinychat.com/settings/profile">Profile</a></span><span><a href="https://tinychat.com/room/' + CTS.Me.username + '">My Room</a></span><span><a href="https://tinychat.com/#">Directory</a></span></div></div>');
  374. //RECENT GIFTS
  375. var recent_gifts = "\n";
  376. for (var g = 0; g < CTS.Room.Recent_Gifts.length; g++) recent_gifts += "<img src=\"" + CTS.Room.Recent_Gifts[g] + "\" />";
  377. //ALERT
  378. 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>");
  379. CTS.ShowedSettings = true;
  380. AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
  381.  
  382. var tag = document.createElement('script');
  383. tag.text = `var tag = document.createElement('script');\ntag.src = "https://www.youtube.com/iframe_api";\nvar firstScriptTag = document.getElementsByTagName('script')[0];\nfirstScriptTag.parentNode.insertBefore(tag, firstScriptTag);`;
  384. document.body.appendChild(tag);
  385. //FEATURE LAUNCH
  386. SoundMeter();
  387. Reminder();
  388. PerformanceModeInit(CTS.PerformanceMode);
  389. }
  390. }, 500);
  391. }
  392.  
  393. function CTSHomeInject() {
  394. 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;}";
  395. //INSERT HTML/CSS
  396. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  397. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  398. //INSERT SCRIPT
  399. var script = document.createElement("script"),
  400. elem = document.getElementsByTagName("script")[0];
  401. script.text = 'function RemoveFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'FavoritedRooms"));\n val[index]=null;\n localStorage.setItem("' + CTS.Project.Storage + 'FavoritedRooms", JSON.stringify(val));\n return obj.parentNode.parentNode.remove();\n}';
  402. elem.parentNode.insertBefore(script, elem);
  403. var len = CTS.FavoritedRooms.length;
  404. for (var i = 0; i < len; i++) document.body.querySelector(".cts-footer-contents").insertAdjacentHTML("beforeend", CTS.FavoritedRooms[i] !== null ? '<div class="tile" data-room-name="' + CTS.FavoritedRooms[i] + '">Favorite #' + (i + 1) + ' <div class="tile-header"><img id="tile-header-image" src=\"https://upload.tinychat.com/pic/' + CTS.FavoritedRooms[i] + '\")' + '" onload="MasonryTails.Refresh();" onclick="locationTo(\'/room/' + CTS.FavoritedRooms[i] + '\');"><div class="tile-info"><div class="tile-favroom-opt" onclick="RemoveFavorite(this,' + i + ')">X</div><div class="tile-name">' + CTS.FavoritedRooms[i] + '</div><div class="tile-statistic"><svg width="18" height="14" viewBox="0 0 18 14" xmlns="https://www.w3.org/2000/svg"><path d="M9.333 5.667c0-.367-.3-.667-.666-.667h-8C.3 5 0 5.3 0 5.667v6.666C0 12.7.3 13 .667 13h8c.366 0 .666-.3.666-.667V10L12 12.667V5.333L9.333 8V5.667z" transform="translate(3 -3)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span><svg width="20" height="16" viewBox="0 0 20 16" xmlns="https://www.w3.org/2000/svg"><path d="M57 4c-3.182 0-5.9 2.073-7 5 1.1 2.927 3.818 5 7 5s5.9-2.073 7-5c-1.1-2.927-3.818-5-7-5zm0 8.495c1.93 0 3.495-1.565 3.495-3.495 0-1.93-1.565-3.495-3.495-3.495-1.93 0-3.495 1.565-3.495 3.495 0 1.93 1.565 3.495 3.495 3.495zm0-1.51c1.096 0 1.985-.89 1.985-1.985 0-1.096-.89-1.985-1.985-1.985-1.096 0-1.985.89-1.985 1.985 0 1.096.89 1.985 1.985 1.985z" transform="translate(-47 -2)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span></div></div></div></div>' : '<div class="tile">Favorite #' + (i + 1) + "</div>");
  405. //SCRIPT INIT -> PREPARE()
  406. clearInterval(CTS.ScriptLoading);
  407. CTS.ScriptInit = true;
  408. CTSHomePrepare();
  409. }
  410.  
  411. function CTSHomePrepare() {
  412. //FUNCTION BYPASS
  413. window.ModalFreeTrialPro = function() {};
  414. //REMOVE
  415. Remove(document, "#footer");
  416. Remove(document, ".nav-logo");
  417. }
  418.  
  419. function CTSRoomInject() {
  420. // PUBLIC / ADDON GRABBERS
  421. window.CTSRoomVolume = 1;
  422. window.CTSMuted = false;
  423. window.CTSImages = [
  424. "https://i.imgur.com/0E5d32a.png", "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",
  425. "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",
  426. "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",
  427. "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",
  428. "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",
  429. "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",
  430. "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",
  431. ];
  432. 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."];
  433. window.CTSWelcomes = ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "];
  434. window.CTSSound = {
  435. C: new Audio("https://media.vocaroo.com/mp3/e3VIvvFqdHe"),
  436. HIGHLIGHT: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  437. GREET: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  438. MENTION: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"),
  439. MSG: new Audio("https://tinychat.com" + window.rootDir + "/sound/pop.mp3"),
  440. GIFT: new Audio("https://tinychat.com" + window.rootDir + "/sound/magic.mp3"),
  441. PVTMSG: new Audio("https://media.vocaroo.com/mp3/1eX3L752VdQ")
  442. };
  443. window.CTSRadioStations = [
  444. ["WYUL 94.7 Hits", "https://ice66.securenetsystems.net/WYUL2"],
  445. ["Oldies Radio", "https://proxy.stream.statsradio.com/cjwv"],
  446. ["Planet Rock", "https://stream-mz.planetradio.co.uk/planetrock.aac"],
  447. ["Rock On", "https://streaming.radiostreamlive.com/radiorockon_devices"],
  448. ["CKFM", "https://17013.live.streamtheworld.com/CKFMFMAAC_SC"],
  449. ["CHUMFM", "https://22073.live.streamtheworld.com/CHUMFMAAC_SC"],
  450. ["CJKXFMAAC", "http://18073.live.streamtheworld.com/CJKXFMAAC.aac"],
  451. ["CKQBFM", "https://corus.leanstream.co/CKQBFM"],
  452. ["CFMJAM", "https://corus.leanstream.co/CFMJAM-MP3?type=.mp3"],
  453. ["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],
  454. ["HOT899", "https://newcap.leanstream.co/CIHTFM"],
  455. ["HOT997", "https://ice5.securenetsystems.net/KHHK"]
  456. ];
  457. window.CTSNameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  458. window.CTSChatCSS = [
  459. [ //STYLE #0
  460. ["#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;}"],
  461. [".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;}"],
  462. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  463. ],
  464. [ //STYLE #1
  465. ["#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;}"],
  466. [".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;}"],
  467. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
  468. ],
  469. [ //STYLE #2
  470. ["#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;}"],
  471. [".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;}"],
  472. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
  473. ],
  474. [ //STYLE #3
  475. ["#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;}"],
  476. [".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;}"],
  477. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
  478. ],
  479. [ //STYLE #4
  480. ["#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;}"],
  481. [".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;}"],
  482. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
  483. ],
  484. [ //STYLE #5
  485. ["#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;}"],
  486. [".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;}"],
  487. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
  488. ],
  489. [ //STYLE #6
  490. ["#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;}"],
  491. [".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;}"],
  492. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
  493. ],
  494. [ //STYLE #7
  495. ["#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;}"],
  496. [".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;}"],
  497. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
  498. ],
  499. [ //STYLE #8
  500. ["#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;}"],
  501. [".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;}"],
  502. ["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
  503. ],
  504. [ //STYLE #9
  505. ["#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;}"],
  506. [".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;}"],
  507. ["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
  508. ],
  509. [ //STYLE #10
  510. ["#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;}"],
  511. [".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;}"],
  512. ["#sidemenu{background: linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)100%);}"]
  513. ],
  514. [ //STYLE #11
  515. ["#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;}"],
  516. [".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;}"],
  517. ["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}"]
  518. ],
  519. [ //STYLE #12
  520. [".stackmessage{background:#ffffff}#chat-wrapper{background: #fff!important;}.message>.systemuser{color:#FFFFFF}#cts-chat-content>.message{background:#00000000}.message{color:#000000;text-shadow: unset;}"],
  521. [".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;}"],
  522. ["#sidemenu{background: #2d373a;}"]
  523. ],
  524. [ //STYLE #13
  525. ["#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;}"],
  526. [".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;}"],
  527. ["#sidemenu{background: url(https://i.imgur.com/LCOulGB.png) repeat-x bottom;}"]
  528. ],
  529. [ //STYLE #14
  530. ["#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;}"],
  531. [".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;}"],
  532. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  533. ],
  534. [ //STYLE #14
  535. ["#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;}"],
  536. [".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;}"],
  537. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  538. ],
  539. [ //STYLE #15
  540. ["#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;}"],
  541. [".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;}"],
  542. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  543. ],
  544. [ //STYLE #16
  545. ["#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;}"],
  546. [".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;}"],
  547. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  548. ],
  549. [ //STYLE #17
  550. ["#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;}"],
  551. [".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;}"],
  552. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  553. ],
  554. [ //STYLE #18
  555. ["#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;}"],
  556. [".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;}"],
  557. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  558. ],
  559. [ //STYLE #19
  560. ["#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;}"],
  561. [".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;}"],
  562. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  563. ],
  564. [ //STYLE #20
  565. ["#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;}"],
  566. [".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;}"],
  567. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  568. ],
  569. [ //STYLE #21
  570. ["#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;}"],
  571. [".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;}"],
  572. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  573. ],
  574. [ //STYLE #22
  575. ["#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;}"],
  576. [".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;}"],
  577. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  578. ],
  579. [ //STYLE #23
  580. ["#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;}"],
  581. [".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;}"],
  582. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  583. ],
  584. [ //STYLE #24
  585. ["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: #202628!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  586. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:#202628;}#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;}"],
  587. ["#sidemenu{background:#202628;}"]
  588. ]
  589. ];
  590. //INSERT SCRIPT
  591. var script = document.createElement("script"),
  592. elem = document.getElementsByTagName("script")[0];
  593. script.text = 'function UserProfileView(username) {if (username === "") {return;}var profilefetch = new XMLHttpRequest();profilefetch.onreadystatechange = function() {if (this.readyState == 4 && this.status == 200){window.ShowProfile(profilefetch.responseText);}};profilefetch.open("GET", "https://tinychat.com/api/v1.0/user/profile?username="+username, true);profilefetch.send();}window.StationSelected = 0,\n window.StationPlay = false,\n window.StationVol = 1;\nfunction VolStation(elem, vol){\n window.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 window.StationElem.volume = StationVol*window.CTSRoomVolume;\nStationVolElem.style.width=((StationVol * 100)+"%");}\nfunction PlayPauseStation(elem) {\n var StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n window.StationElem=elem.parentElement.nextSibling;\nvar StationDescElem=elem.parentElement.querySelector(".music-radio-info>.description");\n StationPlay=!StationPlay;\n if (StationPlay) {\n window.StationElem.volume = StationVol*window.CTSRoomVolume;\n if(!window.CTSMuted) window.StationElem.play();\n StationPlayPauseBtn.innerText="❚❚"; StationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n} else {\n window.StationElem.pause();\nStationPlayPauseBtn.innerText="▶";\n StationDescElem.innerText = ("Paused: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);}\n}\nfunction SeekStation(elem, direction) {\n window.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 window.StationElem.pause();\n window.StationElem.setAttribute("src", window.CTSRadioStations[StationSelected][1]);\n window.StationElem.load();\n window.StationElem.volume = StationVol*window.CTSRoomVolume;\nStationPlayPauseBtn.innerText="❚❚";\n if(!window.CTSMuted) window.StationElem.play();\nStationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n}';
  594. elem.parentNode.insertBefore(script, elem);
  595. //LOCALSETTINGS
  596. CTS.enablePMs = window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enablePMs;
  597.  
  598. //TTS (TEXT-TO-SPEECH)
  599. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && "speechSynthesis" in window) {
  600. CTS.TTS.synth = window.speechSynthesis;
  601. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  602. }
  603. //ELEMENT DEFINE
  604. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  605. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  606. TextAreaElement = ChatLogElement.querySelector("#textarea");
  607. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  608. MicrophoneElement = document.createEvent("MouseEvent");
  609. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  610. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  611. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  612. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  613. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  614. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  615. var insert = TitleElement.querySelector('span[title="Settings"]');
  616. VideoListElement.querySelector("#videos-header").appendChild(insert);
  617. //INSERT HTML/CSS
  618. if (!CTS.Project.isTouchScreen) {
  619. insert = VideoListElement.querySelector("#videos-footer-broadcast-wrapper");
  620. VideoListElement.querySelector("#videolist").appendChild(insert);
  621. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  622. 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>');
  623. TitleCSS += "span[title=\"Follow\"], span[title=\"Share room\"]{display:none!important;}";
  624. } else {
  625. VideoCSS = ".video>div{border-radius:10px;}#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{top:38px;}#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{top:28px;right:0;background:#181d1e;width: 92px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsdrop-content button:hover, .ctsoptions:hover{background:#53b6ef}.ctsdrop-content button.hidden{display:none;}.ctsdrop-content button., .ctsoptions{line-height: 22px;color: white;width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #181d1e75;border: none;padding: 5% 0;display: inline-block;}";
  626. MainCSS += "body{overflow:auto;}";
  627. UserListCSS += "#contextmenu{top:unset;bottom:0;left:0;}";
  628. }
  629. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  630. StyleSet();
  631. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  632. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  633. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  634. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  635. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  636. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  637. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  638. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  639. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  640. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  641. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  642. VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin", "<button style=\"display:" + ((CTS.Project.isTouchScreen) ? "none" : "block") + "\" class=\"tcsettings\">←</button><input id=\"cts-vol-control\" type=\"range\" min=\"0\" max=\"100\" value=\"100\" step=\"1\" oninput=\"window.AdjustRoomVolume(this.value)\" onchange=\"window.AdjustRoomVolume(this.value)\" style=\"min-width: 100px;\"><span id=\"videos-header-sound-cts\"><svg id=\"videos-header-sound-mute-cts\" style=\"padding: 5px 0;\" width=\"20\" height=\"26\" viewBox=\"0 0 20 26\" xmlns=\"http://www.w3.org/2000/svg\" class=\"\"><path d=\"M533.31 159.634c.933.582 1.69.166 1.69-.94v-19.388c0-1.1-.76-1.52-1.69-.94l-6.724 4.187c-.934.58-2.587 1.053-3.687 1.053h-1.904c-1.102 0-1.996.9-1.996 2.004v6.78c0 1.107.895 2.004 1.996 2.004h1.903c1.1 0 2.754.473 3.686 1.054l6.723 4.186z\" transform=\"translate(-517 -136)\" stroke=\"#41b7ef\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"></path></svg></span>");
  643. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  644. VideoListElement.querySelector("#videolist").insertAdjacentHTML("afterbegin", '<div class="ctsdrop"><button class="ctsoptions" title="CTS Options">🔧</button><div class="ctsdrop-content"><div style="height:6px;background:#624482;"></div><button id="BackgroundUpdateRight" class="ctsoptions" title="Background">➖</button><button id="BackgroundUpdateLeft" class="ctsoptions" title="Background">➕</button><div style="height:6px;background:#624482;"></div><button id="FontSizeUpdate" class="ctsoptions" title="Font Size">🔍</button><button id="ChatCompact" class="ctsoptions" title="Compact Chat">💬</button><div style="height:6px;background:#624482;"></div>' + ((!CTS.ThemeChange) ? '<button id="ChatWidthToggled" class="ctsoptions" title="Chat Resize">↔</button><button id="ChatHeightToggled" class="ctsoptions" title="Chat Resize">↕</button><div style="height:6px;background:#624482;"></div>' : '') + '<button id="ChatColor" class="ctsoptions" title="Chat Style">🔨</button><button id="CameraBorderToggled" class="ctsoptions" title="Camera Border">📷</button><button id="FeaturedToggled" class="ctsoptions" title="Featured Resize">📺</button><button id="PerformanceModeToggled" class="ctsoptions" title="Performance Mode">🎮</button>' + ((!CTS.Project.isTouchScreen) ? '<div style="height:6px;background:#624482;"></div><button id="ThemeChange" class="ctsoptions" title="Switch CTS Theme Mode">🔄</button></div></div>' : ''));
  645. insert = UserListElement.querySelector("#button-banlist");
  646. VideoListElement.querySelector("#videos-header").appendChild(insert);
  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.YouTube = {
  659. Player: undefined, Volume: 100, Ready: false, BehindChat: false, Playing: false,LastKnownMute:false, Muted: false, Popup: null, Offset: 0,PlayerStateOK:false,
  660. Init: function() {
  661. if (CTS.YouTube.CurrentTrack.ID != undefined) {
  662. if (window.YouTube.Popup !== null) {
  663. window.YouTube.Popup.location.href = "https://www.youtube.com/watch?v=" + CTS.YouTube.CurrentTrack.ID+"&autoplay=1&t="+Math.trunc(CTS.YouTube.CurrentTrack.offset+2);
  664. } else if (window.YouTube.Ready) {
  665. // CONTAINER
  666. var element = document.createElement("div");
  667. element.setAttribute("id", "playerYT");
  668. var query = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content").insertBefore(element, SideMenuElement.querySelector("#sidemenu-content").childNodes[0] || null) : ChatListElement.insertBefore(element, ChatListElement.childNodes[0] || null);
  669. // OVERLAY
  670. element = document.createElement("div");
  671. element.setAttribute("class", "overlay");
  672. element.innerHTML = '<div class="volume"></div><div class="duration"></div><button id="yt_voldown">🔉</button><button id="yt_volup">🔊</button><button id="yt_volmute">🔇</button>' + ((!CTS.Project.isTouchScreen) ? '<button id="yt_fullscreen">⛶</button><button id="yt_pip">PIP</button>' + ((!CTS.ThemeChange) ? '<button id="yt_behindchat">↸</button>' : '') : '') + ((CTS.Me.mod) ? '<button id="yt_close" style="float:right;">X</button>' : '');
  673. query.insertBefore(element, query.childNodes[0]);
  674. // EVENT LISTENERS
  675. query.querySelector("#yt_voldown").addEventListener("click", YouTubeVolumeDown, true);
  676. query.querySelector("#yt_volup").addEventListener("click", YouTubeVolumeUp, true);
  677. query.querySelector("#yt_volmute").addEventListener("click", YouTubeMute, true);
  678. if (!CTS.ThemeChange && !CTS.Project.isTouchScreen) query.querySelector("#yt_behindchat").addEventListener("click", YouTubeBehindChat, true);
  679. if (!CTS.Project.isTouchScreen) query.querySelector("#yt_fullscreen").addEventListener("click", YouTubeFullScreen, true);
  680. if (!CTS.Project.isTouchScreen) query.querySelector("#yt_pip").addEventListener("click", YouTubePIP, true);
  681. if (CTS.Me.mod) query.querySelector("#yt_close").addEventListener("click", YouTubeClose, true);
  682. // PLAYER
  683. element = document.createElement("div");
  684. element.setAttribute("id", "player");
  685. query = query.insertBefore(element, query.childNodes[0]);
  686. // Convert To Video
  687. window.YouTube.Player = new window.YT.Player(query, { width: 200, height: 200, videoId: CTS.YouTube.CurrentTrack.ID, playerVars: { autohide: 0, autoplay: 1, controls: 0, disablekb: 1, enablejsapi: 1, fs: 1, iv_load_policy: 3, modestbranding: 1}, events: {'onReady': window.YouTube.onPlayerReady, 'onStateChange': window.YouTube.onPlayerStateChange}});
  688. window.YouTube.Playing = true;
  689. } else {
  690. setTimeout(window.YouTube.Init, 250);
  691. }
  692. }
  693. },
  694. onPlayerReady: function(event) {
  695. event.target.setVolume(window.YouTube.Volume);
  696. event.target.seekTo(Math.trunc(CTS.YouTube.CurrentTrack.offset)+2);
  697. event.target.playVideo();
  698. YouTubeVolumeIndicator();
  699. YouTubeBehindChat(true);
  700. YouTubeMute(true);
  701. },
  702. onPlayerStateChange: function(event) {
  703. if (event.data == 1) {
  704. window.YouTube.PlayerStateOK = true;
  705. } else {
  706. window.YouTube.PlayerStateOK = false;
  707. }
  708. },
  709. stopVideo: function() {
  710. if (window.YouTube.Playing) {
  711. window.YouTube.Playing = false;
  712. var elem = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement;
  713. elem.querySelector("#yt_voldown").removeEventListener("click", YouTubeVolumeDown, true);
  714. elem.querySelector("#yt_volmute").removeEventListener("click", YouTubeMute, true);
  715. if (!CTS.ThemeChange && !CTS.Project.isTouchScreen) elem.querySelector("#yt_behindchat").removeEventListener("click", YouTubeBehindChat, true);
  716. if (!CTS.Project.isTouchScreen) elem.querySelector("#yt_fullscreen").removeEventListener("click", YouTubeFullScreen, true);
  717. if (CTS.Me.mod) elem.querySelector("#yt_close").removeEventListener("click", YouTubeClose, true);
  718. Remove(elem, "#playerYT");
  719. }
  720. }
  721. };
  722. window.onYouTubeIframeAPIReady = function() {
  723. window.YouTube.Ready = true;
  724. };
  725. window.AdjustRoomVolume = function(val) {
  726. window.CTSRoomVolume = val / 100;
  727. window.CTSMuted = (window.CTSRoomVolume == 0)?true:false;
  728. Cameras();
  729. VideoListElement.querySelector("#videos-header-sound-cts path").setAttribute('style', ('stroke:'+((window.CTSMuted)?'#FF4136':'#41b7ef')));
  730. if (window.YouTube.PlayerStateOK) {
  731. window.YouTube.Player.setVolume((window.CTSMuted)?0:(window.YouTube.Volume*(window.CTSRoomVolume)));
  732. if (!window.CTSMuted && !window.YouTube.LastKnownMute) window.YouTube.Player.unMute();
  733. }
  734. VideoListElement.querySelector("#music-radio-audio").volume = (window.CTSMuted)?0:(window.StationVol*(window.CTSRoomVolume));
  735. if (window.StationPlay) VideoListElement.querySelector("#music-radio-audio").play();
  736. };
  737. window.TinychatApp.BLL.Videolist.prototype.blurOtherVids = function() {};
  738. window.TinychatApp.BLL.SoundPlayer.playMessage = function() {};
  739. window.TinychatApp.BLL.SoundPlayer.playGift = function() {};
  740. window.TinychatApp.BLL.User.isSubscription = function() {
  741. return true;
  742. };
  743. window.TinychatApp.BLL.User.canUseFilters = function() {
  744. return true;
  745. };
  746. window.TinychatApp.BLL.MediaConnection.prototype.Close = function() {
  747. RTC(this);
  748. };
  749. window.TinychatApp.BLL.ChatRoom.prototype.sendPushForUnreadPrivateMessage = function() {};
  750. if (!CTS.Project.isTouchScreen) {
  751. window.TinychatApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  752. var b = this,
  753. d = this.settings.getSettings();
  754. if (d.video === null) {
  755. return void this.app.MediaSettings(() => {
  756. this.BroadcastStart();
  757. });
  758. }
  759. this.videolist.AddingVideoSelf(this.self_handle);
  760. var e = {};
  761. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  762. e.audio = true;
  763. e.video = { width: { min: 320, max: 4096 }, height: { min: 240, max: 2160 }, frameRate: { min: 15, ideal: 30, max: 60 } };
  764. } else {
  765. navigator.mediaDevices.enumerateDevices().then(g => {
  766. var h = false;
  767. var len = g.length;
  768. for (var c = 0; c < len; c++) {
  769. if (g[c].kind === "videoinput") {
  770. if (e.video === void 0) e.video = {width: {min: 320,max: 4096},height: {min: 240,max: 2160},frameRate: {min: 15,ideal: 30,max: 60}};
  771. if (h) {
  772. d.video = g[c];
  773. h = false;
  774. this.settings.saveSettings(d);
  775. } else if (d.video === null) {
  776. d.video = g[c];
  777. this.settings.saveSettings(d);
  778. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  779. e.video.deviceId = {exact: d.video.deviceId};
  780. } else if (d.video.deviceId === a) {
  781. h = true;
  782. }
  783. }
  784. if (g[c].kind === "audioinput") {
  785. if (e.audio === void 0) e.audio = {};
  786. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) e.audio = {deviceId: {exact: d.audio.deviceId}};
  787. }
  788. }
  789. if (e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
  790. let i = navigator.mediaDevices.getSupportedConstraints();
  791. for (let a in i) {
  792. if (i.hasOwnProperty(a) && "echoCancellation" == a && e.audio) e.audio[a] = this.settings.isAcousticEchoCancelation();
  793. }
  794. if (!(e.audio || e.video)) {
  795. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  796. } else if ("https:" === location.protocol || this.app.isDebug()) {
  797. debug("BROADCAST", "Initiating Media...");
  798. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  799. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  800. b.mediaLastConstraints = e;
  801. navigator.mediaDevices.getUserMedia(e).then(m => {
  802. b.onMediaSuccessCallback(m);
  803. });
  804. }
  805. }).catch(er => {
  806. debug("CAMERA::ERROR", er);
  807. });
  808. }
  809. };
  810. }
  811. window.TinychatApp.BLL.Userlist.prototype.ignore = function(a) {
  812. var b = ((a.isUsername) ? a.username : a.nickname);
  813. if (this.isIgnored(a) || this.ignored.push(b)) {
  814. var c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  815. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
  816. this.app.showToast(b + " ignored successfully till they leave or you refresh!");
  817. if (!a.isUsername) {
  818. CTS.TempIgnoreNickList.push(b.toUpperCase());
  819. } else {
  820. CTS.TempIgnoreUserList.push(b.toUpperCase());
  821. }
  822. }
  823. };
  824. window.TinychatApp.BLL.Userlist.prototype.unignore = function(a) {
  825. var b = ((a.isUsername) ? a.username : a.nickname),
  826. index = this.ignored.indexOf(b);
  827. if (index != -1) this.ignored.splice(index, 1);
  828. if (!a.isUsername) {
  829. index = CTS.TempIgnoreNickList.indexOf(b.toUpperCase());
  830. if (index != -1) CTS.TempIgnoreNickList.splice(index, 1);
  831. } else {
  832. index = CTS.TempIgnoreUserList.indexOf(b.toUpperCase());
  833. if (index != -1) CTS.TempIgnoreUserList.splice(index, 1);
  834. }
  835. var e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  836. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
  837. this.app.showToast(a.username + " unignored");
  838. };
  839. if (CTS.StorageSupport) {
  840. window.TinychatApp.BLL.SettingsFeature.prototype.getSettings = function() {
  841. var A = this._get("tinychat_settings");
  842. try {
  843. A = Object.assign(new window.TinychatApp.DAL.SettingsEntity(), JSON.parse(A));
  844. } catch (E) {}
  845. if (A !== undefined) {
  846. CTS.enableSound = A.enableSound;
  847. if (CTS.enablePMs !== A.enablePMs) {
  848. CTS.enablePMs = A.enablePMs;
  849. PMShow();
  850. }
  851. }
  852. return ((void 0 == A || "object" !== typeof A) && (A = new window.TinychatApp.DAL.SettingsEntity()) || A);
  853. };
  854. }
  855. if (!CTS.Project.isTouchScreen) {
  856. window.TinychatApp.BLL.ChatRoom.prototype.prepareStream = function(a) {
  857. function b() {
  858. if (null == c.mediaStreamCanvas) {
  859. if (CTS.AnimationFrameWorker != undefined) {
  860. CTS.AnimationFrameWorker.terminate();
  861. CTS.AnimationFrameWorker = undefined;
  862. }
  863. CTS.Me.broadcasting = false;
  864. return;
  865. }
  866. d.clearRect(0, 0, c.mediaStreamCanvas.width, c.mediaStreamCanvas.height);
  867. var a = c.mediaStreamVideo.videoHeight,
  868. e = c.mediaStreamVideo.videoWidth;
  869. c.mediaStreamCanvas.width = e;
  870. c.mediaStreamCanvas.height = a;
  871. window.TinychatApp.BLL.VideoFilters.getFilter(CTS.MediaStreamFilter).apply(d, e, a);
  872. d.drawImage(c.mediaStreamVideo, 0, 0, e, a, 0, 0, c.mediaStreamCanvas.width, c.mediaStreamCanvas.height);
  873. }
  874. this.mediaStreamOrigin = a;
  875. this.mediaStreamVideo = document.createElement("video");
  876. this.mediaStreamVideo.srcObject = this.mediaStreamOrigin;
  877. this.mediaStreamVideo.pause();
  878. this.mediaStreamVideo.oncanplay = function() {
  879. CTS.Me.broadcasting = true;
  880. if (CTS.WorkersAllowed) {
  881. if (CTS.AnimationFrameWorker == undefined) {
  882. CTS.AnimationFrameWorker = new Worker(window.URL.createObjectURL(new Blob(["function Counter() {self.postMessage(\"0\");}setInterval(function(){Counter();}, 1e3/" + CTS.FPS + ");"])));
  883. CTS.AnimationFrameWorker.onmessage = function() {
  884. b();
  885. };
  886. }
  887. } else {
  888. requestAnimationFrame(b);
  889. }
  890. };
  891. this.mediaStreamVideo.autoplay = !0;
  892. this.mediaStreamVideo.muted = !0;
  893. this.mediaStreamCanvas = document.createElement("canvas");
  894. var c = this,
  895. d = this.mediaStreamCanvas.getContext("2d");
  896. this.mediaStreamVideo.play();
  897. var e = this.mediaStreamCanvas.captureStream(CTS.FPS);
  898. return (e.addTrack(this.mediaStreamOrigin.getAudioTracks()[0]) || e);
  899. };
  900. }
  901. window.TinychatApp.BLL.ChatRoom.prototype.applyFilter = function(a) {
  902. this.mediaStreamFilter = a;
  903. CTS.MediaStreamFilter = a;
  904. Save("MediaStreamFilter", CTS.MediaStreamFilter);
  905. };
  906. window.TinychatApp.BLL.Videolist.prototype.toggleHiddenVW = function(a) {
  907. var b = window.TinychatApp.getInstance().defaultChatroom._videolist.items.indexOf(a);
  908. if (b != -1) {
  909. var username = a.userentity.username.toUpperCase(),
  910. index = CTS.HiddenCameraList.indexOf(username.toUpperCase());
  911. if (username === "GUEST") {
  912. a.hidden = !a.hidden;
  913. } else {
  914. if (a.hidden) {
  915. a.hidden = false;
  916. if (index !== -1) {
  917. //REMOVE
  918. if (arguments[1] === undefined) {
  919. debug("HIDDENCAMERALIST::", "REMOVE USER " + username + " FROM HIDDENCAMERALIST");
  920. Alert(GetActiveChat(), "✓ Removing " + username + " from hiddencameralist!");
  921. CommandList.hiddencameraremove(index);
  922. }
  923. }
  924. } else {
  925. a.hidden = true;
  926. if (index === -1) {
  927. //ADD
  928. if (arguments[1] === undefined) {
  929. debug("HIDDENCAMERALIST::", "ADD USER " + username + " TO HIDDEN CAMERA LIST");
  930. Alert(GetActiveChat(), "✓ Adding " + username + " to hidden camera list!");
  931. CommandList.hiddencameraadd(username);
  932. }
  933. }
  934. }
  935. }
  936. a.mute = ((CTS.Me.username === username) ? true : a.mute);
  937. window.TinychatApp.getInstance().defaultChatroom._videolist._pauseMediaStream(a.mediastream, a.hidden);
  938. if (!a.hidden) window.TinychatApp.getInstance().defaultChatroom._videolist._muteMediaStream(a.mediastream, a.mute);
  939. let d = new window.TinychatApp.BLL.VideolistEvent(window.TinychatApp.BLL.VideolistAction.Update, a, b);
  940. window.TinychatApp.getInstance().defaultChatroom._videolist.EventBus.broadcast(window.TinychatApp.BLL.VideolistEvent.ID, d);
  941. }
  942. };
  943. window.fullscreenManager.status = () => {
  944. if (CTS.isFullScreen !== (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen)) {
  945. CTS.isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
  946. // Fix FullScreen
  947. MainElement.querySelector("#room").classList.toggle("full-screen");
  948. }
  949. return document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
  950. };
  951. //REMOVE
  952. Remove(ChatLogElement, 'span[id="input-unread"]');
  953. Remove(ChatLogElement, "#chat-content");
  954. Remove(VideoListElement, "#youtube");
  955. Remove(VideoListElement, "#videos-header-sound");
  956. //SETTINGS PREPARE
  957. if (CTS.enablePMs === false) PMShow();
  958. //LOAD
  959. CTSRoomLoad();
  960. }
  961.  
  962. function CTSRoomLoad() {
  963. var element;
  964. //EVENT LISTENERS
  965. if (!CTS.ThemeChange) {
  966. // BOOT UP OG THEME
  967. var finishoff = false;
  968. while (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter || CTS.OGStyle.SavedWidth !== CTS.OGStyle.WidthCounter) {
  969. if (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter) {
  970. ChatHeightToggled();
  971. } else {
  972. finishoff = true;
  973. }
  974. if (CTS.OGStyle.SaveWidth !== CTS.OGStyle.WidthCounter && finishoff) ChatWidthToggled();
  975. }
  976. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  977. ChatHeightToggled();
  978. Save("OGStyleHeight", CTS.OGStyle.HeightCounter);
  979. }, {
  980. passive: true
  981. });
  982. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  983. ChatWidthToggled();
  984. Save("OGStyleWidth", JSON.stringify(CTS.OGStyle.WidthCounter));
  985. }, {
  986. passive: true
  987. });
  988. } else {
  989. if (!CTS.Project.isTouchScreen) {
  990. element = document.createElement("div");
  991. element.setAttribute("id", "chat-hide");
  992. ChatLogElement.querySelector("#chat-wider").parentNode.insertBefore(element, ChatLogElement.querySelector("#chat-wider"));
  993. ChatLogElement.querySelector("#chat-hide").addEventListener("click", function() {
  994. ChatHide();
  995. }, {
  996. passive: true
  997. });
  998. }
  999. }
  1000. element = document.createElement("button");
  1001. element.setAttribute("id", "chat-download");
  1002. element.setAttribute("class", "chat-button");
  1003. element.setAttribute("title", "Download copy of chat-log");
  1004. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1005. ChatLogElement.querySelector("#chat-download").textContent = "📋";
  1006. ChatLogElement.querySelector("#chat-download").addEventListener("click", function() {
  1007. var len = CTS.UserList.length,
  1008. t = "Users : " + len + "\n",
  1009. c;
  1010. for (c = 0; c < len; c++) {
  1011. if (c) {
  1012. t += ", ";
  1013. if (c % 10 === 0) t += "\n";
  1014. }
  1015. t += CTS.UserList[c].username + " (" + CTS.UserList[c].nick + ")";
  1016. }
  1017. t += "\n\n";
  1018. len = CTS.Message[GetActiveChat()].length;
  1019. for (c = 0; c < len; c++) t += "[" + CTS.Message[GetActiveChat()][c].time + "][" + CTS.Message[GetActiveChat()][c].username + "(" + CTS.Message[GetActiveChat()][c].nick + ")]: " + (CTS.Message[GetActiveChat()][c].msg.replace(/(\r\n|\n|\r)/gm, "") + "\n");
  1020. Export("TinyChat_" + CTS.Room.Name.toUpperCase() + " " + DateTime() + ".log", "Room : " + CTS.Room.Name + "\n" + t);
  1021. }, {
  1022. passive: true
  1023. });
  1024. element = document.createElement("button");
  1025. element.setAttribute("id", "safelist-export");
  1026. element.setAttribute("class", "chat-button");
  1027. element.setAttribute("title", "Export your safelist");
  1028. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1029. ChatLogElement.querySelector("#safelist-export").textContent = "📤";
  1030. ChatLogElement.querySelector("#safelist-export").addEventListener("click", function() {
  1031. if (localStorage.getItem("CTS_AKB") !== null) Export("CTS_Safelist_" + DateTime() + ".backup", JSON.stringify(CTS.SafeList));
  1032. }, {
  1033. passive: true
  1034. });
  1035. element = document.createElement("label");
  1036. element.setAttribute("for", "safelist-import");
  1037. element.setAttribute("class", "chat-button");
  1038. element.setAttribute("title", "Import your safelist");
  1039. element.setAttribute("id", "safelist-import-label");
  1040. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1041. ChatLogElement.querySelector("#safelist-import-label").textContent = "📥";
  1042. element = document.createElement("input");
  1043. element.setAttribute("type", "file");
  1044. element.setAttribute("id", "safelist-import");
  1045. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1046. ChatLogElement.querySelector("#safelist-import").addEventListener('change', function(e) {
  1047. var file = ChatLogElement.querySelector("#safelist-import").files[0],
  1048. reader = new FileReader();
  1049. reader.readAsText(file);
  1050. reader.onload = function() {
  1051. try {
  1052. var resp = JSON.parse(reader.result);
  1053. if (resp !== null) {
  1054. var len2 = resp.length,
  1055. counter = 0;
  1056. for (var i = 0; i < len2; i++) {
  1057. if (CheckUserNameStrict(resp[i]) && !CTS.SafeList.includes(resp[i].toUpperCase())) {
  1058. CTS.SafeList.push(resp[i].toUpperCase());
  1059. counter++;
  1060. }
  1061. }
  1062. Save("AKB", JSON.stringify(CTS.SafeList));
  1063. Alert(GetActiveChat(), "✓ Backup looks good! " + counter + "users added to SafeList!");
  1064. }
  1065. } catch (e) {
  1066. debug("BACKUP::ERROR", e);
  1067. }
  1068. };
  1069. reader.onerror = function() {
  1070. debug("BACKUP::ERROR", "Something went wrong...");
  1071. };
  1072. });
  1073. element = document.createElement("button");
  1074. element.setAttribute("id", "chat-export");
  1075. element.setAttribute("class", "chat-button");
  1076. element.setAttribute("title", "Export your saved CTS settings");
  1077. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1078. ChatLogElement.querySelector("#chat-export").textContent = "📤";
  1079. ChatLogElement.querySelector("#chat-export").addEventListener("click", function() {
  1080. var tempobj = {};
  1081. for (var i = 0; i < localStorage.length; i++) {
  1082. if (localStorage.key(i).substring(0, 4) == 'CTS_') tempobj[localStorage.key(i)] = localStorage[localStorage.key(i)];
  1083. }
  1084. Export("CTS_Settings_" + DateTime() + ".backup", JSON.stringify(tempobj));
  1085. }, {
  1086. passive: true
  1087. });
  1088. element = document.createElement("label");
  1089. element.setAttribute("for", "chat-import");
  1090. element.setAttribute("class", "chat-button");
  1091. element.setAttribute("title", "Import your saved CTS settings");
  1092. element.setAttribute("id", "chat-import-label");
  1093. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1094. ChatLogElement.querySelector("#chat-import-label").textContent = "📥";
  1095. element = document.createElement("input");
  1096. element.setAttribute("type", "file");
  1097. element.setAttribute("id", "chat-import");
  1098. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1099. ChatLogElement.querySelector("#chat-import").addEventListener('change', function(e) {
  1100. var file = ChatLogElement.querySelector("#chat-import").files[0],
  1101. reader = new FileReader();
  1102. reader.readAsText(file);
  1103. reader.onload = function() {
  1104. try {
  1105. var resp = JSON.parse(reader.result);
  1106. if (resp !== null) {
  1107. var keys = Object.keys(resp),
  1108. ready = true;
  1109. Alert(GetActiveChat(), "- Scanning backup!");
  1110. for (var a = 0; a < keys.length; a++) {
  1111. if (keys[a].substring(0, 4) !== 'CTS_') ready = false;
  1112. }
  1113. if (ready) {
  1114. Alert(GetActiveChat(), "✓ Backup looks good!");
  1115. var localkeys = Object.keys(localStorage),
  1116. locallen = localkeys.length;
  1117. Alert(GetActiveChat(), "- Clearing Storage!");
  1118. for (var b = 0; b < locallen; b++) {
  1119. if (localkeys[b].substring(0, 4) === "CTS_") localStorage.removeItem(localkeys[b]);
  1120. }
  1121. Alert(GetActiveChat(), "✓ Storage cleared!\n- Applying CTS Backup!");
  1122. for (var c = 0; c < keys.length; c++) {
  1123. localStorage.setItem(keys[c], resp[keys[c]]);
  1124. }
  1125. Alert(GetActiveChat(), "✓ All done!\n\nYou'll auto-refresh shortly!");
  1126. setTimeout(function() {
  1127. location.reload();
  1128. }, 3000);
  1129. }
  1130. }
  1131. } catch (e) {
  1132. debug("BACKUP::ERROR", e);
  1133. }
  1134. };
  1135. reader.onerror = function() {
  1136. debug("BACKUP::ERROR", "Something went wrong...");
  1137. };
  1138. });
  1139.  
  1140. if (!CTS.Project.isTouchScreen) {
  1141. VideoListElement.querySelector("#ThemeChange").addEventListener("click", function() {
  1142. CTS.ThemeChange = !CTS.ThemeChange;
  1143. Save("ThemeChange", JSON.stringify(CTS.ThemeChange));
  1144. location.reload();
  1145. }, {
  1146. passive: true
  1147. });
  1148. }
  1149. VideoListElement.querySelector("#videos-header-sound-mute-cts").addEventListener("click", function() {
  1150. window.CTSMuted = !window.CTSMuted;
  1151. VideoListElement.querySelector("#videos-header-sound-cts path").setAttribute('style', ('stroke:'+((window.CTSMuted)?'#FF4136':'#41b7ef')));
  1152. VideoListElement.querySelector("#cts-vol-control").value = window.CTSMuted?0:(window.CTSRoomVolume*100);
  1153. var radioelem = VideoListElement.querySelector("#music-radio-audio");
  1154. if (radioelem) radioelem[(window.CTSMuted)?"pause":(window.StationPlay)?"play":"pause"]();
  1155. window.YouTube.Muted = window.CTSMuted;
  1156. if (window.YouTube.Ready && window.YouTube.PlayerStateOK) window.YouTube.Player[(window.CTSMuted)?"mute":(window.YouTube.LastKnownMute)?"mute":"unMute"]();
  1157. Cameras();
  1158. }, {
  1159. passive: true
  1160. });
  1161. VideoListElement.querySelector("#PerformanceModeToggled").addEventListener("click", function() {
  1162. if (CTS.ChatDisplay) {
  1163. CTS.PerformanceMode = !CTS.PerformanceMode;
  1164. Save("PerformanceMode", JSON.stringify(CTS.PerformanceMode));
  1165. PerformanceModeInit(CTS.PerformanceMode);
  1166. }
  1167. }, {
  1168. passive: true
  1169. });
  1170. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  1171. CTS.Featured = !CTS.Featured;
  1172. Save("Featured", JSON.stringify(CTS.Featured));
  1173. FeaturedCameras(CTS.Featured);
  1174. Resize();
  1175. }, {
  1176. passive: true
  1177. });
  1178. VideoListElement.querySelector("#CameraBorderToggled").addEventListener("click", function() {
  1179. CTS.CameraBorderToggle = !CTS.CameraBorderToggle;
  1180. Save("CameraBorderToggle", JSON.stringify(CTS.CameraBorderToggle));
  1181. Cameras();
  1182. Resize();
  1183. }, {
  1184. passive: true
  1185. });
  1186. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  1187. CTS.ChatStyleCounter++;
  1188. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1189. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1190. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1191. var len = window.CTSChatCSS.length - 1;
  1192. if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
  1193. StyleSet();
  1194. Save("ChatStyle", CTS.ChatStyleCounter);
  1195. }, {
  1196. passive: true
  1197. });
  1198. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  1199. UpdateScroll(1, true);
  1200. CheckUnreadMessage();
  1201. }, {
  1202. passive: true
  1203. });
  1204. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  1205. var element = event.target;
  1206.  
  1207. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage(true);
  1208. }, {
  1209. passive: true
  1210. });
  1211. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  1212. var element = event.target;
  1213. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  1214. }, {
  1215. passive: true
  1216. });
  1217. if (CTS.NotificationToggle === 0) {
  1218. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  1219. passive: true
  1220. });
  1221. }
  1222. VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
  1223. var arg;
  1224. if (this.innerText === "→") {
  1225. this.innerText = "←";
  1226. arg = "block";
  1227. } else {
  1228. this.innerText = "→";
  1229. arg = "none";
  1230. }
  1231. if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
  1232. //VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
  1233. VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
  1234. VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
  1235. VideoListElement.querySelector("#videos-header-sound-cts").style.display = arg;
  1236. VideoListElement.querySelector("#cts-vol-control").style.display = arg;
  1237. }, {
  1238. passive: true
  1239. });
  1240. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  1241. if (!Addon.active("BGIMG")) {
  1242. CTS.MainBackgroundCounter++;
  1243. if (CTS.MainBackgroundCounter === window.CTSImages.length) CTS.MainBackgroundCounter = 0;
  1244. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  1245. document.body.style.background = background;
  1246. Save("MainBackground", background);
  1247. }
  1248. }, {
  1249. passive: true
  1250. });
  1251. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  1252. if (!Addon.active("BGIMG")) {
  1253. CTS.MainBackgroundCounter--;
  1254. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = window.CTSImages.length - 1;
  1255. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  1256. document.body.style.background = background;
  1257. Save("MainBackground", background);
  1258. }
  1259. }, {
  1260. passive: true
  1261. });
  1262. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  1263. CTS.FontSize += 5;
  1264. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  1265. Save("FontSize", CTS.FontSize);
  1266. TextAreaElement.style.fontSize = (CTS.FontSize - 4) + "px";
  1267. LoadMessage();
  1268. }, {
  1269. passive: true
  1270. });
  1271. VideoListElement.querySelector("button[id=\"ChatCompact\"]").addEventListener("click", function() {
  1272. CTS.ChatType = !CTS.ChatType;
  1273. Save("ChatType", CTS.ChatType);
  1274. LoadMessage();
  1275. }, {
  1276. passive: true
  1277. });
  1278.  
  1279. TextAreaElement.oninput = function() {
  1280. CTS.Clipboard.Log = TextAreaElement.value;
  1281. };
  1282. TextAreaElement.onkeyup = function(e) {
  1283. e = e || window.event;
  1284. if (e.keyCode == 13) {
  1285. // SAVE CLIPBOARD
  1286. CTS.Clipboard.Message.push(CTS.Clipboard.Log);
  1287. if (CTS.Clipboard.Message.length > 3) CTS.Clipboard.Message.shift();
  1288. CTS.Clipboard.MessageLen = CTS.Clipboard.Message.length - 1;
  1289. } else if (e.keyCode == 40) {
  1290. // NAVIGATE CLIPBOARD (IF TYPING IS FALSE)
  1291. if (CTS.Clipboard.Message.includes(CTS.Clipboard.Log)) {
  1292. CTS.Clipboard.Counter = ((TextAreaElement.value == "") ? 0 : ((CTS.Clipboard.Counter >= CTS.Clipboard.MessageLen) ? 0 : (CTS.Clipboard.Counter + 1)));
  1293. TextAreaElement.value = CTS.Clipboard.Message[CTS.Clipboard.Counter];
  1294. }
  1295. } else if (e.keyCode == 38) {
  1296. // NAVIGATE CLIPBOARD (IF TYPING IS FALSE)
  1297. if (CTS.Clipboard.Message.includes(CTS.Clipboard.Log)) {
  1298. CTS.Clipboard.Counter = ((TextAreaElement.value == "") ? CTS.Clipboard.MessageLen : ((CTS.Clipboard.Counter <= 0) ? CTS.Clipboard.MessageLen : (CTS.Clipboard.Counter - 1)));
  1299. TextAreaElement.value = CTS.Clipboard.Message[CTS.Clipboard.Counter];
  1300. }
  1301. }
  1302. };
  1303. //MUTATION OBSERVERS
  1304. new MutationObserver(function() {
  1305. LoadMessage();
  1306. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  1307. attributes: true,
  1308. attributeFilter: ["class"],
  1309. childList: false,
  1310. characterData: false
  1311. });
  1312. new MutationObserver(function() {
  1313. Cameras();
  1314. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  1315. childList: true
  1316. });
  1317. new MutationObserver(function() {
  1318. Cameras();
  1319. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  1320. childList: true
  1321. });
  1322. new MutationObserver(function() {
  1323. if (CTS.AutoMicrophone) {
  1324. OpenMicrophone();
  1325. }
  1326. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  1327. attributes: true,
  1328. attributeFilter: ["class"]
  1329. });
  1330. //BOOT UP - FIRST START
  1331. NotificationDisplay();
  1332. FeaturedCameras(CTS.Featured);
  1333. Cameras();
  1334. }
  1335. //YOUTUBE FUNCTIONS
  1336. function YouTubePIP() {
  1337. if (window.YouTube.Popup == null || window.YouTube.Popup.closed) {
  1338. window.YouTube.Popup = window.open("https://www.youtube.com/watch?v=" + CTS.YouTube.CurrentTrack.ID+"&autoplay=1&t="+Math.trunc(CTS.YouTube.CurrentTrack.offset+2), "CTS YouTube - "+CTS.YouTube.CurrentTrack.title, "width=1080,height=720");
  1339. var detect_popup = setInterval(function() {
  1340. if(window.YouTube.Popup.closed) {
  1341. clearInterval(detect_popup);
  1342. window.YouTube.Popup = null;
  1343. window.YouTube.Init();
  1344. }
  1345. }, 1000);
  1346. window.YouTube.Popup.focus();
  1347. window.YouTube.stopVideo();
  1348. }
  1349. }
  1350.  
  1351. function YouTubeDuration(calc) {
  1352. var elem = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement;
  1353. elem.querySelector(".duration").style.width= calc+"%";
  1354. }
  1355.  
  1356. function YouTubeFullScreen() {
  1357. var elem = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement;
  1358.  
  1359. var playerElement = elem.querySelector("#player");
  1360. var requestFullScreen = playerElement.requestFullScreen || playerElement.mozRequestFullScreen || playerElement.webkitRequestFullScreen;
  1361. if (requestFullScreen) requestFullScreen.bind(playerElement)();
  1362. }
  1363.  
  1364. function YouTubeBehindChat(reset) {
  1365. if (!CTS.ThemeChange) {
  1366. if (reset !== true) window.YouTube.BehindChat = !window.YouTube.BehindChat;
  1367. var elem = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement;
  1368. elem.querySelector("#player").style.cssText = (window.YouTube.BehindChat) ? "position: fixed;top: 0;left: 0;height: 100%;z-index: -1;" : "";
  1369. elem.querySelector(".overlay").style.cssText = (window.YouTube.BehindChat) ? "left: 0px;position: absolute; z-index: 1;" : "";
  1370. }
  1371. }
  1372. function YouTubeMute (reset) {
  1373. if (window.CTSMuted) {
  1374. window.YouTube.Player.mute();
  1375. } else {
  1376. if (window.YouTube.Ready && window.YouTube.PlayerStateOK) {
  1377. if(reset === true) {
  1378. if (window.YouTube.Muted) {
  1379. window.YouTube.LastKnownMute = true;
  1380. if (window.CTSRoomVolume !== 1) {
  1381. window.YouTube.Player.setVolume(window.YouTube.Volume*window.CTSRoomVolume);
  1382. } else {
  1383. window.YouTube.Player.setVolume(window.YouTube.Volume);
  1384. }
  1385. window.YouTube.Player.mute();
  1386. } else {
  1387. window.YouTube.LastKnownMute = false;
  1388. if (window.CTSRoomVolume !== 1) {
  1389. window.YouTube.Player.setVolume(window.YouTube.Volume*window.CTSRoomVolume);
  1390. } else {
  1391. window.YouTube.Player.setVolume(window.YouTube.Volume);
  1392. }
  1393. window.YouTube.Player.unMute();
  1394. }
  1395. } else {
  1396. if (window.YouTube.Player.isMuted()) {
  1397. window.YouTube.Player.unMute();
  1398. window.YouTube.Muted = false;
  1399. window.YouTube.LastKnownMute = false;
  1400. } else {
  1401. window.YouTube.Player.mute();
  1402. window.YouTube.Muted = true;
  1403. window.YouTube.LastKnownMute = true;
  1404. }
  1405. }
  1406. }
  1407. }
  1408. }
  1409. function YouTubeVolumeUp() {
  1410. var vol = window.YouTube.Volume;
  1411. vol = (vol < 100) ? (vol >= 50) ? vol + 10 : (vol >= 20) ? vol + 5 : vol + 1 : vol;
  1412. if (window.YouTube.PlayerStateOK) {
  1413. if (window.CTSRoomVolume !== 1) {
  1414. window.YouTube.Player.setVolume(vol*window.CTSRoomVolume);
  1415. } else {
  1416. window.YouTube.Player.setVolume(vol);
  1417. }
  1418. window.YouTube.Volume = vol;
  1419. YouTubeVolumeIndicator();
  1420. }
  1421. }
  1422.  
  1423. function YouTubeVolumeDown() {
  1424. var vol = window.YouTube.Volume;
  1425. vol = (vol > 1) ? (vol >= 60) ? vol - 10 : (vol >= 25) ? vol - 5 : vol - 1 : vol;
  1426. if (window.YouTube.PlayerStateOK) {
  1427. if (window.CTSRoomVolume !== 1) {
  1428. window.YouTube.Player.setVolume(vol*window.CTSRoomVolume);
  1429. } else {
  1430. window.YouTube.Player.setVolume(vol);
  1431. }
  1432. window.YouTube.Volume = vol;
  1433. YouTubeVolumeIndicator();
  1434. }
  1435. }
  1436.  
  1437. function YouTubeVolumeIndicator() {
  1438. var elem = ((!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement);
  1439. elem.querySelector(".volume").style.width = window.YouTube.Volume + "%";
  1440. }
  1441.  
  1442. function YouTubeClose() {
  1443. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  1444. }
  1445.  
  1446. function VerifyYouTube() {
  1447. // Check Mod/JRMod
  1448. if (CTS.UserList[arguments[0]].mod || CTS.BotModList.includes(CTS.UserList[arguments[0]].username)) return true;
  1449. // Check OP
  1450. if (CTS.UserYT) {
  1451. if (CTS.BotOPList.includes(CTS.UserList[arguments[0]].username)) return true;
  1452. if (CTS.BotOPList.includes("-ALL") && isSafeListed(CTS.UserList[arguments[0]].username)) return true;
  1453. }
  1454. return false;
  1455. }
  1456.  
  1457. function CheckHost() {
  1458. if (CTS.Host === 0) {
  1459. Send("msg", "!whoisbot");
  1460. CTS.HostAttempt = 0;
  1461. CTS.HostWaiting = true;
  1462. }
  1463. }
  1464.  
  1465. function SetBot() {
  1466. if (arguments[0]) CTS.Game.NoReset = true;
  1467. Send("msg", "!bot");
  1468. CTS.HostWaiting = false;
  1469. }
  1470.  
  1471. function CheckYouTube() {
  1472. //CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
  1473. if (arguments[3] === undefined) arguments[3] = true;
  1474. CTS.YouTube.XHR.type = arguments[1];
  1475. 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);
  1476. if (videoid !== null) {
  1477. videoid = videoid[1].replace(/v\=/g, "");
  1478. //LINK IS PLAYLIST
  1479. if (videoid.match(/list\=/i)) {
  1480. if (arguments[3]) {
  1481. videoid = videoid.replace(/list\=/, "");
  1482. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  1483. 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);
  1484. CTS.YouTube.XHR.send();
  1485. }
  1486. } else {
  1487. //LINK IS REGULAR
  1488. CTS.YouTube.XHR.videoid = videoid;
  1489. CTS.YouTube.VideoReturn = true;
  1490. 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);
  1491. CTS.YouTube.XHR.send();
  1492. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  1493. }
  1494. } else {
  1495. //KEYWORD SEARCH
  1496. if (CTS.YouTube.MessageQueueList.length <= 0) {
  1497. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  1498. CTS.YouTube.SearchReturn = true;
  1499. 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");
  1500. CTS.YouTube.XHR.send();
  1501. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  1502. }
  1503. }
  1504. }
  1505.  
  1506. function YoutubeBypass() {
  1507. var videoid = arguments[0].match(/http(?:s)?(?:\:\/\/)(?:w{1,3}\.)?(?:youtu(?:\.be|be\.com))(?:\/v\/|\/)?(?:watch\?|embed\/|user\/|v\/|\/)(?:v\=)?([a-z0-9\-\_]{1,11})/i);
  1508. if (videoid !== null) {
  1509. CTS.SocketTarget.send(JSON.stringify({
  1510. "tc": "yut_play",
  1511. "item": {
  1512. "id": videoid[1],
  1513. "duration": 7200,
  1514. "offset": 0,
  1515. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1516. }
  1517. }));
  1518. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1519. }
  1520. }
  1521.  
  1522. function YouTubePlayList() {
  1523. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  1524. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  1525. }
  1526.  
  1527. function YouTubeTrackAdd() {
  1528. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  1529. if (CTS.YouTube.Busy === false) {
  1530. if (CTS.YouTube.MessageQueueList.length > 0) {
  1531. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  1532. 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);
  1533. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  1534. CTS.YouTube.XHR.send();
  1535. CTS.YouTube.MessageQueueList.shift();
  1536. }
  1537. }
  1538. }
  1539. }
  1540.  
  1541. function YouTubePlayListItems() {
  1542. var len = arguments[0].length;
  1543. for (var i = 0; i < len; i++) {
  1544. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  1545. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  1546. }
  1547. }
  1548. }
  1549.  
  1550. function YouTubeTimeConvert() {
  1551. //TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
  1552. var a = arguments[0].match(/\d+/g);
  1553. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  1554. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  1555. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  1556. var len = a.length;
  1557. arguments[0] = 0;
  1558. if (len == 3) {
  1559. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  1560. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  1561. arguments[0] = arguments[0] + parseInt(a[2]);
  1562. }
  1563. if (len == 2) {
  1564. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  1565. arguments[0] = arguments[0] + parseInt(a[1]);
  1566. }
  1567. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  1568. return arguments[0];
  1569. }
  1570.  
  1571. function BotCommandCheck() {
  1572. //USER COMMANDS TO HOST
  1573. if (isCommand(arguments[1])) {
  1574. if (arguments[1].match(/^!play$|^!yt |^!ytbypass |^!ytclear$|^!ytskip$|^!ytqueue$/i)) {
  1575. BotCommandCheckYT(arguments[0], arguments[1]);
  1576. } else if (arguments[1].match(/^!userkick |^!userban |^!userclose |^!nickkick |^!nickban |^!nickclose /i)) {
  1577. BotCommandCheckJR(arguments[0], arguments[1]);
  1578. } else if (arguments[1].match(/^!whoisbot$|^!8ball |^!vote |^!coin$|^!chuck$|^!urb |^!dad$|^!advice$/i)) {
  1579. BotCommandCheckPUB(arguments[0], arguments[1]);
  1580. } else if (CTS.UserList[arguments[0]].canGame && CTS.CanHostFishGames) {
  1581. FishCommandCheck(arguments[0], arguments[1]);
  1582. }
  1583. }
  1584. if (CTS.Game.Trivia.Started && CTS.CanHostTriviaGames && arguments[1].match(/^!iq$|^!triviahelp$|^!triviashop$|^!raid |^!ytbypass |^!spot$|^[a-d]$/i)) TriviaCommandCheck(arguments[0], arguments[1]);
  1585. }
  1586.  
  1587. function TriviaCommandCheck() {
  1588. var User = CTS.UserList[arguments[0]];
  1589. if (User.canGame) {
  1590. if (isSafeListed(User.username)) {
  1591. if (!isCommand(arguments[1])) {
  1592. //NO CHEATERS
  1593. var Guessed = CTS.Game.Trivia.AttemptList.includes(User.username);
  1594. if (arguments[1].length == 1 && CTS.Game.Trivia.ANum.includes(arguments[1].toUpperCase()) && !Guessed && !CTS.Game.Trivia.Waiting) {
  1595. if (CTS.Game.Trivia.Correct === arguments[1].toUpperCase()) {
  1596. // Save Progress
  1597. User.triviapoints += CTS.Game.Trivia.Worth;
  1598. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1599. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1600. // Send Output
  1601. Send("msg", "[TRIVIA]\n" + User.username + ", that's correct!\nYou've gained " + CTS.Game.Trivia.Worth + " IQ points to use towards the store or save.\n\nYour added IQ puts you at " + User.triviapoints + " points!");
  1602. if (User.triviapoints > CTS.Game.Trivia.HighScore[1]) {
  1603. CTS.Game.Trivia.HighScore[0] = User.username;
  1604. CTS.Game.Trivia.HighScore[1] = User.triviapoints;
  1605. // Save HighScore
  1606. Save("TriviaHighScore", JSON.stringify(CTS.Game.Trivia.HighScore));
  1607. }
  1608. // Wait
  1609. Trivia.Wait();
  1610. } else {
  1611. CTS.Game.Trivia.Attempts++;
  1612. CTS.Game.Trivia.AttemptList.push(User.username);
  1613. Send("msg", "[TRIVIA]\n" + User.username + " that's wrong however you may attempt next rounds question.");
  1614. if (CTS.Game.Trivia.Attempts == 3) {
  1615. Send("msg", "[TRIVIA]\nNobody got it!\nNext round will start in shortly.\nThe answer however was: " + CTS.Game.Trivia.Correct);
  1616. Trivia.Wait();
  1617. }
  1618. }
  1619. }
  1620. } else {
  1621. TriviaCommand(arguments[0], arguments[1]);
  1622. }
  1623. }
  1624. }
  1625. }
  1626.  
  1627. function TriviaCommand() {
  1628. var User = CTS.UserList[arguments[0]];
  1629. if (!User.mod && !CTS.BotModList.includes(User.username)) {
  1630. if (arguments[1].match(/^!ytbypass/i) && CTS.Room.YT_ON) {
  1631. if (CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.ytbypass) {
  1632. User.triviapoints -= CTS.Game.Trivia.PriceList.ytbypass;
  1633. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1634. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1635. Send("msg", "[TRIVIA]\n" + User.username + ",\nyou've just purchased ytbypass for " + CTS.Game.Trivia.PriceList.ytbypass + " IQ Points!\n\nHopefully you inserted the link right!:)");
  1636. YoutubeBypass(arguments[1]);
  1637. } else {
  1638. TriviaTooPoor(User.username);
  1639. }
  1640. }
  1641. }
  1642. if (CTS.Me.owner) {
  1643. if (!User.owner) {
  1644. if (arguments[1].match(/^!raid /i)) {
  1645. if (CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.raid) {
  1646. var raid = arguments[1].match(/^(?:!raid )(?:<a href=")(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})/i);
  1647. if (raid !== null) {
  1648. User.triviapoints -= CTS.Game.Trivia.PriceList.raid;
  1649. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1650. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1651. Send("msg", "[TRIVIA]\n" + User.username + ",\nyou've just purchased raid for " + CTS.Game.Trivia.PriceList.raid + " IQ Points!\n\nCTS Users be prepared to teleport in several seconds!");
  1652. Send("msg", "[TRIVIA]\nREMEMBER HAVE FUN IF YOU DON'T WARP CLICK THE LINK SHORTLY!\n\nhttps://tinychat.com/room/" + raid[1]);
  1653. // WAIT
  1654. setTimeout(function() {
  1655. Send("msg", "!raid https://tinychat.com/room/" + raid[1]);
  1656. }, 10000);
  1657. } else {
  1658. Send("msg", "[TRIVIA]\nThis is not a valid link/format for raid.\n\n(ex. !raid https://tinychat.com/stonercircle)\n\nThis is a costly operation, can't mess around if you want to be captain!");
  1659. }
  1660. } else {
  1661. TriviaTooPoor(User.username);
  1662. }
  1663. } else if (arguments[1].match(/^!spot$/i)) {
  1664. if (CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.spot) {
  1665. var rand = Rand(0, CTS.Camera.List.length - 1),
  1666. target = HandleToUser(CTS.Camera.List[rand]);
  1667. if (target != -1) {
  1668. User.triviapoints -= CTS.Game.Trivia.PriceList.spot;
  1669. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1670. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1671. Send("msg", "[TRIVIA]\n" + User.username + ",\nyou've just purchased " + CTS.UserList[target].username + "'s spot for " + CTS.Game.Trivia.PriceList.spot + " IQ Points!\n");
  1672. if (CTS.UserList[target].handle !== CTS.Me.handle) {
  1673. Send("stream_moder_close", CTS.Camera.List[rand]);
  1674. } else {
  1675. CTS.SocketTarget.send(JSON.stringify({
  1676. "tc": "stream_close",
  1677. "handle": CTS.Me.handle
  1678. }));
  1679. }
  1680. }
  1681. } else {
  1682. TriviaTooPoor(User.username);
  1683. }
  1684. }
  1685. }
  1686. }
  1687. if (arguments[1].match(/^!triviashop$/i)) {
  1688. Send("msg", "[TRIVIA]\n" + ((CTS.Me.owner) ? "!raid\n[FOR " + CTS.Game.Trivia.PriceList.raid + "IQ]\n\n!spot\n[FOR " + CTS.Game.Trivia.PriceList.spot + "IQ]\n\n" : "") + "!ytbypass <link>\n[FOR " + CTS.Game.Trivia.PriceList.ytbypass + "IQ]");
  1689. } else if (arguments[1].match(/^!triviahelp$/i)) {
  1690. Send("msg", "[TRIVIA]\n!iq\n!triviashop");
  1691. } else if (arguments[1].match(/^!iq$/i)) {
  1692. Send("msg", "[TRIVIA]\n" + User.username + ",\nYou have an IQ of " + User.triviapoints + ".");
  1693. }
  1694. }
  1695.  
  1696. function TriviaTooPoor() {
  1697. Send("msg", "[TRIVIA]\n" + arguments[0] + ",\nyou cannot afford this right now!");
  1698. }
  1699.  
  1700. function BotCommandCheckYT() {
  1701. //ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
  1702. if (CTS.Room.YT_ON) {
  1703. if (arguments[1].match(/^!play$/i)) {
  1704. if (CTS.UserList[arguments[0]].mod) YouTubePlayList();
  1705. } else if (arguments[1].match(/^!yt /i)) {
  1706. BotCommand(1, arguments[0], arguments[1]);
  1707. } else if (arguments[1].match(/^!ytbypass /i)) {
  1708. BotCommand(6, arguments[0], arguments[1]);
  1709. } else if (arguments[1].match(/^!ytclear$/i)) {
  1710. BotCommand(2, arguments[0]);
  1711. } else if (arguments[1].match(/^!ytskip$/i)) {
  1712. BotCommand(3, arguments[0]);
  1713. } else if (arguments[1].match(/^!ytqueue$/i)) {
  1714. BotCommand(4, arguments[0]);
  1715. }
  1716. }
  1717. }
  1718.  
  1719. function BotCommandCheckJR() {
  1720. //MOD/JR.MOD
  1721. if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
  1722. if (arguments[1].match(/^!userkick /i)) {
  1723. ModCommand("kick", arguments[1], true);
  1724. } else if (arguments[1].match(/^!userban /i)) {
  1725. ModCommand("ban", arguments[1], true);
  1726. } else if (arguments[1].match(/^!userclose /i)) {
  1727. ModCommand("stream_moder_close", arguments[1], true);
  1728. } else if (arguments[1].match(/^!nickkick /i)) {
  1729. ModCommand("kick", arguments[1], false);
  1730. } else if (arguments[1].match(/^!nickban /i)) {
  1731. ModCommand("ban", arguments[1], false);
  1732. } else if (arguments[1].match(/^!nickclose /i)) {
  1733. ModCommand("stream_moder_close", arguments[1], false);
  1734. }
  1735. }
  1736. }
  1737.  
  1738. function BotCommandCheckPUB() {
  1739. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  1740. if (arguments[1].match(/^!vote /i)) Vote(arguments[0], arguments[1]);
  1741. // PUBLIC COMMANDS
  1742. if (CTS.PublicCommandToggle) {
  1743. if (arguments[1].match(/^!8ball [\w\s]*\??/i)) {
  1744. if (CTS.UserList[arguments[0]].mod || isSafeListed(CTS.UserList[arguments[0]].username)) Send("msg", "[8BALL]\n" + window.CTSEightBall[Rand(0, window.CTSEightBall.length - 1)]);
  1745. } else if (arguments[1].match(/^!coin$/i)) {
  1746. 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") + "!");
  1747. } else {
  1748. if (arguments[1].match(/^!chuck$/i)) {
  1749. Chuck(CTS.UserList[arguments[0]].username);
  1750. } else if (arguments[1].match(/^!urb /i)) {
  1751. Urb(arguments[1], CTS.UserList[arguments[0]].username);
  1752. } else if (arguments[1].match(/^!dad$/i)) {
  1753. Dad(CTS.UserList[arguments[0]].username);
  1754. } else if (arguments[1].match(/^!advice$/i)) {
  1755. Advice(CTS.UserList[arguments[0]].username);
  1756. }
  1757. }
  1758. }
  1759. }
  1760.  
  1761. function BotCheck() {
  1762. if (CTS.UserList[arguments[0]].mod) {
  1763. //CHECK HOST
  1764. if (arguments[1].match(/^!bot$/i)) {
  1765. //SET HOST
  1766. CTS.Host = arguments[2].handle;
  1767. CTS.HostWaiting = false;
  1768. //RESET GAMES
  1769. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  1770. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  1771. if (CTS.Me.handle !== arguments[2].handle) {
  1772. CTS.Game.NoReset = false;
  1773. Fish.Reset(true);
  1774. // Reset Trivia
  1775. Trivia.Reset();
  1776. }
  1777. }
  1778. //IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
  1779. if (CTS.Me.handle == arguments[2].handle && CTS.Room.YT_ON) YouTubePlayList();
  1780. //ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
  1781. } else if (CTS.HostWaiting === true) {
  1782. CTS.HostAttempt++;
  1783. //SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
  1784. if (CTS.HostAttempt == 1) {
  1785. setTimeout(function() {
  1786. //CHECK WAITING STATE OR IF HOST HAS CHANGED
  1787. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  1788. }, 10000);
  1789. }
  1790. //SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
  1791. if (CTS.HostAttempt == 10) SetBot(false);
  1792. }
  1793. }
  1794. }
  1795.  
  1796. function Chuck() {
  1797. //OPEN REQUEST
  1798. if (isSafeListed(arguments[0])) {
  1799. CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
  1800. CTS.Chuck.XHR.send();
  1801. }
  1802. }
  1803.  
  1804. function Urb() {
  1805. //CHECK TERM
  1806. if (isSafeListed(arguments[1])) {
  1807. var urban = arguments[0].match(/^!urb ([\w ]*)/i);
  1808. if (urban !== null) {
  1809. //OPEN REQUEST
  1810. CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
  1811. CTS.Urb.XHR.send();
  1812. }
  1813. }
  1814. }
  1815.  
  1816. function Dad() {
  1817. //OPEN REQUEST
  1818. if (isSafeListed(arguments[0])) {
  1819. CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
  1820. CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
  1821. CTS.Dad.XHR.send();
  1822. }
  1823. }
  1824.  
  1825. function Advice() {
  1826. //OPEN REQUEST
  1827. if (isSafeListed(arguments[0])) {
  1828. CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
  1829. CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
  1830. CTS.Advice.XHR.send();
  1831. }
  1832. }
  1833. //MESSAGE FUNCTION
  1834. function CreateMessage() {
  1835. //SCROLLED UP? MISSED A MESSAGE?
  1836. CheckUnreadMessage();
  1837. // POST NEW CHAT ITEM IF ACTIVECHAT IS OUR CURRENT CHAT
  1838. if (arguments[7] == GetActiveChat()) {
  1839. var stack = ChatLogElement.querySelector("#cts-chat-content>.message:last-child cts-message-html:last-child");
  1840. if (arguments[4] == CTS.CreateMessageLast && stack !== null && CTS.ChatType) {
  1841. // Stack
  1842. stack.insertAdjacentHTML("afterend", "<cts-message-html><div class=\"stackmessage\">" + (CTS.TimeStampToggle ? "<div class=\"ctstimehighlight\"> " + arguments[0] + " </div>" : "") + "<span id=\"html\" class=\"message common\"style=\"font-size:" + CTS.FontSize + "px;\">" + arguments[5] + "</span></div></CTS-message-html>");
  1843. } else {
  1844. CTS.CreateMessageLast = arguments[4];
  1845. 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 onclick=\"UserProfileView('" + arguments[3] + "')\" 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>");
  1846. }
  1847. } else {
  1848. CTS.CreateMessageLast = undefined;
  1849. }
  1850. UpdateScroll(1, false);
  1851. }
  1852.  
  1853. function LoadMessage() {
  1854. var Chat = ChatLogElement.querySelector("#cts-chat-content");
  1855. CTS.ChatScroll = true;
  1856. Chat.innerHTML = "";
  1857. CheckUnreadMessage();
  1858. if (CTS.Message[GetActiveChat()]) {
  1859. //POST MESSAGE
  1860. var len = CTS.Message[GetActiveChat()].length,
  1861. LoadMessageLast;
  1862. for (var ChatIndex = 0; ChatIndex < len; ChatIndex++) {
  1863. if (CTS.Message[GetActiveChat()][ChatIndex].nick == LoadMessageLast && CTS.ChatType) {
  1864. // Stack
  1865. ChatLogElement.querySelector("#cts-chat-content>.message:last-child cts-message-html:last-child").insertAdjacentHTML("afterend", "<cts-message-html><div class=\"stackmessage\">" + (CTS.TimeStampToggle ? "<div class=\"ctstimehighlight\"> " + CTS.Message[GetActiveChat()][ChatIndex].time + " </div>" : "") + "<span id=\"html\" class=\"message common\" style=\"font-size:" + CTS.FontSize + "px;\">" + CTS.Message[GetActiveChat()][ChatIndex].msg + "</span></div></CTS-message-html>");
  1866. } else {
  1867. LoadMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1868. ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(CTS.Message[GetActiveChat()][ChatIndex].username) || CTS.Message[GetActiveChat()][ChatIndex].mention) ? "highlight" : "") + "\" " + ((CTS.Message[GetActiveChat()][ChatIndex].avatar === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + (CTS.Message[GetActiveChat()][ChatIndex].avatar) + "\"></div></a>" : "") + "<div onclick=\"UserProfileView('" + CTS.Message[GetActiveChat()][ChatIndex].username + "')\" class=\"nickname\" style=\"-webkit-box-shadow: 0 0 6px " + CTS.Message[GetActiveChat()][ChatIndex].namecolor + ";box-shadow: 0 0 6px " + CTS.Message[GetActiveChat()][ChatIndex].namecolor + ";background:" + CTS.Message[GetActiveChat()][ChatIndex].namecolor + ";\">" + CTS.Message[GetActiveChat()][ChatIndex].nick + (CTS.TimeStampToggle ? "<div class=\"ctstime\"> " + CTS.Message[GetActiveChat()][ChatIndex].time + " </div>" : "") + "</div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\" style=\"font-size:" + CTS.FontSize + "px;\">" + CTS.Message[GetActiveChat()][ChatIndex].msg + "</span></CTS-message-html></div></div>");
  1869. }
  1870. if (ChatIndex == (len - 1)) CTS.CreateMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1871. }
  1872. } else {
  1873. //START PM
  1874. CTS.Message[GetActiveChat()] = [];
  1875. }
  1876. UpdateScroll(1, false);
  1877. UpdateScroll(2, false);
  1878. }
  1879.  
  1880. function CreateGift() {
  1881. var gift = arguments[0].gift,
  1882. from = (!gift.anon) ? arguments[0].from.name : "ANONYMOUS",
  1883. to = arguments[0].to.name,
  1884. comment = (comment = gift.comment) ? gift.comment : "";
  1885. CTS.Message[0].push({
  1886. "time": Time(),
  1887. "namecolor": "#3f69c0",
  1888. "avatar": "",
  1889. "username": "",
  1890. "nick": "SPECIAL DELIVERY",
  1891. "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 + "</center></div><br>",
  1892. "mention": true
  1893. });
  1894. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  1895. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  1896. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  1897. window.CTSSound.Gift.volume = window.CTSRoomVolume;
  1898. window.CTSSound.GIFT.play();
  1899. }
  1900. UpdateScroll(1, true);
  1901. }
  1902.  
  1903. function AKB() {
  1904. //WATCH OR REMOVE USERS
  1905. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  1906. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  1907. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  1908. } else {
  1909. if (CTS.Me.mod) {
  1910. if (CTS.AutoKick === true) {
  1911. CTS.NoGreet = true;
  1912. Send("kick", arguments[1]);
  1913. } else if (CTS.AutoBan === true) {
  1914. CTS.NoGreet = true;
  1915. Send("ban", arguments[1]);
  1916. }
  1917. }
  1918. }
  1919. }
  1920.  
  1921. function AKBS() {
  1922. if (arguments[0].username !== "") {
  1923. //EXTENDED SAFELIST
  1924. var temp = [];
  1925. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1926. //DEFAULT SAFELIST
  1927. if (!isSafeListed(arguments[0].username.toUpperCase())) {
  1928. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  1929. if (CTS.SafeList.length < 5000) {
  1930. CTS.SafeList.push(arguments[0].username.toUpperCase());
  1931. Save("AKB", JSON.stringify(CTS.SafeList));
  1932. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1933. }
  1934. } else {
  1935. if (arguments[0].lurker === false) {
  1936. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1937. } else {
  1938. AKB(false, arguments[0].handle);
  1939. }
  1940. }
  1941. }
  1942. } else {
  1943. AKB(false, arguments[0].handle);
  1944. }
  1945. }
  1946.  
  1947. function CheckSafeList() {
  1948. var target = HandleToUser(arguments[0]);
  1949. if (target !== -1) {
  1950. var a = CTS.SafeList.indexOf(CTS.UserList[target].username);
  1951. if (a !== -1) {
  1952. //REMOVE
  1953. if (arguments[1]) {
  1954. debug("SAFELIST::", "REMOVE USER " + CTS.UserList[target].username + " FROM SAFELIST");
  1955. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[target].username + " from safelist!");
  1956. CommandList.saferemove(a);
  1957. } else {
  1958. //GETID
  1959. return a;
  1960. }
  1961. }
  1962. }
  1963. }
  1964.  
  1965. function CheckUnreadMessage() {
  1966. if ((Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) || arguments[0] !== undefined) {
  1967. CTS.MissedMsg = 0;
  1968. CTS.ChatScroll = true;
  1969. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1970. } else {
  1971. CTS.MissedMsg++;
  1972. CTS.ChatScroll = false;
  1973. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1974. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1975. }
  1976. }
  1977.  
  1978. function GetActiveChat() {
  1979. var elem = ChatListElement.querySelector(".active");
  1980. if (elem) return elem.getAttribute("data-chat-id");
  1981. return 0;
  1982. }
  1983.  
  1984. function CheckImgur() {
  1985. if (CTS.Imgur) {
  1986. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpeg|jpg|gif|png|mp4)/);
  1987. if (i !== null) {
  1988. CTS.ImgurWarning++;
  1989. 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>";
  1990. if (CTS.ImgurWarning < 2 && CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nYou can !imgurtoggle at anytime to stop unwanted images showing through.");
  1991. }
  1992. }
  1993. return arguments[0];
  1994. }
  1995.  
  1996. function TTS() {
  1997. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1998. utter.voice = CTS.TTS.voices[0];
  1999. utter.rate = 1.0;
  2000. utter.pitch = 0.5;
  2001. CTS.TTS.synth.speak(utter);
  2002. }
  2003.  
  2004. function isCommand() {
  2005. return arguments[0].match(/^!/);
  2006. }
  2007.  
  2008. function RoomUsers() {
  2009. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  2010. }
  2011.  
  2012. function LineSpam() {
  2013. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  2014. if (LineBreaks >= 14 && arguments[1] === false) return true;
  2015. return false;
  2016. }
  2017.  
  2018. function GamePrevention() {
  2019. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(FISHING BOAT|TRIVIA)\]/)) return false;
  2020. return true;
  2021. }
  2022.  
  2023. function UpdateScroll() {
  2024. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  2025. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true) && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  2026. }
  2027.  
  2028. function DecodeTXT() {
  2029. var txt = document.createElement("textarea");
  2030. txt.innerHTML = arguments[0];
  2031. return txt.value;
  2032. }
  2033.  
  2034. function HTMLtoTXT() {
  2035. var p = document.createElement("p");
  2036. var text = document.createTextNode(arguments[0]);
  2037. p.appendChild(text);
  2038. 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>");
  2039. }
  2040.  
  2041. function IgnoreText() {
  2042. if (arguments[0] !== "") {
  2043. if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
  2044. return true;
  2045. }
  2046. }
  2047.  
  2048. function TimeToDate() {
  2049. if (arguments[1] === undefined) arguments[1] = new Date();
  2050. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((?:am|pm))/i);
  2051. var t = {
  2052. hours: parseInt(match[1]),
  2053. minutes: parseInt(match[2]),
  2054. period: match[3].toLowerCase()
  2055. };
  2056. if (t.hours === 12) {
  2057. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  2058. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  2059. } else {
  2060. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  2061. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  2062. }
  2063. return arguments[1];
  2064. }
  2065.  
  2066. function PushPM() {
  2067. var text = HTMLtoTXT(arguments[1]),
  2068. list;
  2069. if (arguments[2] !== undefined) {
  2070. list = CTS.UserList[arguments[2]];
  2071. if (isSafeListed(CTS.UserList[arguments[2]].username)) text = CheckImgur(text);
  2072. } else {
  2073. list = CTS.Me;
  2074. text = CheckImgur(text);
  2075. }
  2076.  
  2077. CTS.Message[arguments[0]].push({
  2078. "time": Time(),
  2079. "namecolor": list.namecolor,
  2080. "avatar": list.avatar,
  2081. "username": list.username,
  2082. "nick": list.nick,
  2083. "msg": text,
  2084. "mention": false
  2085. });
  2086.  
  2087. if (arguments[0] == GetActiveChat()) {
  2088. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  2089. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, msg.mention, arguments[0]);
  2090. UpdateScroll(1, false);
  2091. }
  2092. }
  2093.  
  2094. function Time() {
  2095. return (new Date().toLocaleString("en-US", {
  2096. hour: "numeric",
  2097. minute: "numeric",
  2098. second: "numeric",
  2099. hour12: true
  2100. }));
  2101. }
  2102.  
  2103. function DateTime() {
  2104. return (new Date().toLocaleString("en-US", {
  2105. year: 'numeric',
  2106. month: 'numeric',
  2107. day: 'numeric',
  2108. hour: "numeric",
  2109. minute: "numeric",
  2110. second: "numeric",
  2111. hour12: true
  2112. }));
  2113. }
  2114. //FEATURES
  2115. function StorageSupport() {
  2116. try {
  2117. if ("localStorage" in window && window.localStorage !== null) {
  2118. localStorage.setItem("CTS_StorageVerify", true);
  2119. localStorage.removeItem("CTS_StorageVerify");
  2120. return true;
  2121. }
  2122. } catch (e) {
  2123. return false;
  2124. }
  2125. }
  2126.  
  2127. function Export() {
  2128. var element = document.createElement("a");
  2129. element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(arguments[1]));
  2130. element.setAttribute("download", arguments[0]);
  2131. element.style.display = "none";
  2132. document.body.appendChild(element);
  2133. element.click();
  2134. document.body.removeChild(element);
  2135. }
  2136.  
  2137. function StyleSet() {
  2138. // Chat
  2139. var style = document.createElement("style");
  2140. style.setAttribute("id", CTS.ChatStyleCounter);
  2141. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][0] + ":host, #videolist {background-color:unset;}";
  2142. ChatLogElement.appendChild(style);
  2143. // Video
  2144. style = document.createElement("style");
  2145. style.setAttribute("id", CTS.ChatStyleCounter);
  2146. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][1] + ":host, #videolist {background-color:unset;}";
  2147. VideoListElement.appendChild(style);
  2148. // Side Menu
  2149. style = document.createElement("style");
  2150. style.setAttribute("id", CTS.ChatStyleCounter);
  2151. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][2] + ":host, #videolist {background-color:unset;}";
  2152. SideMenuElement.appendChild(style);
  2153. }
  2154.  
  2155. function ChatHeightToggled() {
  2156. CTS.OGStyle.HeightCounter++;
  2157. if (!CTS.ChatDisplay) {
  2158. CTS.ChatWidth += 5;
  2159. CTS.ChatDisplay = true;
  2160. }
  2161. CTS.ChatHeight -= 5;
  2162. CTS.UserListDisplay = true;
  2163. if (CTS.ChatHeight == 20) {
  2164. CTS.ChatHeight = 45;
  2165. CTS.UserListDisplay = false;
  2166. CTS.OGStyle.HeightCounter = 0;
  2167. }
  2168. 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;");
  2169. 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;");
  2170. 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;");
  2171. VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
  2172. 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;";
  2173. //UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2174. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2175. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2176. PerformanceModeInit(CTS.PerformanceMode);
  2177. UpdateScroll(1, true);
  2178. UpdateScroll(2, true);
  2179. Resize();
  2180. }
  2181.  
  2182. function ChatWidthToggled() {
  2183. CTS.OGStyle.WidthCounter++;
  2184. CTS.ChatWidth += 5;
  2185. CTS.ChatDisplay = true;
  2186. if (CTS.ChatWidth == 25) {
  2187. CTS.ChatWidth = -5;
  2188. CTS.ChatDisplay = false;
  2189. CTS.OGStyle.WidthCounter = 0;
  2190. }
  2191. 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;");
  2192. 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;");
  2193. 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;");
  2194. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
  2195. 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;";
  2196. //UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2197. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2198. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2199. CTS.PerformanceMode = false;
  2200. PerformanceModeInit(CTS.PerformanceMode);
  2201. UpdateScroll(1, true);
  2202. UpdateScroll(2, true);
  2203. Resize();
  2204. }
  2205.  
  2206. function ChatHide() {
  2207. CTS.NormalStyle.ChatHide = !CTS.NormalStyle.ChatHide;
  2208. ChatLogElement.querySelector("#chat-wrapper").style.display = (CTS.NormalStyle.ChatHide ? "none" : "block");
  2209. UpdateScroll(1, true);
  2210. UpdateScroll(2, true);
  2211. Resize();
  2212. }
  2213.  
  2214. function SoundMeter() {
  2215. //MICROPHONE INDICATOR
  2216. if (CTS.SoundMeterToggle) {
  2217. setTimeout(function() {
  2218. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2219. Featured = VideoListElement.querySelectorAll(".videos-items:first-child tc-video-item"),
  2220. videolist = window.TinychatApp.getInstance().defaultChatroom._videolist,
  2221. TCCameraList = videolist.items.length,
  2222. CameraLen = Camera.length,
  2223. users,
  2224. item;
  2225. if (Featured.length > 0) {
  2226. for (var x = 0; x < TCCameraList; x++) {
  2227. if (CameraLen < 1) break;
  2228. for (users = 0; users < CameraLen; users++) {
  2229. item = videolist.items[x];
  2230. if (item != undefined) {
  2231. if (Camera[users].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id") == item.userentity.path) {
  2232. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2233. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2234. break;
  2235. }
  2236. }
  2237. }
  2238. }
  2239. } else {
  2240. for (users = 0; users < CameraLen; users++) {
  2241. item = videolist.items[users];
  2242. if (item != undefined) {
  2243. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2244. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2245. }
  2246. }
  2247. }
  2248. //REPEAT
  2249. SoundMeter();
  2250. }, 300);
  2251. }
  2252. }
  2253.  
  2254. function RTC() {
  2255. if (null != arguments[0].rtc) {
  2256. let a = arguments[0].rtc;
  2257. arguments[0].rtc = null;
  2258. MS(arguments[0], a);
  2259. }
  2260. }
  2261.  
  2262. function Vote() {
  2263. var ChecksOut = CTS.VoteSystem,
  2264. len = CTS.WaitToVoteList.length;
  2265. if (len > 0 && ChecksOut) {
  2266. for (var i = 0; i < len; i++) {
  2267. if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
  2268. Send("msg", "Please wait several minutes till you can cast your vote again!");
  2269. ChecksOut = false;
  2270. break;
  2271. }
  2272. }
  2273. }
  2274. if (ChecksOut) {
  2275. if (isSafeListed(CTS.UserList[arguments[0]].username.toUpperCase())) {
  2276. var targetname = arguments[1].match(/^!vote ([a-z0-9]{1,16})$/i);
  2277. if (targetname !== null) {
  2278. var Target = UsernameToUser(targetname[1].toUpperCase());
  2279. if (Target !== -1) {
  2280. if (CTS.UserList[Target].broadcasting && CTS.UserList[Target].username !== "GUEST") {
  2281. if (CTS.Me.owner || !CTS.UserList[Target].mod) {
  2282. Send("msg", "Your vote has been cast, you may vote again shortly!");
  2283. CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
  2284. CTS.UserList[Target].vote += 1;
  2285. if (CTS.UserList[Target].vote === 3) {
  2286. CTS.UserList[Target].vote = 0;
  2287. Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
  2288. Send("stream_moder_close", CTS.UserList[Target].handle);
  2289. }
  2290. } else {
  2291. Send("msg", "I cannot do that!");
  2292. }
  2293. }
  2294. } else {
  2295. Send("msg", "The user is not broadcasting...");
  2296. }
  2297. } else {
  2298. Send("msg", "The nickname or username does not exist!");
  2299. }
  2300. }
  2301. }
  2302. }
  2303.  
  2304. function PMShow() {
  2305. ChatListElement.querySelector("#chatlist").style.display = ((CTS.enablePMs) ? "block" : "none");
  2306. }
  2307.  
  2308. function MessagePopUp() {
  2309. if (CTS.Popups) {
  2310. var push = false;
  2311. if (arguments[0] != -1) {
  2312. if (ChatListElement.querySelector(".list-item .active")) {
  2313. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  2314. if (arguments[2]) push = true;
  2315. } else {
  2316. push = true;
  2317. }
  2318. } else if (!arguments[2]) {
  2319. push = true;
  2320. }
  2321. }
  2322. if (arguments[3]) push = true;
  2323. if (push || !CTS.ChatDisplay) {
  2324. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  2325. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2326. clearTimeout(CTS.NotificationTimeOut[0]);
  2327. CTS.NotificationTimeOut.shift();
  2328. }
  2329. 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>");
  2330. CTS.NotificationTimeOut.push(setTimeout(function() {
  2331. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  2332. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2333. CTS.NotificationTimeOut.shift();
  2334. }
  2335. }, 11100));
  2336. }
  2337. }
  2338. }
  2339.  
  2340. function Reminder() {
  2341. var temp,
  2342. i,
  2343. len = CTS.ReminderServerInList.length;
  2344. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  2345. CTS.ReminderServerInList = [];
  2346. if (CTS.Reminder === true) {
  2347. var OffsetTime;
  2348. len = CTS.ReminderList.length;
  2349. for (i = 0; i < len; i++) {
  2350. temp = TimeToDate(CTS.ReminderList[i][0]);
  2351. CTS.RecentTime = new Date();
  2352. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  2353. OffsetTime = temp - CTS.RecentTime;
  2354. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, CTS.ReminderList[i][1]));
  2355. }
  2356. if (Addon.active("ReminderList")) {
  2357. len = Addon.get("ReminderList").length;
  2358. for (i = 0; i < len; i++) {
  2359. temp = TimeToDate(Addon.get("ReminderList")[i][0]);
  2360. CTS.RecentTime = new Date();
  2361. if (temp < CTS.RecentTime) temp.setDate(CTS.RecentTime.getDate() + 1);
  2362. OffsetTime = temp - CTS.RecentTime;
  2363. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, Addon.get("ReminderList")[i][1]));
  2364. }
  2365. }
  2366. }
  2367. }
  2368.  
  2369. function AddReminder() {
  2370. Send("msg", "📣 " + arguments[0]);
  2371. setTimeout(Reminder, 5000);
  2372. }
  2373.  
  2374. function NotificationDisplay() {
  2375. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2376. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2377. if (CTS.NotificationToggle == 0) {
  2378. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  2379. passive: true
  2380. });
  2381. } else {
  2382. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
  2383. passive: true
  2384. });
  2385. }
  2386. UpdateScroll(1, true);
  2387. UpdateScroll(2, true);
  2388. }
  2389.  
  2390. function NotificationResize() {
  2391. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  2392. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  2393. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  2394. ChatLogElement.querySelector("#chat").style.height = "50%%";
  2395. } else {
  2396. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  2397. ChatLogElement.querySelector("#chat").style.height = "100%";
  2398. }
  2399. UpdateScroll(1, false);
  2400. UpdateScroll(2, true);
  2401. }
  2402.  
  2403. function Dice() {
  2404. return String.fromCharCode("0x268" + Rand(0, 5));
  2405. }
  2406.  
  2407. function Rand() {
  2408. arguments[0] = Math.ceil(arguments[0]);
  2409. arguments[1] = Math.floor(arguments[1]);
  2410. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  2411. }
  2412.  
  2413. function OpenMicrophone() {
  2414. MicrophoneElement.initMouseEvent("mousedown");
  2415. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  2416. }
  2417. var CameraSound = new MutationObserver(function(mutations) {Cameras();});
  2418. function Cameras() {
  2419. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2420. Len = Camera.length;
  2421. for (var num = 0; num < Len; num++) {
  2422. var user = HandleToUser(Camera[num].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id"));
  2423. Camera[num].shadowRoot.querySelector(".video").style.padding = (CTS.CameraBorderToggle) ? "5px" : "0";
  2424. if (user != -1) {
  2425.  
  2426. if (CTS.Me.handle !== CTS.UserList[user].handle) {
  2427. CameraSound.observe(Camera[num].shadowRoot.querySelector("div > div > div.overlay > div.icon-volume > tc-volume-control").shadowRoot.querySelector(".icon-volume"), { attributes: true, childList: true, subtree: true } );
  2428. if (window.CTSMuted) {
  2429. Camera[num].shadowRoot.querySelector(".video > div > video").volume = 0;
  2430. } else {
  2431. Camera[num].shadowRoot.querySelector(".video > div > video").volume = (parseInt(Camera[num].shadowRoot.querySelector("div > div > div.overlay > div.icon-volume > tc-volume-control").shadowRoot.querySelector("#videos-header-volume-level").style.width)/100)*window.CTSRoomVolume;
  2432. }
  2433. }
  2434. if (!Camera[num].shadowRoot.querySelector(".video #fixed")) {
  2435. if (CTS.HiddenCameraList.includes(CTS.UserList[user].username)) {
  2436. window.TinychatApp.BLL.Videolist.prototype.toggleHiddenVW(window.TinychatApp.getInstance().defaultChatroom._videolist.items[num], false);
  2437. Alert(GetActiveChat(), CTS.UserList[user].username + " has been auto-hidden!");
  2438. }
  2439. Camera[num].shadowRoot.querySelector(".video").insertAdjacentHTML("afterbegin", "<style id=\"fixed\">.video{border-radius: 12px;}.video.not-visible>div>.overlay{background: url(https://i.imgur.com/uOP8tlr.png) rgb(0, 0, 0) no-repeat;background-position: center!important;background-size: cover!important;}.video.large{position: absolute;left:20%;top: 0;z-index: 2;width: 60%;}.video>div>.overlay[data-mic-level=\"1\"] {-webkit-box-shadow: inset 0 0 2px 3px #53b6ef;box-shadow: inset 0 0 2px 3px #53b6ef;}.video>div>.overlay[data-mic-level=\"2\"] {-webkit-box-shadow: inset 0 0 6px 4px #53b6ef;box-shadow: inset 0 0 6px 4px #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 8px 5px #53b6ef;box-shadow: inset 0 0 8px 5px #53b6ef;}.video:after{content:unset;}</style>");
  2440. }
  2441. }
  2442. }
  2443. Resize();
  2444. }
  2445.  
  2446. function FeaturedCameras() {
  2447. if (arguments[0] === true) {
  2448. if (VideoListElement.querySelector("#SmallFTYT")) Remove(VideoListElement, "#SmallFTYT");
  2449. } else {
  2450. var node = document.createElement("style");
  2451. node.appendChild(document.createTextNode(FeaturedCSS));
  2452. node.setAttribute("id", "SmallFTYT");
  2453. VideoListElement.appendChild(node);
  2454. }
  2455. }
  2456.  
  2457. function Resize() {
  2458. window.dispatchEvent(new Event("resize"));
  2459. }
  2460.  
  2461. function PerformanceModeInit() {
  2462. if (!CTS.ThemeChange) {
  2463. var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
  2464. ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
  2465. ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
  2466. ChatLogElement.querySelector("#chat-wrapper").style.width = value;
  2467. TitleElement.querySelector("#room-header").style.minWidth = value;
  2468. TitleElement.querySelector("#room-header").style.maxWidth = value;
  2469. TitleElement.querySelector("#room-header").style.width = value;
  2470. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2471. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2472. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
  2473. VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2474. VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2475. VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2476. SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
  2477. SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
  2478. SideMenuElement.querySelector("#sidemenu").style.width = value;
  2479. document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
  2480. if (arguments[0]) {
  2481. VideoListElement.querySelector("#videos-content").style.display = "none";
  2482. } else {
  2483. VideoListElement.querySelector("#videos-content").style.removeProperty("display");
  2484. }
  2485. } else {
  2486. if (arguments[0]) {
  2487. VideoListElement.querySelector("#videos-content").style.display = "none";
  2488. ChatLogElement.querySelector("#chat-wrapper").style.width = "100%";
  2489. ChatLogElement.querySelector("#chat-wrapper").style.position = "fixed";
  2490. ChatLogElement.querySelector("#chat-wrapper").style.left = "0";
  2491. ChatLogElement.querySelector("#chat-wrapper").style.bottom = "0";
  2492. ChatLogElement.querySelector("#chat-wrapper").style.minHeight = "100%";
  2493. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.display = "none";
  2494. VideoListElement.querySelector("#videos-header").style.display = "none";
  2495. VideoListElement.querySelector("#videos-footer").style.display = "none";
  2496. } else {
  2497. VideoListElement.querySelector("#videos-content").style.removeProperty("display");
  2498. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("width");
  2499. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("position");
  2500. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("left");
  2501. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("bottom");
  2502. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("min-height");
  2503. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.removeProperty("display");
  2504. VideoListElement.querySelector("#videos-header").style.removeProperty("display");
  2505. VideoListElement.querySelector("#videos-footer").style.removeProperty("display");
  2506. }
  2507. }
  2508. UpdateScroll(1, true);
  2509. UpdateScroll(2, true);
  2510. Resize();
  2511. }
  2512.  
  2513. function OwnerCommand() {
  2514. //MESSAGE FROM OWNER
  2515. if (isCommand(arguments[1])) {
  2516. if (CTS.UserList[arguments[0]].owner) {
  2517. if (!CTS.Me.owner) {
  2518. //PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
  2519. if (arguments[1].match(/^!raid /i)) {
  2520. // !raid https://tinychat.com/roomname
  2521. var raid = arguments[1].match(/^(?:!raid )(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})$/i);
  2522. if (raid !== null) {
  2523. if (CTS.RaidToggle) {
  2524. window.location.replace("https://tinychat.com/room/" + raid[1]);
  2525. } else {
  2526. Alert(GetActiveChat(), "[TIP]\nRaids are silenced. Refresh or !raidtoggle");
  2527. }
  2528. } else {
  2529. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nThis is not a valid link for raid.");
  2530. }
  2531. }
  2532. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + Ver(), CTS.UserList[arguments[0]].handle);
  2533. } else {
  2534. if (arguments[1].match(/^!closeall$/i)) {
  2535. for (var a = 0; a < CTS.Camera.List.length; a++) {
  2536. if (CTS.Me.handle !== CTS.Camera.List[a]) {
  2537. Send("stream_moder_close", CTS.Camera.List[a]);
  2538. } else {
  2539. CTS.SocketTarget.send(JSON.stringify({
  2540. "tc": "stream_close",
  2541. "handle": CTS.Me.handle
  2542. }));
  2543. }
  2544. }
  2545. }
  2546. if (arguments[1].match(/^!kickall$/i)) {
  2547. for (var b = 0; b < CTS.UserList.length; b++) {
  2548. if (CTS.Me.handle !== CTS.UserList[b].handle) Send("kick", CTS.UserList[b].handle);
  2549. }
  2550. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nIf you leave now, the entire room resets! GOGOGO~");
  2551. }
  2552. }
  2553. }
  2554. }
  2555. }
  2556.  
  2557. function Command() {
  2558. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?: ?)(.*)/i);
  2559. if (UserCommand) {
  2560. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  2561. debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
  2562. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  2563. }
  2564. }
  2565. }
  2566. //ALERT FUNCTIONS
  2567. function Settings() {
  2568. 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") + "\n\nReminder Mode: " + ((CTS.Reminder) ? "ON" : "OFF") + "\n\nGame View: " + ((CTS.CanSeeGames) ? "ON" : "OFF") + "\n\nTriva Game Host: " + ((CTS.CanHostTriviaGames) ? "ON" : "OFF") + "\nFish Game Host: " + ((CTS.CanHostFishGames) ? "ON" : "OFF") + "\n\nNotification Display: " + ((CTS.NotificationToggle != 2) ? "SHOW(" + CTS.NotificationToggle + ")" : "HIDE") + "\nPopup Display: " + ((CTS.Popups) ? "SHOW" : "HIDE") + "\n\nFOR LIST OF COMMANDS:\n!CTS</center>");
  2569. }
  2570.  
  2571. function Alert() {
  2572. CTS.Message[arguments[0]].push({
  2573. "time": Time(),
  2574. "namecolor": (arguments[2] !== undefined) ? "#000000" : "#3f69c0",
  2575. "avatar": (arguments[2] !== undefined) ? ("") : ("https://i.imgur.com/S09irS7.png"),
  2576. "username": "",
  2577. "nick": (arguments[2] !== undefined) ? (arguments[2]) : ("CTS Version: " + Ver()),
  2578. "msg": ((arguments[2] !== undefined) ? ("<div class=\"systemuser\">" + arguments[1] + "</div>") : arguments[1]),
  2579. "mention": true
  2580. });
  2581. var len = CTS.Message[arguments[0]].length - 1;
  2582. arguments[1] = CTS.Message[arguments[0]][len];
  2583. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[1].mention, arguments[0]);
  2584. }
  2585.  
  2586. window.ShowProfile = function() {
  2587. var resp = JSON.parse(arguments[0]);
  2588. if (resp.result == "success") Alert(GetActiveChat(), "Username:\n" + resp.username + "\nAge:\n" + resp.age + "\nGender:\n" + resp.gender + "\nLocation:\n" + resp.location + "\nBiography:\n" + resp.biography, "Profile Lookup");
  2589. };
  2590.  
  2591. function Ver() {
  2592. return window.CTSVersion.Major + "." + window.CTSVersion.Minor + "." + window.CTSVersion.Patch;
  2593. }
  2594.  
  2595. function AddUserNotification() {
  2596. if (CTS.FullLoad && CTS.ShowedSettings) {
  2597. var chat = ChatLogElement.querySelector("#notification-content"),
  2598. Notification;
  2599. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  2600. if (arguments[0] == 1) {
  2601. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  2602. } else if (arguments[0] == 2) {
  2603. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left.");
  2604. } else if (arguments[0] == 3) {
  2605. Notification = arguments[2] + "has mentioned you!";
  2606. 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>");
  2607. UpdateScroll(2, true);
  2608. } else if (arguments[0] == 4) {
  2609. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  2610. }
  2611. 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>");
  2612. if (CTS.NotificationToggle == 1) Alert(0, Notification, arguments[2]);
  2613. 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);
  2614. UpdateScroll(2, false);
  2615. var Notifications = ChatLogElement.querySelectorAll(".notification");
  2616. if (Notifications.length > CTS.NotificationLimit + 25) {
  2617. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  2618. }
  2619. }
  2620. }
  2621.  
  2622. function AddSystemNotification() {
  2623. if (CTS.FullLoad && CTS.ShowedSettings) {
  2624. if (CTS.NotificationToggle == 0) {
  2625. 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>");
  2626. } else if (CTS.NotificationToggle == 1) {
  2627. Alert(0, arguments[0], "SYSTEM");
  2628. }
  2629. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  2630. UpdateScroll(2, false);
  2631. }
  2632. }
  2633. //USER FUNCTION
  2634. function AddUser() {
  2635. CTS.UserList.push({
  2636. "handle": arguments[0],
  2637. "username": arguments[5],
  2638. "nick": arguments[4],
  2639. "owner": arguments[7],
  2640. "mod": arguments[1],
  2641. "namecolor": arguments[2],
  2642. "avatar": arguments[3],
  2643. "canGame": arguments[6],
  2644. "broadcasting": false,
  2645. "vote": 0,
  2646. "triviapoints": CTS.Game.Trivia.PlayerList[arguments[5]] || 0
  2647. });
  2648. if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  2649. }
  2650.  
  2651. function HandleToUser() {
  2652. for (var user = 0; user < CTS.UserList.length; user++) {
  2653. if (CTS.UserList[user].handle == arguments[0]) return user;
  2654. }
  2655. return -1;
  2656. }
  2657.  
  2658. function UsernameToHandle() {
  2659. for (var user = 0; user < CTS.UserList.length; user++) {
  2660. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2661. }
  2662. return -1;
  2663. }
  2664.  
  2665. function UsernameToUser() {
  2666. for (var user = 0; user < CTS.UserList.length; user++) {
  2667. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return user;
  2668. }
  2669. return -1;
  2670. }
  2671.  
  2672. function NicknameToHandle() {
  2673. for (var user = 0; user < CTS.UserList.length; user++) {
  2674. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2675. }
  2676. return -1;
  2677. }
  2678.  
  2679. function NicknameToUser() {
  2680. for (var user = 0; user < CTS.UserList.length; user++) {
  2681. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  2682. }
  2683. return -1;
  2684. }
  2685.  
  2686. function CheckUserListSafe() {
  2687. var len = CTS.UserList.length;
  2688. var temp = [];
  2689. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2690. for (var user = 0; user < len; user++) {
  2691. if (!CTS.UserList[user].mod && !isSafeListed(CTS.UserList[user].username)) CTS.KBQueue.push(CTS.UserList[user].handle);
  2692. }
  2693. len = CTS.KBQueue.length;
  2694. for (var kb = 0; kb < len; kb++) {
  2695. Send(arguments[0], CTS.KBQueue[kb]);
  2696. }
  2697. CTS.KBQueue = [];
  2698. }
  2699.  
  2700. function isSafeListed() {
  2701. var temp = [];
  2702. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2703. return (CTS.SafeList.includes(arguments[0]) || temp.includes(arguments[0]));
  2704. }
  2705.  
  2706. function CheckUserTempIgnore() {
  2707. if (CTS.TempIgnoreUserList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreNickList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  2708. return false;
  2709. }
  2710.  
  2711. function CheckUserIgnore() {
  2712. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username)) return true;
  2713. return false;
  2714. }
  2715.  
  2716. function CheckUserTouchScreen() {
  2717. if (/Mobi|Android/i.test(navigator.userAgent) || 'ontouchstart' in document.documentElement) {
  2718. CTS.Project.isTouchScreen = true;
  2719. CTS.ThemeChange = true;
  2720. }
  2721. }
  2722.  
  2723. function CheckUserAbuse() {
  2724. var action = false;
  2725. if (CTS.Me.mod) {
  2726. if (CTS.UserKickList.includes(arguments[1]) || CTS.NickKickList.includes(arguments[2].toUpperCase())) {
  2727. CTS.NoGreet = true;
  2728. Send("kick", arguments[0]);
  2729. action = true;
  2730. }
  2731. if (!action) {
  2732. if (CTS.UserBanList.includes(arguments[1]) || CTS.NickBanList.includes(arguments[2].toUpperCase())) {
  2733. CTS.NoGreet = true;
  2734. Send("ban", arguments[0]);
  2735. }
  2736. }
  2737. }
  2738. }
  2739.  
  2740. function CheckUserWordAbuse() {
  2741. if (CTS.UserList[arguments[0]].handle != CTS.Me.handle && !CTS.UserList[arguments[0]].mod) {
  2742. var action = false; //LETS NOT REPEAT/KICK
  2743. var len = CTS.KickKeywordList.length;
  2744. for (var i = 0; i < len; i++) {
  2745. if (arguments[1].includes(CTS.KickKeywordList[i])) {
  2746. Send("kick", CTS.UserList[arguments[0]].handle);
  2747. action = true;
  2748. break;
  2749. }
  2750. }
  2751. if (!action) {
  2752. len = CTS.BanKeywordList.length;
  2753. for (i = 0; i < len; i++) {
  2754. if (arguments[1].includes(CTS.BanKeywordList[i])) {
  2755. Send("ban", CTS.UserList[arguments[0]].handle);
  2756. break;
  2757. }
  2758. }
  2759. }
  2760. }
  2761. }
  2762.  
  2763. function RemoveUserCamera() {
  2764. var len = CTS.Camera.List.length;
  2765. if (len > 0) {
  2766. for (var i = 0; i < len; i++) {
  2767. if (CTS.Camera.List[i] === arguments[0]) {
  2768. CTS.Camera.List.splice(i, 1);
  2769. clearTimeout(CTS.Camera.clearRandom);
  2770. break;
  2771. }
  2772. }
  2773. }
  2774. }
  2775.  
  2776. function CheckUserStream() {
  2777. var user = HandleToUser(arguments[0]);
  2778. if (user != -1) {
  2779. if (CTS.Me.mod) {
  2780. if (arguments[1]) {
  2781. //PUSH UPDATE
  2782. CTS.Camera.List.push(CTS.UserList[user].handle);
  2783. CTS.UserList[user].broadcasting = true;
  2784. var len = CTS.Camera.List.length;
  2785. if (CTS.UserList[user].username !== "GUEST" && !CTS.GreenRoomList.includes(CTS.UserList[user].username)) {
  2786. CTS.GreenRoomList.push(CTS.UserList[user].username);
  2787. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  2788. }
  2789. //CLEAR TIMERS
  2790. clearTimeout(CTS.Camera.clearRandom);
  2791. //CAMERA SWEEP FUNCTION
  2792. if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
  2793. CTS.Camera.clearRandom = setTimeout(function() {
  2794. var rand = Rand(0, len - 1);
  2795. if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
  2796. var target = HandleToUser(CTS.Camera.List[rand]);
  2797. if (CTS.Me.owner || !CTS.UserList[target].mod) {
  2798. Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
  2799. Send("stream_moder_close", CTS.Camera.List[rand]);
  2800. CTS.Camera.List.splice(rand, 1);
  2801. }
  2802. }
  2803. }, CTS.Camera.SweepTimer * 60000);
  2804. }
  2805. } else {
  2806. clearTimeout(CTS.Camera.clearRandom);
  2807. RemoveUserCamera(CTS.UserList[user].handle);
  2808. CTS.UserList[user].broadcasting = false;
  2809. }
  2810. CTS.UserList[user].broadcasting = arguments[1];
  2811. }
  2812. if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  2813. }
  2814. }
  2815.  
  2816. function CheckUserName() {
  2817. return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
  2818. }
  2819.  
  2820. function CheckUserNameStrict() {
  2821. return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
  2822. }
  2823.  
  2824. function MSR() {
  2825. if (arguments[0]) {
  2826. arguments[1].videolist.RemoveVideoRemote(arguments[1].handle);
  2827. } else {
  2828. arguments[1].mediaStream.stop();
  2829. arguments[1].mediaStream = null;
  2830. }
  2831. }
  2832.  
  2833. function MS() {
  2834. if (arguments[0].mediaStream !== null) {
  2835. if (arguments[0].mediaStream.active && arguments[1].signalingState !== "closed" && typeof arguments[1].removeStream === "function" && arguments[1].removeStream(arguments[0].mediaStream)) MSR(false, arguments[0]);
  2836. } else {
  2837. MSR(true, arguments[0]);
  2838. }
  2839. if (arguments[1].signalingState !== "closed" && arguments[1].close());
  2840. }
  2841. //LOAD/SAVE FUNCTION
  2842. function Load() {
  2843. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  2844. if (null === val && "undefined" != typeof arguments[1]) {
  2845. Save(arguments[0], arguments[1]);
  2846. return arguments[1];
  2847. }
  2848. return val;
  2849. }
  2850.  
  2851. function Save() {
  2852. if (CTS.StorageSupport) {
  2853. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  2854. } else {
  2855. Alert(GetActiveChat(), "Looks like you don't have LocalStorage allowed on this device!\nYour options will not be saved!");
  2856. }
  2857. }
  2858.  
  2859. //SOCKET FUNCTION
  2860. function CTSWebSocket() {
  2861. if (window.Proxy === undefined) return;
  2862. var handler = {
  2863. set: function(Target, prop, value) {
  2864. if (prop == "onmessage") {
  2865. var oldMessage = value;
  2866. value = function(event) {
  2867. ServerMsg(JSON.parse(event.data), Target);
  2868. oldMessage(event);
  2869. };
  2870. }
  2871. return (Target[prop] = value);
  2872. },
  2873. get: function(Target, prop) {
  2874. var value = Target[prop];
  2875. if (prop == "send") {
  2876. value = function(event) {
  2877. ClientMsg(JSON.parse(event), Target);
  2878. Target.send(event);
  2879. };
  2880. } else if (typeof value == 'function') {
  2881. value = value.bind(Target);
  2882. }
  2883. return value;
  2884. }
  2885. };
  2886. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  2887. construct: function(Target, args) {
  2888. CTS.SocketTarget = new Target(args[0]);
  2889. debug("SOCKET::CONNECTING", args[0]);
  2890. return new window.Proxy(CTS.SocketTarget, handler);
  2891. }
  2892. });
  2893. window.WebSocket = WebSocketProxy;
  2894. }
  2895.  
  2896. function ModCommand() {
  2897. var name = arguments[1].match(/^!(?:userkick|nickkick|userban|nickban|userclose|nickclose) (guest-[0-9]{1,32}|[a-z0-9_]{1,32})$/i),
  2898. target;
  2899. if (name !== null) {
  2900. if (name[1].toUpperCase() !== "GUEST") {
  2901. target = ((arguments[2]) ? UsernameToUser(name[1].toUpperCase()) : NicknameToUser(name[1].toUpperCase()));
  2902. } else {
  2903. target = NicknameToUser(name[1].toUpperCase());
  2904. }
  2905. if (target != -1) { // USER ONLINE
  2906. if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
  2907. //IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
  2908. if (arguments[0] === "stream_moder_close") {
  2909. if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
  2910. } else {
  2911. Send(arguments[0], CTS.UserList[target].handle);
  2912. }
  2913. } else {
  2914. Send("msg", "This users authorization is similar or above yours!");
  2915. }
  2916. }
  2917. }
  2918. }
  2919.  
  2920. function BotCommand() {
  2921. var len = CTS.YouTube.MessageQueueList.length;
  2922. if (len <= 0) {
  2923. var check = true;
  2924. // Moderator Control
  2925. if (CTS.UserList[arguments[1]].mod) {
  2926. if (arguments[0] == 2) {
  2927. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2928. CTS.YouTube.Clear = true;
  2929. YouTubePlayList();
  2930. }
  2931. check = false;
  2932. }
  2933. if (arguments[0] == 5) {
  2934. SetBot(true);
  2935. check = false;
  2936. }
  2937. }
  2938. // User and Moderator Control
  2939. if (check) {
  2940. if (VerifyYouTube(arguments[1])) {
  2941. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  2942. if (arguments[0] == 4) YouTubePlayList(true);
  2943. if (CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
  2944. if (arguments[0] == 6) YoutubeBypass(arguments[2]);
  2945. if (arguments[0] == 3) {
  2946. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2947. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  2948. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  2949. }
  2950. }
  2951. }
  2952. }
  2953. }
  2954. } else {
  2955. if (CTS.YouTube.ListBuilt === false) {
  2956. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  2957. } else {
  2958. Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  2959. }
  2960. }
  2961. }
  2962.  
  2963. function ServerMsg() {
  2964. if (typeof ServerInList[arguments[0].tc] == "function") {
  2965. debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2966. ServerInList[arguments[0].tc](arguments[0]);
  2967. }
  2968. }
  2969.  
  2970. function ClientMsg() {
  2971. if (typeof ServerOutList[arguments[0].tc] == "function") {
  2972. debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2973. ServerOutList[arguments[0].tc](arguments[0]);
  2974. }
  2975. }
  2976.  
  2977. function Send() {
  2978. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  2979. if (arguments[1] === undefined) arguments[1] = "Open Request";
  2980. debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  2981. }
  2982. //GAME FUNCTION
  2983. //FISHING BOAT
  2984. function FishUpgradeStatus() {
  2985. var msg = "[FISHING BOAT]\n";
  2986. if (arguments[1] != 7) msg += arguments[0].Nickname + ":\n";
  2987. if (arguments[1] == 0 || arguments[1] == 1) msg += "[NET]Lv. " + arguments[0].Upgrades.Net + "\n" + ((arguments[0].Upgrades.Net >= 10) ? "[MAXED]" : "[COSTS $" + Fish.PriceList(arguments[0], 0) + " to UPGRADE]\n\n");
  2988. if (arguments[1] == 0 || arguments[1] == 2) msg += "[RADAR]Lv. " + arguments[0].Upgrades.Radar + "\n" + ((arguments[0].Upgrades.Radar >= 20) ? "[MAXED]" : "[COSTS $" + Fish.PriceList(arguments[0], 1) + " to UPGRADE]") + "\n\n";
  2989. if (arguments[1] == 0 || arguments[1] == 3) msg += "[INSURANCE]\n" + ((arguments[0].Upgrades.Insurance) ? "[OWNED]" : "[COSTS $" + Fish.PriceList(arguments[0], 3) + " per ROUND]") + "\n\n";
  2990. if (arguments[1] == 0 || arguments[1] == 4) msg += "[SHOP]Lv. " + arguments[0].Upgrades.Store + "\n" + ((arguments[0].Upgrades.Store >= 6) ? "[MAXED]" : "[COSTS $" + Fish.PriceList(arguments[0], 2) + " to UPGRADE]") + "\n\n";
  2991. if (arguments[1] == 6) msg += "HELP:\n!fish\n!fishbank\n!fishsplit user|nick\n!fishgamble\n[COSTS $" + Fish.PriceList(arguments[0], 6) + "]\n!fishrob user|nick\n[COSTS $" + Fish.PriceList(arguments[0], 4) + "]\n!fishslap user|nick\n[COSTS $" + Fish.PriceList(arguments[0], 5) + "]\n!fishupgrade\n!fishupgrade\n[Net|Radar|Insurance|Shop]\n\n";
  2992. Send("msg", msg);
  2993. }
  2994.  
  2995. function FishTimerCheck() {
  2996. if (new Date() - arguments[0].LastCheck >= 5000) {
  2997. arguments[0].LastCheck = new Date();
  2998. return true;
  2999. }
  3000. return false;
  3001. }
  3002.  
  3003. function FishCommandCheck() {
  3004. var command,
  3005. playerExist = Fish.GetPlayer(CTS.UserList[arguments[0]].handle, false, true),
  3006. FishCommand = arguments[1].match(/^!(fish(?:rob|slap|split|help|upgrade)?) ?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
  3007. if (FishCommand) {
  3008. if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
  3009. if (FishCommand[2] !== undefined) {
  3010. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  3011. }
  3012. } else {
  3013. command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
  3014. if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  3015. }
  3016. }
  3017. }
  3018.  
  3019. function FishTransfer() {
  3020. if (arguments[1] !== undefined && arguments[1] !== -1) {
  3021. if (arguments[0].Points > arguments[2]) {
  3022. if (arguments[4]) {
  3023. arguments[0].Points -= arguments[2];
  3024. if (arguments[1].Points <= arguments[3]) {
  3025. arguments[3] = arguments[1].Points;
  3026. arguments[1].Points -= arguments[3];
  3027. arguments[0].Points += arguments[3];
  3028. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " destroyed " + arguments[1].Nickname + "\nMoney made $" + arguments[3] + "!");
  3029. Fish.GetPlayer(arguments[1].Handle, true);
  3030. } else {
  3031. arguments[1].Points -= arguments[3];
  3032. arguments[0].Points += arguments[3];
  3033. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " robbed " + arguments[1].Nickname + " for $" + arguments[3] + "!");
  3034. }
  3035. } else {
  3036. arguments[0].Points = arguments[3];
  3037. arguments[1].Points += arguments[3];
  3038. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " split their money with " + arguments[1].Nickname + "!");
  3039. }
  3040. } else {
  3041. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " are you kidding me?\nTalk to me when you have money!");
  3042. }
  3043. }
  3044. }
  3045.  
  3046. function FishTransaction() {
  3047. if (arguments[0].Points > arguments[1]) {
  3048. arguments[0].Points -= arguments[1];
  3049. return true;
  3050. } else {
  3051. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + ", are you kidding me?\nTalk to me when you have money!");
  3052. return false;
  3053. }
  3054. }
  3055. //SERVER/CLIENT LIST FUNCTION
  3056. var CommandList = {
  3057. cts: function() {
  3058. Alert(GetActiveChat(), "<b style=\"color:#ffffff;\"><u>Owner Commands:</u></b>\n!raid <b style=\"color:#ffff00;\">tc link</b>\n!closeall\n!kickall\n!version\n\n<b style=\"color:#ffffff;\"><u>Moderator Commands:</u></b>\n!whoisbot\n!bot\n!bottoggle\n!greenroomtoggle\n!publiccommandtoggle\n!camsweep <b style=\"color:#ffff00;\">5 - 30</b>\n!votetoggle\n!autokick (be careful!)\n!autoban (be careful!)\n\n!ytapi <b style=\"color:#ffff00;\">apikey</b>\n!ytbypass <b style=\"color:#ffff00;\">link (no playlists)</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytskip\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!modlist\n!modlistclear\n!modadd <b style=\"color:#ffff00;\">user</b>\n!modremove <b style=\"color:#ffff00;\">#</b>\n\n<b style=\"color:#ffffff;\"><u>Jr. Moderator Commands:</u></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:#ffffff;\"><u>User Commands:</u></b>\n!fps <b style=\"color:#ffff00;\">1 - 60</b>\n\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\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!hiddencameralist\n!hiddencameralistclear\n!hiddencameraadd <b style=\"color:#ffff00;\">user</b>\n!hiddencameraremove <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!greetmodetoggle\n!imgurtoggle\n!raidtoggle\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!clrall\n!clr\n!settings\n!share\n\n<b style=\"color:#ffffff;\"><u>Game Commands:</u></b>\n!gameview\n!triviahost\n!trivia\n!triviahelp\n!fishhost\n!fish\n!fishhelp\n\n!triviaplayerlist\n!triviaplayerlistclear\n!triviaplayeradd <b style=\"color:#ffff00;\">user</b>\n!triviaplayerremove <b style=\"color:#ffff00;\">#</b>");
  3059. },
  3060. help: function() {
  3061. this.cts();
  3062. },
  3063. userlist: function() {
  3064. Alert(GetActiveChat(), SettingsList.UserList());
  3065. },
  3066. ytapi: function() {
  3067. if (arguments[0] === "") {
  3068. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3069. } else {
  3070. if (arguments[0].match(/^([0-9A-Z_-]*)/i)) {
  3071. CTS.YouTube.API_KEY = arguments[0];
  3072. Save("YouTubeAPI", arguments[0]);
  3073. Alert(GetActiveChat(), "✓ Command Accepted!");
  3074. } else {
  3075. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3076. }
  3077. }
  3078. },
  3079. fps: function() {
  3080. CTS.FPS = (arguments[0] === "" || isNaN(arguments[0])) ? 30 : (arguments[0] > 60) ? 60 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  3081. Save("FPS", CTS.FPS);
  3082. Alert(GetActiveChat(), "✓ Command Accepted!");
  3083. if (CTS.Me.broadcasting) Alert(GetActiveChat(), "Settings will not change till you re-cam!");
  3084. },
  3085. mentionadd: function() {
  3086. if (arguments[0] === "") {
  3087. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3088. } else {
  3089. if (CheckUserNameStrict(arguments[0])) {
  3090. if (!CTS.MentionList.includes(arguments[0].toUpperCase())) {
  3091. CTS.MentionList.push(arguments[0].toUpperCase());
  3092. Save("MentionList", JSON.stringify(CTS.MentionList));
  3093. Alert(GetActiveChat(), "✓ Command Accepted!");
  3094. } else {
  3095. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3096. }
  3097. } else {
  3098. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3099. }
  3100. }
  3101. },
  3102. mentionremove: function() {
  3103. if (arguments[0] === "" || isNaN(arguments[0])) {
  3104. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3105. } else {
  3106. if (CTS.MentionList[arguments[0]] !== undefined) {
  3107. CTS.MentionList.splice(arguments[0], 1);
  3108. Save("MentionList", JSON.stringify(CTS.MentionList));
  3109. Alert(GetActiveChat(), "✓ Command Accepted!");
  3110. } else {
  3111. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3112. }
  3113. }
  3114. },
  3115. mentionlistclear: function() {
  3116. CTS.MentionList = [];
  3117. Save("MentionList", JSON.stringify(CTS.MentionList));
  3118. Alert(GetActiveChat(), "✓ Command Accepted!");
  3119. },
  3120. mentionlist: function() {
  3121. Alert(GetActiveChat(), SettingsList.MentionList());
  3122. },
  3123. hiddencameraadd: function() {
  3124. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") {
  3125. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3126. } else {
  3127. if (CheckUserNameStrict(arguments[0])) {
  3128. if (!CTS.HiddenCameraList.includes(arguments[0].toUpperCase())) {
  3129. CTS.HiddenCameraList.push(arguments[0].toUpperCase());
  3130. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3131. Alert(GetActiveChat(), "✓ Command Accepted!");
  3132. } else {
  3133. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3134. }
  3135. } else {
  3136. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3137. }
  3138. }
  3139. },
  3140. hiddencameraremove: function() {
  3141. if (arguments[0] === "" || isNaN(arguments[0])) {
  3142. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3143. } else {
  3144. if (CTS.HiddenCameraList[arguments[0]] !== undefined) {
  3145. CTS.HiddenCameraList.splice(arguments[0], 1);
  3146. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3147. Alert(GetActiveChat(), "✓ Command Accepted!");
  3148. } else {
  3149. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3150. }
  3151. }
  3152. },
  3153. hiddencameralistclear: function() {
  3154. CTS.HiddenCameraList = [];
  3155. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3156. Alert(GetActiveChat(), "✓ Command Accepted!");
  3157. },
  3158. hiddencameralist: function() {
  3159. Alert(GetActiveChat(), SettingsList.HiddenCameraList());
  3160. },
  3161. ignoreadd: function() {
  3162. if (arguments[0] === "") {
  3163. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3164. } else {
  3165. if (CheckUserNameStrict(arguments[0])) {
  3166. if (!CTS.IgnoreList.includes(arguments[0].toUpperCase())) {
  3167. CTS.IgnoreList.push(arguments[0].toUpperCase());
  3168. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3169. Alert(GetActiveChat(), "✓ Command Accepted!");
  3170. } else {
  3171. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3172. }
  3173. } else {
  3174. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3175. }
  3176. }
  3177. },
  3178. ignoreremove: function() {
  3179. if (arguments[0] === "" || isNaN(arguments[0])) {
  3180. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3181. } else {
  3182. if (CTS.IgnoreList[arguments[0]] !== undefined) {
  3183. CTS.IgnoreList.splice(arguments[0], 1);
  3184. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3185. Alert(GetActiveChat(), "✓ Command Accepted!");
  3186. } else {
  3187. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3188. }
  3189. }
  3190. },
  3191. ignorelistclear: function() {
  3192. CTS.IgnoreList = [];
  3193. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3194. Alert(GetActiveChat(), "✓ Command Accepted!");
  3195. },
  3196. ignorelist: function() {
  3197. Alert(GetActiveChat(), SettingsList.IgnoreList());
  3198. },
  3199. userbanadd: function() {
  3200. if (arguments[0] === "") {
  3201. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3202. } else {
  3203. if (CheckUserNameStrict(arguments[0])) {
  3204. if (!CTS.UserBanList.includes(arguments[0].toUpperCase())) {
  3205. CTS.UserBanList.push(arguments[0].toUpperCase());
  3206. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3207. Alert(GetActiveChat(), "✓ Command Accepted!");
  3208. var check = UsernameToHandle(arguments[0].toUpperCase());
  3209. if (check != -1 && CTS.Me.mod) Send("ban", check);
  3210. } else {
  3211. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3212. }
  3213. } else {
  3214. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3215. }
  3216. }
  3217. },
  3218. userbanremove: function() {
  3219. if (arguments[0] === "" || isNaN(arguments[0])) {
  3220. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3221. } else {
  3222. if (CTS.UserBanList[arguments[0]] !== undefined) {
  3223. CTS.UserBanList.splice(arguments[0], 1);
  3224. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3225. Alert(GetActiveChat(), "✓ Command Accepted!");
  3226. } else {
  3227. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3228. }
  3229. }
  3230. },
  3231. userbanlistclear: function() {
  3232. CTS.UserBanList = [];
  3233. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3234. Alert(GetActiveChat(), "✓ Command Accepted!");
  3235. },
  3236. userbanlist: function() {
  3237. Alert(GetActiveChat(), SettingsList.UserBanList());
  3238. },
  3239. nickbanadd: function() {
  3240. if (arguments[0] === "") {
  3241. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3242. } else {
  3243. if (CheckUserNameStrict(arguments[0])) {
  3244. if (!CTS.NickBanList.includes(arguments[0].toUpperCase())) {
  3245. CTS.NickBanList.push(arguments[0].toUpperCase());
  3246. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3247. Alert(GetActiveChat(), "✓ Command Accepted!");
  3248. var check = NicknameToHandle(arguments[0].toUpperCase());
  3249. if (check != -1 && CTS.Me.mod) Send("ban", check);
  3250. } else {
  3251. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3252. }
  3253. } else {
  3254. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3255. }
  3256. }
  3257. },
  3258. nickbanremove: function() {
  3259. if (arguments[0] === "" || isNaN(arguments[0])) {
  3260. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3261. } else {
  3262. if (CTS.NickBanList[arguments[0]] !== undefined) {
  3263. CTS.NickBanList.splice(arguments[0], 1);
  3264. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3265. Alert(GetActiveChat(), "✓ Command Accepted!");
  3266. } else {
  3267. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3268. }
  3269. }
  3270. },
  3271. nickbanlistclear: function() {
  3272. CTS.NickBanList = [];
  3273. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3274. Alert(GetActiveChat(), "✓ Command Accepted!");
  3275. },
  3276. nickbanlist: function() {
  3277. Alert(GetActiveChat(), SettingsList.NickBanList());
  3278. },
  3279. userkickadd: function() {
  3280. if (arguments[0] === "") {
  3281. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3282. } else {
  3283. if (CheckUserNameStrict(arguments[0])) {
  3284. if (!CTS.UserKickList.includes(arguments[0].toUpperCase())) {
  3285. CTS.UserKickList.push(arguments[0].toUpperCase());
  3286. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3287. Alert(GetActiveChat(), "✓ Command Accepted!");
  3288. var check = UsernameToHandle(arguments[0].toUpperCase());
  3289. if (check != -1 && CTS.Me.mod) Send("kick", check);
  3290. } else {
  3291. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3292. }
  3293. } else {
  3294. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3295. }
  3296. }
  3297. },
  3298. userkickremove: function() {
  3299. if (arguments[0] === "" || isNaN(arguments[0])) {
  3300. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3301. } else {
  3302. if (CTS.UserKickList[arguments[0]] !== undefined) {
  3303. CTS.UserKickList.splice(arguments[0], 1);
  3304. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3305. Alert(GetActiveChat(), "✓ Command Accepted!");
  3306. } else {
  3307. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3308. }
  3309. }
  3310. },
  3311. userkicklistclear: function() {
  3312. CTS.UserKickList = [];
  3313. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3314. Alert(GetActiveChat(), "✓ Command Accepted!");
  3315. },
  3316. userkicklist: function() {
  3317. Alert(GetActiveChat(), SettingsList.UserKickList());
  3318. },
  3319. nickkickadd: function() {
  3320. if (arguments[0] === "") {
  3321. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3322. } else {
  3323. if (CheckUserNameStrict(arguments[0])) {
  3324. if (!CTS.NickKickList.includes(arguments[0].toUpperCase())) {
  3325. CTS.NickKickList.push(arguments[0].toUpperCase());
  3326. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3327. Alert(GetActiveChat(), "✓ Command Accepted!");
  3328. var check = NicknameToHandle(arguments[0].toUpperCase());
  3329. if (check != -1 && CTS.Me.mod) Send("kick", check);
  3330. } else {
  3331. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3332. }
  3333. } else {
  3334. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3335. }
  3336. }
  3337. },
  3338. nickkickremove: function() {
  3339. if (arguments[0] === "" || isNaN(arguments[0])) {
  3340. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3341. } else {
  3342. if (CTS.NickKickList[arguments[0]] !== undefined) {
  3343. CTS.NickKickList.splice(arguments[0], 1);
  3344. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3345. Alert(GetActiveChat(), "✓ Command Accepted!");
  3346. } else {
  3347. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3348. }
  3349. }
  3350. },
  3351. nickkicklistclear: function() {
  3352. CTS.NickKickList = [];
  3353. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3354. Alert(GetActiveChat(), "✓ Command Accepted!");
  3355. },
  3356. nickkicklist: function() {
  3357. Alert(GetActiveChat(), SettingsList.NickKickList());
  3358. },
  3359. bankeywordadd: function() {
  3360. if (arguments[0] === "") {
  3361. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3362. } else {
  3363. if (!CTS.BanKeywordList.includes(arguments[0])) {
  3364. CTS.BanKeywordList.push(arguments[0]);
  3365. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3366. Alert(GetActiveChat(), "✓ Command Accepted!");
  3367. } else {
  3368. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3369. }
  3370. }
  3371. },
  3372. bankeywordremove: function() {
  3373. if (arguments[0] === "" || isNaN(arguments[0])) {
  3374. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3375. } else {
  3376. if (CTS.BanKeywordList[arguments[0]] !== undefined) {
  3377. CTS.BanKeywordList.splice(arguments[0], 1);
  3378. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3379. Alert(GetActiveChat(), "✓ Command Accepted!");
  3380. } else {
  3381. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3382. }
  3383. }
  3384. },
  3385. bankeywordlistclear: function() {
  3386. CTS.BanKeywordList = [];
  3387. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3388. Alert(GetActiveChat(), "✓ Command Accepted!");
  3389. },
  3390. bankeywordlist: function() {
  3391. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  3392. },
  3393. kickkeywordadd: function() {
  3394. if (arguments[0] === "") {
  3395. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3396. } else {
  3397. if (!CTS.KickKeywordList.includes(arguments[0])) {
  3398. CTS.KickKeywordList.push(arguments[0]);
  3399. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3400. Alert(GetActiveChat(), "✓ Command Accepted!");
  3401. } else {
  3402. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3403. }
  3404. }
  3405. },
  3406. kickkeywordremove: function() {
  3407. if (arguments[0] === "" || isNaN(arguments[0])) {
  3408. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3409. } else {
  3410. if (CTS.KickKeywordList[arguments[0]] !== undefined) {
  3411. CTS.KickKeywordList.splice(arguments[0], 1);
  3412. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3413. Alert(GetActiveChat(), "✓ Command Accepted!");
  3414. } else {
  3415. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3416. }
  3417. }
  3418. },
  3419. kickkeywordlistclear: function() {
  3420. CTS.KickKeywordList = [];
  3421. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3422. Alert(GetActiveChat(), "✓ Command Accepted!");
  3423. },
  3424. kickkeywordlist: function() {
  3425. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  3426. },
  3427. greetadd: function() {
  3428. if (arguments[0] === "") {
  3429. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3430. } else {
  3431. if (CheckUserName(arguments[0])) {
  3432. if (!CTS.GreetList.includes(arguments[0].toUpperCase())) {
  3433. CTS.GreetList.push(arguments[0].toUpperCase());
  3434. Save("GreetList", JSON.stringify(CTS.GreetList));
  3435. Alert(GetActiveChat(), "✓ Command Accepted!");
  3436. } else {
  3437. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3438. }
  3439. } else {
  3440. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3441. }
  3442. }
  3443. },
  3444. greetremove: function() {
  3445. if (arguments[0] === "" || isNaN(arguments[0])) {
  3446. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3447. } else {
  3448. if (CTS.GreetList[arguments[0]] !== undefined) {
  3449. CTS.GreetList.splice(arguments[0], 1);
  3450. Save("GreetList", JSON.stringify(CTS.GreetList));
  3451. Alert(GetActiveChat(), "✓ Command Accepted!");
  3452. } else {
  3453. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3454. }
  3455. }
  3456. },
  3457. greetlistclear: function() {
  3458. CTS.GreetList = [];
  3459. Save("GreetList", JSON.stringify(CTS.GreetList));
  3460. Alert(GetActiveChat(), "✓ Command Accepted!");
  3461. },
  3462. greetlist: function() {
  3463. Alert(GetActiveChat(), SettingsList.GreetList());
  3464. },
  3465. highlightadd: function() {
  3466. if (arguments[0] === "") {
  3467. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3468. } else {
  3469. if (CheckUserNameStrict(arguments[0])) {
  3470. if (!CTS.HighlightList.includes(arguments[0].toUpperCase())) {
  3471. CTS.HighlightList.push(arguments[0].toUpperCase());
  3472. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3473. Alert(GetActiveChat(), "✓ Command Accepted!");
  3474. } else {
  3475. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3476. }
  3477. } else {
  3478. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3479. }
  3480. }
  3481. },
  3482. highlightremove: function() {
  3483. if (arguments[0] === "" || isNaN(arguments[0])) {
  3484. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3485. } else {
  3486. if (CTS.HighlightList[arguments[0]] !== undefined) {
  3487. CTS.HighlightList.splice(arguments[0], 1);
  3488. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3489. Alert(GetActiveChat(), "✓ Command Accepted!");
  3490. } else {
  3491. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3492. }
  3493. }
  3494. },
  3495. highlightlistclear: function() {
  3496. CTS.HighlightList = [];
  3497. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3498. Alert(GetActiveChat(), "✓ Command Accepted!");
  3499. },
  3500. highlightlist: function() {
  3501. Alert(GetActiveChat(), SettingsList.HighlightList());
  3502. },
  3503. opadd: function() {
  3504. if (arguments[0] === "") {
  3505. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3506. } else {
  3507. if (CheckUserName(arguments[0])) {
  3508. if (!CTS.BotOPList.includes(arguments[0].toUpperCase())) {
  3509. CTS.BotOPList.push(arguments[0].toUpperCase());
  3510. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3511. Alert(GetActiveChat(), "✓ Command Accepted!");
  3512. } else {
  3513. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3514. }
  3515. } else {
  3516. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3517. }
  3518. }
  3519. },
  3520. opremove: function() {
  3521. if (arguments[0] === "" || isNaN(arguments[0])) {
  3522. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3523. } else {
  3524. if (CTS.BotOPList[arguments[0]] !== undefined) {
  3525. CTS.BotOPList.splice(arguments[0], 1);
  3526. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3527. Alert(GetActiveChat(), "✓ Command Accepted!");
  3528. } else {
  3529. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3530. }
  3531. }
  3532. },
  3533. oplistclear: function() {
  3534. CTS.BotOPList = [];
  3535. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3536. Alert(GetActiveChat(), "✓ Command Accepted!");
  3537. },
  3538. oplist: function() {
  3539. Alert(GetActiveChat(), SettingsList.BotOPList());
  3540. },
  3541. modadd: function() {
  3542. if (arguments[0] === "") {
  3543. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3544. } else {
  3545. if (CheckUserNameStrict(arguments[0])) {
  3546. if (!CTS.BotModList.includes(arguments[0].toUpperCase())) {
  3547. CTS.BotModList.push(arguments[0].toUpperCase());
  3548. Save("BotModList", JSON.stringify(CTS.BotModList));
  3549. Alert(GetActiveChat(), "✓ Command Accepted!");
  3550. } else {
  3551. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3552. }
  3553. } else {
  3554. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3555. }
  3556. }
  3557. },
  3558. modremove: function() {
  3559. if (arguments[0] === "" || isNaN(arguments[0])) {
  3560. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3561. } else {
  3562. if (CTS.BotModList[arguments[0]] !== undefined) {
  3563. CTS.BotModList.splice(arguments[0], 1);
  3564. Save("BotModList", JSON.stringify(CTS.BotModList));
  3565. Alert(GetActiveChat(), "✓ Command Accepted!");
  3566. } else {
  3567. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3568. }
  3569. }
  3570. },
  3571. modlistclear: function() {
  3572. CTS.BotModList = [];
  3573. Save("BotModList", JSON.stringify(CTS.BotModList));
  3574. Alert(GetActiveChat(), "✓ Command Accepted!");
  3575. },
  3576. modlist: function() {
  3577. Alert(GetActiveChat(), SettingsList.BotModList());
  3578. },
  3579. ttsadd: function() {
  3580. if (arguments[0] === "") {
  3581. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3582. } else {
  3583. if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  3584. if (!CTS.TTSList.includes(arguments[0].toUpperCase())) {
  3585. CTS.TTSList.push(arguments[0].toUpperCase());
  3586. Save("TTSList", JSON.stringify(CTS.TTSList));
  3587. Alert(GetActiveChat(), "✓ Command Accepted!");
  3588. } else {
  3589. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3590. }
  3591. } else {
  3592. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3593. }
  3594. }
  3595. },
  3596. ttsremove: function() {
  3597. if (arguments[0] === "" || isNaN(arguments[0])) {
  3598. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3599. } else {
  3600. if (CTS.TTSList[arguments[0]] !== undefined) {
  3601. CTS.TTSList.splice(arguments[0], 1);
  3602. Save("TTSList", JSON.stringify(CTS.TTSList));
  3603. Alert(GetActiveChat(), "✓ Command Accepted!");
  3604. } else {
  3605. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3606. }
  3607. }
  3608. },
  3609. ttslistclear: function() {
  3610. CTS.TTSList = [];
  3611. Save("TTSList", JSON.stringify(CTS.TTSList));
  3612. Alert(GetActiveChat(), "✓ Command Accepted!");
  3613. },
  3614. ttslist: function() {
  3615. Alert(GetActiveChat(), SettingsList.TTSList());
  3616. },
  3617. reminderadd: function() {
  3618. if (arguments[0] === "") {
  3619. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3620. } else {
  3621. var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9]) ?(?:am|pm)) ([\w\d\s|[^\x00-\x7F]*]*)/i);
  3622. if (reminder === null) {
  3623. Alert(GetActiveChat(), "X Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  3624. } else {
  3625. CTS.ReminderList.push([reminder[1], reminder[2]]);
  3626. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3627. Alert(GetActiveChat(), "✓ Command Accepted!");
  3628. Reminder();
  3629. }
  3630. }
  3631. },
  3632. reminderremove: function() {
  3633. if (arguments[0] === "" || isNaN(arguments[0])) {
  3634. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3635. } else {
  3636. if (CTS.ReminderList[arguments[0]] !== undefined) {
  3637. CTS.ReminderList.splice(arguments[0], 1);
  3638. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3639. Reminder();
  3640. Alert(GetActiveChat(), "✓ Command Accepted!");
  3641. } else {
  3642. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3643. }
  3644. }
  3645. },
  3646. reminderlistclear: function() {
  3647. CTS.ReminderList = [];
  3648. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3649. Alert(GetActiveChat(), "✓ Command Accepted!");
  3650. },
  3651. reminderlist: function() {
  3652. Alert(GetActiveChat(), SettingsList.ReminderList());
  3653. },
  3654. remindertoggle: function() {
  3655. CTS.Reminder = !CTS.Reminder;
  3656. Save("Reminder", JSON.stringify(CTS.Reminder));
  3657. Reminder();
  3658. Settings();
  3659. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  3660. },
  3661. soundmetertoggle: function() {
  3662. CTS.SoundMeterToggle = !CTS.SoundMeterToggle;
  3663. Save("SoundMeterToggle", JSON.stringify(CTS.SoundMeterToggle));
  3664. SoundMeter();
  3665. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.SoundMeterToggle) ? "Sound meter is now on!\n" : "Sound meter is now off!\n "));
  3666. },
  3667. timestamptoggle: function() {
  3668. CTS.TimeStampToggle = !CTS.TimeStampToggle;
  3669. Save("TimeStampToggle", JSON.stringify(CTS.TimeStampToggle));
  3670. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.TimeStampToggle) ? "Timestamps are now on!\n" : "Timestamps are now off\n "));
  3671. LoadMessage();
  3672. },
  3673. raidtoggle: function() {
  3674. CTS.RaidToggle = !CTS.RaidToggle;
  3675. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.RaidToggle) ? "You'll listen for raid call by room owners!\n" : "You've temporarily silenced raids!\n"));
  3676. },
  3677. safeadd: function() {
  3678. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3679. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3680. } else {
  3681. if (CheckUserNameStrict(arguments[0])) {
  3682. if (!CTS.SafeList.includes(arguments[0].toUpperCase())) {
  3683. CTS.SafeList.push(arguments[0].toUpperCase());
  3684. Save("AKB", JSON.stringify(CTS.SafeList));
  3685. Alert(GetActiveChat(), "✓ Command Accepted!");
  3686. } else {
  3687. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3688. }
  3689. } else {
  3690. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3691. }
  3692. }
  3693. },
  3694. saferemove: function() {
  3695. if (arguments[0] === "" || isNaN(arguments[0])) {
  3696. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3697. } else {
  3698. if (CTS.SafeList[arguments[0]] !== undefined) {
  3699. CTS.SafeList.splice(arguments[0], 1);
  3700. Save("AKB", JSON.stringify(CTS.SafeList));
  3701. Alert(GetActiveChat(), "✓ Command Accepted!");
  3702. } else {
  3703. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3704. }
  3705. }
  3706. },
  3707. safelistclear: function() {
  3708. CTS.SafeList = [];
  3709. Save("AKB", JSON.stringify(CTS.SafeList));
  3710. Alert(GetActiveChat(), "✓ Command Accepted!");
  3711. },
  3712. safelist: function() {
  3713. Alert(GetActiveChat(), SettingsList.SafeList());
  3714. },
  3715. greenroomadd: function() {
  3716. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3717. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3718. } else {
  3719. if (CheckUserNameStrict(arguments[0])) {
  3720. if (!CTS.GreenRoomList.includes(arguments[0].toUpperCase())) {
  3721. CTS.GreenRoomList.push(arguments[0].toUpperCase());
  3722. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3723. Alert(GetActiveChat(), "✓ Command Accepted!");
  3724. } else {
  3725. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3726. }
  3727. } else {
  3728. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3729. }
  3730. }
  3731. },
  3732. greenroomremove: function() {
  3733. if (arguments[0] === "" || isNaN(arguments[0])) {
  3734. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3735. } else {
  3736. if (CTS.GreenRoomList[arguments[0]] !== undefined) {
  3737. CTS.GreenRoomList.splice(arguments[0], 1);
  3738. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3739. Alert(GetActiveChat(), "✓ Command Accepted!");
  3740. } else {
  3741. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3742. }
  3743. }
  3744. },
  3745. greenroomlistclear: function() {
  3746. CTS.GreenRoomList = [];
  3747. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3748. Alert(GetActiveChat(), "✓ Command Accepted!");
  3749. },
  3750. greenroomlist: function() {
  3751. Alert(GetActiveChat(), SettingsList.GreenRoomList());
  3752. },
  3753. greenroomignoreadd: function() {
  3754. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3755. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3756. } else {
  3757. if (CheckUserNameStrict(arguments[0])) {
  3758. if (!CTS.GreenRoomIgnoreList.includes(arguments[0].toUpperCase())) {
  3759. CTS.GreenRoomIgnoreList.push(arguments[0].toUpperCase());
  3760. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3761. Alert(GetActiveChat(), "✓ Command Accepted!");
  3762. } else {
  3763. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3764. }
  3765. } else {
  3766. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3767. }
  3768. }
  3769. },
  3770. greenroomignoreremove: function() {
  3771. if (arguments[0] === "" || isNaN(arguments[0])) {
  3772. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3773. } else {
  3774. if (CTS.GreenRoomIgnoreList[arguments[0]] !== undefined) {
  3775. CTS.GreenRoomIgnoreList.splice(arguments[0], 1);
  3776. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3777. Alert(GetActiveChat(), "✓ Command Accepted!");
  3778. } else {
  3779. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3780. }
  3781. }
  3782. },
  3783. greenroomignorelistclear: function() {
  3784. CTS.GreenRoomIgnoreList = [];
  3785. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3786. Alert(GetActiveChat(), "✓ Command Accepted!");
  3787. },
  3788. greenroomignorelist: function() {
  3789. Alert(GetActiveChat(), SettingsList.GreenRoomIgnoreList());
  3790. },
  3791. optoggle: function() {
  3792. CTS.UserYT = !CTS.UserYT;
  3793. Save("UserYT", JSON.stringify(CTS.UserYT));
  3794. Settings();
  3795. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  3796. },
  3797. avatartoggle: function() {
  3798. CTS.Avatar = !CTS.Avatar;
  3799. Save("Avatar", JSON.stringify(CTS.Avatar));
  3800. Settings();
  3801. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  3802. LoadMessage();
  3803. },
  3804. popuptoggle: function() {
  3805. CTS.Popups = !CTS.Popups;
  3806. Save("Popups", JSON.stringify(CTS.Popups));
  3807. Settings();
  3808. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  3809. },
  3810. notificationtoggle: function() {
  3811. CTS.NotificationToggle++;
  3812. if (CTS.NotificationToggle >= 3) CTS.NotificationToggle = 0;
  3813. Save("NotificationToggle", JSON.stringify(CTS.NotificationToggle));
  3814. NotificationDisplay();
  3815. Settings();
  3816. Alert(GetActiveChat(), "✓ Command Accepted!\nNotifications " + ((CTS.NotificationToggle == 0) ? "above chat enabled" : (CTS.NotificationToggle == 1) ? "in chat enabled" : "disabled") + ".");
  3817. },
  3818. greetmodetoggle: function() {
  3819. CTS.GreetMode = !CTS.GreetMode;
  3820. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  3821. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  3822. },
  3823. imgurtoggle: function() {
  3824. CTS.Imgur = !CTS.Imgur;
  3825. Save("Imgur", JSON.stringify(CTS.Imgur));
  3826. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  3827. },
  3828. publiccommandtoggle: function() {
  3829. CTS.PublicCommandToggle = !CTS.PublicCommandToggle;
  3830. Save("PublicCommandToggle", JSON.stringify(CTS.PublicCommandToggle));
  3831. Settings();
  3832. 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."));
  3833. },
  3834. greenroomtoggle: function() {
  3835. CTS.GreenRoomToggle = !CTS.GreenRoomToggle;
  3836. Save("GreenRoomToggle", JSON.stringify(CTS.GreenRoomToggle));
  3837. Settings();
  3838. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.GreenRoomToggle) ? "Green Room Auto Allow ON!" : "Green Room Auto Allow OFF!"));
  3839. },
  3840. clr: function() {
  3841. CTS.Message[GetActiveChat()] = [];
  3842. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  3843. },
  3844. clrall: function() {
  3845. CTS.Message = [];
  3846. CTS.Message[0] = [];
  3847. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  3848. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  3849. },
  3850. autokick: function() {
  3851. if (arguments[1] === false && CTS.Me.mod) {
  3852. CTS.AutoKick = !CTS.AutoKick;
  3853. CTS.AutoBan = false;
  3854. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  3855. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  3856. }
  3857. },
  3858. autoban: function() {
  3859. if (arguments[1] === false && CTS.Me.mod) {
  3860. CTS.AutoBan = !CTS.AutoBan;
  3861. CTS.AutoKick = false;
  3862. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  3863. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  3864. }
  3865. },
  3866. camsweep: function() {
  3867. if (CTS.Me.mod && CTS.Host === CTS.Me.handle) {
  3868. CTS.Camera.SweepTimer = (arguments[0] === "" || isNaN(arguments[0])) ? 5 : (arguments[0] > 30) ? 30 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  3869. CTS.Camera.Sweep = !CTS.Camera.Sweep;
  3870. clearTimeout(CTS.Camera.clearRandom);
  3871. Settings();
  3872. 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!"));
  3873. }
  3874. },
  3875. bottoggle: function() {
  3876. CTS.Bot = !CTS.Bot;
  3877. Save("Bot", JSON.stringify(CTS.Bot));
  3878. Settings();
  3879. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  3880. },
  3881. votetoggle: function() {
  3882. if (CTS.Me.mod) {
  3883. CTS.VoteSystem = !CTS.VoteSystem;
  3884. CTS.WaitToVoteList = [];
  3885. var len = CTS.UserList.length;
  3886. if (len > 0) {
  3887. for (var i = 0; i < len; i++) CTS.UserList[i].vote = 0;
  3888. }
  3889. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.VoteSystem) ? "VOTING IS NOW ON!" : "VOTING IS NOW OFF!"));
  3890. }
  3891. },
  3892. bot: function() {
  3893. if (arguments[1] === false && CTS.Me.mod) Alert(0, "✓ Command Accepted!\nBot bypass was called!");
  3894. },
  3895. share: function() {
  3896. 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/KCfH5PQ";
  3897. if (GetActiveChat() !== 0) {
  3898. Send("pvtmsg", msg, GetActiveChat());
  3899. PushPM(GetActiveChat(), msg);
  3900. } else {
  3901. Send("msg", msg);
  3902. }
  3903. },
  3904. gameview: function() {
  3905. CTS.CanSeeGames = !CTS.CanSeeGames;
  3906. Save("CanSeeGames", JSON.stringify(CTS.CanSeeGames));
  3907. Settings();
  3908. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
  3909. },
  3910. fishhost: function() {
  3911. CTS.CanHostFishGames = !CTS.CanHostFishGames;
  3912. Save("CanHostFishGames", JSON.stringify(CTS.CanHostFishGames));
  3913. Fish.Reset(true, true);
  3914. Settings();
  3915. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanHostFishGames) ? "FISH GAME HOSTING IS NOW ON!" : "FISH GAME HOSTING IS NOW OFF!"));
  3916. },
  3917. triviahost: function() {
  3918. CTS.CanHostTriviaGames = !CTS.CanHostTriviaGames;
  3919. Save("CanHostTriviaGames", JSON.stringify(CTS.CanHostTriviaGames));
  3920. Trivia.Reset();
  3921. Settings();
  3922. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanHostTriviaGames) ? "TRIVIA GAME HOSTING IS NOW ON!" : "TRIVIA GAME HOSTING IS NOW OFF!"));
  3923. },
  3924. trivia: function() {
  3925. if (CTS.Host === CTS.Me.handle && CTS.CanHostTriviaGames) {
  3926. CTS.Game.Trivia.Started = !CTS.Game.Trivia.Started;
  3927. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Game.Trivia.Started) ? "Trivia is now on!\n" : "Trivia is now off!\n"));
  3928. if (CTS.Game.Trivia.Started) {
  3929. Trivia.init();
  3930. } else {
  3931. Trivia.Reset();
  3932. }
  3933. }
  3934. },
  3935. triviaplayeradd: function() {
  3936. if (arguments[0] === "") {
  3937. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3938. } else {
  3939. var player = arguments[0].match(/^([a-z0-9_]{1,32}) ([0-9]{1,10})/i);
  3940. if (player === null) {
  3941. Alert(GetActiveChat(), "X Command Rejected!\n!triviaplayeradd cosmosist 2000\nThis is an example you can try!");
  3942. } else {
  3943. if (CTS.Game.Trivia.PlayerList[player[1].toUpperCase()] === undefined) {
  3944. var point = parseInt(player[2]);
  3945. CTS.Game.Trivia.PlayerList[player[1].toUpperCase()] = point;
  3946. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3947. var user = UsernameToUser(player[1].toUpperCase());
  3948. if (user != -1) CTS.UserList[user].triviapoints = point;
  3949. Alert(GetActiveChat(), "✓ Command Accepted!");
  3950. } else {
  3951. Alert(GetActiveChat(), "X Command Rejected!\nUsername is already entered!");
  3952. }
  3953. }
  3954. }
  3955. },
  3956. triviaplayerremove: function() {
  3957. if (arguments[0] === "" || isNaN(arguments[0])) {
  3958. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3959. } else {
  3960. var user = Object.keys(CTS.Game.Trivia.PlayerList);
  3961. if (CTS.Game.Trivia.PlayerList[user[arguments[0]]] !== undefined) {
  3962. delete CTS.Game.Trivia.PlayerList[user[arguments[0]]];
  3963. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3964. var useron = UsernameToUser(user[arguments[0]]);
  3965. if (useron != -1) CTS.UserList[useron].triviapoints = 0;
  3966. Alert(GetActiveChat(), "✓ Command Accepted!");
  3967. } else {
  3968. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3969. }
  3970. }
  3971. },
  3972. triviaplayerlistclear: function() {
  3973. CTS.Game.Trivia.PlayerList = {};
  3974. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3975. for (var i = 0; i < CTS.UserList.length; i++) CTS.UserList[i].triviapoints = 0;
  3976. Alert(GetActiveChat(), "✓ Command Accepted!");
  3977. },
  3978. triviaplayerlist: function() {
  3979. Alert(GetActiveChat(), SettingsList.TriviaPlayerList());
  3980. },
  3981. version: function() {
  3982. if (!CTS.Me.owner) {
  3983. var msg = "I am using " + CTS.Project.Name + "v" + Ver();
  3984. if (GetActiveChat() !== 0) {
  3985. Send("pvtmsg", msg, GetActiveChat());
  3986. PushPM(GetActiveChat(), msg);
  3987. } else {
  3988. Send("msg", msg);
  3989. }
  3990. }
  3991. },
  3992. roll: function() {
  3993. var dice,
  3994. msg = "";
  3995. dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
  3996. for (var i = 0; i < dice; i++) msg += Dice();
  3997. if (GetActiveChat() !== 0) {
  3998. Send("pvtmsg", msg, GetActiveChat());
  3999. PushPM(GetActiveChat(), msg);
  4000. } else {
  4001. Send("msg", msg);
  4002. }
  4003. },
  4004. coin: function() {
  4005. if (CTS.Host == 0 || GetActiveChat() !== 0) {
  4006. var msg = "The coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!";
  4007. if (GetActiveChat() !== 0) {
  4008. Send("pvtmsg", msg, GetActiveChat());
  4009. } else {
  4010. Send("msg", msg);
  4011. }
  4012. }
  4013. },
  4014. settings: function() {
  4015. Settings();
  4016. },
  4017. lists: function() {
  4018. Alert(GetActiveChat(), SettingsList.UserList() + "\n" + SettingsList.UserBanList() + "\n" + SettingsList.NickBanList() + "\n" + SettingsList.BanKeywordList() + "\n" + SettingsList.UserKickList() + "\n" + SettingsList.NickKickList() + "\n" + SettingsList.KickKeywordList() + "\n" + SettingsList.BotOPList() + "\n" + SettingsList.BotModList() + "\n" + SettingsList.MentionList() + "\n" + SettingsList.HiddenCameraList() + "\n" + SettingsList.IgnoreList() + "\n" + SettingsList.GreetList() + "\n" + SettingsList.TTSList() + "\n" + SettingsList.HighlightList() + "\n" + SettingsList.ReminderList() + "\n" + SettingsList.TriviaPlayerList());
  4019. },
  4020. listsclear: function() {
  4021. CTS.MentionList = [];
  4022. CTS.IgnoreList = [];
  4023. CTS.HiddenCameraList = [];
  4024. CTS.UserBanList = [];
  4025. CTS.UserKickList = [];
  4026. CTS.NickBanList = [];
  4027. CTS.NickKickList = [];
  4028. CTS.BanKeywordList = [];
  4029. CTS.KickKeywordList = [];
  4030. CTS.GreetList = [];
  4031. CTS.HighlightList = [];
  4032. CTS.ReminderList = [];
  4033. CTS.TTSList = [];
  4034. CTS.BotOPList = [];
  4035. CTS.BotModList = [];
  4036. Save("MentionList", JSON.stringify(CTS.MentionList));
  4037. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  4038. Save("HiddenCameraList", JSON.stringify(CTS.IgnoreList));
  4039. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  4040. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  4041. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  4042. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  4043. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  4044. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  4045. Save("GreetList", JSON.stringify(CTS.GreetList));
  4046. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  4047. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  4048. Save("TTSList", JSON.stringify(CTS.TTSList));
  4049. Save("BotModList", JSON.stringify(CTS.BotModList));
  4050. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  4051. Alert(GetActiveChat(), "✓ Command Accepted!\nItems Mentionlist, igore");
  4052. },
  4053. ytqueue: function() {},
  4054. ytclear: function() {},
  4055. ytskip: function() {},
  4056. yt: function() {},
  4057. ytbypass: function() {}
  4058. };
  4059. var SettingsList = {
  4060. UserList: function() {
  4061. var index,
  4062. msg,
  4063. len = CTS.UserList.length;
  4064. msg = "<b style=\"color:#ffffff;\"><u>User list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4065. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserList[index].username + "\n(" + CTS.UserList[index].nick + ")\n";
  4066. return msg;
  4067. },
  4068. UserBanList: function() {
  4069. var index,
  4070. msg,
  4071. len = CTS.UserBanList.length;
  4072. msg = "<b style=\"color:#ffffff;\"><u>User Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4073. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserBanList[index] + "\n";
  4074. return msg;
  4075. },
  4076. NickBanList: function() {
  4077. var index,
  4078. msg,
  4079. len = CTS.NickBanList.length;
  4080. msg = "<b style=\"color:#ffffff;\"><u>Nick Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4081. for (index = 0; index < len; index++) msg += index + " : " + CTS.NickBanList[index] + "\n";
  4082. return msg;
  4083. },
  4084. BanKeywordList: function() {
  4085. var index,
  4086. msg,
  4087. len = CTS.BanKeywordList.length;
  4088. msg = "<b style=\"color:#ffffff;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4089. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  4090. return msg;
  4091. },
  4092. UserKickList: function() {
  4093. var index,
  4094. msg,
  4095. len = CTS.UserKickList.length;
  4096. msg = "<b style=\"color:#ffffff;\"><u>User Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4097. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserKickList[index] + "\n";
  4098. return msg;
  4099. },
  4100. NickKickList: function() {
  4101. var index,
  4102. msg,
  4103. len = CTS.NickKickList.length;
  4104. msg = "<b style=\"color:#ffffff;\"><u>Nick Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4105. for (index = 0; index < len; index++) msg += index + " : " + CTS.NickKickList[index] + "\n";
  4106. return msg;
  4107. },
  4108. KickKeywordList: function() {
  4109. var index,
  4110. msg,
  4111. len = CTS.KickKeywordList.length;
  4112. msg = "<b style=\"color:#ffffff;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4113. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  4114. return msg;
  4115. },
  4116. BotOPList: function() {
  4117. var index,
  4118. msg,
  4119. len = CTS.BotOPList.length;
  4120. msg = "<b style=\"color:#ffffff;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4121. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  4122. return msg;
  4123. },
  4124. BotModList: function() {
  4125. var index,
  4126. msg,
  4127. len = CTS.BotModList.length;
  4128. msg = "<b style=\"color:#ffffff;\"><u>Bot Mod list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4129. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotModList[index] + "\n";
  4130. return msg;
  4131. },
  4132. MentionList: function() {
  4133. var index,
  4134. msg,
  4135. len = CTS.MentionList.length;
  4136. msg = "<b style=\"color:#ffffff;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4137. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  4138. return msg;
  4139. },
  4140. IgnoreList: function() {
  4141. var index,
  4142. msg,
  4143. len = CTS.IgnoreList.length;
  4144. msg = "<b style=\"color:#ffffff;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4145. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  4146. return msg;
  4147. },
  4148. HiddenCameraList: function() {
  4149. var index,
  4150. msg,
  4151. len = CTS.IgnoreList.length;
  4152. msg = "<b style=\"color:#ffffff;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4153. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  4154. return msg;
  4155. },
  4156. GreetList: function() {
  4157. var index,
  4158. msg,
  4159. len = CTS.GreetList.length;
  4160. msg = "<b style=\"color:#ffffff;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4161. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  4162. return msg;
  4163. },
  4164. TTSList: function() {
  4165. var index,
  4166. msg,
  4167. len = CTS.TTSList.length;
  4168. msg = "<b style=\"color:#ffffff;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4169. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  4170. return msg;
  4171. },
  4172. HighlightList: function() {
  4173. var index,
  4174. msg,
  4175. len = CTS.HighlightList.length;
  4176. msg = "<b style=\"color:#ffffff;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4177. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  4178. return msg;
  4179. },
  4180. ReminderList: function() {
  4181. var index,
  4182. msg,
  4183. len = CTS.ReminderList.length;
  4184. msg = "<b style=\"color:#ffffff;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4185. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  4186. return msg;
  4187. },
  4188. SafeList: function() {
  4189. var index,
  4190. msg,
  4191. len = CTS.SafeList.length;
  4192. msg = "<b style=\"color:#ffffff;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4193. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  4194. return msg;
  4195. },
  4196. GreenRoomList: function() {
  4197. var index,
  4198. msg,
  4199. len = CTS.GreenRoomList.length;
  4200. msg = "<b style=\"color:#ffffff;\"><u>Green Room list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4201. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomList[index] + "\n";
  4202. return msg;
  4203. },
  4204. GreenRoomIgnoreList: function() {
  4205. var index,
  4206. msg,
  4207. len = CTS.GreenRoomIgnoreList.length;
  4208. msg = "<b style=\"color:#ffffff;\"><u>Green Room Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4209. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomIgnoreList[index] + "\n";
  4210. return msg;
  4211. },
  4212. TriviaPlayerList: function() {
  4213. var index,
  4214. msg,
  4215. user = Object.keys(CTS.Game.Trivia.PlayerList),
  4216. len = user.length;
  4217. msg = "<b style=\"color:#ffffff;\"><u>Trivia Player List list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4218. for (index = 0; index < len; index++) msg += index + ": " + user[index] + "@" + CTS.Game.Trivia.PlayerList[user[index]] + "IQ\n";
  4219. return msg;
  4220. }
  4221. };
  4222. var MessageQueueList = {
  4223. add: function() {
  4224. CTS.SendQueue.push(arguments[0]);
  4225. MessageQueueList.run();
  4226. },
  4227. run: function() {
  4228. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  4229. setTimeout(function() {
  4230. var temp = new Date();
  4231. var OffsetTime = temp - CTS.LastMessage;
  4232. if (OffsetTime >= 1500) {
  4233. CTS.LastMessage = new Date();
  4234. CTS.SocketTarget.send(CTS.SendQueue[0]);
  4235. CTS.SendQueue.shift();
  4236. }
  4237. MessageQueueList.run();
  4238. }, 1600);
  4239. }
  4240. }
  4241. };
  4242. var ServerSendList = {
  4243. msg: function() {
  4244. var obj = {
  4245. "tc": arguments[0]
  4246. };
  4247. if (arguments[2] !== undefined) {
  4248. obj.handle = arguments[1];
  4249. CTS.SocketTarget.send(JSON.stringify(obj));
  4250. } else {
  4251. if (arguments[1] !== undefined) {
  4252. obj.text = arguments[1];
  4253. MessageQueueList.add(JSON.stringify(obj));
  4254. } else {
  4255. CTS.SocketTarget.send(JSON.stringify(obj));
  4256. }
  4257. }
  4258. },
  4259. pvtmsg: function() {
  4260. var obj = {
  4261. "tc": arguments[0],
  4262. "text": arguments[1],
  4263. "handle": Number(arguments[2])
  4264. };
  4265. MessageQueueList.add(JSON.stringify(obj));
  4266. },
  4267. kick: function() {
  4268. CheckSafeList(arguments[1], true);
  4269. ServerSendList.msg(arguments[0], arguments[1], "kick");
  4270. },
  4271. ban: function() {
  4272. CheckSafeList(arguments[1], true);
  4273. ServerSendList.msg(arguments[0], arguments[1], "ban");
  4274. },
  4275. nick: function() {
  4276. var obj = {
  4277. "tc": "nick",
  4278. "nick": arguments[1]
  4279. };
  4280. CTS.SocketTarget.send(JSON.stringify(obj));
  4281. },
  4282. stream_moder_close: function() {
  4283. CheckSafeList(arguments[1], true);
  4284. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_close");
  4285. },
  4286. stream_moder_allow: function() {
  4287. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_allow");
  4288. },
  4289. yut_playlist_add: function() {
  4290. var obj = {
  4291. "tc": arguments[0],
  4292. "item": {
  4293. "id": arguments[1][0],
  4294. "duration": arguments[1][1] + 10,
  4295. "title": arguments[1][2],
  4296. "image": arguments[1][3]
  4297. }
  4298. };
  4299. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  4300. CTS.SocketTarget.send(JSON.stringify(obj));
  4301. },
  4302. yut_playlist_remove: function() {
  4303. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4304. },
  4305. yut_stop: function() {
  4306. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4307. },
  4308. yut_play: function() {
  4309. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4310. },
  4311. yut_playlist: function() {
  4312. ServerSendList.msg("yut_playlist");
  4313. },
  4314. yut_playlist_clear: function() {
  4315. ServerSendList.msg("yut_playlist_clear");
  4316. }
  4317. };
  4318. var ServerInList = {
  4319. joined: function() {
  4320. Reset();
  4321. CTS.Me = {
  4322. "handle": arguments[0].self.handle,
  4323. "username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
  4324. "nick": arguments[0].self.nick,
  4325. "owner": arguments[0].self.owner,
  4326. "mod": arguments[0].self.mod,
  4327. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  4328. "avatar": arguments[0].self.avatar,
  4329. "broadcasting": false
  4330. };
  4331. if (CTS.Me.nick.match(/^guest(?:\-[0-9]{1,10})?/i) && CTS.Me.username !== "GUEST") Send("nick", CTS.Me.username); //AUTO CORRECT NAME
  4332. if (CTS.Me.mod && CTS.Bot && CTS.ScriptInit && CTS.SocketConnected) CheckHost();
  4333. CTS.Room = {
  4334. "Avatar": arguments[0].room.avatar,
  4335. "Bio": arguments[0].room.biography,
  4336. "Name": arguments[0].room.name,
  4337. "PTT": arguments[0].room.pushtotalk,
  4338. "Website": arguments[0].room.website,
  4339. "YT_ON": arguments[0].room.youtube_enabled,
  4340. "Recent_Gifts": arguments[0].room.recent_gifts
  4341. };
  4342. CTS.SocketConnected = true;
  4343. },
  4344. userlist: function() {
  4345. var len = arguments[0].users.length;
  4346. for (var user = 0; user < len; user++) {
  4347. AKBS(arguments[0].users[user]);
  4348. var username = (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase();
  4349. CheckUserAbuse(arguments[0].users[user].handle, username, arguments[0].users[user].nick);
  4350. CTS.UserList.push({
  4351. "handle": arguments[0].users[user].handle,
  4352. "username": username,
  4353. "nick": arguments[0].users[user].nick,
  4354. "owner": arguments[0].users[user].owner,
  4355. "mod": arguments[0].users[user].mod,
  4356. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  4357. "avatar": (arguments[0].users[user].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].users[user].avatar,
  4358. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
  4359. "broadcasting": false,
  4360. "vote": 0,
  4361. "triviapoints": CTS.Game.Trivia.PlayerList[username] || 0
  4362. });
  4363. }
  4364. RoomUsers();
  4365. debug();
  4366. },
  4367. join: function() {
  4368. AKBS(arguments[0]);
  4369. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  4370. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick);
  4371. if (CTS.HighlightList.includes(user) && window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4372. window.CTSSound.HIGHLIGHT.volume = window.CTSRoomVolume;
  4373. window.CTSSound.HIGHLIGHT.play();
  4374. }
  4375. if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
  4376. CTS.hasGreetedWC = true;
  4377. window.CTSSound.C.play();
  4378. Send("msg", "HI! " + arguments[0].nick.toUpperCase() + "!");
  4379. } else {
  4380. if ((CTS.GreetList.includes(user) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  4381. 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!") : "!"));
  4382. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4383. window.CTSSound.GREET.volume = window.CTSRoomVolume;
  4384. window.CTSSound.GREET.play();
  4385. }
  4386. }
  4387. }
  4388. CTS.NoGreet = false;
  4389. 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);
  4390. RoomUsers();
  4391. debug();
  4392. },
  4393. sysmsg: function() {
  4394. if (CTS.Me.mod) {
  4395. var action = arguments[0].text.match(/^([a-z0-9_]{1,32}):? (closed|banned|kicked) ([a-z0-9_]{1,32})$/i);
  4396. if (action !== null) {
  4397. var user;
  4398. if (action[2] == "closed" || action[2] == "banned" || action[2] == "kicked") {
  4399. user = NicknameToUser(action[3].toUpperCase());
  4400. if (user != -1) {
  4401. if (CTS.UserList[user].username !== "GUEST") {
  4402. var a = CTS.GreenRoomList.indexOf(CTS.UserList[user].username);
  4403. if (a !== -1) {
  4404. //REMOVE
  4405. debug("GREENROOMLIST::", "REMOVE USER " + CTS.UserList[user].username + " FROM GREENROOMLIST");
  4406. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[user].username + " from greenroomlist!");
  4407. CommandList.greenroomremove(a);
  4408. }
  4409. }
  4410. }
  4411. }
  4412. }
  4413. }
  4414. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  4415. debug();
  4416. },
  4417. nick: function() {
  4418. var user = HandleToUser(arguments[0].handle);
  4419. if (user != -1) {
  4420. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  4421. if ((CTS.GreetList.includes(CTS.UserList[user].username) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) Send("msg", CTS.UserList[user].nick + "\nwith the account name " + CTS.UserList[user].username + " changed their name to " + arguments[0].nick);
  4422. CTS.UserList[user].nick = arguments[0].nick;
  4423. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  4424. CheckUserAbuse(arguments[0].handle, CTS.UserList[user].username, arguments[0].nick);
  4425. }
  4426. debug();
  4427. },
  4428. stream_connected: function() {
  4429. 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)) {
  4430. //USER IS NOT ON CAMERA START AUTO ACCEPT PROCESS
  4431. var user = HandleToUser(arguments[0].handle);
  4432. if (user != -1) {
  4433. debug("CAMERA::WAITING", "nickname:" + CTS.UserList[user].nick);
  4434. if (!CTS.GreenRoomIgnoreList.includes(CTS.UserList[user].username) && CTS.GreenRoomList.includes(CTS.UserList[user].username)) Send("stream_moder_allow", CTS.UserList[user].handle);
  4435. }
  4436. }
  4437. debug();
  4438. },
  4439. stream_closed: function() {
  4440. debug();
  4441. },
  4442. publish: function() { //ADD GLOBAL CAMERA
  4443. CheckUserStream(arguments[0].handle, true);
  4444. debug();
  4445. },
  4446. unpublish: function() { //REMOVE GLOBAL CAMERA
  4447. CheckUserStream(arguments[0].handle, false);
  4448. debug();
  4449. },
  4450. ping: function() {
  4451. if (CTS.ScriptInit) {
  4452. var verify;
  4453. if (CTS.WatchList.length > 0) {
  4454. verify = new Date() - CTS.WatchList[0][2];
  4455. debug("WATCHLIST::LIST", CTS.WatchList);
  4456. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/700000");
  4457. if (CTS.SafeList.indexOf(CTS.WatchList[0][0]) === -1) { //LET'S NOT ADD TWICE
  4458. if (verify > 700000) {
  4459. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/700000");
  4460. CTS.SafeList.push(CTS.WatchList[0][0]);
  4461. CTS.WatchList.shift();
  4462. }
  4463. } else {
  4464. CTS.WatchList.shift();
  4465. }
  4466. }
  4467. if (CTS.WaitToVoteList.length > 0) {
  4468. verify = new Date() - CTS.WaitToVoteList[0][1];
  4469. debug("VOTE::LIST", CTS.WaitToVoteList);
  4470. debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4471. if (verify > 300000) {
  4472. debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4473. CTS.WaitToVoteList.shift();
  4474. }
  4475. }
  4476. }
  4477. //DISPOSE OF ITEMS
  4478. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  4479. window.TinychatApp.getInstance().defaultChatroom.packetWorker.queue = {};
  4480. debug();
  4481. },
  4482. quit: function() {
  4483. if (CTS.ScriptInit) {
  4484. if (CTS.WatchList.length > 0) {
  4485. var len = CTS.WatchList.length;
  4486. for (var i = 0; i < len; i++) {
  4487. if (CTS.WatchList[i][1] == arguments[0].handle) {
  4488. CTS.WatchList.splice(i, 1);
  4489. break;
  4490. }
  4491. }
  4492. }
  4493. if (CTS.Me.mod) RemoveUserCamera(arguments[0].handle);
  4494. var user = HandleToUser(arguments[0].handle);
  4495. if (user != -1) {
  4496. 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.");
  4497. //SEND THEM OUT
  4498. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4499. CTS.UserList.splice(user, 1);
  4500. }
  4501. RoomUsers();
  4502. if (CTS.Host == arguments[0].handle) {
  4503. CTS.Host = 0;
  4504. CTS.Camera.Sweep = false;
  4505. if (CTS.Me.mod && CTS.Bot) {
  4506. setTimeout(function() {
  4507. if (CTS.Host == 0) SetBot(false);
  4508. }, (Rand(10, 30) * 1000));
  4509. }
  4510. }
  4511. }
  4512. debug();
  4513. },
  4514. msg: function() {
  4515. if (CTS.ScriptInit) {
  4516. var user = HandleToUser(arguments[0].handle);
  4517. if (user != -1) {
  4518. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4519. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4520. var text = HTMLtoTXT(arguments[0].text);
  4521. //ALL USERS REPORT
  4522. OwnerCommand(user, arguments[0].text);
  4523. BotCheck(user, text, arguments[0]);
  4524. //MODERATORS
  4525. if (CTS.Me.mod) {
  4526. if (CTS.Host == CTS.Me.handle) BotCommandCheck(user, text);
  4527. CheckUserWordAbuse(user, arguments[0].text);
  4528. }
  4529.  
  4530. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4531. //PUSH MESSAGE
  4532. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4533. CTS.Message[0].push({
  4534. "time": Time(),
  4535. "namecolor": CTS.UserList[user].namecolor,
  4536. "avatar": CTS.UserList[user].avatar,
  4537. "username": CTS.UserList[user].username,
  4538. "nick": CTS.UserList[user].nick,
  4539. "msg": text,
  4540. "mention": false
  4541. });
  4542. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  4543. if (CTS.Me.handle !== arguments[0].handle) {
  4544. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  4545. Alert(GetActiveChat(), "✓ AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  4546. CTS.AutoKick = false;
  4547. CTS.AutoBan = false;
  4548. }
  4549. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4550. if (CTS.UserList.length <= 14) {
  4551. window.CTSSound.MSG.volume = window.CTSRoomVolume;
  4552. window.CTSSound.MSG.play();
  4553. }
  4554. 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!"));
  4555. }
  4556. var len = CTS.MentionList.length;
  4557. for (var i = 0; i < len; i++) {
  4558. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  4559. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4560. window.CTSSound.MENTION.volume = window.CTSRoomVolume;
  4561. window.CTSSound.MENTION.play();
  4562. }
  4563. msg.mention = true;
  4564. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4565. }
  4566. }
  4567. }
  4568. if (GetActiveChat() === 0) CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  4569. MessagePopUp(user, text, true, false);
  4570. }
  4571. }
  4572. } else {
  4573. if (CTS.Host == CTS.Me.handle) {
  4574. Send("kick", arguments[0].handle);
  4575. } else if (CTS.Host == 0) {
  4576. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4577. }
  4578. }
  4579. }
  4580. }
  4581. debug();
  4582. },
  4583. pvtmsg: function() {
  4584. if (CTS.ScriptInit) {
  4585. if (CTS.enablePMs === true) {
  4586. if (arguments[0].handle != CTS.Me.handle) {
  4587. var user = HandleToUser(arguments[0].handle);
  4588. if (user != -1) {
  4589. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4590. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4591. var text = arguments[0].text;
  4592. if (CTS.Me.mod) CheckUserWordAbuse(user, arguments[0].text);
  4593. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4594. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4595. PushPM(arguments[0].handle, text, user);
  4596. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4597. window.CTSSound.PVTMSG.volume = window.CTSRoomVolume;
  4598. window.CTSSound.PVTMSG.play();
  4599. 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!"));
  4600. }
  4601. text = HTMLtoTXT(text);
  4602. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4603. MessagePopUp(user, text, false, false);
  4604. }
  4605. }
  4606. } else {
  4607. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4608. }
  4609. }
  4610. }
  4611. }
  4612. }
  4613. debug();
  4614. },
  4615. gift: function() {
  4616. CreateGift(arguments[0]);
  4617. debug();
  4618. },
  4619. yut_playlist_add: function() {
  4620. if (CTS.ScriptInit) {
  4621. if (!CTS.YouTube.Playing) {
  4622. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  4623. if (CTS.Host != CTS.Me.handle) {
  4624. Send("msg", "!play");
  4625. } else {
  4626. YouTubePlayList();
  4627. }
  4628. }
  4629. }
  4630. debug();
  4631. },
  4632. yut_playlist: function() {
  4633. if (CTS.ScriptInit) {
  4634. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  4635. if (CTS.YouTube.Clear === true) {
  4636. if (arguments[0].items !== null) Send("yut_playlist_clear");
  4637. CTS.YouTube.MessageQueueList = [];
  4638. Send("msg", "🎵YouTube cleared!🎵");
  4639. CTS.YouTube.Clear = false;
  4640. } else {
  4641. if (arguments[0].items === null) {
  4642. CTS.PlayListStart = true;
  4643. } else {
  4644. CTS.YouTube.PlayListCount = arguments[0].items.length;
  4645. CTS.PlayListStart = false;
  4646. if (CTS.YouTube.ShowQueue === true) {
  4647. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  4648. for (var i = 0; i < 3; i++) {
  4649. if (arguments[0].items[i] === undefined) break;
  4650. 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]";
  4651. }
  4652. Send("msg", msg);
  4653. }
  4654. }
  4655. 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);
  4656. }
  4657. CTS.YouTube.ShowQueue = false;
  4658. }
  4659. }
  4660. debug();
  4661. },
  4662. yut_play: function() {
  4663. if (CTS.ScriptInit) {
  4664. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  4665. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  4666. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  4667. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  4668. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  4669. CTS.YouTube.CurrentTrack.offset = arguments[0].item.offset;
  4670. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  4671. }
  4672. if (window.YouTube.Playing) window.YouTube.stopVideo();
  4673. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableYoutube) {
  4674. window.YouTube.Init();
  4675. window.YouTube.Offset = setInterval(function() {
  4676. CTS.YouTube.CurrentTrack.offset += 1;
  4677. if ((window.YouTube.Popup == null || window.YouTube.Popup.closed) && window.YouTube.Playing) YouTubeDuration(Math.trunc((CTS.YouTube.CurrentTrack.offset * 100) / CTS.YouTube.CurrentTrack.duration));
  4678. }, 1000);
  4679. }
  4680. CTS.YouTube.Playing = true;
  4681. YouTubePlayList();
  4682. }
  4683. debug();
  4684. },
  4685. yut_stop: function() {
  4686. if (CTS.ScriptInit) {
  4687. CTS.YouTube.CurrentTrack.ID = undefined;
  4688. CTS.YouTube.CurrentTrack.duration = undefined;
  4689. CTS.YouTube.CurrentTrack.title = undefined;
  4690. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  4691. CTS.YouTube.Playing = false;
  4692. clearInterval(window.YouTube.Offset);
  4693.  
  4694. window.YouTube.stopVideo();
  4695. YouTubePlayList();
  4696. }
  4697. debug();
  4698. }
  4699. };
  4700. var ServerOutList = {
  4701. pvtmsg: function() {
  4702. if (CTS.ScriptInit) {
  4703. Command(arguments[0].text, true);
  4704. var text = arguments[0].text;
  4705. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4706. PushPM(arguments[0].handle, text);
  4707. }
  4708. debug();
  4709. },
  4710. msg: function() {
  4711. if (CTS.ScriptInit) {
  4712. CTS.LastMessage = new Date();
  4713. Command(arguments[0].text, false);
  4714. }
  4715. debug();
  4716. },
  4717. ban: function() {
  4718. CheckSafeList(arguments[0].handle, true);
  4719. debug();
  4720. },
  4721. kick: function() {
  4722. CheckSafeList(arguments[0].handle, true);
  4723. debug();
  4724. },
  4725. stream_moder_close: function() {
  4726. CheckSafeList(arguments[0].handle, true);
  4727. debug();
  4728. }
  4729. };
  4730. //ADDON
  4731. var Addon = {
  4732. active: function() {
  4733. if (window.CTSAddon !== undefined) {
  4734. if (window.CTSAddon[arguments[0]] !== undefined) {
  4735. return true;
  4736. }
  4737. }
  4738. return false;
  4739. },
  4740. get: function() {
  4741. return window.CTSAddon[arguments[0]];
  4742. }
  4743. };
  4744. //XMLHttpRequest
  4745. // YouTube Search V3 API (https://console.developers.google.com/)
  4746. CTS.YouTube.XHR.onload = function() {
  4747. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  4748. if (response.error) {
  4749. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  4750. } else {
  4751. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  4752. CTS.YouTube.ListBuilt = true;
  4753. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  4754. CTS.YouTube.DataReady = true;
  4755. CTS.YouTube.Busy = false;
  4756. YouTubeTrackAdd();
  4757. }
  4758. CTS.YouTube.DataReady = false;
  4759. if (response.items[0]) {
  4760. CTS.YouTube.Busy = true;
  4761. if (response.items[0].id) {
  4762. if (response.kind == "youtube#playlistItemListResponse") {
  4763. YouTubePlayListItems(response.items);
  4764. } else {
  4765. CTS.YouTube.VideoID = response.items[0].id.videoId;
  4766. 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);
  4767. CTS.YouTube.XHR.send();
  4768. }
  4769. } else if (response.items[0].contentDetails.duration) {
  4770. CTS.YouTube.DataReady = true;
  4771. }
  4772. if (CTS.YouTube.DataReady === false) {
  4773. CTS.YouTube.Busy = false;
  4774. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  4775. if (response.kind == "youtube#playlistItemListResponse") {
  4776. CTS.YouTube.ListBuilt = true;
  4777. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  4778. CTS.YouTube.Busy = false;
  4779. }
  4780. } else {
  4781. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  4782. if (CTS.YouTube.Playing === true) {
  4783. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  4784. 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]);
  4785. CTS.YouTube.Busy = false;
  4786. } else {
  4787. if (response.items[0].snippet.title !== undefined) {
  4788. 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]);
  4789. 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]);
  4790. CTS.YouTube.Playing = true;
  4791. }
  4792. CTS.YouTube.Busy = false;
  4793. }
  4794. }
  4795. }
  4796. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  4797. var title = "";
  4798. CTS.YouTube.SearchReturn = false;
  4799. CTS.YouTube.VideoReturn = false;
  4800. if (response.items[0] !== undefined) {
  4801. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  4802. }
  4803. if (response.items !== undefined) {
  4804. if (response.items.length > 0) title = response.items[0].snippet.title;
  4805. }
  4806. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  4807. }
  4808. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  4809. }
  4810. };
  4811. //Chuck Norris Jokes API (https://api.chucknorris.io/)
  4812. CTS.Chuck.XHR.onload = function() {
  4813. var resp = JSON.parse(CTS.Chuck.XHR.responseText),
  4814. msg = "[CHUCK NORRIS]\n" + resp.value;
  4815. if (resp !== null) Send("msg", msg.substr(0, 499));
  4816. };
  4817. //URB API (https://api.Urb.com/)
  4818. CTS.Urb.XHR.onload = function() {
  4819. var resp = JSON.parse(CTS.Urb.XHR.responseText),
  4820. msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
  4821. if (resp !== null) Send("msg", msg.substr(0, 499));
  4822. };
  4823. //ICanHazDadJoke's API (https://icanhazdadjoke.com/)
  4824. CTS.Dad.XHR.onload = function() {
  4825. var resp = JSON.parse(CTS.Dad.XHR.responseText),
  4826. msg = "[DAD JOKE]\n" + resp.joke;
  4827. if (resp !== null) Send("msg", msg.substr(0, 499));
  4828. };
  4829. //AdviceSlip API (https://api.adviceslip.com/advice)
  4830. CTS.Advice.XHR.onload = function() {
  4831. var resp = JSON.parse(CTS.Advice.XHR.responseText),
  4832. msg = "[ADVICE]\n" + resp.slip.advice;
  4833. if (resp !== null) Send("msg", msg.substr(0, 499));
  4834. };
  4835. // https://opentdb.com/api.php?amount=10
  4836. CTS.Game.Trivia.XHR.onload = function() {
  4837. var resp = JSON.parse(CTS.Game.Trivia.XHR.responseText);
  4838. if (resp.response_code == 0) {
  4839. CTS.Game.Trivia.QuestionList = resp.results;
  4840. Trivia.AskQuestion();
  4841. }
  4842. };
  4843. //GAME LIST FUNCTION
  4844. var Trivia = {
  4845. init: function() {
  4846. if (CTS.Me.handle == CTS.Host && CTS.CanHostTriviaGames) { // CHANGE BACK TO HOST NEEDED!!!!
  4847. this.Reset();
  4848. CTS.Game.Trivia.Started = true;
  4849. this.GetQuestion();
  4850. }
  4851. },
  4852. GetQuestion: function() {
  4853. CTS.Game.Trivia.XHR.open("GET", "https://opentdb.com/api.php?amount=50&type=multiple");
  4854. CTS.Game.Trivia.XHR.send();
  4855. },
  4856. AskQuestion: function() {
  4857. clearTimeout(CTS.Game.Trivia.Timer);
  4858. CTS.Game.Trivia.AttemptList = [];
  4859. CTS.Game.Trivia.Attempts = 0;
  4860. if (CTS.Game.Trivia.Started) {
  4861. if (CTS.Game.Trivia.QuestionList.length > 0) {
  4862. var RandSlot = Rand(0, 3),
  4863. msg,
  4864. incorrect = 0;
  4865. CTS.Game.Trivia.WaitCount++;
  4866. CTS.Game.Trivia.Correct = CTS.Game.Trivia.ANum[RandSlot];
  4867. CTS.Game.Trivia.Worth = ((CTS.Game.Trivia.QuestionList[0].difficulty === "easy") ? Rand(10, 20) : (CTS.Game.Trivia.QuestionList[0].difficulty === "medium") ? Rand(30, 50) : Rand(70, 100));
  4868. CTS.Game.Trivia.Waiting = false;
  4869. msg = "[TRIVIA]\n" + CTS.Game.Trivia.QuestionList[0].question + "\n\nWorth:" + CTS.Game.Trivia.Worth + "IQ points!\n-------------";
  4870. for (var i = 0; i < 4; i++) {
  4871. msg += "\n\n" + CTS.Game.Trivia.ANum[i] + ") ";
  4872. if (i == RandSlot) {
  4873. msg += CTS.Game.Trivia.QuestionList[0].correct_answer;
  4874. } else {
  4875. msg += CTS.Game.Trivia.QuestionList[0].incorrect_answers[incorrect];
  4876. incorrect++;
  4877. }
  4878. }
  4879. CTS.Game.Trivia.QuestionList.shift();
  4880. Send("msg", DecodeTXT(msg));
  4881. CTS.Game.Trivia.Timer = setTimeout(function(g) {
  4882. Send("msg", "[TRIVIA]\nToo hard eh? Next question coming up in sixty seconds!\nThe answer however was: " + CTS.Game.Trivia.Correct);
  4883. g.Wait();
  4884. }, 240000, this);
  4885. } else {
  4886. CTS.Game.Trivia.WaitCount = 0;
  4887. this.GetQuestion();
  4888. }
  4889. if (CTS.Game.Trivia.WaitCount >= 4) {
  4890. CTS.Game.Trivia.WaitCount = 0;
  4891. this.Ranking();
  4892. }
  4893. }
  4894. },
  4895. Wait: function() {
  4896. CTS.Game.Trivia.Correct = "";
  4897. CTS.Game.Trivia.Waiting = true;
  4898. clearTimeout(CTS.Game.Trivia.Timer);
  4899. setTimeout(function() {
  4900. if (CTS.Game.Trivia.Started) Trivia.AskQuestion();
  4901. }, 60000);
  4902. },
  4903. Ranking: function() {
  4904. Send("msg", "[TRIVIA RANK]\n" + CTS.Game.Trivia.HighScore[0] + " has set the record of " + CTS.Game.Trivia.HighScore[1] + " IQ Points!");
  4905. },
  4906. Reset: function() {
  4907. clearTimeout(CTS.Game.Trivia.Timer);
  4908. CTS.Game.Trivia.Attempts = 0;
  4909. CTS.Game.Trivia.WaitCount = 0;
  4910. CTS.Game.Trivia.Started = false;
  4911. CTS.Game.Trivia.Correct = "";
  4912. CTS.Game.Trivia.AttemptList = [];
  4913. CTS.Game.Trivia.QuestionList = {};
  4914. CTS.Game.Trivia.Waiting = true;
  4915. }
  4916. };
  4917. var Fish = {
  4918. Init: function() {
  4919. if (CTS.Me.handle == CTS.Host && CTS.CanHostFishGames === true) {
  4920. Send("msg", "[FISH]\n!fish at any time and upgrade your way up!\n\n!gameview to show/hide games.\n\nRemember there's a five second delay for all commands, don't spam!\nFor commands type !fishhelp!");
  4921. CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
  4922. g.StartRound();
  4923. }, 5000, this);
  4924. }
  4925. },
  4926. AddPlayer: function() {
  4927. if (!this.GetPlayer(arguments[0], false, false) && CTS.CanHostFishGames === true) {
  4928. if (isSafeListed(arguments[1])) {
  4929. CTS.Game.Fish.Player.push({
  4930. Handle: arguments[0],
  4931. Username: arguments[1],
  4932. Nickname: arguments[2],
  4933. LastCheck: new Date() - 5000,
  4934. Points: 5000,
  4935. Upgrades: {
  4936. Net: 1,
  4937. Store: 1,
  4938. Radar: 1,
  4939. Insurance: false
  4940. },
  4941. });
  4942. Send("msg", "[FISHING BOAT]\n" + arguments[2].substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  4943. if (this.GetPlayer() == 0) this.Init();
  4944. }
  4945. }
  4946. },
  4947. GetPlayer: function() {
  4948. var len = CTS.Game.Fish.Player.length;
  4949. if (arguments[0] !== undefined) {
  4950. for (var player = 0; player < len; player++) {
  4951. if (CTS.Game.Fish.Player[player].Handle == arguments[0]) {
  4952. if (arguments[2]) return CTS.Game.Fish.Player[player];
  4953. if (arguments[1]) {
  4954. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  4955. CTS.Game.Fish.Player.splice(player, 1);
  4956. }
  4957. if (!arguments[2]) return true;
  4958. }
  4959. }
  4960. if (!arguments[2]) {
  4961. return false;
  4962. } else {
  4963. return -1;
  4964. }
  4965. } else {
  4966. return len - 1;
  4967. }
  4968. },
  4969. Ranking: function() {
  4970. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
  4971. place = 0;
  4972. for (var u = arguments[0]; u >= 0; u--) {
  4973. place++;
  4974. if (u < 5) {
  4975. msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
  4976. }
  4977. CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
  4978. CTS.Game.Fish.Player[u].Points += 10000;
  4979. }
  4980. Send("msg", msg);
  4981. },
  4982. Winner: function() {
  4983. CTS.Game.Fish.Player.sort(function(a, b) {
  4984. return a.Points - b.Points;
  4985. });
  4986. if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
  4987. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
  4988. CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
  4989. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  4990. }
  4991. var len = CTS.Game.Fish.Player.length - 1;
  4992. 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!");
  4993. this.Ranking(len);
  4994. CTS.Game.Fish.RestockTimeout = setTimeout(function() {
  4995. Fish.reset(false, true);
  4996. }, 30000);
  4997. },
  4998. PriceList: function() {
  4999. if (arguments[1] == 0) { // net
  5000. return (1000 * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net);
  5001. } else if (arguments[1] == 1) { // radar
  5002. return (1000 * arguments[0].Upgrades.Radar * 2) + 3500;
  5003. } else if (arguments[1] == 2) { // shop
  5004. return (arguments[0].Upgrades.Store * arguments[0].Upgrades.Store * 25000);
  5005. } else if (arguments[1] == 3) { // insurance
  5006. return (20000);
  5007. } else if (arguments[1] == 4) { // rob
  5008. return (10000);
  5009. } else if (arguments[1] == 5) { // slap
  5010. return (50000);
  5011. } else if (arguments[1] == 6) { // split (min$) / gamble
  5012. return (1000);
  5013. }
  5014. },
  5015. StartRound: function() {
  5016. clearTimeout(CTS.Game.Fish.StartTimeout);
  5017. if (CTS.Host === CTS.Me.handle) {
  5018. if (this.GetPlayer() >= 0) {
  5019. if (CTS.Game.Fish.Round < 10) {
  5020. CTS.Game.Fish.Round++;
  5021. var playerlen,
  5022. fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
  5023. id,
  5024. type,
  5025. handle,
  5026. eliminate = false,
  5027. msgeliminate,
  5028. value,
  5029. msg = "[FISHING BOAT]\n";
  5030. for (var cast = 0; cast <= 2; cast++) {
  5031. playerlen = this.GetPlayer();
  5032. id = Rand(0, playerlen);
  5033. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  5034. if (Rand(0, 100) <= Rand(10, 70)) {
  5035. var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
  5036. value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
  5037. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  5038. CTS.Game.Fish.Player[id].Points += value;
  5039. 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");
  5040. } else {
  5041. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  5042. CTS.Game.Fish.Player[id].Points -= value;
  5043. 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");
  5044. } else {
  5045. 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");
  5046. }
  5047. }
  5048. } else {
  5049. cast--;
  5050. }
  5051. if (this.GetPlayer() == -1) break;
  5052. if (CTS.Game.Fish.Player[id].Points < 0) {
  5053. eliminate = true;
  5054. handle = CTS.Game.Fish.Player[id].Handle;
  5055. msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
  5056. CTS.Game.Fish.Player.splice(id, 1);
  5057. break;
  5058. }
  5059. }
  5060. if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
  5061. if (eliminate) {
  5062. eliminate = false;
  5063. Send("msg", msgeliminate);
  5064. }
  5065. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
  5066. g.StartRound();
  5067. }, Rand(90000, 120000), this);
  5068. } else {
  5069. this.Winner();
  5070. }
  5071. } else {
  5072. //RESTART
  5073. Fish.Stop();
  5074. }
  5075. }
  5076. },
  5077. Reset: function() {
  5078. var get = this.GetPlayer();
  5079. if (get !== undefined) {
  5080. if (get >= 0 && !CTS.Game.NoReset || arguments[1] !== undefined) {
  5081. CTS.Game.Fish.Round = 0;
  5082. clearTimeout(CTS.Game.Fish.StartTimeout);
  5083. clearTimeout(CTS.Game.Fish.RestockTimeout);
  5084. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  5085. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  5086. if (!arguments[0]) {
  5087. this.Init();
  5088. } else {
  5089. if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  5090. CTS.Game.Fish.Player = [];
  5091. }
  5092. }
  5093. }
  5094. },
  5095. Stop: function() {
  5096. CTS.Game.NoReset = false;
  5097. this.Reset(true, true);
  5098. }
  5099. };
  5100. var FishList = {
  5101. fish: function() {
  5102. Fish.AddPlayer(arguments[1].handle, arguments[1].username, arguments[1].nick);
  5103. },
  5104. fishbank: function() {
  5105. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname.substr(0, 16) + ", you have $" + arguments[0].Points + ".");
  5106. },
  5107. fishrob: function() {
  5108. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5109. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  5110. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 4), Rand(5000, 20000), true);
  5111. }
  5112. },
  5113. fishgamble: function() {
  5114. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5115. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 6))) {
  5116. var winnings;
  5117. if (Rand(1, 10) === 7) { // 10% chance
  5118. winnings = Rand(1000, 25000);
  5119. arguments[0].Points += winnings;
  5120. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  5121. } else {
  5122. if (Rand(1, 7) === 4) { // 15%
  5123. winnings = Rand(1000, 5000);
  5124. arguments[0].Points += winnings;
  5125. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  5126. } else {
  5127. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " tough luck, you lost $1000!");
  5128. }
  5129. }
  5130. }
  5131. }
  5132. },
  5133. fishslap: function() {
  5134. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5135. var user = UsernameToUser(arguments[1].toUpperCase());
  5136. if (user !== -1) {
  5137. if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle && CTS.UserList[user].username !== "GUEST") {
  5138. if (CTS.Me.owner || !CTS.UserList[user].mod) {
  5139. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 5))) {
  5140. Send("stream_moder_close", CTS.UserList[user].handle);
  5141. Send("msg", arguments[0].Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
  5142. }
  5143. } else {
  5144. Send("msg", "Cannot close moderator!");
  5145. }
  5146. } else {
  5147. Send("msg", "Cannot close user!");
  5148. }
  5149. }
  5150. }
  5151. },
  5152. fishsplit: function() {
  5153. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5154. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  5155. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 6), Math.round(arguments[0].Points / 2), false);
  5156. }
  5157. },
  5158. fishupgrade: function() {
  5159. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 0);
  5160. },
  5161. fishhelp: function() {
  5162. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 6);
  5163. },
  5164. fishupgradenet: function() {
  5165. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5166. if (arguments[0].Upgrades.Net >= 10) {
  5167. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5168. } else {
  5169. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 0))) {
  5170. arguments[0].Upgrades.Net += 1;
  5171. FishUpgradeStatus(arguments[0], 1);
  5172. }
  5173. }
  5174. }
  5175. },
  5176. fishupgradeshop: function() {
  5177. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5178. if (arguments[0].Upgrades.Store >= 6) {
  5179. Send("msg", arguments[0].Nickname + ", you own them all already!");
  5180. } else {
  5181. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 2))) {
  5182. arguments[0].Upgrades.Store += 1;
  5183. FishUpgradeStatus(arguments[0], 4);
  5184. }
  5185. }
  5186. }
  5187. },
  5188. fishupgraderadar: function() {
  5189. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5190. if (arguments[0].Upgrades.Radar >= 20) {
  5191. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5192. } else {
  5193. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 1))) {
  5194. arguments[0].Upgrades.Radar += 5;
  5195. FishUpgradeStatus(arguments[0], 2);
  5196. }
  5197. }
  5198. }
  5199. },
  5200. fishupgradeinsurance: function() {
  5201. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5202. if (arguments[0].Upgrades.Insurance === true) {
  5203. Send("msg", arguments[0].Nickname + ", you already have insurance!");
  5204. } else {
  5205. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 3))) {
  5206. arguments[0].Upgrades.Insurance = true;
  5207. FishUpgradeStatus(arguments[0], 3);
  5208. }
  5209. }
  5210. }
  5211. }
  5212. };
  5213. //MISC FUNCTION
  5214. function SetLocalValues() {
  5215. if (CTS.StorageSupport) {
  5216. //CTS SETTINGS
  5217. CTS.Game.Trivia.PlayerList = JSON.parse(Load("TriviaPlayerList", JSON.stringify({})));
  5218. CTS.Game.Trivia.HighScore = JSON.parse(Load("TriviaHighScore", JSON.stringify(["CosmosisT", 1])));
  5219. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
  5220. CTS.PublicCommandToggle = JSON.parse(Load("PublicCommandToggle", JSON.stringify(true)));
  5221. CTS.OGStyle.SavedHeight = JSON.parse(Load("OGStyleHeight", JSON.stringify(3)));
  5222. CTS.GreenRoomIgnoreList = JSON.parse(Load("GreenRoomIgnoreList", JSON.stringify([])));
  5223. CTS.CameraBorderToggle = JSON.parse(Load("CameraBorderToggle", JSON.stringify(true)));
  5224. CTS.OGStyle.SavedWidth = JSON.parse(Load("OGStyleWidth", JSON.stringify(1)));
  5225. CTS.NotificationToggle = JSON.parse(Load("NotificationToggle", JSON.stringify(0)));
  5226. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", JSON.stringify(14)));
  5227. CTS.SoundMeterToggle = JSON.parse(Load("SoundMeterToggle", JSON.stringify(true)));
  5228. CTS.HiddenCameraList = JSON.parse(Load("HiddenCameraList", JSON.stringify([])));
  5229. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  5230. CTS.PerformanceMode = JSON.parse(Load("PerformanceMode", JSON.stringify(false)));
  5231. CTS.TimeStampToggle = JSON.parse(Load("TimeStampToggle", JSON.stringify(true)));
  5232. CTS.YouTube.API_KEY = Load("YouTubeAPI", "AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs");
  5233. CTS.GreenRoomToggle = JSON.parse(Load("GreenRoomToggle", JSON.stringify(true)));
  5234. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  5235. CTS.FavoritedRooms = JSON.parse(Load("FavoritedRooms", JSON.stringify(["stonercircle", null, null, null, null])));
  5236. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/aS5RCaX.jpg) rgb(0, 0, 0) no-repeat");
  5237. CTS.GreenRoomList = JSON.parse(Load("GreenRoomList", JSON.stringify([])));
  5238. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  5239. CTS.CanHostTriviaGames = JSON.parse(Load("CanHostTriviaGames", JSON.stringify(false)));
  5240. CTS.CanHostFishGames = JSON.parse(Load("CanHostFishGames", JSON.stringify(false)));
  5241. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  5242. CTS.UserKickList = JSON.parse(Load("UserKickList", JSON.stringify([])));
  5243. CTS.NickKickList = JSON.parse(Load("NickKickList", JSON.stringify([])));
  5244. CTS.UserBanList = JSON.parse(Load("UserBanList", JSON.stringify([])));
  5245. CTS.NickBanList = JSON.parse(Load("NickBanList", JSON.stringify([])));
  5246. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  5247. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  5248. CTS.ThemeChange = JSON.parse(Load("ThemeChange", JSON.stringify(true)));
  5249. CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
  5250. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  5251. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  5252. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  5253. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  5254. CTS.FontSize = JSON.parse(Load("FontSize", JSON.stringify(20)));
  5255. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  5256. CTS.Featured = JSON.parse(Load("Featured", JSON.stringify(false)));
  5257. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  5258. CTS.ChatType = JSON.parse(Load("ChatType", JSON.stringify(true)));
  5259. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  5260. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  5261. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  5262. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  5263. CTS.Imgur = JSON.parse(Load("Imgur", JSON.stringify(true)));
  5264. CTS.FPS = JSON.parse(Load("FPS", JSON.stringify(30)));
  5265. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  5266. CTS.MediaStreamFilter = Load("MediaStreamFilter", "No Filter");
  5267. }
  5268. }
  5269.  
  5270. function debug() {
  5271. if (window.DebugClear === false) {
  5272. if (arguments[0] !== undefined) {
  5273. var msg = "CTS::" + arguments[0];
  5274. if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
  5275. console.log(msg);
  5276. }
  5277. } else {
  5278. console.clear();
  5279. 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/KCfH5PQ");
  5280. }
  5281. }
  5282.  
  5283. function Reset() {
  5284. CTS.UserList = [];
  5285. CTS.Me = [];
  5286. CTS.Room = [];
  5287. CTS.SendQueue = [];
  5288. CTS.Camera.List = [];
  5289. CTS.Camera.List = [];
  5290. CTS.WaitToVoteList = [];
  5291. CTS.WatchList = [];
  5292. CTS.Host = 0;
  5293. CTS.HostAttempt = 0;
  5294. CTS.HostWaiting = false;
  5295. CTS.TempIgnoreUserList = [];
  5296. CTS.TempIgnoreNickList = [];
  5297. // Game Reset
  5298. Fish.Stop();
  5299. Trivia.Reset();
  5300. }
  5301.  
  5302. function Remove() {
  5303. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  5304. }
  5305. })();