CosmosisT's TinyChat Script (CTS V1.8.424)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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