CosmosisT's TinyChat Script (CTS V1.8.57)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2023-03-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.8.57)
  3. // @version 1.8.57
  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: 57
  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(elem) {
  1319. MainElement.querySelector("#modal").shadowRoot.querySelector("#modal-window").classList.remove("modal-show");
  1320. if (MainElement.querySelector("#fatal")) Remove(MainElement.querySelector("#fatal"));
  1321. if(MainElement.querySelector("#modal").hasChildNodes()) MainElement.querySelector("#modal").shadowRoot.querySelector("#modal-window").classList.add("modal-show");
  1322. }).observe(MainElement.querySelector("#modal"), {
  1323. childList: true
  1324. });
  1325.  
  1326. new MutationObserver(function() {
  1327. LoadMessage();
  1328. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  1329. attributes: true,
  1330. attributeFilter: ["class"],
  1331. childList: false,
  1332. characterData: false
  1333. });
  1334. new MutationObserver(function() {
  1335. Cameras();
  1336. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  1337. childList: true
  1338. });
  1339. new MutationObserver(function() {
  1340. Cameras();
  1341. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  1342. childList: true
  1343. });
  1344. new MutationObserver(function() {
  1345. if (CTS.AutoMicrophone) {
  1346. OpenMicrophone();
  1347. }
  1348. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  1349. attributes: true,
  1350. attributeFilter: ["class"]
  1351. });
  1352. //BOOT UP - FIRST START
  1353. NotificationDisplay();
  1354. FeaturedCameras(CTS.Featured);
  1355. Cameras();
  1356. }
  1357. //YOUTUBE FUNCTIONS
  1358. function YouTubePIP() {
  1359. if (window.YouTube.Popup == null || window.YouTube.Popup.closed) {
  1360. 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");
  1361. var detect_popup = setInterval(function() {
  1362. if(window.YouTube.Popup.closed) {
  1363. clearInterval(detect_popup);
  1364. window.YouTube.Popup = null;
  1365. window.YouTube.Init();
  1366. }
  1367. }, 1000);
  1368. window.YouTube.Popup.focus();
  1369. window.YouTube.stopVideo();
  1370. }
  1371. }
  1372.  
  1373. function YouTubeDuration(calc) {
  1374. var elem = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement;
  1375. if (elem.querySelector(".duration")) elem.querySelector(".duration").style.width = calc+"%";
  1376. }
  1377.  
  1378. function YouTubeFullScreen() {
  1379. var elem = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement;
  1380.  
  1381. var playerElement = elem.querySelector("#player");
  1382. var requestFullScreen = playerElement.requestFullScreen || playerElement.mozRequestFullScreen || playerElement.webkitRequestFullScreen;
  1383. if (requestFullScreen) requestFullScreen.bind(playerElement)();
  1384. }
  1385.  
  1386. function YouTubeBehindChat(reset) {
  1387. if (!CTS.ThemeChange) {
  1388. if (reset !== true) window.YouTube.BehindChat = !window.YouTube.BehindChat;
  1389. var elem = (!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement;
  1390. elem.querySelector("#player").style.cssText = (window.YouTube.BehindChat) ? "position: fixed;top: 0;left: 0;height: 100%;z-index: -1;" : "";
  1391. elem.querySelector(".overlay").style.cssText = (window.YouTube.BehindChat) ? "left: 0px;position: absolute; z-index: 1;" : "";
  1392. }
  1393. }
  1394. function YouTubeMute (reset) {
  1395. if (window.YouTube.onReadyYT) {
  1396. if (window.CTSMuted) {
  1397. window.YouTube.Player.mute();
  1398. } else {
  1399. if(reset === true) {
  1400. window.YouTube.Player[(window.YouTube.Muted)?"mute":"unMute"]();
  1401. } else {
  1402. window.YouTube.Player[(window.YouTube.Player.isMuted())?"unMute":"mute"]();
  1403. window.YouTube.Muted = (window.YouTube.Player.isMuted())?false:true;
  1404. }
  1405. }
  1406. window.YouTube.Player.setVolume(Math.ceil((window.CTSRoomVolume !== 1)?window.YouTube.Volume*window.CTSRoomVolume:window.YouTube.Volume));
  1407. }
  1408. }
  1409. function YouTubeVolumeUp() {
  1410. YouTubeVolumeController(true);
  1411. }
  1412. function YouTubeVolumeController(val) {
  1413. if (window.YouTube.onReadyYT) {
  1414. var vol = window.YouTube.Volume;
  1415. 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);
  1416. window.YouTube.Volume = vol;
  1417. window.YouTube.Player.setVolume(Math.ceil(vol*window.CTSRoomVolume));
  1418. if (!window.CTSMuted && window.YouTube.Muted) {
  1419. window.YouTube.Player.unMute();
  1420. window.YouTube.Muted = false;
  1421. }
  1422. YouTubeVolumeIndicator();
  1423. }
  1424. }
  1425.  
  1426. function YouTubeVolumeDown() {
  1427. YouTubeVolumeController(false);
  1428. }
  1429.  
  1430. function YouTubeVolumeIndicator() {
  1431. var elem = ((!CTS.ThemeChange) ? SideMenuElement.querySelector("#sidemenu-content") : ChatListElement);
  1432. elem.querySelector(".volume").style.width = window.YouTube.Volume + "%";
  1433. }
  1434.  
  1435. function YouTubeClose() {
  1436. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  1437. }
  1438.  
  1439. function VerifyYouTube() {
  1440. // Check Mod/JRMod
  1441. if (CTS.UserList[arguments[0]].mod || CTS.BotModList.includes(CTS.UserList[arguments[0]].username)) return true;
  1442. // Check OP
  1443. if (CTS.UserYT) {
  1444. if (CTS.BotOPList.includes(CTS.UserList[arguments[0]].username)) return true;
  1445. if (CTS.BotOPList.includes("-ALL") && isSafeListed(CTS.UserList[arguments[0]].username)) return true;
  1446. }
  1447. return false;
  1448. }
  1449.  
  1450. function CheckHost() {
  1451. if (CTS.Host === 0) {
  1452. Send("msg", "!whoisbot");
  1453. CTS.HostAttempt = 0;
  1454. CTS.HostWaiting = true;
  1455. }
  1456. }
  1457.  
  1458. function SetBot() {
  1459. if (arguments[0]) CTS.Game.NoReset = true;
  1460. Send("msg", "!bot");
  1461. CTS.HostWaiting = false;
  1462. }
  1463.  
  1464. function CheckYouTube() {
  1465. //CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
  1466. if (arguments[3] === undefined) arguments[3] = true;
  1467. CTS.YouTube.XHR.type = arguments[1];
  1468. 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);
  1469. if (videoid !== null) {
  1470. videoid = videoid[1].replace(/v\=/g, "");
  1471. //LINK IS PLAYLIST
  1472. if (videoid.match(/list\=/i)) {
  1473. if (arguments[3]) {
  1474. videoid = videoid.replace(/list\=/, "");
  1475. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  1476. 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);
  1477. CTS.YouTube.XHR.send();
  1478. }
  1479. } else {
  1480. //LINK IS REGULAR
  1481. CTS.YouTube.XHR.videoid = videoid;
  1482. CTS.YouTube.VideoReturn = true;
  1483. 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);
  1484. CTS.YouTube.XHR.send();
  1485. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  1486. }
  1487. } else {
  1488. //KEYWORD SEARCH
  1489. if (CTS.YouTube.MessageQueueList.length <= 0) {
  1490. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  1491. CTS.YouTube.SearchReturn = true;
  1492. 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");
  1493. CTS.YouTube.XHR.send();
  1494. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  1495. }
  1496. }
  1497. }
  1498.  
  1499. function YoutubeBypass() {
  1500. 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);
  1501. if (videoid !== null) {
  1502. CTS.SocketTarget.send(JSON.stringify({
  1503. "tc": "yut_play",
  1504. "item": {
  1505. "id": videoid[1],
  1506. "duration": 7200,
  1507. "offset": 0,
  1508. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1509. }
  1510. }));
  1511. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1512. }
  1513. }
  1514.  
  1515. function YouTubePlayList() {
  1516. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  1517. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  1518. }
  1519.  
  1520. function YouTubeTrackAdd() {
  1521. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  1522. if (CTS.YouTube.Busy === false) {
  1523. if (CTS.YouTube.MessageQueueList.length > 0) {
  1524. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  1525. 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);
  1526. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  1527. CTS.YouTube.XHR.send();
  1528. CTS.YouTube.MessageQueueList.shift();
  1529. }
  1530. }
  1531. }
  1532. }
  1533.  
  1534. function YouTubePlayListItems() {
  1535. var len = arguments[0].length;
  1536. for (var i = 0; i < len; i++) {
  1537. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  1538. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  1539. }
  1540. }
  1541. }
  1542.  
  1543. function YouTubeTimeConvert() {
  1544. //TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
  1545. var a = arguments[0].match(/\d+/g);
  1546. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  1547. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  1548. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  1549. var len = a.length;
  1550. arguments[0] = 0;
  1551. if (len == 3) {
  1552. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  1553. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  1554. arguments[0] = arguments[0] + parseInt(a[2]);
  1555. }
  1556. if (len == 2) {
  1557. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  1558. arguments[0] = arguments[0] + parseInt(a[1]);
  1559. }
  1560. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  1561. return arguments[0];
  1562. }
  1563.  
  1564. function BotCommandCheck() {
  1565. //USER COMMANDS TO HOST
  1566. if (isCommand(arguments[1])) {
  1567. if (arguments[1].match(/^!play$|^!yt |^!ytbypass |^!ytclear$|^!ytskip$|^!ytqueue$/i)) {
  1568. BotCommandCheckYT(arguments[0], arguments[1]);
  1569. } else if (arguments[1].match(/^!userkick |^!userban |^!userclose |^!nickkick |^!nickban |^!nickclose /i)) {
  1570. BotCommandCheckJR(arguments[0], arguments[1]);
  1571. } else if (arguments[1].match(/^!whoisbot$|^!8ball |^!vote |^!coin$|^!chuck$|^!urb |^!dad$|^!advice$/i)) {
  1572. BotCommandCheckPUB(arguments[0], arguments[1]);
  1573. } else if (CTS.UserList[arguments[0]].canGame && CTS.CanHostFishGames) {
  1574. FishCommandCheck(arguments[0], arguments[1]);
  1575. }
  1576. }
  1577. if (CTS.Game.Trivia.Started && CTS.CanHostTriviaGames && arguments[1].match(/^!iq$|^!triviahelp$|^!triviashop$|^!raid |^!ytbypass |^!spot$|^[a-d]$/i)) TriviaCommandCheck(arguments[0], arguments[1]);
  1578. }
  1579.  
  1580. function TriviaCommandCheck() {
  1581. var User = CTS.UserList[arguments[0]];
  1582. if (User.canGame) {
  1583. if (isSafeListed(User.username)) {
  1584. if (!isCommand(arguments[1])) {
  1585. //NO CHEATERS
  1586. var Guessed = CTS.Game.Trivia.AttemptList.includes(User.username);
  1587. if (arguments[1].length == 1 && CTS.Game.Trivia.ANum.includes(arguments[1].toUpperCase()) && !Guessed && !CTS.Game.Trivia.Waiting) {
  1588. if (CTS.Game.Trivia.Correct === arguments[1].toUpperCase()) {
  1589. // Save Progress
  1590. User.triviapoints += CTS.Game.Trivia.Worth;
  1591. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1592. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1593. // Send Output
  1594. 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!");
  1595. if (User.triviapoints > CTS.Game.Trivia.HighScore[1]) {
  1596. CTS.Game.Trivia.HighScore[0] = User.username;
  1597. CTS.Game.Trivia.HighScore[1] = User.triviapoints;
  1598. // Save HighScore
  1599. Save("TriviaHighScore", JSON.stringify(CTS.Game.Trivia.HighScore));
  1600. }
  1601. // Wait
  1602. Trivia.Wait();
  1603. } else {
  1604. CTS.Game.Trivia.Attempts++;
  1605. CTS.Game.Trivia.AttemptList.push(User.username);
  1606. Send("msg", "[TRIVIA]\n" + User.username + " that's wrong however you may attempt next rounds question.");
  1607. if (CTS.Game.Trivia.Attempts == 3) {
  1608. Send("msg", "[TRIVIA]\nNobody got it!\nNext round will start in shortly.\nThe answer however was: " + CTS.Game.Trivia.Correct);
  1609. Trivia.Wait();
  1610. }
  1611. }
  1612. }
  1613. } else {
  1614. TriviaCommand(arguments[0], arguments[1]);
  1615. }
  1616. }
  1617. }
  1618. }
  1619.  
  1620. function TriviaCommand() {
  1621. var User = CTS.UserList[arguments[0]];
  1622. if (!User.mod && !CTS.BotModList.includes(User.username)) {
  1623. if (arguments[1].match(/^!ytbypass/i) && CTS.Room.YT_ON) {
  1624. if (CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.ytbypass) {
  1625. User.triviapoints -= CTS.Game.Trivia.PriceList.ytbypass;
  1626. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1627. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1628. 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!:)");
  1629. YoutubeBypass(arguments[1]);
  1630. } else {
  1631. TriviaTooPoor(User.username);
  1632. }
  1633. }
  1634. }
  1635. if (CTS.Me.owner) {
  1636. if (!User.owner) {
  1637. if (arguments[1].match(/^!raid /i)) {
  1638. if (CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.raid) {
  1639. var raid = arguments[1].match(/^(?:!raid )(?:<a href=")(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})/i);
  1640. if (raid !== null) {
  1641. User.triviapoints -= CTS.Game.Trivia.PriceList.raid;
  1642. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1643. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1644. Send("msg", "[TRIVIA]\n" + User.username + ",\nyou've just purchased raid for " + CTS.Game.Trivia.PriceList.raid + " IQ Points!\n\nCTS Users be prepared to teleport in several seconds!");
  1645. Send("msg", "[TRIVIA]\nREMEMBER HAVE FUN IF YOU DON'T WARP CLICK THE LINK SHORTLY!\n\nhttps://tinychat.com/room/" + raid[1]);
  1646. // WAIT
  1647. setTimeout(function() {
  1648. Send("msg", "!raid https://tinychat.com/room/" + raid[1]);
  1649. }, 10000);
  1650. } else {
  1651. 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!");
  1652. }
  1653. } else {
  1654. TriviaTooPoor(User.username);
  1655. }
  1656. } else if (arguments[1].match(/^!spot$/i)) {
  1657. if (CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.spot) {
  1658. var rand = Rand(0, CTS.Camera.List.length - 1),
  1659. target = HandleToUser(CTS.Camera.List[rand]);
  1660. if (target != -1) {
  1661. User.triviapoints -= CTS.Game.Trivia.PriceList.spot;
  1662. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1663. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1664. 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");
  1665. if (CTS.UserList[target].handle !== CTS.Me.handle) {
  1666. Send("stream_moder_close", CTS.Camera.List[rand]);
  1667. } else {
  1668. CTS.SocketTarget.send(JSON.stringify({
  1669. "tc": "stream_close",
  1670. "handle": CTS.Me.handle
  1671. }));
  1672. }
  1673. }
  1674. } else {
  1675. TriviaTooPoor(User.username);
  1676. }
  1677. }
  1678. }
  1679. }
  1680. if (arguments[1].match(/^!triviashop$/i)) {
  1681. 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]");
  1682. } else if (arguments[1].match(/^!triviahelp$/i)) {
  1683. Send("msg", "[TRIVIA]\n!iq\n!triviashop");
  1684. } else if (arguments[1].match(/^!iq$/i)) {
  1685. Send("msg", "[TRIVIA]\n" + User.username + ",\nYou have an IQ of " + User.triviapoints + ".");
  1686. }
  1687. }
  1688.  
  1689. function TriviaTooPoor() {
  1690. Send("msg", "[TRIVIA]\n" + arguments[0] + ",\nyou cannot afford this right now!");
  1691. }
  1692.  
  1693. function BotCommandCheckYT() {
  1694. //ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
  1695. if (CTS.Room.YT_ON) {
  1696. if (arguments[1].match(/^!play$/i)) {
  1697. if (CTS.UserList[arguments[0]].mod) YouTubePlayList();
  1698. } else if (arguments[1].match(/^!yt /i)) {
  1699. BotCommand(1, arguments[0], arguments[1]);
  1700. } else if (arguments[1].match(/^!ytbypass /i)) {
  1701. BotCommand(6, arguments[0], arguments[1]);
  1702. } else if (arguments[1].match(/^!ytclear$/i)) {
  1703. BotCommand(2, arguments[0]);
  1704. } else if (arguments[1].match(/^!ytskip$/i)) {
  1705. BotCommand(3, arguments[0]);
  1706. } else if (arguments[1].match(/^!ytqueue$/i)) {
  1707. BotCommand(4, arguments[0]);
  1708. }
  1709. }
  1710. }
  1711.  
  1712. function BotCommandCheckJR() {
  1713. //MOD/JR.MOD
  1714. if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
  1715. if (arguments[1].match(/^!userkick /i)) {
  1716. ModCommand("kick", arguments[1], true);
  1717. } else if (arguments[1].match(/^!userban /i)) {
  1718. ModCommand("ban", arguments[1], true);
  1719. } else if (arguments[1].match(/^!userclose /i)) {
  1720. ModCommand("stream_moder_close", arguments[1], true);
  1721. } else if (arguments[1].match(/^!nickkick /i)) {
  1722. ModCommand("kick", arguments[1], false);
  1723. } else if (arguments[1].match(/^!nickban /i)) {
  1724. ModCommand("ban", arguments[1], false);
  1725. } else if (arguments[1].match(/^!nickclose /i)) {
  1726. ModCommand("stream_moder_close", arguments[1], false);
  1727. }
  1728. }
  1729. }
  1730.  
  1731. function BotCommandCheckPUB() {
  1732. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  1733. if (arguments[1].match(/^!vote /i)) Vote(arguments[0], arguments[1]);
  1734. // PUBLIC COMMANDS
  1735. if (CTS.PublicCommandToggle) {
  1736. if (arguments[1].match(/^!8ball [\w\s]*\??/i)) {
  1737. if (CTS.UserList[arguments[0]].mod || isSafeListed(CTS.UserList[arguments[0]].username)) Send("msg", "[8BALL]\n" + window.CTSEightBall[Rand(0, window.CTSEightBall.length - 1)]);
  1738. } else if (arguments[1].match(/^!coin$/i)) {
  1739. 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") + "!");
  1740. } else {
  1741. if (arguments[1].match(/^!chuck$/i)) {
  1742. Chuck(CTS.UserList[arguments[0]].username);
  1743. } else if (arguments[1].match(/^!urb /i)) {
  1744. Urb(arguments[1], CTS.UserList[arguments[0]].username);
  1745. } else if (arguments[1].match(/^!dad$/i)) {
  1746. Dad(CTS.UserList[arguments[0]].username);
  1747. } else if (arguments[1].match(/^!advice$/i)) {
  1748. Advice(CTS.UserList[arguments[0]].username);
  1749. }
  1750. }
  1751. }
  1752. }
  1753.  
  1754. function BotCheck() {
  1755. if (CTS.UserList[arguments[0]].mod) {
  1756. //CHECK HOST
  1757. if (arguments[1].match(/^!bot$/i)) {
  1758. //SET HOST
  1759. CTS.Host = arguments[2].handle;
  1760. CTS.HostWaiting = false;
  1761. //RESET GAMES
  1762. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  1763. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  1764. if (CTS.Me.handle !== arguments[2].handle) {
  1765. CTS.Game.NoReset = false;
  1766. Fish.Reset(true);
  1767. // Reset Trivia
  1768. Trivia.Reset();
  1769. }
  1770. }
  1771. //IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
  1772. if (CTS.Me.handle == arguments[2].handle && CTS.Room.YT_ON) YouTubePlayList();
  1773. //ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
  1774. } else if (CTS.HostWaiting === true) {
  1775. CTS.HostAttempt++;
  1776. //SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
  1777. if (CTS.HostAttempt == 1) {
  1778. setTimeout(function() {
  1779. //CHECK WAITING STATE OR IF HOST HAS CHANGED
  1780. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  1781. }, 10000);
  1782. }
  1783. //SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
  1784. if (CTS.HostAttempt == 10) SetBot(false);
  1785. }
  1786. }
  1787. }
  1788.  
  1789. function Chuck() {
  1790. //OPEN REQUEST
  1791. if (isSafeListed(arguments[0])) {
  1792. CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
  1793. CTS.Chuck.XHR.send();
  1794. }
  1795. }
  1796.  
  1797. function Urb() {
  1798. //CHECK TERM
  1799. if (isSafeListed(arguments[1])) {
  1800. var urban = arguments[0].match(/^!urb ([\w ]*)/i);
  1801. if (urban !== null) {
  1802. //OPEN REQUEST
  1803. CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
  1804. CTS.Urb.XHR.send();
  1805. }
  1806. }
  1807. }
  1808.  
  1809. function Dad() {
  1810. //OPEN REQUEST
  1811. if (isSafeListed(arguments[0])) {
  1812. CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
  1813. CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
  1814. CTS.Dad.XHR.send();
  1815. }
  1816. }
  1817.  
  1818. function Advice() {
  1819. //OPEN REQUEST
  1820. if (isSafeListed(arguments[0])) {
  1821. CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
  1822. CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
  1823. CTS.Advice.XHR.send();
  1824. }
  1825. }
  1826. //MESSAGE FUNCTION
  1827. function CreateMessage() {
  1828. //SCROLLED UP? MISSED A MESSAGE?
  1829. CheckUnreadMessage();
  1830. // POST NEW CHAT ITEM IF ACTIVECHAT IS OUR CURRENT CHAT
  1831. if (arguments[7] == GetActiveChat()) {
  1832. var stack = ChatLogElement.querySelector("#cts-chat-content>.message:last-child cts-message-html:last-child");
  1833. if (arguments[4] == CTS.CreateMessageLast && stack !== null && CTS.ChatType) {
  1834. // Stack
  1835. 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>");
  1836. } else {
  1837. CTS.CreateMessageLast = arguments[4];
  1838. 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>");
  1839. }
  1840. } else {
  1841. CTS.CreateMessageLast = undefined;
  1842. }
  1843. UpdateScroll(1, false);
  1844. }
  1845.  
  1846. function LoadMessage() {
  1847. var Chat = ChatLogElement.querySelector("#cts-chat-content");
  1848. CTS.ChatScroll = true;
  1849. Chat.innerHTML = "";
  1850. CheckUnreadMessage();
  1851. if (CTS.Message[GetActiveChat()]) {
  1852. //POST MESSAGE
  1853. var len = CTS.Message[GetActiveChat()].length,
  1854. LoadMessageLast;
  1855. for (var ChatIndex = 0; ChatIndex < len; ChatIndex++) {
  1856. if (CTS.Message[GetActiveChat()][ChatIndex].nick == LoadMessageLast && CTS.ChatType) {
  1857. // Stack
  1858. 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>");
  1859. } else {
  1860. LoadMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1861. 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>");
  1862. }
  1863. if (ChatIndex == (len - 1)) CTS.CreateMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1864. }
  1865. } else {
  1866. //START PM
  1867. CTS.Message[GetActiveChat()] = [];
  1868. }
  1869. UpdateScroll(1, false);
  1870. UpdateScroll(2, false);
  1871. }
  1872.  
  1873. function CreateGift() {
  1874. var gift = arguments[0].gift,
  1875. from = (!gift.anon) ? arguments[0].from.name : "ANONYMOUS",
  1876. to = arguments[0].to.name,
  1877. comment = gift.comment;
  1878. CTS.Message[0].push({
  1879. "time": Time(),
  1880. "namecolor": "#3f69c0",
  1881. "avatar": "",
  1882. "username": "",
  1883. "nick": "SPECIAL DELIVERY",
  1884. "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>",
  1885. "mention": true
  1886. });
  1887. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  1888. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  1889. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  1890. window.CTSSound.GIFT.volume = window.CTSRoomVolume;
  1891. window.CTSSound.GIFT.play();
  1892. }
  1893. UpdateScroll(1, true);
  1894. }
  1895.  
  1896. function AKB() {
  1897. //WATCH OR REMOVE USERS
  1898. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  1899. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  1900. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  1901. } else {
  1902. if (CTS.Me.mod) {
  1903. if (CTS.AutoKick === true) {
  1904. CTS.NoGreet = true;
  1905. Send("kick", arguments[1]);
  1906. } else if (CTS.AutoBan === true) {
  1907. CTS.NoGreet = true;
  1908. Send("ban", arguments[1]);
  1909. }
  1910. }
  1911. }
  1912. }
  1913.  
  1914. function AKBS() {
  1915. if (arguments[0].username !== "") {
  1916. //EXTENDED SAFELIST
  1917. var temp = [];
  1918. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1919. //DEFAULT SAFELIST
  1920. if (!isSafeListed(arguments[0].username.toUpperCase())) {
  1921. if (arguments[0].subscription > 0 || arguments[0].mod === true) {
  1922. if (CTS.SafeList.length < 10000) {
  1923. CTS.SafeList.push(arguments[0].username.toUpperCase());
  1924. Save("AKB", JSON.stringify(CTS.SafeList));
  1925. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1926. }
  1927. } else {
  1928. if (arguments[0].lurker === false) {
  1929. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1930. } else {
  1931. AKB(false, arguments[0].handle);
  1932. }
  1933. }
  1934. }
  1935. } else {
  1936. AKB(false, arguments[0].handle);
  1937. }
  1938. }
  1939.  
  1940. function CheckSafeList() {
  1941. var target = HandleToUser(arguments[0]);
  1942. if (target !== -1) {
  1943. var a = CTS.SafeList.indexOf(CTS.UserList[target].username);
  1944. if (a !== -1) {
  1945. //REMOVE
  1946. if (arguments[1]) {
  1947. debug("SAFELIST::", "REMOVE USER " + CTS.UserList[target].username + " FROM SAFELIST");
  1948. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[target].username + " from safelist!");
  1949. CommandList.saferemove(a);
  1950. } else {
  1951. //GETID
  1952. return a;
  1953. }
  1954. }
  1955. }
  1956. }
  1957.  
  1958. function CheckUnreadMessage() {
  1959. if ((Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) || arguments[0] !== undefined) {
  1960. CTS.MissedMsg = 0;
  1961. CTS.ChatScroll = true;
  1962. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1963. } else {
  1964. CTS.MissedMsg++;
  1965. CTS.ChatScroll = false;
  1966. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1967. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1968. }
  1969. }
  1970.  
  1971. function GetActiveChat() {
  1972. var elem = ChatListElement.querySelector(".active");
  1973. if (elem) return elem.getAttribute("data-chat-id");
  1974. return 0;
  1975. }
  1976.  
  1977. function CheckImgur() {
  1978. if (CTS.Imgur) {
  1979. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpeg|jpg|gif|png|mp4)/);
  1980. if (i !== null) {
  1981. CTS.ImgurWarning++;
  1982. 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>";
  1983. if (CTS.ImgurWarning < 2 && CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nYou can !imgurtoggle at anytime to stop unwanted images showing through.");
  1984. }
  1985. }
  1986. return arguments[0];
  1987. }
  1988.  
  1989. function TTS() {
  1990. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1991. utter.voice = CTS.TTS.voices[0];
  1992. utter.rate = 1.0;
  1993. utter.pitch = 0.5;
  1994. CTS.TTS.synth.speak(utter);
  1995. }
  1996.  
  1997. function isCommand() {
  1998. return arguments[0].match(/^!/);
  1999. }
  2000.  
  2001. function RoomUsers() {
  2002. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  2003. }
  2004.  
  2005. function LineSpam() {
  2006. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  2007. if (LineBreaks >= 14 && arguments[1] === false) return true;
  2008. return false;
  2009. }
  2010.  
  2011. function GamePrevention() {
  2012. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(FISHING BOAT|TRIVIA)\]/)) return false;
  2013. return true;
  2014. }
  2015.  
  2016. function UpdateScroll() {
  2017. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  2018. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true) && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  2019. }
  2020.  
  2021. function DecodeTXT() {
  2022. var txt = document.createElement("textarea");
  2023. txt.innerHTML = arguments[0];
  2024. return txt.value;
  2025. }
  2026.  
  2027. function HTMLtoTXT() {
  2028. var p = document.createElement("p");
  2029. var text = document.createTextNode(arguments[0]);
  2030. p.appendChild(text);
  2031. 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)=> {
  2032. try {
  2033. if(new URL(url).hostname.includes('xn--')) {
  2034. return`URL BLOCKED`;
  2035. } else {
  2036. return `<a target="_blank" href="${url}">${url}</a>`
  2037. }
  2038. } catch (e) {
  2039. return`URL BLOCKED`;
  2040. }
  2041. });
  2042. p = p.replace(/[\u2680-\u2685]/g, "<span style=\"font-size:275%;\">$&</span>").replace(/\n|\r/g, "<br>");
  2043. return p;
  2044. }
  2045.  
  2046. function IgnoreText() {
  2047. if (arguments[0] !== "") {
  2048. if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
  2049. return true;
  2050. }
  2051. }
  2052.  
  2053. function TimeToDate() {
  2054. if (arguments[1] === undefined) arguments[1] = new Date();
  2055. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((?:am|pm))/i);
  2056. var t = {
  2057. hours: parseInt(match[1]),
  2058. minutes: parseInt(match[2]),
  2059. period: match[3].toLowerCase()
  2060. };
  2061. if (t.hours === 12) {
  2062. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  2063. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  2064. } else {
  2065. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  2066. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  2067. }
  2068. return arguments[1];
  2069. }
  2070.  
  2071. function PushPM() {
  2072. var text = HTMLtoTXT(arguments[1]),
  2073. list;
  2074. if (arguments[2] !== undefined) {
  2075. list = CTS.UserList[arguments[2]];
  2076. if (isSafeListed(CTS.UserList[arguments[2]].username)) text = CheckImgur(text);
  2077. } else {
  2078. list = CTS.Me;
  2079. text = CheckImgur(text);
  2080. }
  2081.  
  2082. CTS.Message[arguments[0]].push({
  2083. "time": Time(),
  2084. "namecolor": list.namecolor,
  2085. "avatar": list.avatar,
  2086. "username": list.username,
  2087. "nick": list.nick,
  2088. "msg": text,
  2089. "mention": false
  2090. });
  2091.  
  2092. if (arguments[0] == GetActiveChat()) {
  2093. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  2094. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, msg.mention, arguments[0]);
  2095. UpdateScroll(1, false);
  2096. }
  2097. }
  2098.  
  2099. function Time() {
  2100. return (new Date().toLocaleString("en-US", {
  2101. hour: "numeric",
  2102. minute: "numeric",
  2103. second: "numeric",
  2104. hour12: true
  2105. }));
  2106. }
  2107.  
  2108. function DateTime() {
  2109. return (new Date().toLocaleString("en-US", {
  2110. year: 'numeric',
  2111. month: 'numeric',
  2112. day: 'numeric',
  2113. hour: "numeric",
  2114. minute: "numeric",
  2115. second: "numeric",
  2116. hour12: true
  2117. }));
  2118. }
  2119. //FEATURES
  2120. function StorageSupport() {
  2121. try {
  2122. if ("localStorage" in window && window.localStorage !== null) {
  2123. localStorage.setItem("CTS_StorageVerify", true);
  2124. localStorage.removeItem("CTS_StorageVerify");
  2125. return true;
  2126. }
  2127. } catch (e) {
  2128. return false;
  2129. }
  2130. }
  2131.  
  2132. function Export() {
  2133. var element = document.createElement("a");
  2134. element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(arguments[1]));
  2135. element.setAttribute("download", arguments[0]);
  2136. element.style.display = "none";
  2137. document.body.appendChild(element);
  2138. element.click();
  2139. document.body.removeChild(element);
  2140. }
  2141.  
  2142. function StyleSet() {
  2143. // Chat
  2144. var style = document.createElement("style");
  2145. style.setAttribute("id", CTS.ChatStyleCounter);
  2146. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][0] + ":host, #videolist {background-color:unset;}";
  2147. ChatLogElement.appendChild(style);
  2148. // Video
  2149. style = document.createElement("style");
  2150. style.setAttribute("id", CTS.ChatStyleCounter);
  2151. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][1] + ":host, #videolist {background-color:unset;}";
  2152. VideoListElement.appendChild(style);
  2153. // Side Menu
  2154. style = document.createElement("style");
  2155. style.setAttribute("id", CTS.ChatStyleCounter);
  2156. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][2] + ":host, #videolist {background-color:unset;}";
  2157. SideMenuElement.appendChild(style);
  2158. }
  2159.  
  2160. function ChatHeightToggled() {
  2161. CTS.OGStyle.HeightCounter++;
  2162. if (!CTS.ChatDisplay) {
  2163. CTS.ChatWidth += 5;
  2164. CTS.ChatDisplay = true;
  2165. }
  2166. CTS.ChatHeight -= 5;
  2167. CTS.UserListDisplay = true;
  2168. if (CTS.ChatHeight == 20) {
  2169. CTS.ChatHeight = 45;
  2170. CTS.UserListDisplay = false;
  2171. CTS.OGStyle.HeightCounter = 0;
  2172. }
  2173. 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;");
  2174. 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;");
  2175. 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;");
  2176. VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
  2177. 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;";
  2178. //UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2179. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2180. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2181. PerformanceModeInit(CTS.PerformanceMode);
  2182. UpdateScroll(1, true);
  2183. UpdateScroll(2, true);
  2184. Resize();
  2185. }
  2186.  
  2187. function ChatWidthToggled() {
  2188. CTS.OGStyle.WidthCounter++;
  2189. CTS.ChatWidth += 5;
  2190. CTS.ChatDisplay = true;
  2191. if (CTS.ChatWidth == 25) {
  2192. CTS.ChatWidth = -5;
  2193. CTS.ChatDisplay = false;
  2194. CTS.OGStyle.WidthCounter = 0;
  2195. }
  2196. 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;");
  2197. 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;");
  2198. 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;");
  2199. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
  2200. 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;";
  2201. //UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2202. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2203. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2204. CTS.PerformanceMode = false;
  2205. PerformanceModeInit(CTS.PerformanceMode);
  2206. UpdateScroll(1, true);
  2207. UpdateScroll(2, true);
  2208. Resize();
  2209. }
  2210.  
  2211. function ChatHide() {
  2212. CTS.NormalStyle.ChatHide = !CTS.NormalStyle.ChatHide;
  2213. ChatLogElement.querySelector("#chat-wrapper").style.display = (CTS.NormalStyle.ChatHide ? "none" : "block");
  2214. UpdateScroll(1, true);
  2215. UpdateScroll(2, true);
  2216. Resize();
  2217. }
  2218.  
  2219. function SoundMeter() {
  2220. //MICROPHONE INDICATOR
  2221. if (CTS.SoundMeterToggle) {
  2222. setTimeout(function() {
  2223. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2224. Featured = VideoListElement.querySelectorAll(".videos-items:first-child tc-video-item"),
  2225. videolist = window.TinychatApp.getInstance().defaultChatroom._videolist,
  2226. TCCameraList = videolist.items.length,
  2227. CameraLen = Camera.length,
  2228. users,
  2229. item;
  2230. if (Featured.length > 0) {
  2231. for (var x = 0; x < TCCameraList; x++) {
  2232. if (CameraLen < 1) break;
  2233. for (users = 0; users < CameraLen; users++) {
  2234. item = videolist.items[x];
  2235. if (item != undefined) {
  2236. if (Camera[users].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id") == item.userentity.path) {
  2237. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2238. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2239. break;
  2240. }
  2241. }
  2242. }
  2243. }
  2244. } else {
  2245. for (users = 0; users < CameraLen; users++) {
  2246. item = videolist.items[users];
  2247. if (item != undefined) {
  2248. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2249. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2250. }
  2251. }
  2252. }
  2253. //REPEAT
  2254. SoundMeter();
  2255. }, 250);
  2256. }
  2257. }
  2258.  
  2259. function RTC() {
  2260. if (null != arguments[0].rtc) {
  2261. let a = arguments[0].rtc;
  2262. arguments[0].rtc = null;
  2263. MS(arguments[0], a);
  2264. }
  2265. }
  2266.  
  2267. function Vote() {
  2268. var ChecksOut = CTS.VoteSystem,
  2269. len = CTS.WaitToVoteList.length;
  2270. if (len > 0 && ChecksOut) {
  2271. for (var i = 0; i < len; i++) {
  2272. if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
  2273. Send("msg", "Please wait several minutes till you can cast your vote again!");
  2274. ChecksOut = false;
  2275. break;
  2276. }
  2277. }
  2278. }
  2279. if (ChecksOut) {
  2280. if (isSafeListed(CTS.UserList[arguments[0]].username.toUpperCase())) {
  2281. var targetname = arguments[1].match(/^!vote ([a-z0-9]{1,16})$/i);
  2282. if (targetname !== null) {
  2283. var Target = UsernameToUser(targetname[1].toUpperCase());
  2284. if (Target !== -1) {
  2285. if (CTS.UserList[Target].broadcasting && CTS.UserList[Target].username !== "GUEST") {
  2286. if (CTS.Me.owner || !CTS.UserList[Target].mod) {
  2287. Send("msg", "Your vote has been cast, you may vote again shortly!");
  2288. CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
  2289. CTS.UserList[Target].vote += 1;
  2290. if (CTS.UserList[Target].vote === 3) {
  2291. CTS.UserList[Target].vote = 0;
  2292. Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
  2293. Send("stream_moder_close", CTS.UserList[Target].handle);
  2294. }
  2295. } else {
  2296. Send("msg", "I cannot do that!");
  2297. }
  2298. }
  2299. } else {
  2300. Send("msg", "The user is not broadcasting...");
  2301. }
  2302. } else {
  2303. Send("msg", "The nickname or username does not exist!");
  2304. }
  2305. }
  2306. }
  2307. }
  2308.  
  2309. function PMShow() {
  2310. ChatListElement.querySelector("#chatlist").style.display = ((CTS.enablePMs) ? "block" : "none");
  2311. }
  2312.  
  2313. function MessagePopUp() {
  2314. if (CTS.Popups) {
  2315. var push = false;
  2316. if (arguments[0] != -1) {
  2317. if (ChatListElement.querySelector(".list-item .active")) {
  2318. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  2319. if (arguments[2]) push = true;
  2320. } else {
  2321. push = true;
  2322. }
  2323. } else if (!arguments[2]) {
  2324. push = true;
  2325. }
  2326. }
  2327. if (arguments[3]) push = true;
  2328. if (push || !CTS.ChatDisplay) {
  2329. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  2330. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2331. clearTimeout(CTS.NotificationTimeOut[0]);
  2332. CTS.NotificationTimeOut.shift();
  2333. }
  2334. 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>");
  2335. CTS.NotificationTimeOut.push(setTimeout(function() {
  2336. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  2337. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2338. CTS.NotificationTimeOut.shift();
  2339. }
  2340. }, 11100));
  2341. }
  2342. }
  2343. }
  2344.  
  2345. function Reminder() {
  2346. var temp,
  2347. i,
  2348. len = CTS.ReminderServerInList.length;
  2349. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  2350. CTS.ReminderServerInList = [];
  2351. if (CTS.Reminder === true) {
  2352. var OffsetTime;
  2353. len = CTS.ReminderList.length;
  2354. for (i = 0; i < len; i++) {
  2355. temp = TimeToDate(CTS.ReminderList[i][0]);
  2356. CTS.RecentTime = new Date();
  2357. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  2358. OffsetTime = temp - CTS.RecentTime;
  2359. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, CTS.ReminderList[i][1]));
  2360. }
  2361. if (Addon.active("ReminderList")) {
  2362. len = Addon.get("ReminderList").length;
  2363. for (i = 0; i < len; i++) {
  2364. temp = TimeToDate(Addon.get("ReminderList")[i][0]);
  2365. CTS.RecentTime = new Date();
  2366. if (temp < CTS.RecentTime) temp.setDate(CTS.RecentTime.getDate() + 1);
  2367. OffsetTime = temp - CTS.RecentTime;
  2368. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, Addon.get("ReminderList")[i][1]));
  2369. }
  2370. }
  2371. }
  2372. }
  2373.  
  2374. function AddReminder() {
  2375. Send("msg", "📣 " + arguments[0]);
  2376. setTimeout(Reminder, 5000);
  2377. }
  2378.  
  2379. function NotificationDisplay() {
  2380. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2381. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2382. if (CTS.NotificationToggle == 0) {
  2383. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  2384. passive: true
  2385. });
  2386. } else {
  2387. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
  2388. passive: true
  2389. });
  2390. }
  2391. UpdateScroll(1, true);
  2392. UpdateScroll(2, true);
  2393. }
  2394.  
  2395. function NotificationResize() {
  2396. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  2397. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  2398. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  2399. ChatLogElement.querySelector("#chat").style.height = "50%%";
  2400. } else {
  2401. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  2402. ChatLogElement.querySelector("#chat").style.height = "100%";
  2403. }
  2404. UpdateScroll(1, false);
  2405. UpdateScroll(2, true);
  2406. }
  2407.  
  2408. function Dice() {
  2409. return String.fromCharCode("0x268" + Rand(0, 5));
  2410. }
  2411.  
  2412. function Rand() {
  2413. arguments[0] = Math.ceil(arguments[0]);
  2414. arguments[1] = Math.floor(arguments[1]);
  2415. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  2416. }
  2417.  
  2418. function OpenMicrophone() {
  2419. MicrophoneElement.initMouseEvent("mousedown");
  2420. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  2421. }
  2422. var CameraSound = new MutationObserver(function(mutations) {Cameras();});
  2423. function Cameras() {
  2424. // Video Items
  2425. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2426. Len = Camera.length;
  2427. for (var num = 0; num < Len; num++) {
  2428. // Camera Selection
  2429. if (Camera[num] === null) continue;
  2430. if (Camera[num].shadowRoot === null) continue;
  2431. var select = Camera[num].shadowRoot;
  2432. var user = HandleToUser(select.querySelector(".video > div > video").getAttribute("data-video-id"));
  2433.  
  2434. // Video Border
  2435. if (select.querySelector(".video")) select.querySelector(".video").style.padding = (CTS.CameraBorderToggle) ? "5px" : "0";
  2436. // Handle to UserIndex
  2437. if (user == -1) continue;
  2438. if (CTS.Me.handle !== CTS.UserList[user].handle) {
  2439. if (select.querySelector("div > div > div.overlay > div.icon-volume > tc-volume-control")) {
  2440. if (select.querySelector("div > div > div.overlay > div.icon-volume > tc-volume-control").shadowRoot) {
  2441. var VolIco = select.querySelector("div > div > div.overlay > div.icon-volume > tc-volume-control").shadowRoot;
  2442. CameraSound.observe(VolIco.querySelector(".icon-volume"), { attributes: true, childList: true, subtree: true } );
  2443. select.querySelector(".video > div > video").volume = (window.CTSMuted)?0:((parseInt(VolIco.querySelector("#videos-header-volume-level").style.width)/100)*window.CTSRoomVolume);
  2444. }
  2445. }
  2446. }
  2447.  
  2448. if (select.querySelector(".video #fixed")) continue;
  2449. if (CTS.HiddenCameraList.includes(CTS.UserList[user].username)) {
  2450. window.TinychatApp.BLL.Videolist.prototype.toggleHiddenVW(window.TinychatApp.getInstance().defaultChatroom._videolist.items[num], false);
  2451. Alert(GetActiveChat(), CTS.UserList[user].username + " has been auto-hidden!");
  2452. }
  2453. 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>");
  2454. }
  2455. Resize();
  2456. }
  2457.  
  2458. function FeaturedCameras() {
  2459. if (arguments[0] === true) {
  2460. if (VideoListElement.querySelector("#SmallFTYT")) Remove(VideoListElement, "#SmallFTYT");
  2461. } else {
  2462. var node = document.createElement("style");
  2463. node.appendChild(document.createTextNode(FeaturedCSS));
  2464. node.setAttribute("id", "SmallFTYT");
  2465. VideoListElement.appendChild(node);
  2466. }
  2467. }
  2468.  
  2469. function Resize() {
  2470. window.dispatchEvent(new Event("resize"));
  2471. }
  2472.  
  2473. function PerformanceModeInit() {
  2474. if (!CTS.ThemeChange) {
  2475. var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
  2476. ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
  2477. ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
  2478. ChatLogElement.querySelector("#chat-wrapper").style.width = value;
  2479. TitleElement.querySelector("#room-header").style.minWidth = value;
  2480. TitleElement.querySelector("#room-header").style.maxWidth = value;
  2481. TitleElement.querySelector("#room-header").style.width = value;
  2482. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2483. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2484. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
  2485. VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2486. VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2487. VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2488. SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
  2489. SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
  2490. SideMenuElement.querySelector("#sidemenu").style.width = value;
  2491. document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
  2492. if (arguments[0]) {
  2493. VideoListElement.querySelector("#videos-content").style.display = "none";
  2494. } else {
  2495. VideoListElement.querySelector("#videos-content").style.removeProperty("display");
  2496. }
  2497. } else {
  2498. if (arguments[0]) {
  2499. VideoListElement.querySelector("#videos-content").style.display = "none";
  2500. ChatLogElement.querySelector("#chat-wrapper").style.width = "100%";
  2501. ChatLogElement.querySelector("#chat-wrapper").style.position = "fixed";
  2502. ChatLogElement.querySelector("#chat-wrapper").style.left = "0";
  2503. ChatLogElement.querySelector("#chat-wrapper").style.bottom = "0";
  2504. ChatLogElement.querySelector("#chat-wrapper").style.minHeight = "100%";
  2505. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.display = "none";
  2506. VideoListElement.querySelector("#videos-header").style.display = "none";
  2507. VideoListElement.querySelector("#videos-footer").style.display = "none";
  2508. } else {
  2509. VideoListElement.querySelector("#videos-content").style.removeProperty("display");
  2510. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("width");
  2511. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("position");
  2512. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("left");
  2513. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("bottom");
  2514. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("min-height");
  2515. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.removeProperty("display");
  2516. VideoListElement.querySelector("#videos-header").style.removeProperty("display");
  2517. VideoListElement.querySelector("#videos-footer").style.removeProperty("display");
  2518. }
  2519. }
  2520. UpdateScroll(1, true);
  2521. UpdateScroll(2, true);
  2522. Resize();
  2523. }
  2524.  
  2525. function OwnerCommand() {
  2526. //MESSAGE FROM OWNER
  2527. if (isCommand(arguments[1])) {
  2528. if (CTS.UserList[arguments[0]].owner) {
  2529. if (!CTS.Me.owner) {
  2530. //PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
  2531. if (arguments[1].match(/^!raid /i)) {
  2532. // !raid https://tinychat.com/roomname
  2533. var raid = arguments[1].match(/^(?:!raid )(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})$/i);
  2534. if (raid !== null) {
  2535. if (CTS.RaidToggle) {
  2536. window.location.replace("https://tinychat.com/room/" + raid[1]);
  2537. } else {
  2538. Alert(GetActiveChat(), "[TIP]\nRaids are silenced. Refresh or !raidtoggle");
  2539. }
  2540. } else {
  2541. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nThis is not a valid link for raid.");
  2542. }
  2543. }
  2544. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + Ver(), CTS.UserList[arguments[0]].handle);
  2545. } else {
  2546. if (arguments[1].match(/^!closeall$/i)) {
  2547. for (var a = 0; a < CTS.Camera.List.length; a++) {
  2548. if (CTS.Me.handle !== CTS.Camera.List[a]) {
  2549. Send("stream_moder_close", CTS.Camera.List[a]);
  2550. } else {
  2551. CTS.SocketTarget.send(JSON.stringify({
  2552. "tc": "stream_close",
  2553. "handle": CTS.Me.handle
  2554. }));
  2555. }
  2556. }
  2557. }
  2558. if (arguments[1].match(/^!kickall$/i)) {
  2559. for (var b = 0; b < CTS.UserList.length; b++) {
  2560. if (CTS.Me.handle !== CTS.UserList[b].handle) Send("kick", CTS.UserList[b].handle);
  2561. }
  2562. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nIf you leave now, the entire room resets! GOGOGO~");
  2563. }
  2564. }
  2565. }
  2566. }
  2567. }
  2568.  
  2569. function Command() {
  2570. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?: ?)(.*)/i);
  2571. if (UserCommand) {
  2572. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  2573. debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
  2574. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  2575. }
  2576. }
  2577. }
  2578. //ALERT FUNCTIONS
  2579. function Settings() {
  2580. 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>");
  2581. }
  2582.  
  2583. function Alert() {
  2584. CTS.Message[arguments[0]].push({
  2585. "time": Time(),
  2586. "namecolor": (arguments[2] !== undefined) ? "#000000" : "#3f69c0",
  2587. "avatar": (arguments[2] !== undefined) ? ("") : ("https://i.imgur.com/S09irS7.png"),
  2588. "username": "",
  2589. "nick": (arguments[2] !== undefined) ? (arguments[2]) : ("CTS Version: " + Ver()),
  2590. "msg": ((arguments[2] !== undefined) ? ("<div class=\"systemuser\">" + arguments[1] + "</div>") : arguments[1]),
  2591. "mention": true
  2592. });
  2593. var len = CTS.Message[arguments[0]].length - 1;
  2594. arguments[1] = CTS.Message[arguments[0]][len];
  2595. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[1].mention, arguments[0]);
  2596. }
  2597.  
  2598. window.ShowProfile = function() {
  2599. var resp = JSON.parse(arguments[0]);
  2600. 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");
  2601. };
  2602.  
  2603. function Ver() {
  2604. return window.CTSVersion.Major + "." + window.CTSVersion.Minor + "." + window.CTSVersion.Patch;
  2605. }
  2606.  
  2607. function AddUserNotification() {
  2608. if (CTS.FullLoad && CTS.ShowedSettings) {
  2609. var chat = ChatLogElement.querySelector("#notification-content"),
  2610. Notification;
  2611. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  2612. if (arguments[0] == 1) {
  2613. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  2614. } else if (arguments[0] == 2) {
  2615. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left.");
  2616. } else if (arguments[0] == 3) {
  2617. Notification = arguments[2] + "has mentioned you!";
  2618. 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>");
  2619. UpdateScroll(2, true);
  2620. } else if (arguments[0] == 4) {
  2621. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  2622. }
  2623. 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>");
  2624. if (CTS.NotificationToggle == 1) Alert(0, Notification, arguments[2]);
  2625. 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);
  2626. UpdateScroll(2, false);
  2627. var Notifications = ChatLogElement.querySelectorAll(".notification");
  2628. if (Notifications.length > CTS.NotificationLimit + 25) {
  2629. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  2630. }
  2631. }
  2632. }
  2633.  
  2634. function AddSystemNotification() {
  2635. if (CTS.FullLoad && CTS.ShowedSettings) {
  2636. if (CTS.NotificationToggle == 0) {
  2637. 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>");
  2638. } else if (CTS.NotificationToggle == 1) {
  2639. Alert(0, arguments[0], "SYSTEM");
  2640. }
  2641. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  2642. UpdateScroll(2, false);
  2643. }
  2644. }
  2645. //USER FUNCTION
  2646. function AddUser() {
  2647. CTS.UserList.push({
  2648. "handle": arguments[0],
  2649. "username": arguments[5],
  2650. "nick": arguments[4],
  2651. "owner": arguments[7],
  2652. "mod": arguments[1],
  2653. "namecolor": arguments[2],
  2654. "avatar": arguments[3],
  2655. "canGame": arguments[6],
  2656. "broadcasting": false,
  2657. "vote": 0,
  2658. "triviapoints": CTS.Game.Trivia.PlayerList[arguments[5]] || 0
  2659. });
  2660. if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  2661. }
  2662.  
  2663. function HandleToUser() {
  2664. for (var user = 0; user < CTS.UserList.length; user++) {
  2665. if (CTS.UserList[user].handle == arguments[0]) return user;
  2666. }
  2667. return -1;
  2668. }
  2669.  
  2670. function UsernameToHandle() {
  2671. for (var user = 0; user < CTS.UserList.length; user++) {
  2672. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2673. }
  2674. return -1;
  2675. }
  2676.  
  2677. function UsernameToUser() {
  2678. for (var user = 0; user < CTS.UserList.length; user++) {
  2679. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return user;
  2680. }
  2681. return -1;
  2682. }
  2683.  
  2684. function NicknameToHandle() {
  2685. for (var user = 0; user < CTS.UserList.length; user++) {
  2686. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2687. }
  2688. return -1;
  2689. }
  2690.  
  2691. function NicknameToUser() {
  2692. for (var user = 0; user < CTS.UserList.length; user++) {
  2693. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  2694. }
  2695. return -1;
  2696. }
  2697.  
  2698. function CheckUserListSafe() {
  2699. var len = CTS.UserList.length;
  2700. var temp = [];
  2701. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2702. for (var user = 0; user < len; user++) {
  2703. if (!CTS.UserList[user].mod && !isSafeListed(CTS.UserList[user].username)) CTS.KBQueue.push(CTS.UserList[user].handle);
  2704. }
  2705. len = CTS.KBQueue.length;
  2706. for (var kb = 0; kb < len; kb++) {
  2707. Send(arguments[0], CTS.KBQueue[kb]);
  2708. }
  2709. CTS.KBQueue = [];
  2710. }
  2711.  
  2712. function isSafeListed() {
  2713. var temp = [];
  2714. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2715. return (CTS.SafeList.includes(arguments[0]) || temp.includes(arguments[0]));
  2716. }
  2717.  
  2718. function CheckUserTempIgnore() {
  2719. if (CTS.TempIgnoreUserList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreNickList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  2720. return false;
  2721. }
  2722.  
  2723. function CheckUserIgnore() {
  2724. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username)) return true;
  2725. return false;
  2726. }
  2727.  
  2728. function CheckUserTouchScreen() {
  2729. if (/Mobi|Android/i.test(navigator.userAgent) || 'ontouchstart' in document.documentElement) {
  2730. CTS.Project.isTouchScreen = true;
  2731. CTS.ThemeChange = true;
  2732. }
  2733. }
  2734.  
  2735. function CheckUserAbuse() {
  2736. var action = false;
  2737. if (CTS.Me.mod) {
  2738. if (CTS.UserKickList.includes(arguments[1]) || CTS.NickKickList.includes(arguments[2].toUpperCase())) {
  2739. CTS.NoGreet = true;
  2740. Send("kick", arguments[0]);
  2741. action = true;
  2742. }
  2743. if (!action) {
  2744. if (CTS.UserBanList.includes(arguments[1]) || CTS.NickBanList.includes(arguments[2].toUpperCase())) {
  2745. CTS.NoGreet = true;
  2746. Send("ban", arguments[0]);
  2747. }
  2748. }
  2749. }
  2750. }
  2751.  
  2752. function CheckUserWordAbuse() {
  2753. if (CTS.UserList[arguments[0]].handle != CTS.Me.handle && !CTS.UserList[arguments[0]].mod) {
  2754. var action = false; //LETS NOT REPEAT/KICK
  2755. var len = CTS.KickKeywordList.length;
  2756. for (var i = 0; i < len; i++) {
  2757. if (arguments[1].includes(CTS.KickKeywordList[i])) {
  2758. Send("kick", CTS.UserList[arguments[0]].handle);
  2759. action = true;
  2760. break;
  2761. }
  2762. }
  2763. if (!action) {
  2764. len = CTS.BanKeywordList.length;
  2765. for (i = 0; i < len; i++) {
  2766. if (arguments[1].includes(CTS.BanKeywordList[i])) {
  2767. Send("ban", CTS.UserList[arguments[0]].handle);
  2768. break;
  2769. }
  2770. }
  2771. }
  2772. }
  2773. }
  2774.  
  2775. function RemoveUserCamera() {
  2776. var len = CTS.Camera.List.length;
  2777. if (len > 0) {
  2778. for (var i = 0; i < len; i++) {
  2779. if (CTS.Camera.List[i] === arguments[0]) {
  2780. CTS.Camera.List.splice(i, 1);
  2781. clearTimeout(CTS.Camera.clearRandom);
  2782. break;
  2783. }
  2784. }
  2785. }
  2786. }
  2787.  
  2788. function CheckUserStream() {
  2789. var user = HandleToUser(arguments[0]);
  2790. if (user != -1) {
  2791. if (CTS.Me.mod) {
  2792. if (arguments[1]) {
  2793. //PUSH UPDATE
  2794. CTS.Camera.List.push(CTS.UserList[user].handle);
  2795. CTS.UserList[user].broadcasting = true;
  2796. var len = CTS.Camera.List.length;
  2797. if (CTS.UserList[user].username !== "GUEST" && !CTS.GreenRoomList.includes(CTS.UserList[user].username)) {
  2798. CTS.GreenRoomList.push(CTS.UserList[user].username);
  2799. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  2800. }
  2801. //CLEAR TIMERS
  2802. clearTimeout(CTS.Camera.clearRandom);
  2803. //CAMERA SWEEP FUNCTION
  2804. if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
  2805. CTS.Camera.clearRandom = setTimeout(function() {
  2806. var rand = Rand(0, len - 1);
  2807. if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
  2808. var target = HandleToUser(CTS.Camera.List[rand]);
  2809. if (CTS.Me.owner || !CTS.UserList[target].mod) {
  2810. Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
  2811. Send("stream_moder_close", CTS.Camera.List[rand]);
  2812. CTS.Camera.List.splice(rand, 1);
  2813. }
  2814. }
  2815. }, CTS.Camera.SweepTimer * 60000);
  2816. }
  2817. } else {
  2818. clearTimeout(CTS.Camera.clearRandom);
  2819. RemoveUserCamera(CTS.UserList[user].handle);
  2820. CTS.UserList[user].broadcasting = false;
  2821. }
  2822. CTS.UserList[user].broadcasting = arguments[1];
  2823. }
  2824. if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  2825. }
  2826. }
  2827.  
  2828. function CheckUserName() {
  2829. return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
  2830. }
  2831.  
  2832. function CheckUserNameStrict() {
  2833. return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
  2834. }
  2835.  
  2836. function MSR() {
  2837. if (arguments[0]) {
  2838. arguments[1].videolist.RemoveVideoRemote(arguments[1].handle);
  2839. } else {
  2840. arguments[1].mediaStream.stop();
  2841. arguments[1].mediaStream = null;
  2842. }
  2843. }
  2844.  
  2845. function MS() {
  2846. if (arguments[0].mediaStream !== null) {
  2847. if (arguments[0].mediaStream.active && arguments[1].signalingState !== "closed" && typeof arguments[1].removeStream === "function" && arguments[1].removeStream(arguments[0].mediaStream)) MSR(false, arguments[0]);
  2848. } else {
  2849. MSR(true, arguments[0]);
  2850. }
  2851. if (arguments[1].signalingState !== "closed" && arguments[1].close());
  2852. }
  2853. //LOAD/SAVE FUNCTION
  2854. function Load() {
  2855. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  2856. if (null === val && "undefined" != typeof arguments[1]) {
  2857. Save(arguments[0], arguments[1]);
  2858. return arguments[1];
  2859. }
  2860. return val;
  2861. }
  2862.  
  2863. function Save() {
  2864. if (CTS.StorageSupport) {
  2865. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  2866. } else {
  2867. Alert(GetActiveChat(), "Looks like you don't have LocalStorage allowed on this device!\nYour options will not be saved!");
  2868. }
  2869. }
  2870.  
  2871. //SOCKET FUNCTION
  2872. function CTSWebSocket() {
  2873. if (window.Proxy === undefined) return;
  2874. var handler = {
  2875. set: function(Target, prop, value) {
  2876. if (prop == "onmessage") {
  2877. var oldMessage = value;
  2878. value = function(event) {
  2879. ServerMsg(JSON.parse(event.data), Target);
  2880. oldMessage(event);
  2881. };
  2882. }
  2883. return (Target[prop] = value);
  2884. },
  2885. get: function(Target, prop) {
  2886. var value = Target[prop];
  2887. if (prop == "send") {
  2888. value = function(event) {
  2889. ClientMsg(JSON.parse(event), Target);
  2890. Target.send(event);
  2891. };
  2892. } else if (typeof value == 'function') {
  2893. value = value.bind(Target);
  2894. }
  2895. return value;
  2896. }
  2897. };
  2898. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  2899. construct: function(Target, args) {
  2900. CTS.SocketTarget = new Target(args[0]);
  2901. debug("SOCKET::CONNECTING", args[0]);
  2902. return new window.Proxy(CTS.SocketTarget, handler);
  2903. }
  2904. });
  2905. window.WebSocket = WebSocketProxy;
  2906. }
  2907.  
  2908. function ModCommand() {
  2909. var name = arguments[1].match(/^!(?:userkick|nickkick|userban|nickban|userclose|nickclose) (guest-[0-9]{1,32}|[a-z0-9_]{1,32})$/i),
  2910. target;
  2911. if (name !== null) {
  2912. if (name[1].toUpperCase() !== "GUEST") {
  2913. target = ((arguments[2]) ? UsernameToUser(name[1].toUpperCase()) : NicknameToUser(name[1].toUpperCase()));
  2914. } else {
  2915. target = NicknameToUser(name[1].toUpperCase());
  2916. }
  2917. if (target != -1) { // USER ONLINE
  2918. if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
  2919. //IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
  2920. if (arguments[0] === "stream_moder_close") {
  2921. if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
  2922. } else {
  2923. Send(arguments[0], CTS.UserList[target].handle);
  2924. }
  2925. } else {
  2926. Send("msg", "This users authorization is similar or above yours!");
  2927. }
  2928. }
  2929. }
  2930. }
  2931.  
  2932. function BotCommand() {
  2933. var len = CTS.YouTube.MessageQueueList.length;
  2934. if (len <= 0) {
  2935. var check = true;
  2936. // Moderator Control
  2937. if (CTS.UserList[arguments[1]].mod) {
  2938. if (arguments[0] == 2) {
  2939. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2940. CTS.YouTube.Clear = true;
  2941. YouTubePlayList();
  2942. }
  2943. check = false;
  2944. }
  2945. if (arguments[0] == 5) {
  2946. SetBot(true);
  2947. check = false;
  2948. }
  2949. }
  2950. // User and Moderator Control
  2951. if (check) {
  2952. if (VerifyYouTube(arguments[1])) {
  2953. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  2954. if (arguments[0] == 4) YouTubePlayList(true);
  2955. if (CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
  2956. if (arguments[0] == 6) YoutubeBypass(arguments[2]);
  2957. if (arguments[0] == 3) {
  2958. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2959. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  2960. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  2961. }
  2962. }
  2963. }
  2964. }
  2965. }
  2966. } else {
  2967. if (CTS.YouTube.ListBuilt === false) {
  2968. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  2969. } else {
  2970. Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  2971. }
  2972. }
  2973. }
  2974.  
  2975. function ServerMsg() {
  2976. if (typeof ServerInList[arguments[0].tc] == "function") {
  2977. debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2978. ServerInList[arguments[0].tc](arguments[0]);
  2979. }
  2980. }
  2981.  
  2982. function ClientMsg() {
  2983. if (typeof ServerOutList[arguments[0].tc] == "function") {
  2984. debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2985. ServerOutList[arguments[0].tc](arguments[0]);
  2986. }
  2987. }
  2988.  
  2989. function Send() {
  2990. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  2991. if (arguments[1] === undefined) arguments[1] = "Open Request";
  2992. debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  2993. }
  2994. //GAME FUNCTION
  2995. //FISHING BOAT
  2996. function FishUpgradeStatus() {
  2997. var msg = "[FISHING BOAT]\n";
  2998. if (arguments[1] != 7) msg += arguments[0].Nickname + ":\n";
  2999. 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");
  3000. 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";
  3001. 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";
  3002. 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";
  3003. 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";
  3004. Send("msg", msg);
  3005. }
  3006.  
  3007. function FishTimerCheck() {
  3008. if (new Date() - arguments[0].LastCheck >= 5000) {
  3009. arguments[0].LastCheck = new Date();
  3010. return true;
  3011. }
  3012. return false;
  3013. }
  3014.  
  3015. function FishCommandCheck() {
  3016. var command,
  3017. playerExist = Fish.GetPlayer(CTS.UserList[arguments[0]].handle, false, true),
  3018. FishCommand = arguments[1].match(/^!(fish(?:rob|slap|split|help|upgrade)?) ?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
  3019. if (FishCommand) {
  3020. if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
  3021. if (FishCommand[2] !== undefined) {
  3022. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  3023. }
  3024. } else {
  3025. try {
  3026. command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
  3027. if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  3028. }catch(err) {
  3029. console.log(err);
  3030. }
  3031. }
  3032. }
  3033. }
  3034.  
  3035. function FishTransfer() {
  3036. if (arguments[1] !== undefined && arguments[1] !== -1) {
  3037. if (arguments[0].Points > arguments[2]) {
  3038. if (arguments[4]) {
  3039. arguments[0].Points -= arguments[2];
  3040. if (arguments[1].Points <= arguments[3]) {
  3041. arguments[3] = arguments[1].Points;
  3042. arguments[1].Points -= arguments[3];
  3043. arguments[0].Points += arguments[3];
  3044. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " destroyed " + arguments[1].Nickname + "\nMoney made $" + arguments[3] + "!");
  3045. Fish.GetPlayer(arguments[1].Handle, true);
  3046. } else {
  3047. arguments[1].Points -= arguments[3];
  3048. arguments[0].Points += arguments[3];
  3049. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " robbed " + arguments[1].Nickname + " for $" + arguments[3] + "!");
  3050. }
  3051. } else {
  3052. arguments[0].Points = arguments[3];
  3053. arguments[1].Points += arguments[3];
  3054. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " split their money with " + arguments[1].Nickname + "!");
  3055. }
  3056. } else {
  3057. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " are you kidding me?\nTalk to me when you have money!");
  3058. }
  3059. }
  3060. }
  3061.  
  3062. function FishTransaction() {
  3063. if (arguments[0].Points > arguments[1]) {
  3064. arguments[0].Points -= arguments[1];
  3065. return true;
  3066. } else {
  3067. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + ", are you kidding me?\nTalk to me when you have money!");
  3068. return false;
  3069. }
  3070. }
  3071. //SERVER/CLIENT LIST FUNCTION
  3072. var CommandList = {
  3073. cts: function() {
  3074. 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>");
  3075. },
  3076. help: function() {
  3077. this.cts();
  3078. },
  3079. userlist: function() {
  3080. Alert(GetActiveChat(), SettingsList.UserList());
  3081. },
  3082. ytapi: function() {
  3083. if (arguments[0] === "") {
  3084. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3085. } else {
  3086. if (arguments[0].match(/^([0-9A-Z_-]*)/i)) {
  3087. CTS.YouTube.API_KEY = arguments[0];
  3088. Save("YouTubeAPI", arguments[0]);
  3089. Alert(GetActiveChat(), "✓ Command Accepted!");
  3090. } else {
  3091. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3092. }
  3093. }
  3094. },
  3095. fps: function() {
  3096. CTS.FPS = (arguments[0] === "" || isNaN(arguments[0])) ? 30 : (arguments[0] > 60) ? 60 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  3097. Save("FPS", CTS.FPS);
  3098. Alert(GetActiveChat(), "✓ Command Accepted!");
  3099. if (CTS.Me.broadcasting) Alert(GetActiveChat(), "Settings will not change till you re-cam!");
  3100. },
  3101. mentionadd: function() {
  3102. if (arguments[0] === "") {
  3103. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3104. } else {
  3105. if (CheckUserNameStrict(arguments[0])) {
  3106. if (!CTS.MentionList.includes(arguments[0].toUpperCase())) {
  3107. CTS.MentionList.push(arguments[0].toUpperCase());
  3108. Save("MentionList", JSON.stringify(CTS.MentionList));
  3109. Alert(GetActiveChat(), "✓ Command Accepted!");
  3110. } else {
  3111. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3112. }
  3113. } else {
  3114. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3115. }
  3116. }
  3117. },
  3118. mentionremove: function() {
  3119. if (arguments[0] === "" || isNaN(arguments[0])) {
  3120. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3121. } else {
  3122. if (CTS.MentionList[arguments[0]] !== undefined) {
  3123. CTS.MentionList.splice(arguments[0], 1);
  3124. Save("MentionList", JSON.stringify(CTS.MentionList));
  3125. Alert(GetActiveChat(), "✓ Command Accepted!");
  3126. } else {
  3127. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3128. }
  3129. }
  3130. },
  3131. mentionlistclear: function() {
  3132. CTS.MentionList = [];
  3133. Save("MentionList", JSON.stringify(CTS.MentionList));
  3134. Alert(GetActiveChat(), "✓ Command Accepted!");
  3135. },
  3136. mentionlist: function() {
  3137. Alert(GetActiveChat(), SettingsList.MentionList());
  3138. },
  3139. hiddencameraadd: function() {
  3140. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") {
  3141. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3142. } else {
  3143. if (CheckUserNameStrict(arguments[0])) {
  3144. if (!CTS.HiddenCameraList.includes(arguments[0].toUpperCase())) {
  3145. CTS.HiddenCameraList.push(arguments[0].toUpperCase());
  3146. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3147. Alert(GetActiveChat(), "✓ Command Accepted!");
  3148. } else {
  3149. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3150. }
  3151. } else {
  3152. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3153. }
  3154. }
  3155. },
  3156. hiddencameraremove: function() {
  3157. if (arguments[0] === "" || isNaN(arguments[0])) {
  3158. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3159. } else {
  3160. if (CTS.HiddenCameraList[arguments[0]] !== undefined) {
  3161. CTS.HiddenCameraList.splice(arguments[0], 1);
  3162. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3163. Alert(GetActiveChat(), "✓ Command Accepted!");
  3164. } else {
  3165. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3166. }
  3167. }
  3168. },
  3169. hiddencameralistclear: function() {
  3170. CTS.HiddenCameraList = [];
  3171. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3172. Alert(GetActiveChat(), "✓ Command Accepted!");
  3173. },
  3174. hiddencameralist: function() {
  3175. Alert(GetActiveChat(), SettingsList.HiddenCameraList());
  3176. },
  3177. ignoreadd: function() {
  3178. if (arguments[0] === "") {
  3179. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3180. } else {
  3181. if (CheckUserNameStrict(arguments[0])) {
  3182. if (!CTS.IgnoreList.includes(arguments[0].toUpperCase())) {
  3183. CTS.IgnoreList.push(arguments[0].toUpperCase());
  3184. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3185. Alert(GetActiveChat(), "✓ Command Accepted!");
  3186. } else {
  3187. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3188. }
  3189. } else {
  3190. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3191. }
  3192. }
  3193. },
  3194. ignoreremove: function() {
  3195. if (arguments[0] === "" || isNaN(arguments[0])) {
  3196. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3197. } else {
  3198. if (CTS.IgnoreList[arguments[0]] !== undefined) {
  3199. CTS.IgnoreList.splice(arguments[0], 1);
  3200. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3201. Alert(GetActiveChat(), "✓ Command Accepted!");
  3202. } else {
  3203. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3204. }
  3205. }
  3206. },
  3207. ignorelistclear: function() {
  3208. CTS.IgnoreList = [];
  3209. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3210. Alert(GetActiveChat(), "✓ Command Accepted!");
  3211. },
  3212. ignorelist: function() {
  3213. Alert(GetActiveChat(), SettingsList.IgnoreList());
  3214. },
  3215. userbanadd: function() {
  3216. if (arguments[0] === "") {
  3217. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3218. } else {
  3219. if (CheckUserNameStrict(arguments[0])) {
  3220. if (!CTS.UserBanList.includes(arguments[0].toUpperCase())) {
  3221. CTS.UserBanList.push(arguments[0].toUpperCase());
  3222. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3223. Alert(GetActiveChat(), "✓ Command Accepted!");
  3224. var check = UsernameToHandle(arguments[0].toUpperCase());
  3225. if (check != -1 && CTS.Me.mod) Send("ban", check);
  3226. } else {
  3227. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3228. }
  3229. } else {
  3230. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3231. }
  3232. }
  3233. },
  3234. userbanremove: function() {
  3235. if (arguments[0] === "" || isNaN(arguments[0])) {
  3236. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3237. } else {
  3238. if (CTS.UserBanList[arguments[0]] !== undefined) {
  3239. CTS.UserBanList.splice(arguments[0], 1);
  3240. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3241. Alert(GetActiveChat(), "✓ Command Accepted!");
  3242. } else {
  3243. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3244. }
  3245. }
  3246. },
  3247. userbanlistclear: function() {
  3248. CTS.UserBanList = [];
  3249. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3250. Alert(GetActiveChat(), "✓ Command Accepted!");
  3251. },
  3252. userbanlist: function() {
  3253. Alert(GetActiveChat(), SettingsList.UserBanList());
  3254. },
  3255. nickbanadd: function() {
  3256. if (arguments[0] === "") {
  3257. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3258. } else {
  3259. if (CheckUserNameStrict(arguments[0])) {
  3260. if (!CTS.NickBanList.includes(arguments[0].toUpperCase())) {
  3261. CTS.NickBanList.push(arguments[0].toUpperCase());
  3262. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3263. Alert(GetActiveChat(), "✓ Command Accepted!");
  3264. var check = NicknameToHandle(arguments[0].toUpperCase());
  3265. if (check != -1 && CTS.Me.mod) Send("ban", check);
  3266. } else {
  3267. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3268. }
  3269. } else {
  3270. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3271. }
  3272. }
  3273. },
  3274. nickbanremove: function() {
  3275. if (arguments[0] === "" || isNaN(arguments[0])) {
  3276. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3277. } else {
  3278. if (CTS.NickBanList[arguments[0]] !== undefined) {
  3279. CTS.NickBanList.splice(arguments[0], 1);
  3280. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3281. Alert(GetActiveChat(), "✓ Command Accepted!");
  3282. } else {
  3283. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3284. }
  3285. }
  3286. },
  3287. nickbanlistclear: function() {
  3288. CTS.NickBanList = [];
  3289. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3290. Alert(GetActiveChat(), "✓ Command Accepted!");
  3291. },
  3292. nickbanlist: function() {
  3293. Alert(GetActiveChat(), SettingsList.NickBanList());
  3294. },
  3295. userkickadd: function() {
  3296. if (arguments[0] === "") {
  3297. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3298. } else {
  3299. if (CheckUserNameStrict(arguments[0])) {
  3300. if (!CTS.UserKickList.includes(arguments[0].toUpperCase())) {
  3301. CTS.UserKickList.push(arguments[0].toUpperCase());
  3302. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3303. Alert(GetActiveChat(), "✓ Command Accepted!");
  3304. var check = UsernameToHandle(arguments[0].toUpperCase());
  3305. if (check != -1 && CTS.Me.mod) Send("kick", check);
  3306. } else {
  3307. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3308. }
  3309. } else {
  3310. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3311. }
  3312. }
  3313. },
  3314. userkickremove: function() {
  3315. if (arguments[0] === "" || isNaN(arguments[0])) {
  3316. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3317. } else {
  3318. if (CTS.UserKickList[arguments[0]] !== undefined) {
  3319. CTS.UserKickList.splice(arguments[0], 1);
  3320. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3321. Alert(GetActiveChat(), "✓ Command Accepted!");
  3322. } else {
  3323. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3324. }
  3325. }
  3326. },
  3327. userkicklistclear: function() {
  3328. CTS.UserKickList = [];
  3329. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3330. Alert(GetActiveChat(), "✓ Command Accepted!");
  3331. },
  3332. userkicklist: function() {
  3333. Alert(GetActiveChat(), SettingsList.UserKickList());
  3334. },
  3335. nickkickadd: function() {
  3336. if (arguments[0] === "") {
  3337. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3338. } else {
  3339. if (CheckUserNameStrict(arguments[0])) {
  3340. if (!CTS.NickKickList.includes(arguments[0].toUpperCase())) {
  3341. CTS.NickKickList.push(arguments[0].toUpperCase());
  3342. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3343. Alert(GetActiveChat(), "✓ Command Accepted!");
  3344. var check = NicknameToHandle(arguments[0].toUpperCase());
  3345. if (check != -1 && CTS.Me.mod) Send("kick", check);
  3346. } else {
  3347. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3348. }
  3349. } else {
  3350. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3351. }
  3352. }
  3353. },
  3354. nickkickremove: function() {
  3355. if (arguments[0] === "" || isNaN(arguments[0])) {
  3356. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3357. } else {
  3358. if (CTS.NickKickList[arguments[0]] !== undefined) {
  3359. CTS.NickKickList.splice(arguments[0], 1);
  3360. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3361. Alert(GetActiveChat(), "✓ Command Accepted!");
  3362. } else {
  3363. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3364. }
  3365. }
  3366. },
  3367. nickkicklistclear: function() {
  3368. CTS.NickKickList = [];
  3369. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3370. Alert(GetActiveChat(), "✓ Command Accepted!");
  3371. },
  3372. nickkicklist: function() {
  3373. Alert(GetActiveChat(), SettingsList.NickKickList());
  3374. },
  3375. bankeywordadd: function() {
  3376. if (arguments[0] === "") {
  3377. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3378. } else {
  3379. if (!CTS.BanKeywordList.includes(arguments[0])) {
  3380. CTS.BanKeywordList.push(arguments[0]);
  3381. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3382. Alert(GetActiveChat(), "✓ Command Accepted!");
  3383. } else {
  3384. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3385. }
  3386. }
  3387. },
  3388. bankeywordremove: function() {
  3389. if (arguments[0] === "" || isNaN(arguments[0])) {
  3390. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3391. } else {
  3392. if (CTS.BanKeywordList[arguments[0]] !== undefined) {
  3393. CTS.BanKeywordList.splice(arguments[0], 1);
  3394. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3395. Alert(GetActiveChat(), "✓ Command Accepted!");
  3396. } else {
  3397. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3398. }
  3399. }
  3400. },
  3401. bankeywordlistclear: function() {
  3402. CTS.BanKeywordList = [];
  3403. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3404. Alert(GetActiveChat(), "✓ Command Accepted!");
  3405. },
  3406. bankeywordlist: function() {
  3407. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  3408. },
  3409. kickkeywordadd: function() {
  3410. if (arguments[0] === "") {
  3411. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3412. } else {
  3413. if (!CTS.KickKeywordList.includes(arguments[0])) {
  3414. CTS.KickKeywordList.push(arguments[0]);
  3415. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3416. Alert(GetActiveChat(), "✓ Command Accepted!");
  3417. } else {
  3418. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3419. }
  3420. }
  3421. },
  3422. kickkeywordremove: function() {
  3423. if (arguments[0] === "" || isNaN(arguments[0])) {
  3424. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3425. } else {
  3426. if (CTS.KickKeywordList[arguments[0]] !== undefined) {
  3427. CTS.KickKeywordList.splice(arguments[0], 1);
  3428. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3429. Alert(GetActiveChat(), "✓ Command Accepted!");
  3430. } else {
  3431. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3432. }
  3433. }
  3434. },
  3435. kickkeywordlistclear: function() {
  3436. CTS.KickKeywordList = [];
  3437. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3438. Alert(GetActiveChat(), "✓ Command Accepted!");
  3439. },
  3440. kickkeywordlist: function() {
  3441. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  3442. },
  3443. greetadd: function() {
  3444. if (arguments[0] === "") {
  3445. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3446. } else {
  3447. if (CheckUserName(arguments[0])) {
  3448. if (!CTS.GreetList.includes(arguments[0].toUpperCase())) {
  3449. CTS.GreetList.push(arguments[0].toUpperCase());
  3450. Save("GreetList", JSON.stringify(CTS.GreetList));
  3451. Alert(GetActiveChat(), "✓ Command Accepted!");
  3452. } else {
  3453. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3454. }
  3455. } else {
  3456. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3457. }
  3458. }
  3459. },
  3460. greetremove: function() {
  3461. if (arguments[0] === "" || isNaN(arguments[0])) {
  3462. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3463. } else {
  3464. if (CTS.GreetList[arguments[0]] !== undefined) {
  3465. CTS.GreetList.splice(arguments[0], 1);
  3466. Save("GreetList", JSON.stringify(CTS.GreetList));
  3467. Alert(GetActiveChat(), "✓ Command Accepted!");
  3468. } else {
  3469. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3470. }
  3471. }
  3472. },
  3473. greetlistclear: function() {
  3474. CTS.GreetList = [];
  3475. Save("GreetList", JSON.stringify(CTS.GreetList));
  3476. Alert(GetActiveChat(), "✓ Command Accepted!");
  3477. },
  3478. greetlist: function() {
  3479. Alert(GetActiveChat(), SettingsList.GreetList());
  3480. },
  3481. highlightadd: function() {
  3482. if (arguments[0] === "") {
  3483. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3484. } else {
  3485. if (CheckUserNameStrict(arguments[0])) {
  3486. if (!CTS.HighlightList.includes(arguments[0].toUpperCase())) {
  3487. CTS.HighlightList.push(arguments[0].toUpperCase());
  3488. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3489. Alert(GetActiveChat(), "✓ Command Accepted!");
  3490. } else {
  3491. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3492. }
  3493. } else {
  3494. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3495. }
  3496. }
  3497. },
  3498. highlightremove: function() {
  3499. if (arguments[0] === "" || isNaN(arguments[0])) {
  3500. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3501. } else {
  3502. if (CTS.HighlightList[arguments[0]] !== undefined) {
  3503. CTS.HighlightList.splice(arguments[0], 1);
  3504. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3505. Alert(GetActiveChat(), "✓ Command Accepted!");
  3506. } else {
  3507. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3508. }
  3509. }
  3510. },
  3511. highlightlistclear: function() {
  3512. CTS.HighlightList = [];
  3513. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3514. Alert(GetActiveChat(), "✓ Command Accepted!");
  3515. },
  3516. highlightlist: function() {
  3517. Alert(GetActiveChat(), SettingsList.HighlightList());
  3518. },
  3519. opadd: function() {
  3520. if (arguments[0] === "") {
  3521. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3522. } else {
  3523. if (CheckUserName(arguments[0])) {
  3524. if (!CTS.BotOPList.includes(arguments[0].toUpperCase())) {
  3525. CTS.BotOPList.push(arguments[0].toUpperCase());
  3526. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3527. Alert(GetActiveChat(), "✓ Command Accepted!");
  3528. } else {
  3529. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3530. }
  3531. } else {
  3532. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3533. }
  3534. }
  3535. },
  3536. opremove: function() {
  3537. if (arguments[0] === "" || isNaN(arguments[0])) {
  3538. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3539. } else {
  3540. if (CTS.BotOPList[arguments[0]] !== undefined) {
  3541. CTS.BotOPList.splice(arguments[0], 1);
  3542. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3543. Alert(GetActiveChat(), "✓ Command Accepted!");
  3544. } else {
  3545. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3546. }
  3547. }
  3548. },
  3549. oplistclear: function() {
  3550. CTS.BotOPList = [];
  3551. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3552. Alert(GetActiveChat(), "✓ Command Accepted!");
  3553. },
  3554. oplist: function() {
  3555. Alert(GetActiveChat(), SettingsList.BotOPList());
  3556. },
  3557. modadd: function() {
  3558. if (arguments[0] === "") {
  3559. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3560. } else {
  3561. if (CheckUserNameStrict(arguments[0])) {
  3562. if (!CTS.BotModList.includes(arguments[0].toUpperCase())) {
  3563. CTS.BotModList.push(arguments[0].toUpperCase());
  3564. Save("BotModList", JSON.stringify(CTS.BotModList));
  3565. Alert(GetActiveChat(), "✓ Command Accepted!");
  3566. } else {
  3567. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3568. }
  3569. } else {
  3570. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3571. }
  3572. }
  3573. },
  3574. modremove: function() {
  3575. if (arguments[0] === "" || isNaN(arguments[0])) {
  3576. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3577. } else {
  3578. if (CTS.BotModList[arguments[0]] !== undefined) {
  3579. CTS.BotModList.splice(arguments[0], 1);
  3580. Save("BotModList", JSON.stringify(CTS.BotModList));
  3581. Alert(GetActiveChat(), "✓ Command Accepted!");
  3582. } else {
  3583. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3584. }
  3585. }
  3586. },
  3587. modlistclear: function() {
  3588. CTS.BotModList = [];
  3589. Save("BotModList", JSON.stringify(CTS.BotModList));
  3590. Alert(GetActiveChat(), "✓ Command Accepted!");
  3591. },
  3592. modlist: function() {
  3593. Alert(GetActiveChat(), SettingsList.BotModList());
  3594. },
  3595. ttsadd: function() {
  3596. if (arguments[0] === "") {
  3597. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3598. } else {
  3599. if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  3600. if (!CTS.TTSList.includes(arguments[0].toUpperCase())) {
  3601. CTS.TTSList.push(arguments[0].toUpperCase());
  3602. Save("TTSList", JSON.stringify(CTS.TTSList));
  3603. Alert(GetActiveChat(), "✓ Command Accepted!");
  3604. } else {
  3605. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3606. }
  3607. } else {
  3608. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3609. }
  3610. }
  3611. },
  3612. ttsremove: function() {
  3613. if (arguments[0] === "" || isNaN(arguments[0])) {
  3614. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3615. } else {
  3616. if (CTS.TTSList[arguments[0]] !== undefined) {
  3617. CTS.TTSList.splice(arguments[0], 1);
  3618. Save("TTSList", JSON.stringify(CTS.TTSList));
  3619. Alert(GetActiveChat(), "✓ Command Accepted!");
  3620. } else {
  3621. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3622. }
  3623. }
  3624. },
  3625. ttslistclear: function() {
  3626. CTS.TTSList = [];
  3627. Save("TTSList", JSON.stringify(CTS.TTSList));
  3628. Alert(GetActiveChat(), "✓ Command Accepted!");
  3629. },
  3630. ttslist: function() {
  3631. Alert(GetActiveChat(), SettingsList.TTSList());
  3632. },
  3633. reminderadd: function() {
  3634. if (arguments[0] === "") {
  3635. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3636. } else {
  3637. var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9]) ?(?:am|pm)) ([\w\d\s|[^\x00-\x7F]*]*)/i);
  3638. if (reminder === null) {
  3639. Alert(GetActiveChat(), "X Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  3640. } else {
  3641. CTS.ReminderList.push([reminder[1], reminder[2]]);
  3642. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3643. Alert(GetActiveChat(), "✓ Command Accepted!");
  3644. Reminder();
  3645. }
  3646. }
  3647. },
  3648. reminderremove: function() {
  3649. if (arguments[0] === "" || isNaN(arguments[0])) {
  3650. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3651. } else {
  3652. if (CTS.ReminderList[arguments[0]] !== undefined) {
  3653. CTS.ReminderList.splice(arguments[0], 1);
  3654. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3655. Reminder();
  3656. Alert(GetActiveChat(), "✓ Command Accepted!");
  3657. } else {
  3658. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3659. }
  3660. }
  3661. },
  3662. reminderlistclear: function() {
  3663. CTS.ReminderList = [];
  3664. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3665. Alert(GetActiveChat(), "✓ Command Accepted!");
  3666. },
  3667. reminderlist: function() {
  3668. Alert(GetActiveChat(), SettingsList.ReminderList());
  3669. },
  3670. remindertoggle: function() {
  3671. CTS.Reminder = !CTS.Reminder;
  3672. Save("Reminder", JSON.stringify(CTS.Reminder));
  3673. Reminder();
  3674. Settings();
  3675. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  3676. },
  3677. soundmetertoggle: function() {
  3678. CTS.SoundMeterToggle = !CTS.SoundMeterToggle;
  3679. Save("SoundMeterToggle", JSON.stringify(CTS.SoundMeterToggle));
  3680. SoundMeter();
  3681. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.SoundMeterToggle) ? "Sound meter is now on!\n" : "Sound meter is now off!\n "));
  3682. },
  3683. timestamptoggle: function() {
  3684. CTS.TimeStampToggle = !CTS.TimeStampToggle;
  3685. Save("TimeStampToggle", JSON.stringify(CTS.TimeStampToggle));
  3686. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.TimeStampToggle) ? "Timestamps are now on!\n" : "Timestamps are now off\n "));
  3687. LoadMessage();
  3688. },
  3689. raidtoggle: function() {
  3690. CTS.RaidToggle = !CTS.RaidToggle;
  3691. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.RaidToggle) ? "You'll listen for raid call by room owners!\n" : "You've temporarily silenced raids!\n"));
  3692. },
  3693. safeadd: function() {
  3694. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3695. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3696. } else {
  3697. if (CheckUserNameStrict(arguments[0])) {
  3698. if (!CTS.SafeList.includes(arguments[0].toUpperCase())) {
  3699. CTS.SafeList.push(arguments[0].toUpperCase());
  3700. Save("AKB", JSON.stringify(CTS.SafeList));
  3701. Alert(GetActiveChat(), "✓ Command Accepted!");
  3702. } else {
  3703. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3704. }
  3705. } else {
  3706. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3707. }
  3708. }
  3709. },
  3710. saferemove: function() {
  3711. if (arguments[0] === "" || isNaN(arguments[0])) {
  3712. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3713. } else {
  3714. if (CTS.SafeList[arguments[0]] !== undefined) {
  3715. CTS.SafeList.splice(arguments[0], 1);
  3716. Save("AKB", JSON.stringify(CTS.SafeList));
  3717. Alert(GetActiveChat(), "✓ Command Accepted!");
  3718. } else {
  3719. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3720. }
  3721. }
  3722. },
  3723. safelistclear: function() {
  3724. CTS.SafeList = [];
  3725. Save("AKB", JSON.stringify(CTS.SafeList));
  3726. Alert(GetActiveChat(), "✓ Command Accepted!");
  3727. },
  3728. safelist: function() {
  3729. Alert(GetActiveChat(), SettingsList.SafeList());
  3730. },
  3731. greenroomadd: function() {
  3732. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3733. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3734. } else {
  3735. if (CheckUserNameStrict(arguments[0])) {
  3736. if (!CTS.GreenRoomList.includes(arguments[0].toUpperCase())) {
  3737. CTS.GreenRoomList.push(arguments[0].toUpperCase());
  3738. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3739. Alert(GetActiveChat(), "✓ Command Accepted!");
  3740. } else {
  3741. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3742. }
  3743. } else {
  3744. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3745. }
  3746. }
  3747. },
  3748. greenroomremove: function() {
  3749. if (arguments[0] === "" || isNaN(arguments[0])) {
  3750. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3751. } else {
  3752. if (CTS.GreenRoomList[arguments[0]] !== undefined) {
  3753. CTS.GreenRoomList.splice(arguments[0], 1);
  3754. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3755. Alert(GetActiveChat(), "✓ Command Accepted!");
  3756. } else {
  3757. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3758. }
  3759. }
  3760. },
  3761. greenroomlistclear: function() {
  3762. CTS.GreenRoomList = [];
  3763. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3764. Alert(GetActiveChat(), "✓ Command Accepted!");
  3765. },
  3766. greenroomlist: function() {
  3767. Alert(GetActiveChat(), SettingsList.GreenRoomList());
  3768. },
  3769. greenroomignoreadd: function() {
  3770. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3771. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3772. } else {
  3773. if (CheckUserNameStrict(arguments[0])) {
  3774. if (!CTS.GreenRoomIgnoreList.includes(arguments[0].toUpperCase())) {
  3775. CTS.GreenRoomIgnoreList.push(arguments[0].toUpperCase());
  3776. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3777. Alert(GetActiveChat(), "✓ Command Accepted!");
  3778. } else {
  3779. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3780. }
  3781. } else {
  3782. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3783. }
  3784. }
  3785. },
  3786. greenroomignoreremove: function() {
  3787. if (arguments[0] === "" || isNaN(arguments[0])) {
  3788. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3789. } else {
  3790. if (CTS.GreenRoomIgnoreList[arguments[0]] !== undefined) {
  3791. CTS.GreenRoomIgnoreList.splice(arguments[0], 1);
  3792. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3793. Alert(GetActiveChat(), "✓ Command Accepted!");
  3794. } else {
  3795. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3796. }
  3797. }
  3798. },
  3799. greenroomignorelistclear: function() {
  3800. CTS.GreenRoomIgnoreList = [];
  3801. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3802. Alert(GetActiveChat(), "✓ Command Accepted!");
  3803. },
  3804. greenroomignorelist: function() {
  3805. Alert(GetActiveChat(), SettingsList.GreenRoomIgnoreList());
  3806. },
  3807. optoggle: function() {
  3808. CTS.UserYT = !CTS.UserYT;
  3809. Save("UserYT", JSON.stringify(CTS.UserYT));
  3810. Settings();
  3811. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  3812. },
  3813. avatartoggle: function() {
  3814. CTS.Avatar = !CTS.Avatar;
  3815. Save("Avatar", JSON.stringify(CTS.Avatar));
  3816. Settings();
  3817. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  3818. LoadMessage();
  3819. },
  3820. popuptoggle: function() {
  3821. CTS.Popups = !CTS.Popups;
  3822. Save("Popups", JSON.stringify(CTS.Popups));
  3823. Settings();
  3824. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  3825. },
  3826. notificationtoggle: function() {
  3827. CTS.NotificationToggle++;
  3828. if (CTS.NotificationToggle >= 3) CTS.NotificationToggle = 0;
  3829. Save("NotificationToggle", JSON.stringify(CTS.NotificationToggle));
  3830. NotificationDisplay();
  3831. Settings();
  3832. Alert(GetActiveChat(), "✓ Command Accepted!\nNotifications " + ((CTS.NotificationToggle == 0) ? "above chat enabled" : (CTS.NotificationToggle == 1) ? "in chat enabled" : "disabled") + ".");
  3833. },
  3834. greetmodetoggle: function() {
  3835. CTS.GreetMode = !CTS.GreetMode;
  3836. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  3837. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  3838. },
  3839. imgurtoggle: function() {
  3840. CTS.Imgur = !CTS.Imgur;
  3841. Save("Imgur", JSON.stringify(CTS.Imgur));
  3842. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  3843. },
  3844. publiccommandtoggle: function() {
  3845. CTS.PublicCommandToggle = !CTS.PublicCommandToggle;
  3846. Save("PublicCommandToggle", JSON.stringify(CTS.PublicCommandToggle));
  3847. Settings();
  3848. 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."));
  3849. },
  3850. greenroomtoggle: function() {
  3851. CTS.GreenRoomToggle = !CTS.GreenRoomToggle;
  3852. Save("GreenRoomToggle", JSON.stringify(CTS.GreenRoomToggle));
  3853. Settings();
  3854. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.GreenRoomToggle) ? "Green Room Auto Allow ON!" : "Green Room Auto Allow OFF!"));
  3855. },
  3856. clr: function() {
  3857. CTS.Message[GetActiveChat()] = [];
  3858. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  3859. },
  3860. clrall: function() {
  3861. CTS.Message = [];
  3862. CTS.Message[0] = [];
  3863. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  3864. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  3865. },
  3866. autokick: function() {
  3867. if (arguments[1] === false && CTS.Me.mod) {
  3868. CTS.AutoKick = !CTS.AutoKick;
  3869. CTS.AutoBan = false;
  3870. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  3871. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  3872. }
  3873. },
  3874. autoban: function() {
  3875. if (arguments[1] === false && CTS.Me.mod) {
  3876. CTS.AutoBan = !CTS.AutoBan;
  3877. CTS.AutoKick = false;
  3878. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  3879. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  3880. }
  3881. },
  3882. camsweep: function() {
  3883. if (CTS.Me.mod && CTS.Host === CTS.Me.handle) {
  3884. CTS.Camera.SweepTimer = (arguments[0] === "" || isNaN(arguments[0])) ? 5 : (arguments[0] > 30) ? 30 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  3885. CTS.Camera.Sweep = !CTS.Camera.Sweep;
  3886. clearTimeout(CTS.Camera.clearRandom);
  3887. Settings();
  3888. 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!"));
  3889. }
  3890. },
  3891. bottoggle: function() {
  3892. CTS.Bot = !CTS.Bot;
  3893. Save("Bot", JSON.stringify(CTS.Bot));
  3894. Settings();
  3895. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  3896. },
  3897. votetoggle: function() {
  3898. if (CTS.Me.mod) {
  3899. CTS.VoteSystem = !CTS.VoteSystem;
  3900. CTS.WaitToVoteList = [];
  3901. var len = CTS.UserList.length;
  3902. if (len > 0) {
  3903. for (var i = 0; i < len; i++) CTS.UserList[i].vote = 0;
  3904. }
  3905. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.VoteSystem) ? "VOTING IS NOW ON!" : "VOTING IS NOW OFF!"));
  3906. }
  3907. },
  3908. bot: function() {
  3909. if (arguments[1] === false && CTS.Me.mod) Alert(0, "✓ Command Accepted!\nBot bypass was called!");
  3910. },
  3911. share: function() {
  3912. 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";
  3913. if (GetActiveChat() !== 0) {
  3914. Send("pvtmsg", msg, GetActiveChat());
  3915. PushPM(GetActiveChat(), msg);
  3916. } else {
  3917. Send("msg", msg);
  3918. }
  3919. },
  3920. gameview: function() {
  3921. CTS.CanSeeGames = !CTS.CanSeeGames;
  3922. Save("CanSeeGames", JSON.stringify(CTS.CanSeeGames));
  3923. Settings();
  3924. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
  3925. },
  3926. fishhost: function() {
  3927. CTS.CanHostFishGames = !CTS.CanHostFishGames;
  3928. Save("CanHostFishGames", JSON.stringify(CTS.CanHostFishGames));
  3929. Fish.Reset(true, true);
  3930. Settings();
  3931. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanHostFishGames) ? "FISH GAME HOSTING IS NOW ON!" : "FISH GAME HOSTING IS NOW OFF!"));
  3932. },
  3933. triviahost: function() {
  3934. CTS.CanHostTriviaGames = !CTS.CanHostTriviaGames;
  3935. Save("CanHostTriviaGames", JSON.stringify(CTS.CanHostTriviaGames));
  3936. Trivia.Reset();
  3937. Settings();
  3938. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanHostTriviaGames) ? "TRIVIA GAME HOSTING IS NOW ON!" : "TRIVIA GAME HOSTING IS NOW OFF!"));
  3939. },
  3940. trivia: function() {
  3941. if (CTS.Host === CTS.Me.handle && CTS.CanHostTriviaGames) {
  3942. CTS.Game.Trivia.Started = !CTS.Game.Trivia.Started;
  3943. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Game.Trivia.Started) ? "Trivia is now on!\n" : "Trivia is now off!\n"));
  3944. if (CTS.Game.Trivia.Started) {
  3945. Trivia.init();
  3946. } else {
  3947. Trivia.Reset();
  3948. }
  3949. }
  3950. },
  3951. triviaplayeradd: function() {
  3952. if (arguments[0] === "") {
  3953. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3954. } else {
  3955. var player = arguments[0].match(/^([a-z0-9_]{1,32}) ([0-9]{1,10})/i);
  3956. if (player === null) {
  3957. Alert(GetActiveChat(), "X Command Rejected!\n!triviaplayeradd cosmosist 2000\nThis is an example you can try!");
  3958. } else {
  3959. if (CTS.Game.Trivia.PlayerList[player[1].toUpperCase()] === undefined) {
  3960. var point = parseInt(player[2]);
  3961. CTS.Game.Trivia.PlayerList[player[1].toUpperCase()] = point;
  3962. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3963. var user = UsernameToUser(player[1].toUpperCase());
  3964. if (user != -1) CTS.UserList[user].triviapoints = point;
  3965. Alert(GetActiveChat(), "✓ Command Accepted!");
  3966. } else {
  3967. Alert(GetActiveChat(), "X Command Rejected!\nUsername is already entered!");
  3968. }
  3969. }
  3970. }
  3971. },
  3972. triviaplayerremove: function() {
  3973. if (arguments[0] === "" || isNaN(arguments[0])) {
  3974. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3975. } else {
  3976. var user = Object.keys(CTS.Game.Trivia.PlayerList);
  3977. if (CTS.Game.Trivia.PlayerList[user[arguments[0]]] !== undefined) {
  3978. delete CTS.Game.Trivia.PlayerList[user[arguments[0]]];
  3979. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3980. var useron = UsernameToUser(user[arguments[0]]);
  3981. if (useron != -1) CTS.UserList[useron].triviapoints = 0;
  3982. Alert(GetActiveChat(), "✓ Command Accepted!");
  3983. } else {
  3984. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3985. }
  3986. }
  3987. },
  3988. triviaplayerlistclear: function() {
  3989. CTS.Game.Trivia.PlayerList = {};
  3990. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3991. for (var i = 0; i < CTS.UserList.length; i++) CTS.UserList[i].triviapoints = 0;
  3992. Alert(GetActiveChat(), "✓ Command Accepted!");
  3993. },
  3994. triviaplayerlist: function() {
  3995. Alert(GetActiveChat(), SettingsList.TriviaPlayerList());
  3996. },
  3997. version: function() {
  3998. if (!CTS.Me.owner) {
  3999. var msg = "I am using " + CTS.Project.Name + "v" + Ver();
  4000. if (GetActiveChat() !== 0) {
  4001. Send("pvtmsg", msg, GetActiveChat());
  4002. PushPM(GetActiveChat(), msg);
  4003. } else {
  4004. Send("msg", msg);
  4005. }
  4006. }
  4007. },
  4008. roll: function() {
  4009. var dice,
  4010. msg = "";
  4011. dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
  4012. for (var i = 0; i < dice; i++) msg += Dice();
  4013. if (GetActiveChat() !== 0) {
  4014. Send("pvtmsg", msg, GetActiveChat());
  4015. PushPM(GetActiveChat(), msg);
  4016. } else {
  4017. Send("msg", msg);
  4018. }
  4019. },
  4020. coin: function() {
  4021. if (CTS.Host == 0 || GetActiveChat() !== 0) {
  4022. var msg = "The coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!";
  4023. if (GetActiveChat() !== 0) {
  4024. Send("pvtmsg", msg, GetActiveChat());
  4025. } else {
  4026. Send("msg", msg);
  4027. }
  4028. }
  4029. },
  4030. settings: function() {
  4031. Settings();
  4032. },
  4033. lists: function() {
  4034. 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());
  4035. },
  4036. listsclear: function() {
  4037. CTS.MentionList = [];
  4038. CTS.IgnoreList = [];
  4039. CTS.HiddenCameraList = [];
  4040. CTS.UserBanList = [];
  4041. CTS.UserKickList = [];
  4042. CTS.NickBanList = [];
  4043. CTS.NickKickList = [];
  4044. CTS.BanKeywordList = [];
  4045. CTS.KickKeywordList = [];
  4046. CTS.GreetList = [];
  4047. CTS.HighlightList = [];
  4048. CTS.ReminderList = [];
  4049. CTS.TTSList = [];
  4050. CTS.BotOPList = [];
  4051. CTS.BotModList = [];
  4052. Save("MentionList", JSON.stringify(CTS.MentionList));
  4053. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  4054. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  4055. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  4056. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  4057. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  4058. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  4059. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  4060. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  4061. Save("GreetList", JSON.stringify(CTS.GreetList));
  4062. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  4063. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  4064. Save("TTSList", JSON.stringify(CTS.TTSList));
  4065. Save("BotModList", JSON.stringify(CTS.BotModList));
  4066. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  4067. Alert(GetActiveChat(), "✓ Command Accepted!\nItems Mentionlist, igore");
  4068. },
  4069. ytqueue: function() {},
  4070. ytclear: function() {},
  4071. ytskip: function() {},
  4072. yt: function() {},
  4073. ytbypass: function() {}
  4074. };
  4075. var SettingsList = {
  4076. UserList: function() {
  4077. var index,
  4078. msg,
  4079. len = CTS.UserList.length;
  4080. msg = "<b style=\"color:#ffffff;\"><u>User list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4081. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserList[index].username + "\n(" + CTS.UserList[index].nick + ")\n";
  4082. return msg;
  4083. },
  4084. UserBanList: function() {
  4085. var index,
  4086. msg,
  4087. len = CTS.UserBanList.length;
  4088. msg = "<b style=\"color:#ffffff;\"><u>User Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4089. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserBanList[index] + "\n";
  4090. return msg;
  4091. },
  4092. NickBanList: function() {
  4093. var index,
  4094. msg,
  4095. len = CTS.NickBanList.length;
  4096. msg = "<b style=\"color:#ffffff;\"><u>Nick Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4097. for (index = 0; index < len; index++) msg += index + " : " + CTS.NickBanList[index] + "\n";
  4098. return msg;
  4099. },
  4100. BanKeywordList: function() {
  4101. var index,
  4102. msg,
  4103. len = CTS.BanKeywordList.length;
  4104. msg = "<b style=\"color:#ffffff;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4105. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  4106. return msg;
  4107. },
  4108. UserKickList: function() {
  4109. var index,
  4110. msg,
  4111. len = CTS.UserKickList.length;
  4112. msg = "<b style=\"color:#ffffff;\"><u>User Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4113. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserKickList[index] + "\n";
  4114. return msg;
  4115. },
  4116. NickKickList: function() {
  4117. var index,
  4118. msg,
  4119. len = CTS.NickKickList.length;
  4120. msg = "<b style=\"color:#ffffff;\"><u>Nick Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4121. for (index = 0; index < len; index++) msg += index + " : " + CTS.NickKickList[index] + "\n";
  4122. return msg;
  4123. },
  4124. KickKeywordList: function() {
  4125. var index,
  4126. msg,
  4127. len = CTS.KickKeywordList.length;
  4128. msg = "<b style=\"color:#ffffff;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4129. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  4130. return msg;
  4131. },
  4132. BotOPList: function() {
  4133. var index,
  4134. msg,
  4135. len = CTS.BotOPList.length;
  4136. msg = "<b style=\"color:#ffffff;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4137. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  4138. return msg;
  4139. },
  4140. BotModList: function() {
  4141. var index,
  4142. msg,
  4143. len = CTS.BotModList.length;
  4144. msg = "<b style=\"color:#ffffff;\"><u>Bot Mod list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4145. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotModList[index] + "\n";
  4146. return msg;
  4147. },
  4148. MentionList: function() {
  4149. var index,
  4150. msg,
  4151. len = CTS.MentionList.length;
  4152. msg = "<b style=\"color:#ffffff;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4153. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  4154. return msg;
  4155. },
  4156. IgnoreList: function() {
  4157. var index,
  4158. msg,
  4159. len = CTS.IgnoreList.length;
  4160. msg = "<b style=\"color:#ffffff;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4161. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  4162. return msg;
  4163. },
  4164. HiddenCameraList: function() {
  4165. var index,
  4166. msg,
  4167. len = CTS.HiddenCameraList.length;
  4168. msg = "<b style=\"color:#ffffff;\"><u>Hidden Camera list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4169. for (index = 0; index < len; index++) msg += index + " : " + CTS.HiddenCameraList[index] + "\n";
  4170. return msg;
  4171. },
  4172. GreetList: function() {
  4173. var index,
  4174. msg,
  4175. len = CTS.GreetList.length;
  4176. msg = "<b style=\"color:#ffffff;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4177. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  4178. return msg;
  4179. },
  4180. TTSList: function() {
  4181. var index,
  4182. msg,
  4183. len = CTS.TTSList.length;
  4184. msg = "<b style=\"color:#ffffff;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4185. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  4186. return msg;
  4187. },
  4188. HighlightList: function() {
  4189. var index,
  4190. msg,
  4191. len = CTS.HighlightList.length;
  4192. msg = "<b style=\"color:#ffffff;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4193. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  4194. return msg;
  4195. },
  4196. ReminderList: function() {
  4197. var index,
  4198. msg,
  4199. len = CTS.ReminderList.length;
  4200. msg = "<b style=\"color:#ffffff;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4201. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  4202. return msg;
  4203. },
  4204. SafeList: function() {
  4205. var index,
  4206. msg,
  4207. len = CTS.SafeList.length;
  4208. msg = "<b style=\"color:#ffffff;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4209. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  4210. return msg;
  4211. },
  4212. GreenRoomList: function() {
  4213. var index,
  4214. msg,
  4215. len = CTS.GreenRoomList.length;
  4216. msg = "<b style=\"color:#ffffff;\"><u>Green Room list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4217. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomList[index] + "\n";
  4218. return msg;
  4219. },
  4220. GreenRoomIgnoreList: function() {
  4221. var index,
  4222. msg,
  4223. len = CTS.GreenRoomIgnoreList.length;
  4224. msg = "<b style=\"color:#ffffff;\"><u>Green Room Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4225. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomIgnoreList[index] + "\n";
  4226. return msg;
  4227. },
  4228. TriviaPlayerList: function() {
  4229. var index,
  4230. msg,
  4231. user = Object.keys(CTS.Game.Trivia.PlayerList),
  4232. len = user.length;
  4233. msg = "<b style=\"color:#ffffff;\"><u>Trivia Player List list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4234. for (index = 0; index < len; index++) msg += index + ": " + user[index] + "@" + CTS.Game.Trivia.PlayerList[user[index]] + "IQ\n";
  4235. return msg;
  4236. }
  4237. };
  4238. var MessageQueueList = {
  4239. add: function() {
  4240. CTS.SendQueue.push(arguments[0]);
  4241. MessageQueueList.run();
  4242. },
  4243. run: function() {
  4244. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  4245. setTimeout(function() {
  4246. var temp = new Date();
  4247. var OffsetTime = temp - CTS.LastMessage;
  4248. if (OffsetTime >= 1500) {
  4249. CTS.LastMessage = new Date();
  4250. CTS.SocketTarget.send(CTS.SendQueue[0]);
  4251. CTS.SendQueue.shift();
  4252. }
  4253. MessageQueueList.run();
  4254. }, 1600);
  4255. }
  4256. }
  4257. };
  4258. var ServerSendList = {
  4259. msg: function() {
  4260. var obj = {
  4261. "tc": arguments[0]
  4262. };
  4263. if (arguments[2] !== undefined) {
  4264. obj.handle = arguments[1];
  4265. CTS.SocketTarget.send(JSON.stringify(obj));
  4266. } else {
  4267. if (arguments[1] !== undefined) {
  4268. obj.text = arguments[1];
  4269. MessageQueueList.add(JSON.stringify(obj));
  4270. } else {
  4271. CTS.SocketTarget.send(JSON.stringify(obj));
  4272. }
  4273. }
  4274. },
  4275. pvtmsg: function() {
  4276. var obj = {
  4277. "tc": arguments[0],
  4278. "text": arguments[1],
  4279. "handle": Number(arguments[2])
  4280. };
  4281. MessageQueueList.add(JSON.stringify(obj));
  4282. },
  4283. kick: function() {
  4284. CheckSafeList(arguments[1], true);
  4285. ServerSendList.msg(arguments[0], arguments[1], "kick");
  4286. },
  4287. ban: function() {
  4288. CheckSafeList(arguments[1], true);
  4289. ServerSendList.msg(arguments[0], arguments[1], "ban");
  4290. },
  4291. nick: function() {
  4292. var obj = {
  4293. "tc": "nick",
  4294. "nick": arguments[1]
  4295. };
  4296. CTS.SocketTarget.send(JSON.stringify(obj));
  4297. },
  4298. stream_moder_close: function() {
  4299. CheckSafeList(arguments[1], true);
  4300. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_close");
  4301. },
  4302. stream_moder_allow: function() {
  4303. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_allow");
  4304. },
  4305. yut_playlist_add: function() {
  4306. var obj = {
  4307. "tc": arguments[0],
  4308. "item": {
  4309. "id": arguments[1][0],
  4310. "duration": arguments[1][1] + 10,
  4311. "title": arguments[1][2],
  4312. "image": arguments[1][3]
  4313. }
  4314. };
  4315. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  4316. CTS.SocketTarget.send(JSON.stringify(obj));
  4317. },
  4318. yut_playlist_remove: function() {
  4319. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4320. },
  4321. yut_stop: function() {
  4322. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4323. },
  4324. yut_play: function() {
  4325. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4326. },
  4327. yut_playlist: function() {
  4328. ServerSendList.msg("yut_playlist");
  4329. },
  4330. yut_playlist_clear: function() {
  4331. ServerSendList.msg("yut_playlist_clear");
  4332. }
  4333. };
  4334. var ServerInList = {
  4335. joined: function() {
  4336. Reset();
  4337. CTS.Me = {
  4338. "handle": arguments[0].self.handle,
  4339. "username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
  4340. "nick": arguments[0].self.nick,
  4341. "owner": arguments[0].self.owner,
  4342. "mod": arguments[0].self.mod,
  4343. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  4344. "avatar": arguments[0].self.avatar,
  4345. "broadcasting": false
  4346. };
  4347. if (CTS.Me.nick.match(/^guest(?:\-[0-9]{1,10})?/i) && CTS.Me.username !== "GUEST") Send("nick", CTS.Me.username); //AUTO CORRECT NAME
  4348. if (CTS.Me.mod && CTS.Bot && CTS.ScriptInit && CTS.SocketConnected) CheckHost();
  4349. CTS.Room = {
  4350. "Avatar": arguments[0].room.avatar,
  4351. "Bio": arguments[0].room.biography,
  4352. "Name": arguments[0].room.name,
  4353. "PTT": arguments[0].room.pushtotalk,
  4354. "Website": arguments[0].room.website,
  4355. "YT_ON": arguments[0].room.youtube_enabled,
  4356. "Recent_Gifts": arguments[0].room.recent_gifts
  4357. };
  4358. CTS.SocketConnected = true;
  4359. },
  4360. userlist: function() {
  4361. var len = arguments[0].users.length;
  4362. for (var user = 0; user < len; user++) {
  4363. AKBS(arguments[0].users[user]);
  4364. var username = (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase();
  4365. CheckUserAbuse(arguments[0].users[user].handle, username, arguments[0].users[user].nick);
  4366. CTS.UserList.push({
  4367. "handle": arguments[0].users[user].handle,
  4368. "username": username,
  4369. "nick": arguments[0].users[user].nick,
  4370. "owner": arguments[0].users[user].owner,
  4371. "mod": arguments[0].users[user].mod,
  4372. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  4373. "avatar": (arguments[0].users[user].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].users[user].avatar,
  4374. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
  4375. "broadcasting": false,
  4376. "vote": 0,
  4377. "triviapoints": CTS.Game.Trivia.PlayerList[username] || 0
  4378. });
  4379. }
  4380. RoomUsers();
  4381. debug();
  4382. },
  4383. join: function() {
  4384. AKBS(arguments[0]);
  4385. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  4386. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick);
  4387. if (CTS.HighlightList.includes(user) && window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4388. window.CTSSound.HIGHLIGHT.volume = window.CTSRoomVolume;
  4389. window.CTSSound.HIGHLIGHT.play();
  4390. }
  4391. if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
  4392. CTS.hasGreetedWC = true;
  4393. window.CTSSound.C.play();
  4394. Send("msg", "HI! " + arguments[0].nick.toUpperCase() + "!");
  4395. } else {
  4396. if ((CTS.GreetList.includes(user) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  4397. 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!") : "!"));
  4398. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4399. window.CTSSound.GREET.volume = window.CTSRoomVolume;
  4400. window.CTSSound.GREET.play();
  4401. }
  4402. }
  4403. }
  4404. CTS.NoGreet = false;
  4405. 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);
  4406. RoomUsers();
  4407. debug();
  4408. },
  4409. sysmsg: function() {
  4410. if (CTS.Me.mod) {
  4411. var action = arguments[0].text.match(/^([a-z0-9_]{1,32}):? (closed|banned|kicked) ([a-z0-9_]{1,32})$/i);
  4412. if (action !== null) {
  4413. var user;
  4414. if (action[2] == "closed" || action[2] == "banned" || action[2] == "kicked") {
  4415. user = NicknameToUser(action[3].toUpperCase());
  4416. if (user != -1) {
  4417. if (CTS.UserList[user].username !== "GUEST") {
  4418. var a = CTS.GreenRoomList.indexOf(CTS.UserList[user].username);
  4419. if (a !== -1) {
  4420. //REMOVE
  4421. debug("GREENROOMLIST::", "REMOVE USER " + CTS.UserList[user].username + " FROM GREENROOMLIST");
  4422. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[user].username + " from greenroomlist!");
  4423. CommandList.greenroomremove(a);
  4424. }
  4425. }
  4426. }
  4427. }
  4428. }
  4429. }
  4430. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  4431. debug();
  4432. },
  4433. nick: function() {
  4434. var user = HandleToUser(arguments[0].handle);
  4435. if (user != -1) {
  4436. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  4437. 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);
  4438. CTS.UserList[user].nick = arguments[0].nick;
  4439. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  4440. CheckUserAbuse(arguments[0].handle, CTS.UserList[user].username, arguments[0].nick);
  4441. }
  4442. debug();
  4443. },
  4444. stream_connected: function() {
  4445. 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)) {
  4446. //USER IS NOT ON CAMERA START AUTO ACCEPT PROCESS
  4447. var user = HandleToUser(arguments[0].handle);
  4448. if (user != -1) {
  4449. debug("CAMERA::WAITING", "nickname:" + CTS.UserList[user].nick);
  4450. if (!CTS.GreenRoomIgnoreList.includes(CTS.UserList[user].username) && CTS.GreenRoomList.includes(CTS.UserList[user].username)) Send("stream_moder_allow", CTS.UserList[user].handle);
  4451. }
  4452. }
  4453. debug();
  4454. },
  4455. stream_closed: function() {
  4456. debug();
  4457. },
  4458. publish: function() { //ADD GLOBAL CAMERA
  4459. CheckUserStream(arguments[0].handle, true);
  4460. debug();
  4461. },
  4462. unpublish: function() { //REMOVE GLOBAL CAMERA
  4463. CheckUserStream(arguments[0].handle, false);
  4464. debug();
  4465. },
  4466. ping: function() {
  4467. if (CTS.ScriptInit) {
  4468. var verify;
  4469. if (CTS.WatchList.length > 0) {
  4470. verify = new Date() - CTS.WatchList[0][2];
  4471. debug("WATCHLIST::LIST", CTS.WatchList);
  4472. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/700000");
  4473. if (CTS.SafeList.indexOf(CTS.WatchList[0][0]) === -1) { //LET'S NOT ADD TWICE
  4474. if (verify > 700000) {
  4475. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/700000");
  4476. CTS.SafeList.push(CTS.WatchList[0][0]);
  4477. CTS.WatchList.shift();
  4478. }
  4479. } else {
  4480. CTS.WatchList.shift();
  4481. }
  4482. }
  4483. if (CTS.WaitToVoteList.length > 0) {
  4484. verify = new Date() - CTS.WaitToVoteList[0][1];
  4485. debug("VOTE::LIST", CTS.WaitToVoteList);
  4486. debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4487. if (verify > 300000) {
  4488. debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4489. CTS.WaitToVoteList.shift();
  4490. }
  4491. }
  4492. }
  4493. //DISPOSE OF ITEMS
  4494. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  4495. window.TinychatApp.getInstance().defaultChatroom.packetWorker.queue = {};
  4496. debug();
  4497. },
  4498. quit: function() {
  4499. if (CTS.ScriptInit) {
  4500. if (CTS.WatchList.length > 0) {
  4501. var len = CTS.WatchList.length;
  4502. for (var i = 0; i < len; i++) {
  4503. if (CTS.WatchList[i][1] == arguments[0].handle) {
  4504. CTS.WatchList.splice(i, 1);
  4505. break;
  4506. }
  4507. }
  4508. }
  4509. if (CTS.Me.mod) RemoveUserCamera(arguments[0].handle);
  4510. var user = HandleToUser(arguments[0].handle);
  4511. if (user != -1) {
  4512. 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.");
  4513. //SEND THEM OUT
  4514. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4515. CTS.UserList.splice(user, 1);
  4516. }
  4517. RoomUsers();
  4518. if (CTS.Host == arguments[0].handle) {
  4519. CTS.Host = 0;
  4520. CTS.Camera.Sweep = false;
  4521. if (CTS.Me.mod && CTS.Bot) {
  4522. setTimeout(function() {
  4523. if (CTS.Host == 0) SetBot(false);
  4524. }, (Rand(10, 30) * 1000));
  4525. }
  4526. }
  4527. }
  4528. debug();
  4529. },
  4530. msg: function() {
  4531. if (CTS.ScriptInit) {
  4532. var user = HandleToUser(arguments[0].handle);
  4533. if (user != -1) {
  4534. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4535. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4536. var text = HTMLtoTXT(arguments[0].text);
  4537. //ALL USERS REPORT
  4538. OwnerCommand(user, arguments[0].text);
  4539. BotCheck(user, text, arguments[0]);
  4540. //MODERATORS
  4541. if (CTS.Me.mod) {
  4542. if (CTS.Host == CTS.Me.handle) BotCommandCheck(user, text);
  4543. CheckUserWordAbuse(user, arguments[0].text);
  4544. }
  4545.  
  4546. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4547. //PUSH MESSAGE
  4548. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4549. CTS.Message[0].push({
  4550. "time": Time(),
  4551. "namecolor": CTS.UserList[user].namecolor,
  4552. "avatar": CTS.UserList[user].avatar,
  4553. "username": CTS.UserList[user].username,
  4554. "nick": CTS.UserList[user].nick,
  4555. "msg": text,
  4556. "mention": false
  4557. });
  4558. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  4559. if (CTS.Me.handle !== arguments[0].handle) {
  4560. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  4561. Alert(GetActiveChat(), "✓ AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  4562. CTS.AutoKick = false;
  4563. CTS.AutoBan = false;
  4564. }
  4565. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4566. if (CTS.UserList.length <= 14) {
  4567. window.CTSSound.MSG.volume = window.CTSRoomVolume;
  4568. window.CTSSound.MSG.play();
  4569. }
  4570. 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!"));
  4571. }
  4572. var len = CTS.MentionList.length;
  4573. for (var i = 0; i < len; i++) {
  4574. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  4575. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4576. window.CTSSound.MENTION.volume = window.CTSRoomVolume;
  4577. window.CTSSound.MENTION.play();
  4578. }
  4579. msg.mention = true;
  4580. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4581. }
  4582. }
  4583. }
  4584. if (GetActiveChat() === 0) CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  4585. MessagePopUp(user, text, true, false);
  4586. }
  4587. }
  4588. } else {
  4589. if (CTS.Host == CTS.Me.handle) {
  4590. Send("kick", arguments[0].handle);
  4591. } else if (CTS.Host == 0) {
  4592. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4593. }
  4594. }
  4595. }
  4596. }
  4597. debug();
  4598. },
  4599. pvtmsg: function() {
  4600. if (CTS.ScriptInit) {
  4601. if (CTS.enablePMs === true) {
  4602. if (arguments[0].handle != CTS.Me.handle) {
  4603. var user = HandleToUser(arguments[0].handle);
  4604. if (user != -1) {
  4605. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4606. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4607. var text = arguments[0].text;
  4608. if (CTS.Me.mod) CheckUserWordAbuse(user, arguments[0].text);
  4609. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4610. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4611. PushPM(arguments[0].handle, text, user);
  4612. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound && !window.CTSMuted) {
  4613. window.CTSSound.PVTMSG.volume = window.CTSRoomVolume;
  4614. window.CTSSound.PVTMSG.play();
  4615. 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!"));
  4616. }
  4617. text = HTMLtoTXT(text);
  4618. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4619. MessagePopUp(user, text, false, false);
  4620. }
  4621. }
  4622. } else {
  4623. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4624. }
  4625. }
  4626. }
  4627. }
  4628. }
  4629. debug();
  4630. },
  4631. gift: function() {
  4632. CreateGift(arguments[0]);
  4633. debug();
  4634. },
  4635. yut_playlist_add: function() {
  4636. if (CTS.ScriptInit) {
  4637. if (!CTS.YouTube.Playing) {
  4638. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  4639. if (CTS.Host != CTS.Me.handle) {
  4640. Send("msg", "!play");
  4641. } else {
  4642. YouTubePlayList();
  4643. }
  4644. }
  4645. }
  4646. debug();
  4647. },
  4648. yut_playlist: function() {
  4649. if (CTS.ScriptInit) {
  4650. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  4651. if (CTS.YouTube.Clear === true) {
  4652. if (arguments[0].items !== null) Send("yut_playlist_clear");
  4653. CTS.YouTube.MessageQueueList = [];
  4654. Send("msg", "🎵YouTube cleared!🎵");
  4655. CTS.YouTube.Clear = false;
  4656. } else {
  4657. if (arguments[0].items === null) {
  4658. CTS.PlayListStart = true;
  4659. } else {
  4660. CTS.YouTube.PlayListCount = arguments[0].items.length;
  4661. CTS.PlayListStart = false;
  4662. if (CTS.YouTube.ShowQueue === true) {
  4663. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  4664. for (var i = 0; i < 3; i++) {
  4665. if (arguments[0].items[i] === undefined) break;
  4666. 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]";
  4667. }
  4668. Send("msg", msg);
  4669. }
  4670. }
  4671. 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);
  4672. }
  4673. CTS.YouTube.ShowQueue = false;
  4674. }
  4675. }
  4676. debug();
  4677. },
  4678. yut_play: function() {
  4679. if (CTS.ScriptInit) {
  4680. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  4681. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  4682. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  4683. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  4684. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  4685. CTS.YouTube.CurrentTrack.offset = arguments[0].item.offset;
  4686. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  4687. }
  4688. if (window.YouTube.Playing) window.YouTube.stopVideo();
  4689. if (window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableYoutube) {
  4690. window.YouTube.Init();
  4691. window.YouTube.Offset = setInterval(function() {
  4692. CTS.YouTube.CurrentTrack.offset += 1;
  4693. if ((window.YouTube.Popup == null || window.YouTube.Popup.closed)) YouTubeDuration(Math.trunc((CTS.YouTube.CurrentTrack.offset * 100) / CTS.YouTube.CurrentTrack.duration));
  4694. }, 1000);
  4695. }
  4696. CTS.YouTube.Playing = true;
  4697. YouTubePlayList();
  4698. }
  4699. debug();
  4700. },
  4701. yut_stop: function() {
  4702. if (CTS.ScriptInit) {
  4703. CTS.YouTube.CurrentTrack.ID = undefined;
  4704. CTS.YouTube.CurrentTrack.duration = undefined;
  4705. CTS.YouTube.CurrentTrack.title = undefined;
  4706. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  4707. clearInterval(window.YouTube.Offset);
  4708. CTS.YouTube.Playing = false;
  4709. window.YouTube.stopVideo();
  4710. YouTubePlayList();
  4711. }
  4712. debug();
  4713. }
  4714. };
  4715. var ServerOutList = {
  4716. pvtmsg: function() {
  4717. if (CTS.ScriptInit) {
  4718. Command(arguments[0].text, true);
  4719. var text = arguments[0].text;
  4720. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4721. PushPM(arguments[0].handle, text);
  4722. }
  4723. debug();
  4724. },
  4725. msg: function() {
  4726. if (CTS.ScriptInit) {
  4727. CTS.LastMessage = new Date();
  4728. Command(arguments[0].text, false);
  4729. }
  4730. debug();
  4731. },
  4732. ban: function() {
  4733. CheckSafeList(arguments[0].handle, true);
  4734. debug();
  4735. },
  4736. kick: function() {
  4737. CheckSafeList(arguments[0].handle, true);
  4738. debug();
  4739. },
  4740. stream_moder_close: function() {
  4741. CheckSafeList(arguments[0].handle, true);
  4742. debug();
  4743. }
  4744. };
  4745. //ADDON
  4746. var Addon = {
  4747. active: function() {
  4748. if (window.CTSAddon !== undefined) {
  4749. if (window.CTSAddon[arguments[0]] !== undefined) {
  4750. return true;
  4751. }
  4752. }
  4753. return false;
  4754. },
  4755. get: function() {
  4756. return window.CTSAddon[arguments[0]];
  4757. }
  4758. };
  4759. //XMLHttpRequest
  4760. // YouTube Search V3 API (https://console.developers.google.com/)
  4761. CTS.YouTube.XHR.onload = function() {
  4762. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  4763. if (response.error) {
  4764. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  4765. } else {
  4766. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  4767. CTS.YouTube.ListBuilt = true;
  4768. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  4769. CTS.YouTube.DataReady = true;
  4770. CTS.YouTube.Busy = false;
  4771. YouTubeTrackAdd();
  4772. }
  4773. CTS.YouTube.DataReady = false;
  4774. if (response.items[0]) {
  4775. CTS.YouTube.Busy = true;
  4776. if (response.items[0].id) {
  4777. if (response.kind == "youtube#playlistItemListResponse") {
  4778. YouTubePlayListItems(response.items);
  4779. } else {
  4780. CTS.YouTube.VideoID = response.items[0].id.videoId;
  4781. 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);
  4782. CTS.YouTube.XHR.send();
  4783. }
  4784. } else if (response.items[0].contentDetails.duration) {
  4785. CTS.YouTube.DataReady = true;
  4786. }
  4787. if (CTS.YouTube.DataReady === false) {
  4788. CTS.YouTube.Busy = false;
  4789. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  4790. if (response.kind == "youtube#playlistItemListResponse") {
  4791. CTS.YouTube.ListBuilt = true;
  4792. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  4793. CTS.YouTube.Busy = false;
  4794. }
  4795. } else {
  4796. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  4797. if (CTS.YouTube.Playing === true) {
  4798. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  4799. 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]);
  4800. CTS.YouTube.Busy = false;
  4801. } else {
  4802. if (response.items[0].snippet.title !== undefined) {
  4803. 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]);
  4804. 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]);
  4805. CTS.YouTube.Playing = true;
  4806. }
  4807. CTS.YouTube.Busy = false;
  4808. }
  4809. }
  4810. }
  4811. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  4812. var title = "";
  4813. CTS.YouTube.SearchReturn = false;
  4814. CTS.YouTube.VideoReturn = false;
  4815. if (response.items[0] !== undefined) {
  4816. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  4817. }
  4818. if (response.items !== undefined) {
  4819. if (response.items.length > 0) title = response.items[0].snippet.title;
  4820. }
  4821. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  4822. }
  4823. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  4824. }
  4825. };
  4826. //Chuck Norris Jokes API (https://api.chucknorris.io/)
  4827. CTS.Chuck.XHR.onload = function() {
  4828. var resp = JSON.parse(CTS.Chuck.XHR.responseText),
  4829. msg = "[CHUCK NORRIS]\n" + resp.value;
  4830. if (resp !== null) Send("msg", msg.substr(0, 499));
  4831. };
  4832. //URB API (https://api.Urb.com/)
  4833. CTS.Urb.XHR.onload = function() {
  4834. var resp = JSON.parse(CTS.Urb.XHR.responseText),
  4835. msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
  4836. if (resp !== null) Send("msg", msg.substr(0, 499));
  4837. };
  4838. //ICanHazDadJoke's API (https://icanhazdadjoke.com/)
  4839. CTS.Dad.XHR.onload = function() {
  4840. var resp = JSON.parse(CTS.Dad.XHR.responseText),
  4841. msg = "[DAD JOKE]\n" + resp.joke;
  4842. if (resp !== null) Send("msg", msg.substr(0, 499));
  4843. };
  4844. //AdviceSlip API (https://api.adviceslip.com/advice)
  4845. CTS.Advice.XHR.onload = function() {
  4846. var resp = JSON.parse(CTS.Advice.XHR.responseText),
  4847. msg = "[ADVICE]\n" + resp.slip.advice;
  4848. if (resp !== null) Send("msg", msg.substr(0, 499));
  4849. };
  4850. // https://opentdb.com/api.php?amount=10
  4851. CTS.Game.Trivia.XHR.onload = function() {
  4852. var resp = JSON.parse(CTS.Game.Trivia.XHR.responseText);
  4853. if (resp.response_code == 0) {
  4854. CTS.Game.Trivia.QuestionList = resp.results;
  4855. Trivia.AskQuestion();
  4856. }
  4857. };
  4858. //GAME LIST FUNCTION
  4859. var Trivia = {
  4860. init: function() {
  4861. if (CTS.Me.handle == CTS.Host && CTS.CanHostTriviaGames) { // CHANGE BACK TO HOST NEEDED!!!!
  4862. this.Reset();
  4863. CTS.Game.Trivia.Started = true;
  4864. this.GetQuestion();
  4865. }
  4866. },
  4867. GetQuestion: function() {
  4868. CTS.Game.Trivia.XHR.open("GET", "https://opentdb.com/api.php?amount=50&type=multiple");
  4869. CTS.Game.Trivia.XHR.send();
  4870. },
  4871. AskQuestion: function() {
  4872. clearTimeout(CTS.Game.Trivia.Timer);
  4873. CTS.Game.Trivia.AttemptList = [];
  4874. CTS.Game.Trivia.Attempts = 0;
  4875. if (CTS.Game.Trivia.Started) {
  4876. if (CTS.Game.Trivia.QuestionList.length > 0) {
  4877. var RandSlot = Rand(0, 3),
  4878. msg,
  4879. incorrect = 0;
  4880. CTS.Game.Trivia.WaitCount++;
  4881. CTS.Game.Trivia.Correct = CTS.Game.Trivia.ANum[RandSlot];
  4882. 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));
  4883. CTS.Game.Trivia.Waiting = false;
  4884. msg = "[TRIVIA]\n" + CTS.Game.Trivia.QuestionList[0].question + "\n\nWorth:" + CTS.Game.Trivia.Worth + "IQ points!\n-------------";
  4885. for (var i = 0; i < 4; i++) {
  4886. msg += "\n\n" + CTS.Game.Trivia.ANum[i] + ") ";
  4887. if (i == RandSlot) {
  4888. msg += CTS.Game.Trivia.QuestionList[0].correct_answer;
  4889. } else {
  4890. msg += CTS.Game.Trivia.QuestionList[0].incorrect_answers[incorrect];
  4891. incorrect++;
  4892. }
  4893. }
  4894. CTS.Game.Trivia.QuestionList.shift();
  4895. Send("msg", DecodeTXT(msg));
  4896. CTS.Game.Trivia.Timer = setTimeout(function(g) {
  4897. Send("msg", "[TRIVIA]\nToo hard eh? Next question coming up in sixty seconds!\nThe answer however was: " + CTS.Game.Trivia.Correct);
  4898. g.Wait();
  4899. }, 240000, this);
  4900. } else {
  4901. CTS.Game.Trivia.WaitCount = 0;
  4902. this.GetQuestion();
  4903. }
  4904. if (CTS.Game.Trivia.WaitCount >= 4) {
  4905. CTS.Game.Trivia.WaitCount = 0;
  4906. this.Ranking();
  4907. }
  4908. }
  4909. },
  4910. Wait: function() {
  4911. CTS.Game.Trivia.Correct = "";
  4912. CTS.Game.Trivia.Waiting = true;
  4913. clearTimeout(CTS.Game.Trivia.Timer);
  4914. setTimeout(function() {
  4915. if (CTS.Game.Trivia.Started) Trivia.AskQuestion();
  4916. }, 60000);
  4917. },
  4918. Ranking: function() {
  4919. Send("msg", "[TRIVIA RANK]\n" + CTS.Game.Trivia.HighScore[0] + " has set the record of " + CTS.Game.Trivia.HighScore[1] + " IQ Points!");
  4920. },
  4921. Reset: function() {
  4922. clearTimeout(CTS.Game.Trivia.Timer);
  4923. CTS.Game.Trivia.Attempts = 0;
  4924. CTS.Game.Trivia.WaitCount = 0;
  4925. CTS.Game.Trivia.Started = false;
  4926. CTS.Game.Trivia.Correct = "";
  4927. CTS.Game.Trivia.AttemptList = [];
  4928. CTS.Game.Trivia.QuestionList = {};
  4929. CTS.Game.Trivia.Waiting = true;
  4930. }
  4931. };
  4932. var Fish = {
  4933. Init: function() {
  4934. if (CTS.Me.handle == CTS.Host && CTS.CanHostFishGames === true) {
  4935. 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!");
  4936. CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
  4937. g.StartRound();
  4938. }, 5000, this);
  4939. }
  4940. },
  4941. AddPlayer: function() {
  4942. if (!this.GetPlayer(arguments[0], false, false) && CTS.CanHostFishGames === true) {
  4943. if (isSafeListed(arguments[1])) {
  4944. CTS.Game.Fish.Player.push({
  4945. Handle: arguments[0],
  4946. Username: arguments[1],
  4947. Nickname: arguments[2],
  4948. LastCheck: new Date() - 5000,
  4949. Points: 5000,
  4950. Upgrades: {
  4951. Net: 1,
  4952. Store: 1,
  4953. Radar: 1,
  4954. Insurance: false
  4955. },
  4956. });
  4957. Send("msg", "[FISHING BOAT]\n" + arguments[2].substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  4958. if (this.GetPlayer() == 0) this.Init();
  4959. }
  4960. }
  4961. },
  4962. GetPlayer: function() {
  4963. var len = CTS.Game.Fish.Player.length;
  4964. if (arguments[0] !== undefined) {
  4965. for (var player = 0; player < len; player++) {
  4966. if (CTS.Game.Fish.Player[player].Handle == arguments[0]) {
  4967. if (arguments[2]) return CTS.Game.Fish.Player[player];
  4968. if (arguments[1]) {
  4969. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  4970. CTS.Game.Fish.Player.splice(player, 1);
  4971. }
  4972. if (!arguments[2]) return true;
  4973. }
  4974. }
  4975. if (!arguments[2]) {
  4976. return false;
  4977. } else {
  4978. return -1;
  4979. }
  4980. } else {
  4981. return len - 1;
  4982. }
  4983. },
  4984. Ranking: function() {
  4985. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
  4986. place = 0;
  4987. for (var u = arguments[0]; u >= 0; u--) {
  4988. place++;
  4989. if (u < 5) {
  4990. msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
  4991. }
  4992. CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
  4993. CTS.Game.Fish.Player[u].Points += 10000;
  4994. }
  4995. Send("msg", msg);
  4996. },
  4997. Winner: function() {
  4998. CTS.Game.Fish.Player.sort(function(a, b) {
  4999. return a.Points - b.Points;
  5000. });
  5001. if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
  5002. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
  5003. CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
  5004. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  5005. }
  5006. var len = CTS.Game.Fish.Player.length - 1;
  5007. 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!");
  5008. this.Ranking(len);
  5009. CTS.Game.Fish.RestockTimeout = setTimeout(function() {
  5010. Fish.Reset(false, true);
  5011. }, 30000);
  5012. },
  5013. PriceList: function() {
  5014. if (arguments[1] == 0) { // net
  5015. return (1000 * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net);
  5016. } else if (arguments[1] == 1) { // radar
  5017. return (1000 * arguments[0].Upgrades.Radar * 2) + 3500;
  5018. } else if (arguments[1] == 2) { // shop
  5019. return (arguments[0].Upgrades.Store * arguments[0].Upgrades.Store * 25000);
  5020. } else if (arguments[1] == 3) { // insurance
  5021. return (20000);
  5022. } else if (arguments[1] == 4) { // rob
  5023. return (10000);
  5024. } else if (arguments[1] == 5) { // slap
  5025. return (50000);
  5026. } else if (arguments[1] == 6) { // split (min$) / gamble
  5027. return (1000);
  5028. }
  5029. },
  5030. StartRound: function() {
  5031. clearTimeout(CTS.Game.Fish.StartTimeout);
  5032. if (CTS.Host === CTS.Me.handle) {
  5033. if (this.GetPlayer() >= 0) {
  5034. if (CTS.Game.Fish.Round < 10) {
  5035. CTS.Game.Fish.Round++;
  5036. var playerlen,
  5037. fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
  5038. id,
  5039. type,
  5040. handle,
  5041. eliminate = false,
  5042. msgeliminate,
  5043. value,
  5044. msg = "[FISHING BOAT]\n";
  5045. for (var cast = 0; cast <= 2; cast++) {
  5046. playerlen = this.GetPlayer();
  5047. id = Rand(0, playerlen);
  5048. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  5049. if (Rand(0, 100) <= Rand(10, 70)) {
  5050. var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
  5051. value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
  5052. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  5053. CTS.Game.Fish.Player[id].Points += value;
  5054. 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");
  5055. } else {
  5056. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  5057. CTS.Game.Fish.Player[id].Points -= value;
  5058. 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");
  5059. } else {
  5060. 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");
  5061. }
  5062. }
  5063. } else {
  5064. cast--;
  5065. }
  5066. if (this.GetPlayer() == -1) break;
  5067. if (CTS.Game.Fish.Player[id].Points < 0) {
  5068. eliminate = true;
  5069. handle = CTS.Game.Fish.Player[id].Handle;
  5070. msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
  5071. CTS.Game.Fish.Player.splice(id, 1);
  5072. break;
  5073. }
  5074. }
  5075. if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
  5076. if (eliminate) {
  5077. eliminate = false;
  5078. Send("msg", msgeliminate);
  5079. }
  5080. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
  5081. g.StartRound();
  5082. }, Rand(90000, 120000), this);
  5083. } else {
  5084. this.Winner();
  5085. }
  5086. } else {
  5087. //RESTART
  5088. Fish.Stop();
  5089. }
  5090. }
  5091. },
  5092. Reset: function() {
  5093. var get = this.GetPlayer();
  5094. if (get !== undefined) {
  5095. if (get >= 0 && !CTS.Game.NoReset || arguments[1] !== undefined) {
  5096. CTS.Game.Fish.Round = 0;
  5097. clearTimeout(CTS.Game.Fish.StartTimeout);
  5098. clearTimeout(CTS.Game.Fish.RestockTimeout);
  5099. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  5100. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  5101. if (!arguments[0]) {
  5102. this.Init();
  5103. } else {
  5104. if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  5105. CTS.Game.Fish.Player = [];
  5106. }
  5107. }
  5108. }
  5109. },
  5110. Stop: function() {
  5111. CTS.Game.NoReset = false;
  5112. this.Reset(true, true);
  5113. }
  5114. };
  5115. var FishList = {
  5116. fish: function() {
  5117. Fish.AddPlayer(arguments[1].handle, arguments[1].username, arguments[1].nick);
  5118. },
  5119. fishbank: function() {
  5120. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname.substr(0, 16) + ", you have $" + arguments[0].Points + ".");
  5121. },
  5122. fishrob: function() {
  5123. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5124. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  5125. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 4), Rand(5000, 20000), true);
  5126. }
  5127. },
  5128. fishgamble: function() {
  5129. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5130. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 6))) {
  5131. var winnings;
  5132. if (Rand(1, 10) === 7) { // 10% chance
  5133. winnings = Rand(1000, 25000);
  5134. arguments[0].Points += winnings;
  5135. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  5136. } else {
  5137. if (Rand(1, 7) === 4) { // 15%
  5138. winnings = Rand(1000, 5000);
  5139. arguments[0].Points += winnings;
  5140. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  5141. } else {
  5142. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " tough luck, you lost $1000!");
  5143. }
  5144. }
  5145. }
  5146. }
  5147. },
  5148. fishslap: function() {
  5149. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5150. var user = UsernameToUser(arguments[1].toUpperCase());
  5151. if (user !== -1) {
  5152. if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle && CTS.UserList[user].username !== "GUEST") {
  5153. if (CTS.Me.owner || !CTS.UserList[user].mod) {
  5154. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 5))) {
  5155. Send("stream_moder_close", CTS.UserList[user].handle);
  5156. Send("msg", arguments[0].Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
  5157. }
  5158. } else {
  5159. Send("msg", "Cannot close moderator!");
  5160. }
  5161. } else {
  5162. Send("msg", "Cannot close user!");
  5163. }
  5164. }
  5165. }
  5166. },
  5167. fishsplit: function() {
  5168. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5169. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  5170. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 6), Math.round(arguments[0].Points / 2), false);
  5171. }
  5172. },
  5173. fishupgrade: function() {
  5174. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 0);
  5175. },
  5176. fishhelp: function() {
  5177. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 6);
  5178. },
  5179. fishupgradenet: function() {
  5180. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5181. if (arguments[0].Upgrades.Net >= 10) {
  5182. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5183. } else {
  5184. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 0))) {
  5185. arguments[0].Upgrades.Net += 1;
  5186. FishUpgradeStatus(arguments[0], 1);
  5187. }
  5188. }
  5189. }
  5190. },
  5191. fishupgradeshop: function() {
  5192. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5193. if (arguments[0].Upgrades.Store >= 6) {
  5194. Send("msg", arguments[0].Nickname + ", you own them all already!");
  5195. } else {
  5196. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 2))) {
  5197. arguments[0].Upgrades.Store += 1;
  5198. FishUpgradeStatus(arguments[0], 4);
  5199. }
  5200. }
  5201. }
  5202. },
  5203. fishupgraderadar: function() {
  5204. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5205. if (arguments[0].Upgrades.Radar >= 20) {
  5206. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5207. } else {
  5208. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 1))) {
  5209. arguments[0].Upgrades.Radar += 5;
  5210. FishUpgradeStatus(arguments[0], 2);
  5211. }
  5212. }
  5213. }
  5214. },
  5215. fishupgradeinsurance: function() {
  5216. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5217. if (arguments[0].Upgrades.Insurance === true) {
  5218. Send("msg", arguments[0].Nickname + ", you already have insurance!");
  5219. } else {
  5220. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 3))) {
  5221. arguments[0].Upgrades.Insurance = true;
  5222. FishUpgradeStatus(arguments[0], 3);
  5223. }
  5224. }
  5225. }
  5226. }
  5227. };
  5228. //MISC FUNCTION
  5229. function SetLocalValues() {
  5230. if (CTS.StorageSupport) {
  5231. //CTS SETTINGS
  5232. CTS.Game.Trivia.PlayerList = JSON.parse(Load("TriviaPlayerList", JSON.stringify({})));
  5233. CTS.Game.Trivia.HighScore = JSON.parse(Load("TriviaHighScore", JSON.stringify(["CosmosisT", 1])));
  5234. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
  5235. CTS.PublicCommandToggle = JSON.parse(Load("PublicCommandToggle", JSON.stringify(true)));
  5236. CTS.OGStyle.SavedHeight = JSON.parse(Load("OGStyleHeight", JSON.stringify(3)));
  5237. CTS.GreenRoomIgnoreList = JSON.parse(Load("GreenRoomIgnoreList", JSON.stringify([])));
  5238. CTS.CameraBorderToggle = JSON.parse(Load("CameraBorderToggle", JSON.stringify(true)));
  5239. CTS.OGStyle.SavedWidth = JSON.parse(Load("OGStyleWidth", JSON.stringify(1)));
  5240. CTS.NotificationToggle = JSON.parse(Load("NotificationToggle", JSON.stringify(0)));
  5241. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", JSON.stringify(14)));
  5242. CTS.SoundMeterToggle = JSON.parse(Load("SoundMeterToggle", JSON.stringify(true)));
  5243. CTS.HiddenCameraList = JSON.parse(Load("HiddenCameraList", JSON.stringify([])));
  5244. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  5245. CTS.PerformanceMode = JSON.parse(Load("PerformanceMode", JSON.stringify(false)));
  5246. CTS.TimeStampToggle = JSON.parse(Load("TimeStampToggle", JSON.stringify(true)));
  5247. CTS.YouTube.API_KEY = Load("YouTubeAPI", "AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs");
  5248. CTS.GreenRoomToggle = JSON.parse(Load("GreenRoomToggle", JSON.stringify(true)));
  5249. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  5250. CTS.FavoritedRooms = JSON.parse(Load("FavoritedRooms", JSON.stringify(["stonercircle", null, null, null, null])));
  5251. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/aS5RCaX.jpg) rgb(0, 0, 0) no-repeat");
  5252. CTS.GreenRoomList = JSON.parse(Load("GreenRoomList", JSON.stringify([])));
  5253. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  5254. CTS.CanHostTriviaGames = JSON.parse(Load("CanHostTriviaGames", JSON.stringify(false)));
  5255. CTS.CanHostFishGames = JSON.parse(Load("CanHostFishGames", JSON.stringify(false)));
  5256. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  5257. CTS.UserKickList = JSON.parse(Load("UserKickList", JSON.stringify([])));
  5258. CTS.NickKickList = JSON.parse(Load("NickKickList", JSON.stringify([])));
  5259. CTS.UserBanList = JSON.parse(Load("UserBanList", JSON.stringify([])));
  5260. CTS.NickBanList = JSON.parse(Load("NickBanList", JSON.stringify([])));
  5261. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  5262. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  5263. CTS.ThemeChange = JSON.parse(Load("ThemeChange", JSON.stringify(true)));
  5264. CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
  5265. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  5266. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  5267. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  5268. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  5269. CTS.FontSize = JSON.parse(Load("FontSize", JSON.stringify(20)));
  5270. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  5271. CTS.Featured = JSON.parse(Load("Featured", JSON.stringify(false)));
  5272. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  5273. CTS.ChatType = JSON.parse(Load("ChatType", JSON.stringify(true)));
  5274. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  5275. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  5276. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  5277. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  5278. CTS.Imgur = JSON.parse(Load("Imgur", JSON.stringify(true)));
  5279. CTS.FPS = JSON.parse(Load("FPS", JSON.stringify(30)));
  5280. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  5281. CTS.MediaStreamFilter = Load("MediaStreamFilter", "No Filter");
  5282. }
  5283. }
  5284.  
  5285. function debug() {
  5286. if (window.DebugClear === false) {
  5287. if (arguments[0] !== undefined) {
  5288. var msg = "CTS::" + arguments[0];
  5289. if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
  5290. console.log(msg);
  5291. }
  5292. } else {
  5293. console.clear();
  5294. 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");
  5295. }
  5296. }
  5297.  
  5298. function Reset() {
  5299. CTS.UserList = [];
  5300. CTS.Me = [];
  5301. CTS.Room = [];
  5302. CTS.SendQueue = [];
  5303. CTS.Camera.List = [];
  5304. CTS.Camera.List = [];
  5305. CTS.WaitToVoteList = [];
  5306. CTS.WatchList = [];
  5307. CTS.Host = 0;
  5308. CTS.HostAttempt = 0;
  5309. CTS.HostWaiting = false;
  5310. CTS.TempIgnoreUserList = [];
  5311. CTS.TempIgnoreNickList = [];
  5312. // Game Reset
  5313. Fish.Stop();
  5314. Trivia.Reset();
  5315. }
  5316.  
  5317. function Remove() {
  5318. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  5319. }
  5320. })();