CosmosisT's TinyChat Script (CTS V1.8.45)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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