CosmosisT's TinyChat Script (CTS V1.8.63)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2024-04-02 提交的版本,查看 最新版本

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