CosmosisT's TinyChat Script (CTS V1.8.62)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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