CosmosisT's TinyChat Script (CTS V1.8.54)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2022-12-01 提交的版本,查看 最新版本

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