CosmosisT's TinyChat Script (CTS V1.8.26)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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