CosmosisT's TinyChat Script (CTS V1.7.16)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-08-01 提交的版本,查看 最新版本

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