CosmosisT's TinyChat Script (CTS V1.7.10)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-06-30 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.7.10)
  3. // @version 1.7.10
  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://tinychat.com/webrtc/2.0.0-81/images/favicon.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: 10
  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. Me: {},
  78. Room: {},
  79. ScriptInit: false,
  80. MainBackground: "url(https://i.imgur.com/aS5RCaX.jpg) rgb(0, 0, 0) no-repeat",
  81. MediaStreamFilter:"No Filter",
  82. OGStyle: {
  83. HeightCounter: 3,
  84. WidthCounter: 1,
  85. SavedHeight: undefined,
  86. SavedWidth: undefined
  87. },
  88. NormalStyle: {
  89. ChatHide: false
  90. },
  91. FontSize: 20,
  92. ChatStyleCounter: 0,
  93. ChatHeight: 30,
  94. ChatWidth: 0,
  95. ChatDisplay: true,
  96. UserListDisplay: true,
  97. ChatStyles: undefined,
  98. ChatType: true,
  99. MainBackgroundCounter: 0,
  100. NotificationLimit: 100,
  101. ChatScroll: true,
  102. CreateMessageLast:undefined,
  103. NotificationScroll: true,
  104. NoGreet: false,
  105. Featured: true,
  106. Bot: true,
  107. AutoKick: false,
  108. AutoBan: false,
  109. GreetMode: false,
  110. PerformanceMode: false,
  111. CanTTS: false,
  112. VoteSystem: false,
  113. Popups: true,
  114. Avatar: true,
  115. Reminder: true,
  116. ServerEvent: true,
  117. CanSeeTips:true,
  118. CanSeeGames: true,
  119. CanHostFishGames: false,
  120. CanHostTriviaGames: false,
  121. isFullScreen: false,
  122. Imgur: true,
  123. ImgurWarning: 0,
  124. Notification: true,
  125. UserYT: true,
  126. RaidToggle:true,
  127. ThemeChange: true,
  128. SoundMeterToggle: true,
  129. TimeStampToggle: true,
  130. AutoMicrophone: false,
  131. GreenRoomToggle: true,
  132. PublicCommandToggle: true,
  133. Game: {
  134. NoReset: false,
  135. Trivia: {
  136. XHR: new XMLHttpRequest(),
  137. QuestionList: [],
  138. Timer: undefined,
  139. ANum: ["A", "B", "C", "D"],
  140. Correct: "",
  141. Attempts: 0,
  142. AttemptList:[],
  143. WaitCount: 0,
  144. Waiting: true,
  145. HighScore:["CosmosisT", 2],
  146. Worth: 0,
  147. PlayerList:{},
  148. PriceList:{
  149. raid: 10000,
  150. spot: 500,
  151. ytbypass: 200
  152. }
  153. },
  154. Fish: {
  155. HighScore: ["CosmosisT", 13337],
  156. StartTimeout: undefined,
  157. RestockTimeout: undefined,
  158. ReCastTimeout: undefined,
  159. NotEnoughTimeout: undefined,
  160. Round: 0,
  161. Player: [],
  162. TypesOfFish: [
  163. ["frog", 1, true],
  164. ["sunfish", 2, true],
  165. ["goldfish", 3, true],
  166. ["fish swollowed hook", 4, false],
  167. ["family of sardine", 5, true],
  168. ["catfish", 6, true],
  169. ["spotted bass", 7, true],
  170. ["largemouth bass", 8, true],
  171. ["family of shrimp", 9, true],
  172. ["it pays to not drink,\ncrazy night however!", 10, false],
  173. ["cisco", 11, true],
  174. ["seaweed, still edible", 12, true],
  175. ["snagged a tire and lost rod", 13, false],
  176. ["snagged a tire and lost hook", 14, false],
  177. ["lost their rod to a shark", 15, false],
  178. ["rainbow trout", 16, true],
  179. ["It's your turn for dinner", 80, false],
  180. ["parrot fish", 17, true],
  181. ["snagged a plastic bag,\n their hook is gone", 18, false],
  182. ["walleye", 19, true],
  183. ["Round Whitefish", 20, true],
  184. ["family of clams", 21, true],
  185. ["family of oyster", 22, true],
  186. ["Round blackfish", 23, true],
  187. ["dolphin", 24, true],
  188. ["seagull,\n not a fish but will do", 25, true],
  189. ["pufferfish", 26, true],
  190. ["fined for smuggling\nmore than fish", 27, false],
  191. ["lobster", 28, true],
  192. ["tuna", 29, true],
  193. ["electric eel", 30, true],
  194. ["Eel electricuted you,\nrod is toast", 31, false],
  195. ["swordfish", 32, true],
  196. ["had bills at home to pay", 33, false],
  197. ["slipped and lost equipment", 34, false],
  198. ["bike, still good too", 35, true],
  199. ["great white", 36, true],
  200. ["octopus", 37, true],
  201. ["serpeant", 38, true],
  202. ["sea turtle", 39, true],
  203. ["cleaned garbage from the lake", 40, true],
  204. ["fined for capturing,\n a female whale", 41, false],
  205. ["male whale", 42, true],
  206. ["barracuda", 43, true],
  207. ["pike", 44, true],
  208. ["lochiness monster", 45, true],
  209. ["anglerfish", 46, true],
  210. ["small treasure chest", 47, true],
  211. ["golden tuna", 48, true],
  212. ["family of beautiful rims", 49, true],
  213. ["red snapper", 50, true],
  214. ["jaws", 51, true],
  215. ["mermaid", 52, true],
  216. ["holy grail,\nhow'd that get there?", 75, true],
  217. ["secret formula", 100, true]
  218. ]
  219. }
  220. },
  221. TTS: {
  222. synth: undefined,
  223. voices: undefined
  224. },
  225. hasGreetedWC: false,
  226. Host: 0,
  227. HostAttempt: 0,
  228. HostWaiting: false,
  229. StorageSupport: true,
  230. WaitToVoteList: [],
  231. UserList: [],
  232. MentionList: [],
  233. TempIgnoreNickList: [],
  234. TempIgnoreUserList: [],
  235. IgnoreList: [],
  236. UserBanList: [],
  237. NickBanList: [],
  238. UserKickList: [],
  239. NickKickList: [],
  240. BotOPList: [],
  241. BotModList: [],
  242. TTSList: [],
  243. BanKeywordList: [],
  244. KickKeywordList: [],
  245. HighlightList: [],
  246. GreetList: [],
  247. ServerEventList: [],
  248. ServerEventServerInList: [],
  249. ReminderList: [],
  250. ReminderServerInList: [],
  251. Favorited: ["stonercircle", null, null, null, null],
  252. SafeList: [],
  253. GreenRoomIgnoreList: [],
  254. GreenRoomList: [],
  255. WatchList: [],
  256. HiddenCameraList: [],
  257. KBQueue: [],
  258. Message: [
  259. []
  260. ],
  261. Clipboard:{
  262. Message: [""],
  263. Typing: false,
  264. Log: "",
  265. MessageLen: 0,
  266. Counter: 0
  267. },
  268. LastMessage: new Date(),
  269. ShowedSettings: false,
  270. SendQueue: [],
  271. MissedMsg: 0,
  272. Camera: {
  273. List: [],
  274. Sweep: false,
  275. SweepTimer: 5,
  276. clearRandom: undefined
  277. },
  278. NotificationTimeOut: [],
  279. };
  280.  
  281. CTS.StorageSupport = StorageSupport();
  282. SetLocalValues();
  283.  
  284. //IS USER TOUCHSCREEN
  285. CheckUserTouchScreen();
  286.  
  287. if (CTS.ThemeChange) {
  288. // TinyChat Style
  289. 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%}";
  290. 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;}";
  291. 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;}.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}#chat-wrapper{transition: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: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;}";
  292. 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;}";
  293. 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;}";
  294. RoomCSS = "tc-title{display:flex;}#room-content{padding-top:0!important;background:unset!important;}";
  295. 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;}";
  296. 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;}";
  297. 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;}";
  298. 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;}";
  299. ModeratorCSS = ".video{min-width: 114px;max-width: 114px;}#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{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\"] {max-height:205px;}#moderatorlist.show[data-videos-count=\"3\"], #moderatorlist.show[data-videos-count=\"4\"] {max-height:290px;}#moderatorlist.show[data-videos-count=\"5\"], #moderatorlist.show[data-videos-count=\"6\"] {max-height:400px;}#moderatorlist.show[data-videos-count=\"7\"], #moderatorlist.show[data-videos-count=\"8\"] {max-height:460px;}#moderatorlist.show[data-videos-count=\"9\"], #moderatorlist.show[data-videos-count=\"10\"] {max-height:545px;}#moderatorlist.show[data-videos-count=\"11\"], #moderatorlist.show[data-videos-count=\"12\"] {max-height:630px;}";
  300. 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;}";
  301. } else {
  302. //CTS Style
  303. 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%}";
  304. 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;}";
  305. 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;}.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;}";
  306. 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;}";
  307. VideoCSS = ".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;}";
  308. RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{padding-top:0!important;background:unset!important;}";
  309. 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;}";
  310. 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;}";
  311. 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;}";
  312. 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;}";
  313. ModeratorCSS = ".video{min-width: 114px;max-width: 114px;}#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{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\"] {max-height:205px;}#moderatorlist.show[data-videos-count=\"3\"], #moderatorlist.show[data-videos-count=\"4\"] {max-height:290px;}#moderatorlist.show[data-videos-count=\"5\"], #moderatorlist.show[data-videos-count=\"6\"] {max-height:400px;}#moderatorlist.show[data-videos-count=\"7\"], #moderatorlist.show[data-videos-count=\"8\"] {max-height:460px;}#moderatorlist.show[data-videos-count=\"9\"], #moderatorlist.show[data-videos-count=\"10\"] {max-height:545px;}#moderatorlist.show[data-videos-count=\"11\"], #moderatorlist.show[data-videos-count=\"12\"] {max-height:630px;}";
  314. 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;}";
  315. }
  316. //INITIATE
  317. CTSInit();
  318.  
  319. function CTSInit() {
  320. //INITIATE CTS
  321. var err_out = 0;
  322. CTS.ScriptLoading = setInterval(function() {
  323. err_out++;
  324. if (document.querySelector("tinychat-webrtc-app")) {
  325. if (document.querySelector("tinychat-webrtc-app").shadowRoot) CTSRoomInject();
  326. debug("TINYCHAT::LOAD", "ROOM");
  327. } else if (document.querySelector("#welcome-wrapper")) {
  328. CTSHomeInject();
  329. debug("TinyChat::LOAD", "HOME");
  330. } else {
  331. err_out++;
  332. }
  333. if (err_out == 50) {
  334. clearInterval(CTS.ScriptLoading);
  335. clearInterval(CTS.FullLoad);
  336. }
  337. }, 200);
  338. //WEBSOCKET HOOK
  339. if (!document.URL.match(/^https:\/\/tinychat\.com\/(?:$|#)/i)) {
  340. new MutationObserver(function() {
  341. this.disconnect();
  342. CTSWebSocket();
  343. }).observe(document, {
  344. subtree: true,
  345. childList: true
  346. });
  347. }
  348. //FULLY LOADED -> RUNALL
  349. CTS.FullLoad = setInterval(function() {
  350. if (CTS.ScriptInit && CTS.SocketConnected) {
  351. clearInterval(CTS.FullLoad);
  352. if (CTS.Me.mod) {
  353. if (CTS.Bot) CheckHost();
  354. if (CTS.Room.YT_ON) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  355. if (CTS.Room.YT_ON && CTS.Project.isTouchScreen) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").classList.toggle("hidden");
  356. //VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
  357. }
  358. //Discord
  359. Discord();
  360. //PTT AUTO
  361. if (CTS.Room.PTT) {
  362. VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
  363. e = e || window.event;
  364. if (e.which == 1) CTS.AutoMicrophone = false;
  365. if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  366. if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  367. }, {
  368. passive: true
  369. });
  370. }
  371. //FAVORITE ROOM
  372. var favorited_rooms = "",
  373. len = CTS.FavoritedRooms.length,
  374. script = document.createElement("script"),
  375. elem = document.getElementsByTagName("script")[0];
  376. 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}';
  377. elem.parentNode.insertBefore(script, elem);
  378. 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>';
  379. 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>');
  380. //RECENT GIFTS
  381. var recent_gifts = "\n";
  382. for (var g = 0; g < CTS.Room.Recent_Gifts.length; g++) recent_gifts += "<img src=\"" + CTS.Room.Recent_Gifts[g] + "\" />";
  383. //ALERT
  384. 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>");
  385. CTS.ShowedSettings = true;
  386. AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
  387. //FEATURE LAUNCH
  388. SoundMeter();
  389. Reminder();
  390. Events();
  391. PerformanceModeInit(CTS.PerformanceMode);
  392. }
  393. }, 500);
  394. }
  395.  
  396. function CTSHomeInject() {
  397. 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;}";
  398. //INSERT HTML/CSS
  399. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  400. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  401. //INSERT SCRIPT
  402. var script = document.createElement("script"),
  403. elem = document.getElementsByTagName("script")[0];
  404. 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}';
  405. elem.parentNode.insertBefore(script, elem);
  406. var len = CTS.FavoritedRooms.length;
  407. 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>");
  408. //SCRIPT INIT -> PREPARE()
  409. clearInterval(CTS.ScriptLoading);
  410. CTS.ScriptInit = true;
  411. CTSHomePrepare();
  412. }
  413.  
  414. function CTSHomePrepare() {
  415. //FUNCTION BYPASS
  416. window.ModalFreeTrialPro = function() {};
  417. //REMOVE
  418. Remove(document, "#footer");
  419. Remove(document, ".nav-logo");
  420. }
  421.  
  422. function CTSRoomInject() {
  423. // PUBLIC / ADDON GRABBERS
  424. window.CTSImages = [
  425. "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",
  426. "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",
  427. "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",
  428. "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",
  429. "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",
  430. "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",
  431. "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",
  432. ];
  433. 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."];
  434. window.CTSWelcomes = ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "];
  435. window.CTSSound = {
  436. C: new Audio("https://media.vocaroo.com/mp3/e3VIvvFqdHe"),
  437. HIGHLIGHT: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  438. GREET: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  439. MENTION: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"),
  440. MSG: new Audio("https://tinychat.com" + window.rootDir + "/sound/pop.mp3"),
  441. GIFT: new Audio("https://tinychat.com" + window.rootDir + "/sound/magic.mp3"),
  442. PVTMSG: new Audio("https://media.vocaroo.com/mp3/1eX3L752VdQ")
  443. };
  444. window.CTSRadioStations = [
  445. ["Flex 98.5FM", "https://edge1-b.exa.live365.net/a23768"],
  446. ["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],
  447. ["HOT899", "https://newcap.leanstream.co/CIHTFM"],
  448. ["chillstep.info", "https://chillstep.info/listen.ogg"],
  449. ["HOT997", "https://ice5.securenetsystems.net/KHHK"],
  450. ["Dance365", "https://edge1-b.exa.live365.net/a93720"],
  451. ["kexp.org", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3"],
  452. ["Classic Deep Cuts", "https://edge1-b.exa.live365.net/a72496"],
  453. ["Divas Hustle Radio", "https://edge1-b.exa.live365.net/a72972"],
  454. ["Retro 8089", "https://edge1-b.exa.live365.net/a53202"],
  455. ["Teerex Radio Teerex", "https://edge1-b.exa.live365.net/a74387"],
  456. ["NGI Radio", "https://edge1-b.exa.live365.net/a24650"],
  457. ["Legend Oldies", "https://edge1-b.exa.live365.net/a88135"],
  458. ["Music City Roadhouse", "https://edge1-b.exa.live365.net/a73754"],
  459. ["Mashrup Reggae Radio", "https://edge1-b.exa.live365.net/a00564"],
  460. ["97.5 Dance Hits", "https://edge1-b.exa.live365.net/a50365"]
  461. ];
  462. window.CTSNameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  463. window.CTSChatCSS = [
  464. [ //STYLE #0
  465. ["#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;}"],
  466. [".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;}"],
  467. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  468. ],
  469. [ //STYLE #1
  470. ["#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;}"],
  471. [".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;}"],
  472. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
  473. ],
  474. [ //STYLE #2
  475. ["#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;}"],
  476. [".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;}"],
  477. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
  478. ],
  479. [ //STYLE #3
  480. ["#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;}"],
  481. [".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;}"],
  482. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
  483. ],
  484. [ //STYLE #4
  485. ["#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;}"],
  486. [".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;}"],
  487. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
  488. ],
  489. [ //STYLE #5
  490. ["#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;}"],
  491. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}"],
  492. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
  493. ],
  494. [ //STYLE #6
  495. ["#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;}"],
  496. [".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;}"],
  497. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
  498. ],
  499. [ //STYLE #7
  500. ["#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;}"],
  501. [".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;}"],
  502. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
  503. ],
  504. [ //STYLE #8
  505. ["#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;}"],
  506. [".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;}"],
  507. ["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
  508. ],
  509. [ //STYLE #9
  510. ["#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;}"],
  511. [".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;}"],
  512. ["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
  513. ],
  514. [ //STYLE #10
  515. ["#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;}"],
  516. [".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;}"],
  517. ["#sidemenu{background: linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)100%);}"]
  518. ],
  519. [ //STYLE #11
  520. ["#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;}"],
  521. [".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;}"],
  522. ["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}"]
  523. ],
  524. [ //STYLE #12
  525. [".stackmessage{background:#ffffff}#chat-wrapper{background: #fff!important;}.message>.systemuser{color:#FFFFFF}#cts-chat-content>.message{background:#00000000}.message{color:#000000;text-shadow: unset;}"],
  526. [".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;}"],
  527. ["#sidemenu{background: #2d373a;}"]
  528. ],
  529. [ //STYLE #13
  530. ["#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;}"],
  531. [".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;}"],
  532. ["#sidemenu{background: url(https://i.imgur.com/LCOulGB.png) repeat-x bottom;}"]
  533. ],
  534. [ //STYLE #14
  535. ["#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;}"],
  536. [".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;}"],
  537. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  538. ],
  539. [ //STYLE #14
  540. ["#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;}"],
  541. [".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;}"],
  542. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  543. ],
  544. [ //STYLE #15
  545. ["#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;}"],
  546. [".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;}"],
  547. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  548. ],
  549. [ //STYLE #16
  550. ["#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;}"],
  551. [".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;}"],
  552. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  553. ],
  554. [ //STYLE #17
  555. ["#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;}"],
  556. [".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;}"],
  557. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  558. ],
  559. [ //STYLE #18
  560. ["#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;}"],
  561. [".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;}"],
  562. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  563. ],
  564. [ //STYLE #19
  565. ["#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;}"],
  566. [".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;}"],
  567. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  568. ],
  569. [ //STYLE #20
  570. ["#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;}"],
  571. [".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;}"],
  572. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  573. ],
  574. [ //STYLE #21
  575. ["#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;}"],
  576. [".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;}"],
  577. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  578. ],
  579. [ //STYLE #22
  580. ["#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;}"],
  581. [".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;}"],
  582. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  583. ],
  584. [ //STYLE #23
  585. ["#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;}"],
  586. [".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;}"],
  587. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  588. ],
  589. [ //STYLE #24
  590. ["#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;}"],
  591. [".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;}"],
  592. ["#sidemenu{background:#202628;}"]
  593. ]
  594. ];
  595. //INSERT SCRIPT
  596. var script = document.createElement("script"),
  597. elem = document.getElementsByTagName("script")[0];
  598. 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}';
  599. elem.parentNode.insertBefore(script, elem);
  600. //LOCALSETTINGS
  601. CTS.enablePMs = window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enablePMs;
  602. CTS.enableSound = window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound;
  603. //TTS (TEXT-TO-SPEECH)
  604. if (CTS.enableSound === true && "speechSynthesis" in window) {
  605. CTS.TTS.synth = window.speechSynthesis;
  606. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  607. }
  608. //ELEMENT DEFINE
  609. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  610. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  611. TextAreaElement = ChatLogElement.querySelector("#textarea");
  612. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  613. MicrophoneElement = document.createEvent("MouseEvent");
  614. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  615. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  616. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  617. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  618. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  619. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  620. var insert = TitleElement.querySelector('span[title="Settings"]');
  621. VideoListElement.querySelector("#videos-header").appendChild(insert);
  622. //INSERT HTML/CSS
  623. if (!CTS.Project.isTouchScreen) {
  624. insert = VideoListElement.querySelector("#videos-footer-broadcast-wrapper");
  625. VideoListElement.querySelector("#videolist").appendChild(insert);
  626. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  627. 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>');
  628. TitleCSS += "span[title=\"Follow\"], span[title=\"Share room\"]{display:none!important;}";
  629. } else {
  630. 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;}";
  631. MainCSS += "body{overflow:auto;}";
  632. UserListCSS += "#contextmenu{top:unset;bottom:0;left:0;}";
  633. }
  634. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  635. StyleSet();
  636. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  637. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  638. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  639. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  640. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  641. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  642. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  643. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  644. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  645. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  646. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  647. VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin", "<button style=\"display:" + ((CTS.Project.isTouchScreen) ? "none" : "block") + "\" class=\"tcsettings\">←</button>");
  648. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  649. 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>' : ''));
  650. ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div><button class="notifbtn">▼</button>');
  651. ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
  652. ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
  653. //SCRIPT INIT -> PREPARE()
  654. clearInterval(CTS.ScriptLoading);
  655. CTS.ScriptInit = true;
  656. CTSRoomPrepare();
  657. }
  658.  
  659. function CTSRoomPrepare() {
  660. //FUNCTION BYPASS
  661. window.TinychatApp.BLL.Videolist.prototype.blurOtherVids = function() {};
  662. window.TinychatApp.BLL.SoundPlayer.playMessage = function() {};
  663. window.TinychatApp.BLL.SoundPlayer.playGift = function() {};
  664. window.TinychatApp.BLL.User.isSubscription = function() {
  665. return true;
  666. };
  667. window.TinychatApp.BLL.User.canUseFilters = function() {
  668. return true;
  669. };
  670. window.TinychatApp.BLL.MediaConnection.prototype.Close = function() {
  671. RTC(this);
  672. };
  673. window.TinychatApp.BLL.ChatRoom.prototype.sendPushForUnreadPrivateMessage = function() {};
  674. if (!CTS.Project.isTouchScreen) {
  675. window.TinychatApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  676. var b = this,
  677. d = this.settings.getSettings();
  678. if (d.video === null) {
  679. return void this.app.MediaSettings(() => {
  680. this.BroadcastStart();
  681. });
  682. }
  683. this.videolist.AddingVideoSelf(this.self_handle);
  684. var e = {};
  685. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  686. e.audio = true;
  687. e.video = {
  688. width: {
  689. min: 320,
  690. max: 4096
  691. },
  692. height: {
  693. min: 240,
  694. max: 2160
  695. },
  696. frameRate: {
  697. min: 15,
  698. ideal: 30,
  699. max: 60
  700. }
  701. };
  702. } else {
  703. navigator.mediaDevices.enumerateDevices().then(g => {
  704. var h = false;
  705. var len = g.length;
  706. for (var c = 0; c < len; c++) {
  707. if (g[c].kind === "videoinput") {
  708. if (e.video === void 0) e.video = {
  709. width: {
  710. min: 320,
  711. max: 4096
  712. },
  713. height: {
  714. min: 240,
  715. max: 2160
  716. },
  717. frameRate: {
  718. min: 15,
  719. ideal: 30,
  720. max: 60
  721. }
  722. };
  723. if (h) {
  724. d.video = g[c];
  725. h = false;
  726. this.settings.saveSettings(d);
  727. } else if (d.video === null) {
  728. d.video = g[c];
  729. this.settings.saveSettings(d);
  730. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  731. e.video.deviceId = {
  732. exact: d.video.deviceId
  733. };
  734. } else if (d.video.deviceId === a) {
  735. h = true;
  736. }
  737. }
  738. if (g[c].kind === "audioinput") {
  739. if (e.audio === void 0) e.audio = {};
  740. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) {
  741. e.audio = {
  742. deviceId: {
  743. exact: d.audio.deviceId
  744. },
  745. };
  746. }
  747. }
  748. }
  749. if (e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
  750. let i = navigator.mediaDevices.getSupportedConstraints();
  751. for (let a in i) {
  752. if (i.hasOwnProperty(a) && "echoCancellation" == a && e.audio) e.audio[a] = this.settings.isAcousticEchoCancelation();
  753. }
  754. if (!(e.audio || e.video)) {
  755. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  756. } else if ("https:" === location.protocol || this.app.isDebug()) {
  757. debug("BROADCAST", "Initiating Media...");
  758. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  759. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  760. b.mediaLastConstraints = e;
  761. navigator.mediaDevices.getUserMedia(e).then(m => {
  762. b.onMediaSuccessCallback(m);
  763. });
  764. }
  765. }).catch(er => {
  766. debug("CAMERA::ERROR", er);
  767. });
  768. }
  769. };
  770. }
  771. window.TinychatApp.BLL.Userlist.prototype.ignore = function(a) {
  772. var b = ((a.isUsername)?a.username:a.nickname);
  773. if (this.isIgnored(a) || this.ignored.push(b)) {
  774. var c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  775. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
  776. this.app.showToast(b + " ignored successfully till they leave or you refresh!");
  777. if (!a.isUsername) {
  778. CTS.TempIgnoreNickList.push(b.toUpperCase());
  779. } else {
  780. CTS.TempIgnoreUserList.push(b.toUpperCase());
  781. }
  782. }
  783. };
  784. window.TinychatApp.BLL.Userlist.prototype.unignore = function(a) {
  785. var b = ((a.isUsername)?a.username:a.nickname),
  786. index = this.ignored.indexOf(b);
  787. if (index != -1) this.ignored.splice(index, 1);
  788. if (!a.isUsername) {
  789. index = CTS.TempIgnoreNickList.indexOf(b.toUpperCase());
  790. if (index != -1) CTS.TempIgnoreNickList.splice(index, 1);
  791. } else {
  792. index = CTS.TempIgnoreUserList.indexOf(b.toUpperCase());
  793. if (index != -1) CTS.TempIgnoreUserList.splice(index, 1);
  794. }
  795. var e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  796. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
  797. this.app.showToast(a.username + " unignored");
  798. };
  799. window.TinychatApp.BLL.Userlist.prototype.generateUpdateEvent = function(a, b) {
  800. var c = -1,
  801. d = null,
  802. e = -1,
  803. f = null;
  804. Object.keys(this.items).forEach(b=>{
  805. var e = this.items[b];
  806. if (e.handle === a) {
  807. c = Number.parseInt(b);
  808. d = Object.assign(new window.TinychatApp.DAL.UserEntity(), e);
  809. f = e;
  810. }
  811. });
  812. if(d != null && (b(f) || !Object.equals(d, f))) {
  813. this.sorting(this.items);
  814. e = this.items.indexOf(f);
  815. if (e != -1) this.EventBus.broadcast(window.TinychatApp.BLL.UserlistUpdateUserEvent.ID, new window.TinychatApp.BLL.UserlistUpdateUserEvent(c,d,e,f,this));
  816. }
  817. };
  818. window.TinychatApp.BLL.Userlist.prototype.sorting = function(a) {
  819. a.sort((c,a)=>{
  820. return (a.subscriptionType - c.subscriptionType || (a.isOperator ? 1 : 0) - (c.isOperator ? 1 : 0) || (a.isBroadcasting ? 1 : 0) - (c.isBroadcasting ? 1 : 0) || a.giftpoints - c.giftpoints || c.nickname.toLowerCase().localeCompare(a.nickname.toLowerCase()) || c.handle - a.handle);
  821. });
  822. };
  823. if (CTS.StorageSupport) {
  824. window.TinychatApp.BLL.SettingsFeature.prototype.getSettings = function() {
  825. var A = this._get("tinychat_settings");
  826. try {
  827. A = Object.assign(new window.TinychatApp.DAL.SettingsEntity(), JSON.parse(A));
  828. } catch (E) {}
  829. if (A !== undefined) {
  830. CTS.enableSound = A.enableSound;
  831. if (CTS.enablePMs !== A.enablePMs) {
  832. CTS.enablePMs = A.enablePMs;
  833. PMShow();
  834. }
  835. }
  836. return ((void 0 == A || "object" !== typeof A) && (A = new window.TinychatApp.DAL.SettingsEntity()) || A);
  837. };
  838. }
  839. window.TinychatApp.BLL.ChatRoom.prototype.prepareStream = function(a) {
  840. function b() {
  841. if (null == c.mediaStreamCanvas) return;
  842. d.clearRect(0, 0, c.mediaStreamCanvas.width, c.mediaStreamCanvas.height);
  843. var a = c.mediaStreamVideo.videoHeight,
  844. e = c.mediaStreamVideo.videoWidth;
  845. c.mediaStreamCanvas.width = e;
  846. c.mediaStreamCanvas.height = a;
  847. window.TinychatApp.BLL.VideoFilters.getFilter(CTS.MediaStreamFilter).apply(d, e, a);
  848. d.drawImage(c.mediaStreamVideo, 0, 0, e, a, 0, 0, c.mediaStreamCanvas.width, c.mediaStreamCanvas.height);
  849. requestAnimationFrame(b);
  850. }
  851. this.mediaStreamOrigin = a;
  852. this.mediaStreamVideo = document.createElement("video");
  853. this.mediaStreamVideo.srcObject = this.mediaStreamOrigin;
  854. this.mediaStreamVideo.pause();
  855. this.mediaStreamVideo.oncanplay = function() {
  856. requestAnimationFrame(b);
  857. };
  858. this.mediaStreamVideo.autoplay = !0;
  859. this.mediaStreamVideo.muted = !0;
  860. this.mediaStreamCanvas = document.createElement("canvas");
  861. var c = this,
  862. d = this.mediaStreamCanvas.getContext("2d");
  863. this.mediaStreamVideo.play();
  864. var e = this.mediaStreamCanvas.captureStream(15);
  865. return (e.addTrack(this.mediaStreamOrigin.getAudioTracks()[0]) || e);
  866. };
  867. window.TinychatApp.BLL.ChatRoom.prototype.applyFilter = function(a) {
  868. this.mediaStreamFilter = a;
  869. CTS.MediaStreamFilter = a;
  870. Save("MediaStreamFilter", CTS.MediaStreamFilter);
  871. };
  872. window.TinychatApp.BLL.Videolist.prototype.toggleHiddenVW = function(a) {
  873. var b = window.TinychatApp.getInstance().defaultChatroom._videolist.items.indexOf(a);
  874. if (b != -1) {
  875. var username = a.userentity.username.toUpperCase(),
  876. index = CTS.HiddenCameraList.indexOf(username.toUpperCase());
  877. if(username === "GUEST") {
  878. a.hidden = !a.hidden;
  879. } else {
  880. if (a.hidden) {
  881. a.hidden = false;
  882. if (index !== -1) {
  883. //REMOVE
  884. if (arguments[1] === undefined) {
  885. debug("HIDDENCAMERALIST::", "REMOVE USER " + username + " FROM HIDDENCAMERALIST");
  886. Alert(GetActiveChat(), "✓ Removing " + username + " from hiddencameralist!");
  887. CommandList.hiddencameraremove(index);
  888. }
  889. }
  890. } else {
  891. a.hidden = true;
  892. if (index === -1) {
  893. //ADD
  894. if (arguments[1] === undefined) {
  895. debug("HIDDENCAMERALIST::", "ADD USER " + username + " TO HIDDEN CAMERA LIST");
  896. Alert(GetActiveChat(), "✓ Adding " + username + " to hidden camera list!");
  897. CommandList.hiddencameraadd(username);
  898. }
  899. }
  900. }
  901. }
  902. a.mute = ((CTS.Me.username === username) ? true : a.mute);
  903. window.TinychatApp.getInstance().defaultChatroom._videolist._pauseMediaStream(a.mediastream, a.hidden);
  904. if (!a.hidden) window.TinychatApp.getInstance().defaultChatroom._videolist._muteMediaStream(a.mediastream, a.mute);
  905. let d = new window.TinychatApp.BLL.VideolistEvent(window.TinychatApp.BLL.VideolistAction.Update,a,b);
  906. window.TinychatApp.getInstance().defaultChatroom._videolist.EventBus.broadcast(window.TinychatApp.BLL.VideolistEvent.ID, d);
  907. }
  908. };
  909. window.fullscreenManager.status = () =>{
  910. if (CTS.isFullScreen !== (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen)) {
  911. CTS.isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
  912. // Fix FullScreen
  913. MainElement.querySelector("#room").classList.toggle("full-screen");
  914. }
  915. return document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
  916. };
  917. //REMOVE
  918. Remove(ChatLogElement, 'span[id="input-unread"]');
  919. Remove(ChatLogElement, "#chat-content");
  920. //SETTINGS PREPARE
  921. if (CTS.enablePMs === false) PMShow();
  922. //LOAD
  923. CTSRoomLoad();
  924. }
  925.  
  926. function CTSRoomLoad() {
  927. var element;
  928. //EVENT LISTENERS
  929. if (!CTS.ThemeChange) {
  930. // BOOT UP OG THEME
  931. var finishoff = false;
  932. while (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter || CTS.OGStyle.SavedWidth !== CTS.OGStyle.WidthCounter) {
  933. if (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter) {
  934. ChatHeightToggled();
  935. } else {
  936. finishoff = true;
  937. }
  938. if (CTS.OGStyle.SaveWidth !== CTS.OGStyle.WidthCounter && finishoff) ChatWidthToggled();
  939. }
  940. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  941. ChatHeightToggled();
  942. Save("OGStyleHeight", CTS.OGStyle.HeightCounter);
  943. }, {
  944. passive: true
  945. });
  946. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  947. ChatWidthToggled();
  948. Save("OGStyleWidth", JSON.stringify(CTS.OGStyle.WidthCounter));
  949. }, {
  950. passive: true
  951. });
  952. } else {
  953. if (!CTS.Project.isTouchScreen) {
  954. element = document.createElement("div");
  955. element.setAttribute("id", "chat-hide");
  956. ChatLogElement.querySelector("#chat-wider").parentNode.insertBefore(element, ChatLogElement.querySelector("#chat-wider"));
  957. ChatLogElement.querySelector("#chat-hide").addEventListener("click", function() {
  958. ChatHide();
  959. }, {
  960. passive: true
  961. });
  962. }
  963. }
  964. element = document.createElement("button");
  965. element.setAttribute("id", "chat-download");
  966. element.setAttribute("class", "chat-button");
  967. element.setAttribute("title", "Download copy of chat-log");
  968. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  969. ChatLogElement.querySelector("#chat-download").textContent = "📋";
  970. ChatLogElement.querySelector("#chat-download").addEventListener("click", function() {
  971. var len = CTS.UserList.length,
  972. t = "Users : " + len + "\n",
  973. c;
  974. for (c = 0; c < len; c++) {
  975. if (c) { // 0 = false
  976. t += ", ";
  977. if (c % 10 === 0) t += "\n";
  978. }
  979. t += CTS.UserList[c].username + " (" + CTS.UserList[c].nick + ")";
  980. }
  981. t += "\n\n";
  982. len = CTS.Message[GetActiveChat()].length;
  983. 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");
  984. Export("TinyChat_" + CTS.Room.Name.toUpperCase() + " " + DateTime() + ".log", "Room : " + CTS.Room.Name + "\n" + t);
  985. }, {
  986. passive: true
  987. });
  988. element = document.createElement("button");
  989. element.setAttribute("id", "chat-export");
  990. element.setAttribute("class", "chat-button");
  991. element.setAttribute("title", "Export your saved CTS settings");
  992. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  993. ChatLogElement.querySelector("#chat-export").textContent = "📤";
  994. ChatLogElement.querySelector("#chat-export").addEventListener("click", function() {
  995. var tempobj = {};
  996. for (var i = 0; i < localStorage.length; i++){
  997. if (localStorage.key(i).substring(0,4) == 'CTS_') {
  998. tempobj[localStorage.key(i)] = localStorage[localStorage.key(i)];
  999. }
  1000. }
  1001. Export("CTS_Settings_" + DateTime() + ".backup", JSON.stringify(tempobj));
  1002. }, {
  1003. passive: true
  1004. });
  1005. element = document.createElement("label");
  1006. element.setAttribute("for", "chat-import");
  1007. element.setAttribute("class", "chat-button");
  1008. element.setAttribute("title", "Import your saved CTS settings");
  1009. element.setAttribute("id", "chat-import-label");
  1010. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1011. ChatLogElement.querySelector("#chat-import-label").textContent = "📥";
  1012. element = document.createElement("input");
  1013. element.setAttribute("type", "file");
  1014. element.setAttribute("id", "chat-import");
  1015. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1016. ChatLogElement.querySelector("#chat-import").addEventListener('change', function(e) {
  1017. var file = ChatLogElement.querySelector("#chat-import").files[0],
  1018. reader = new FileReader();
  1019. reader.readAsText(file);
  1020. reader.onload = function() {
  1021. try {
  1022. var resp = JSON.parse(reader.result);
  1023. if (resp !== null) {
  1024. var keys = Object.keys(resp),
  1025. ready = true;
  1026. Alert(GetActiveChat(), "- Scanning backup!");
  1027. for (var a = 0; a < keys.length; a++) {
  1028. if (keys[a].substring(0,4) !== 'CTS_') ready = false;
  1029. }
  1030. if (ready) {
  1031. Alert(GetActiveChat(), "✓ Backup looks good!");
  1032. var localkeys = Object.keys(localStorage),
  1033. locallen = localkeys.length;
  1034. Alert(GetActiveChat(), "- Clearing Storage!");
  1035. for (var b = 0; b < locallen; b++) {
  1036. if (localkeys[b].substring(0, 4) === "CTS_") localStorage.removeItem(localkeys[b]);
  1037. }
  1038. Alert(GetActiveChat(), "✓ Storage cleared!\n- Applying CTS Backup!");
  1039. for (var c = 0; c < keys.length; c++) {
  1040. localStorage.setItem(keys[c], resp[keys[c]]);
  1041. }
  1042. Alert(GetActiveChat(), "✓ All done!\n\nYou'll auto-refresh shortly!");
  1043. setTimeout(function() {
  1044. location.reload();
  1045. }, 3000);
  1046. }
  1047. }
  1048. } catch (e) {
  1049. debug("BACKUP::ERROR", e);
  1050. }
  1051. };
  1052. reader.onerror = function() {
  1053. debug("BACKUP::ERROR", "Something went wrong...");
  1054. };
  1055. });
  1056.  
  1057. if (!CTS.Project.isTouchScreen) {
  1058. VideoListElement.querySelector("#ThemeChange").addEventListener("click", function() {
  1059. CTS.ThemeChange = !CTS.ThemeChange;
  1060. Save("ThemeChange", JSON.stringify(CTS.ThemeChange));
  1061. location.reload();
  1062. }, {
  1063. passive: true
  1064. });
  1065. }
  1066. VideoListElement.querySelector("#PerformanceModeToggled").addEventListener("click", function() {
  1067. if (CTS.ChatDisplay) {
  1068. CTS.PerformanceMode = !CTS.PerformanceMode;
  1069. Save("PerformanceMode", JSON.stringify(CTS.PerformanceMode));
  1070. PerformanceModeInit(CTS.PerformanceMode);
  1071. }
  1072. }, {
  1073. passive: true
  1074. });
  1075. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  1076. CTS.Featured = !CTS.Featured;
  1077. Save("Featured", JSON.stringify(CTS.Featured));
  1078. FeaturedCameras(CTS.Featured);
  1079. Resize();
  1080. }, {
  1081. passive: true
  1082. });
  1083. VideoListElement.querySelector("#CameraBorderToggled").addEventListener("click", function() {
  1084. CTS.CameraBorderToggle = !CTS.CameraBorderToggle;
  1085. Save("CameraBorderToggle", JSON.stringify(CTS.CameraBorderToggle));
  1086. Cameras();
  1087. Resize();
  1088. }, {
  1089. passive: true
  1090. });
  1091. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  1092. CTS.ChatStyleCounter++;
  1093. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1094. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1095. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1096. var len = window.CTSChatCSS.length - 1;
  1097. if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
  1098. StyleSet();
  1099. Save("ChatStyle", CTS.ChatStyleCounter);
  1100. }, {
  1101. passive: true
  1102. });
  1103. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  1104. UpdateScroll(1, true);
  1105. CheckUnreadMessage();
  1106. }, {
  1107. passive: true
  1108. });
  1109. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  1110. var element = event.target;
  1111.  
  1112. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage(true);
  1113. }, {
  1114. passive: true
  1115. });
  1116. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  1117. var element = event.target;
  1118. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  1119. }, {
  1120. passive: true
  1121. });
  1122. if (CTS.NotificationToggle === 0) {
  1123. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  1124. passive: true
  1125. });
  1126. }
  1127. VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
  1128. var arg;
  1129. if (this.innerText === "→") {
  1130. this.innerText = "←";
  1131. arg = "block";
  1132. } else {
  1133. this.innerText = "→";
  1134. arg = "none";
  1135. }
  1136. VideoListElement.querySelector("#videos-header-sound").style.display = arg;
  1137. if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
  1138. //VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
  1139. VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
  1140. VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
  1141. }, {
  1142. passive: true
  1143. });
  1144. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  1145. if (!Addon.active("BGIMG")) {
  1146. CTS.MainBackgroundCounter++;
  1147. if (CTS.MainBackgroundCounter === window.CTSImages.length) CTS.MainBackgroundCounter = 0;
  1148. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  1149. document.body.style.background = background;
  1150. Save("MainBackground", background);
  1151. }
  1152. }, {
  1153. passive: true
  1154. });
  1155. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  1156. if (!Addon.active("BGIMG")) {
  1157. CTS.MainBackgroundCounter--;
  1158. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = window.CTSImages.length - 1;
  1159. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  1160. document.body.style.background = background;
  1161. Save("MainBackground", background);
  1162. }
  1163. }, {
  1164. passive: true
  1165. });
  1166. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  1167. CTS.FontSize += 5;
  1168. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  1169. Save("FontSize", CTS.FontSize);
  1170. TextAreaElement.style.fontSize = (CTS.FontSize - 4) + "px";
  1171. LoadMessage();
  1172. }, {
  1173. passive: true
  1174. });
  1175. VideoListElement.querySelector("button[id=\"ChatCompact\"]").addEventListener("click", function() {
  1176. CTS.ChatType = !CTS.ChatType;
  1177. Save("ChatType", CTS.ChatType);
  1178. LoadMessage();
  1179. }, {
  1180. passive: true
  1181. });
  1182.  
  1183. TextAreaElement.oninput = function() {
  1184. CTS.Clipboard.Log = TextAreaElement.value;
  1185. };
  1186. TextAreaElement.onkeyup = function(e) {
  1187. e = e || window.event;
  1188. if (e.keyCode == 13) {
  1189. // SAVE CLIPBOARD
  1190. CTS.Clipboard.Message.push(CTS.Clipboard.Log);
  1191. if (CTS.Clipboard.Message.length > 3) CTS.Clipboard.Message.shift();
  1192. CTS.Clipboard.MessageLen = CTS.Clipboard.Message.length-1;
  1193. } else if (e.keyCode == 40) {
  1194. // NAVIGATE CLIPBOARD (IF TYPING IS FALSE)
  1195. if (CTS.Clipboard.Message.includes(CTS.Clipboard.Log)) {
  1196. CTS.Clipboard.Counter = ((TextAreaElement.value == "") ? 0 : ((CTS.Clipboard.Counter >= CTS.Clipboard.MessageLen) ? 0 : (CTS.Clipboard.Counter + 1)));
  1197. TextAreaElement.value = CTS.Clipboard.Message[CTS.Clipboard.Counter];
  1198. }
  1199. } else if (e.keyCode == 38) {
  1200. // NAVIGATE CLIPBOARD (IF TYPING IS FALSE)
  1201. if (CTS.Clipboard.Message.includes(CTS.Clipboard.Log)) {
  1202. CTS.Clipboard.Counter = ((TextAreaElement.value == "") ? CTS.Clipboard.MessageLen : ((CTS.Clipboard.Counter <= 0) ? CTS.Clipboard.MessageLen : (CTS.Clipboard.Counter - 1)));
  1203. TextAreaElement.value = CTS.Clipboard.Message[CTS.Clipboard.Counter];
  1204. }
  1205. }
  1206. };
  1207. //MUTATION OBSERVERS
  1208. new MutationObserver(function() {
  1209. LoadMessage();
  1210. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  1211. attributes: true,
  1212. attributeFilter: ["class"],
  1213. childList: false,
  1214. characterData: false
  1215. });
  1216. new MutationObserver(function() {
  1217. Cameras();
  1218. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  1219. childList: true
  1220. });
  1221. new MutationObserver(function() {
  1222. Cameras();
  1223. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  1224. childList: true
  1225. });
  1226. new MutationObserver(function() {
  1227. if (CTS.AutoMicrophone) {
  1228. OpenMicrophone();
  1229. }
  1230. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  1231. attributes: true,
  1232. attributeFilter: ["class"]
  1233. });
  1234. //BOOT UP - FIRST START
  1235. NotificationDisplay();
  1236. FeaturedCameras(CTS.Featured);
  1237. Cameras();
  1238. }
  1239. //YOUTUBE FUNCTIONS
  1240. function VerifyYouTube() {
  1241. // Check Mod/JRMod
  1242. if (CTS.UserList[arguments[0]].mod || CTS.BotModList.includes(CTS.UserList[arguments[0]].username)) return true;
  1243. // Check OP
  1244. if(CTS.UserYT) {
  1245. if (CTS.BotOPList.includes(CTS.UserList[arguments[0]].username)) return true;
  1246. if (CTS.BotOPList.includes("-ALL") && isSafeListed(CTS.UserList[arguments[0]].username)) return true;
  1247. }
  1248. return false;
  1249. }
  1250.  
  1251. function CheckHost() {
  1252. if (CTS.Host === 0) {
  1253. Send("msg", "!whoisbot");
  1254. CTS.HostAttempt = 0;
  1255. CTS.HostWaiting = true;
  1256. }
  1257. }
  1258.  
  1259. function SetBot() {
  1260. if (arguments[0]) CTS.Game.NoReset = true;
  1261. Send("msg", "!bot");
  1262. CTS.HostWaiting = false;
  1263. }
  1264.  
  1265. function CheckYouTube() {
  1266. //CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
  1267. if (arguments[3] === undefined) arguments[3] = true;
  1268. CTS.YouTube.XHR.type = arguments[1];
  1269. 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);
  1270. if (videoid !== null) {
  1271. videoid = videoid[1].replace(/v\=/g, "");
  1272. //LINK IS PLAYLIST
  1273. if (videoid.match(/list\=/i)) {
  1274. if (arguments[3]) {
  1275. videoid = videoid.replace(/list\=/, "");
  1276. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  1277. 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);
  1278. CTS.YouTube.XHR.send();
  1279. }
  1280. } else {
  1281. //LINK IS REGULAR
  1282. CTS.YouTube.XHR.videoid = videoid;
  1283. CTS.YouTube.VideoReturn = true;
  1284. 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);
  1285. CTS.YouTube.XHR.send();
  1286. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  1287. }
  1288. } else {
  1289. //KEYWORD SEARCH
  1290. if (CTS.YouTube.MessageQueueList.length <= 0) {
  1291. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  1292. CTS.YouTube.SearchReturn = true;
  1293. 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");
  1294. CTS.YouTube.XHR.send();
  1295. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  1296. }
  1297. }
  1298. }
  1299.  
  1300. function YoutubeBypass() {
  1301. 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);
  1302. if (videoid !== null) {
  1303. CTS.SocketTarget.send(JSON.stringify({
  1304. "tc": "yut_play",
  1305. "item": {
  1306. "id": videoid[1],
  1307. "duration": 7200,
  1308. "offset": 0,
  1309. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1310. }
  1311. }));
  1312. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1313. }
  1314. }
  1315.  
  1316. function YouTubePlayList() {
  1317. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  1318. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  1319. }
  1320.  
  1321. function YouTubeTrackAdd() {
  1322. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  1323. if (CTS.YouTube.Busy === false) {
  1324. if (CTS.YouTube.MessageQueueList.length > 0) {
  1325. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  1326. 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);
  1327. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  1328. CTS.YouTube.XHR.send();
  1329. CTS.YouTube.MessageQueueList.shift();
  1330. }
  1331. }
  1332. }
  1333. }
  1334.  
  1335. function YouTubePlayListItems() {
  1336. var len = arguments[0].length;
  1337. for (var i = 0; i < len; i++) {
  1338. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  1339. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  1340. }
  1341. }
  1342. }
  1343.  
  1344. function YouTubeTimeConvert() {
  1345. //TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
  1346. var a = arguments[0].match(/\d+/g);
  1347. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  1348. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  1349. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  1350. var len = a.length;
  1351. arguments[0] = 0;
  1352. if (len == 3) {
  1353. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  1354. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  1355. arguments[0] = arguments[0] + parseInt(a[2]);
  1356. }
  1357. if (len == 2) {
  1358. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  1359. arguments[0] = arguments[0] + parseInt(a[1]);
  1360. }
  1361. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  1362. return arguments[0];
  1363. }
  1364.  
  1365. function BotCommandCheck() {
  1366. //USER COMMANDS TO HOST
  1367. if (isCommand(arguments[1])) {
  1368. if (arguments[1].match(/^!play$|^!yt |^!ytbypass |^!ytclear$|^!ytskip$|^!ytqueue$/i)) {
  1369. BotCommandCheckYT(arguments[0], arguments[1]);
  1370. } else if (arguments[1].match(/^!userkick |^!userban |^!userclose |^!nickkick |^!nickban |^!nickclose /i)) {
  1371. BotCommandCheckJR(arguments[0], arguments[1]);
  1372. } else if (arguments[1].match(/^!whoisbot$|^!8ball |^!vote |^!coin$|^!chuck$|^!urb |^!dad$|^!advice$/i)) {
  1373. BotCommandCheckPUB(arguments[0], arguments[1]);
  1374. } else if (CTS.UserList[arguments[0]].canGame && CTS.CanHostFishGames) {
  1375. FishCommandCheck(arguments[0], arguments[1]);
  1376. }
  1377. }
  1378. if (CTS.Game.Trivia.Started && CTS.CanHostTriviaGames && arguments[1].match(/^!iq$|^!triviahelp$|^!triviashop$|^!raid |^!ytbypass |^!spot$|^[a-d]$/i))TriviaCommandCheck(arguments[0], arguments[1]);
  1379. }
  1380.  
  1381. function TriviaCommandCheck() {
  1382. var User = CTS.UserList[arguments[0]];
  1383. if (User.canGame) {
  1384. if (isSafeListed(User.username)) {
  1385. if (!isCommand(arguments[1])) {
  1386. //NO CHEATERS
  1387. var Guessed = CTS.Game.Trivia.AttemptList.includes(User.username);
  1388. if (arguments[1].length == 1 && CTS.Game.Trivia.ANum.includes(arguments[1].toUpperCase()) && !Guessed && !CTS.Game.Trivia.Waiting) {
  1389. if (CTS.Game.Trivia.Correct === arguments[1].toUpperCase()) {
  1390. // Save Progress
  1391. User.triviapoints += CTS.Game.Trivia.Worth;
  1392. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1393. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1394. // Send Output
  1395. 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!");
  1396. if(User.triviapoints > CTS.Game.Trivia.HighScore[1]) {
  1397. CTS.Game.Trivia.HighScore[0] = User.username;
  1398. CTS.Game.Trivia.HighScore[1] = User.triviapoints;
  1399. // Save HighScore
  1400. Save("TriviaHighScore", JSON.stringify(CTS.Game.Trivia.HighScore));
  1401. }
  1402. // Wait
  1403. Trivia.Wait();
  1404. } else {
  1405. CTS.Game.Trivia.Attempts++;
  1406. CTS.Game.Trivia.AttemptList.push(User.username);
  1407. Send("msg", "[TRIVIA]\n" + User.username + " that's wrong however you may attempt next rounds question.");
  1408. if (CTS.Game.Trivia.Attempts == 3) {
  1409. Send("msg", "[TRIVIA]\nNobody got it!\nNext round will start in shortly.\nThe answer however was: " + CTS.Game.Trivia.Correct);
  1410. Trivia.Wait();
  1411. }
  1412. }
  1413. }
  1414. } else {
  1415. TriviaCommand(arguments[0], arguments[1]);
  1416. }
  1417. }
  1418. }
  1419. }
  1420.  
  1421. function TriviaCommand () {
  1422. var User = CTS.UserList[arguments[0]];
  1423. if(!User.mod && !CTS.BotModList.includes(User.username)) {
  1424. if (arguments[1].match(/^!ytbypass/i) && CTS.Room.YT_ON) {
  1425. if(CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.ytbypass) {
  1426. User.triviapoints -= CTS.Game.Trivia.PriceList.ytbypass;
  1427. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1428. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1429. 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!:)");
  1430. YoutubeBypass(arguments[1]);
  1431. } else {
  1432. TriviaTooPoor(User.username);
  1433. }
  1434. }
  1435. }
  1436. if (CTS.Me.owner) {
  1437. if (!User.owner) {
  1438. if (arguments[1].match(/^!raid /i)) {
  1439. if(CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.raid) {
  1440. var raid = arguments[1].match(/^(?:!raid )(?:<a href=")(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})/i);
  1441. if (raid !== null) {
  1442. User.triviapoints -= CTS.Game.Trivia.PriceList.raid;
  1443. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1444. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1445. 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!");
  1446. Send("msg", "[TRIVIA]\nREMEMBER HAVE FUN IF YOU DON'T WARP CLICK THE LINK SHORTLY!\n\nhttps://tinychat.com/room/" + raid[1]);
  1447. // WAIT
  1448. setTimeout(function() {
  1449. Send("msg", "!raid https://tinychat.com/room/" + raid[1]);
  1450. }, 10000);
  1451. } else {
  1452. 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!");
  1453. }
  1454. } else {
  1455. TriviaTooPoor(User.username);
  1456. }
  1457. } else if (arguments[1].match(/^!spot$/i)) {
  1458. if(CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.spot) {
  1459. var rand = Rand(0, CTS.Camera.List.length - 1),
  1460. target = HandleToUser(CTS.Camera.List[rand]);
  1461. if (target != -1) {
  1462. User.triviapoints -= CTS.Game.Trivia.PriceList.spot;
  1463. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1464. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1465. 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");
  1466. if (CTS.UserList[target].handle !== CTS.Me.handle) {
  1467. Send("stream_moder_close", CTS.Camera.List[rand]);
  1468. } else {
  1469. CTS.SocketTarget.send(JSON.stringify({
  1470. "tc": "stream_close",
  1471. "handle": CTS.Me.handle
  1472. }));
  1473. }
  1474. }
  1475. } else {
  1476. TriviaTooPoor(User.username);
  1477. }
  1478. }
  1479. }
  1480. }
  1481. if (arguments[1].match(/^!triviashop$/i)) {
  1482. 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]");
  1483. } else if (arguments[1].match(/^!triviahelp$/i)) {
  1484. Send("msg", "[TRIVIA]\n!iq\n!triviashop");
  1485. } else if (arguments[1].match(/^!iq$/i)) {
  1486. Send("msg", "[TRIVIA]\n" + User.username + ",\nYou have an IQ of " + User.triviapoints + ".");
  1487. }
  1488. }
  1489.  
  1490. function TriviaTooPoor() {
  1491. Send("msg", "[TRIVIA]\n" + arguments[0] + ",\nyou cannot afford this right now!");
  1492. }
  1493.  
  1494. function BotCommandCheckYT() {
  1495. //ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
  1496. if (CTS.Room.YT_ON) {
  1497. if (arguments[1].match(/^!play$/i)) {
  1498. if (CTS.UserList[arguments[0]].mod) YouTubePlayList();
  1499. } else if (arguments[1].match(/^!yt /i)) {
  1500. BotCommand(1, arguments[0], arguments[1]);
  1501. } else if (arguments[1].match(/^!ytbypass /i)) {
  1502. BotCommand(6, arguments[0], arguments[1]);
  1503. } else if (arguments[1].match(/^!ytclear$/i)) {
  1504. BotCommand(2, arguments[0]);
  1505. } else if (arguments[1].match(/^!ytskip$/i)) {
  1506. BotCommand(3, arguments[0]);
  1507. } else if (arguments[1].match(/^!ytqueue$/i)) {
  1508. BotCommand(4, arguments[0]);
  1509. }
  1510. }
  1511. }
  1512.  
  1513. function BotCommandCheckJR() {
  1514. //MOD/JR.MOD
  1515. if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
  1516. if (arguments[1].match(/^!userkick /i)) {
  1517. ModCommand("kick", arguments[1], true);
  1518. } else if (arguments[1].match(/^!userban /i)) {
  1519. ModCommand("ban", arguments[1], true);
  1520. } else if (arguments[1].match(/^!userclose /i)) {
  1521. ModCommand("stream_moder_close", arguments[1], true);
  1522. } else if (arguments[1].match(/^!nickkick /i)) {
  1523. ModCommand("kick", arguments[1], false);
  1524. } else if (arguments[1].match(/^!nickban /i)) {
  1525. ModCommand("ban", arguments[1], false);
  1526. } else if (arguments[1].match(/^!nickclose /i)) {
  1527. ModCommand("stream_moder_close", arguments[1], false);
  1528. }
  1529. }
  1530. }
  1531.  
  1532. function BotCommandCheckPUB() {
  1533. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  1534. if (arguments[1].match(/^!vote /i)) Vote(arguments[0], arguments[1]);
  1535. // PUBLIC COMMANDS
  1536. if (CTS.PublicCommandToggle) {
  1537. if (arguments[1].match(/^!8ball [\w\s]*\??/i)) {
  1538. if (CTS.UserList[arguments[0]].mod || isSafeListed(CTS.UserList[arguments[0]].username)) Send("msg", "[8BALL]\n" + window.CTSEightBall[Rand(0, window.CTSEightBall.length - 1)]);
  1539. } else if (arguments[1].match(/^!coin$/i)) {
  1540. 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") + "!");
  1541. } else {
  1542. if (arguments[1].match(/^!chuck$/i)) {
  1543. Chuck(CTS.UserList[arguments[0]].username);
  1544. } else if (arguments[1].match(/^!urb /i)) {
  1545. Urb(arguments[1], CTS.UserList[arguments[0]].username);
  1546. } else if (arguments[1].match(/^!dad$/i)) {
  1547. Dad(CTS.UserList[arguments[0]].username);
  1548. } else if (arguments[1].match(/^!advice$/i)) {
  1549. Advice(CTS.UserList[arguments[0]].username);
  1550. }
  1551. }
  1552. }
  1553. }
  1554.  
  1555. function BotCheck() {
  1556. if (CTS.UserList[arguments[0]].mod) {
  1557. //CHECK HOST
  1558. if (arguments[1].match(/^!bot$/i)) {
  1559. //SET HOST
  1560. CTS.Host = arguments[2].handle;
  1561. CTS.HostWaiting = false;
  1562. //RESET GAMES
  1563. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  1564. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  1565. if (CTS.Me.handle !== arguments[2].handle) {
  1566. CTS.Game.NoReset = false;
  1567. Fish.Reset(true);
  1568. // Reset Trivia
  1569. Trivia.Reset();
  1570. }
  1571. }
  1572. //IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
  1573. if (CTS.Me.handle == arguments[2].handle && CTS.Room.YT_ON) YouTubePlayList();
  1574. //ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
  1575. } else if (CTS.HostWaiting === true) {
  1576. CTS.HostAttempt++;
  1577. //SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
  1578. if (CTS.HostAttempt == 1) {
  1579. setTimeout(function() {
  1580. //CHECK WAITING STATE OR IF HOST HAS CHANGED
  1581. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  1582. }, 10000);
  1583. }
  1584. //SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
  1585. if (CTS.HostAttempt == 10) SetBot(false);
  1586. }
  1587. }
  1588. }
  1589.  
  1590. function Chuck() {
  1591. //OPEN REQUEST
  1592. if (isSafeListed(arguments[0])) {
  1593. CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
  1594. CTS.Chuck.XHR.send();
  1595. }
  1596. }
  1597.  
  1598. function Urb() {
  1599. //CHECK TERM
  1600. if (isSafeListed(arguments[1])) {
  1601. var urban = arguments[0].match(/^!urb ([\w ]*)/i);
  1602. if (urban !== null) {
  1603. //OPEN REQUEST
  1604. CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
  1605. CTS.Urb.XHR.send();
  1606. }
  1607. }
  1608. }
  1609.  
  1610. function Dad() {
  1611. //OPEN REQUEST
  1612. if (isSafeListed(arguments[0])) {
  1613. CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
  1614. CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
  1615. CTS.Dad.XHR.send();
  1616. }
  1617. }
  1618.  
  1619. function Advice() {
  1620. //OPEN REQUEST
  1621. if (isSafeListed(arguments[0])) {
  1622. CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
  1623. CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
  1624. CTS.Advice.XHR.send();
  1625. }
  1626. }
  1627.  
  1628. function Events() {
  1629. //OPEN REQUEST
  1630. CTS.Events.XHR.open("GET", "https://api.github.com/gists/c9bad840fb19bf2e6638126c8e430d40");
  1631. CTS.Events.XHR.setRequestHeader("Accept", "application/json");
  1632. CTS.Events.XHR.send();
  1633. }
  1634. //MESSAGE FUNCTION
  1635. function CreateMessage() {
  1636. //SCROLLED UP? MISSED A MESSAGE?
  1637. CheckUnreadMessage();
  1638. // POST NEW CHAT ITEM IF ACTIVECHAT IS OUR CURRENT CHAT
  1639. if (arguments[7] == GetActiveChat()) {
  1640. var stack = ChatLogElement.querySelector("#cts-chat-content>.message:last-child cts-message-html:last-child");
  1641. if (arguments[4] == CTS.CreateMessageLast && stack !== null && CTS.ChatType) {
  1642. // Stack
  1643. 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>");
  1644. } else {
  1645. CTS.CreateMessageLast = arguments[4];
  1646. 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>");
  1647. }
  1648. } else {
  1649. CTS.CreateMessageLast = undefined;
  1650. }
  1651. UpdateScroll(1, false);
  1652. }
  1653.  
  1654. function LoadMessage() {
  1655. var Chat = ChatLogElement.querySelector("#cts-chat-content");
  1656. CTS.ChatScroll = true;
  1657. Chat.innerHTML = "";
  1658. CheckUnreadMessage();
  1659. if (CTS.Message[GetActiveChat()]) {
  1660. //POST MESSAGE
  1661. var len = CTS.Message[GetActiveChat()].length,
  1662. LoadMessageLast;
  1663. for (var ChatIndex = 0; ChatIndex < len; ChatIndex++) {
  1664. if (CTS.Message[GetActiveChat()][ChatIndex].nick == LoadMessageLast && CTS.ChatType) {
  1665. // Stack
  1666. 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>");
  1667. } else {
  1668. LoadMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1669. 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>");
  1670. }
  1671. if(ChatIndex == (len-1)) CTS.CreateMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1672. }
  1673. } else {
  1674. //START PM
  1675. CTS.Message[GetActiveChat()] = [];
  1676. }
  1677. UpdateScroll(1, false);
  1678. UpdateScroll(2, false);
  1679. }
  1680.  
  1681. function CreateServerEvent() {
  1682. CTS.Message[0].push({
  1683. "time": Time(),
  1684. "namecolor": "#3f69c0",
  1685. "avatar": "",
  1686. "username": "",
  1687. "nick": "SERVER EVENT",
  1688. "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>",
  1689. "mention": true
  1690. });
  1691. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1692. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, arguments[0]);
  1693. UpdateScroll(1, true);
  1694. }
  1695.  
  1696. window.CreateGift = function() {
  1697. var gift = arguments[0].gift,
  1698. from = (!gift.anon) ? arguments[0].from.name : "ANONYMOUS",
  1699. to = arguments[0].to.name,
  1700. comment = (comment = gift.comment) ? gift.comment : "";
  1701. CTS.Message[0].push({
  1702. "time": Time(),
  1703. "namecolor": "#3f69c0",
  1704. "avatar": "",
  1705. "username": "",
  1706. "nick": "SPECIAL DELIVERY",
  1707. "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>",
  1708. "mention": true
  1709. });
  1710. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  1711. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  1712. if (CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) window.CTSSound.GIFT.play();
  1713. UpdateScroll(1, true);
  1714. };
  1715.  
  1716. function AKB() {
  1717. //WATCH OR REMOVE USERS
  1718. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  1719. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  1720. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  1721. } else {
  1722. if (CTS.Me.mod) {
  1723. if (CTS.AutoKick === true) {
  1724. CTS.NoGreet = true;
  1725. Send("kick", arguments[1]);
  1726. } else if (CTS.AutoBan === true) {
  1727. CTS.NoGreet = true;
  1728. Send("ban", arguments[1]);
  1729. }
  1730. }
  1731. }
  1732. }
  1733.  
  1734. function AKBS() {
  1735. if (arguments[0].username !== "") {
  1736. //EXTENDED SAFELIST
  1737. var temp = [];
  1738. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1739. //DEFAULT SAFELIST
  1740. if (!isSafeListed(arguments[0].username.toUpperCase())) {
  1741. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  1742. if (CTS.SafeList.length < 5000) {
  1743. CTS.SafeList.push(arguments[0].username.toUpperCase());
  1744. Save("AKB", JSON.stringify(CTS.SafeList));
  1745. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1746. }
  1747. } else {
  1748. if (arguments[0].lurker === false) {
  1749. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1750. } else {
  1751. AKB(false, arguments[0].handle);
  1752. }
  1753. }
  1754. }
  1755. } else {
  1756. AKB(false, arguments[0].handle);
  1757. }
  1758. }
  1759.  
  1760. function CheckSafeList() {
  1761. var target = HandleToUser(arguments[0]);
  1762. if (target !== -1) {
  1763. var a = CTS.SafeList.indexOf(CTS.UserList[target].username);
  1764. if (a !== -1) {
  1765. //REMOVE
  1766. if (arguments[1]) {
  1767. debug("SAFELIST::", "REMOVE USER " + CTS.UserList[target].username + " FROM SAFELIST");
  1768. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[target].username + " from safelist!");
  1769. CommandList.saferemove(a);
  1770. } else {
  1771. //GETID
  1772. return a;
  1773. }
  1774. }
  1775. }
  1776. }
  1777.  
  1778. function CheckUnreadMessage() {
  1779. if ((Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) || arguments[0] !== undefined) {
  1780. CTS.MissedMsg = 0;
  1781. CTS.ChatScroll = true;
  1782. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1783. } else {
  1784. CTS.MissedMsg++;
  1785. CTS.ChatScroll = false;
  1786. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1787. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1788. }
  1789. }
  1790.  
  1791. function GetActiveChat() {
  1792. var elem = ChatListElement.querySelector(".active");
  1793. if (elem) return elem.getAttribute("data-chat-id");
  1794. return 0;
  1795. }
  1796.  
  1797. function Discord() {
  1798. var element = document.createElement("button");
  1799. element.setAttribute("id", "chat-discord");
  1800. element.setAttribute("title", "CTS public chat");
  1801. element.setAttribute("class", "chat-button");
  1802. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1803. ChatLogElement.querySelector("#chat-discord").textContent = "💬Discord";
  1804. element = document.createElement("iframe");
  1805. element.setAttribute("class","chat-discord");
  1806. element.setAttribute("src","https://titanembeds.com/embed/662193343677333505?scrollbartheme=3d&theme=MetroEdge");
  1807. element.setAttribute("height","100%");
  1808. element.setAttribute("width","100%");
  1809. ChatLogElement.querySelector("#chat-discord").parentNode.insertBefore(element, ChatLogElement.querySelector("#chat-discord"));
  1810. ChatLogElement.querySelector("#chat-discord").addEventListener("click", DiscordToggle, {
  1811. passive: true
  1812. });
  1813. }
  1814.  
  1815. function DiscordToggle() {
  1816. CTS.Discord = !CTS.Discord;
  1817. ChatLogElement.querySelector(".chat-discord").style.visibility = ((CTS.Discord) ? "visible" : "hidden");
  1818. }
  1819.  
  1820. function CheckImgur() {
  1821. if (CTS.Imgur) {
  1822. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpeg|jpg|gif|png|mp4)/);
  1823. if (i !== null) {
  1824. CTS.ImgurWarning++;
  1825. 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>";
  1826. if (CTS.ImgurWarning < 2 && CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nYou can !imgurtoggle at anytime to stop unwanted images showing through.");
  1827. }
  1828. }
  1829. return arguments[0];
  1830. }
  1831.  
  1832. function TTS() {
  1833. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1834. utter.voice = CTS.TTS.voices[0];
  1835. utter.rate = 1.0;
  1836. utter.pitch = 0.5;
  1837. CTS.TTS.synth.speak(utter);
  1838. }
  1839.  
  1840. function isCommand() {
  1841. return arguments[0].match(/^!/);
  1842. }
  1843.  
  1844. function RoomUsers() {
  1845. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  1846. }
  1847.  
  1848. function LineSpam() {
  1849. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  1850. if (LineBreaks >= 14 && arguments[1] === false) return true;
  1851. return false;
  1852. }
  1853.  
  1854. function GamePrevention() {
  1855. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(FISHING BOAT|TRIVIA)\]/)) return false;
  1856. return true;
  1857. }
  1858.  
  1859. function UpdateScroll() {
  1860. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  1861. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true) && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  1862. }
  1863.  
  1864. function DecodeTXT() {
  1865. var txt = document.createElement("textarea");
  1866. txt.innerHTML = arguments[0];
  1867. return txt.value;
  1868. }
  1869.  
  1870. function HTMLtoTXT() {
  1871. var p = document.createElement("p");
  1872. var text = document.createTextNode(arguments[0]);
  1873. p.appendChild(text);
  1874. 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>");
  1875. }
  1876.  
  1877. function IgnoreText() {
  1878. if (arguments[0] !== "") {
  1879. if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
  1880. return true;
  1881. }
  1882. }
  1883.  
  1884. function TimeToDate() {
  1885. if (arguments[1] === undefined) arguments[1] = new Date();
  1886. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((?:am|pm))/i);
  1887. var t = {
  1888. hours: parseInt(match[1]),
  1889. minutes: parseInt(match[2]),
  1890. period: match[3].toLowerCase()
  1891. };
  1892. if (t.hours === 12) {
  1893. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  1894. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  1895. } else {
  1896. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  1897. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  1898. }
  1899. return arguments[1];
  1900. }
  1901.  
  1902. function PushPM() {
  1903. var text = HTMLtoTXT(arguments[1]),
  1904. list;
  1905. if (arguments[2] !== undefined) {
  1906. list = CTS.UserList[arguments[2]];
  1907. if (isSafeListed(CTS.UserList[arguments[2]].username)) text = CheckImgur(text);
  1908. } else {
  1909. list = CTS.Me;
  1910. text = CheckImgur(text);
  1911. }
  1912.  
  1913. CTS.Message[arguments[0]].push({
  1914. "time": Time(),
  1915. "namecolor": list.namecolor,
  1916. "avatar": list.avatar,
  1917. "username": list.username,
  1918. "nick": list.nick,
  1919. "msg": text,
  1920. "mention": false
  1921. });
  1922.  
  1923. if (arguments[0] == GetActiveChat()) {
  1924. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1925. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, msg.mention, arguments[0]);
  1926. UpdateScroll(1, false);
  1927. }
  1928. }
  1929.  
  1930. function Time() {
  1931. return (new Date().toLocaleString("en-US", {
  1932. hour: "numeric",
  1933. minute: "numeric",
  1934. second: "numeric",
  1935. hour12: true
  1936. }));
  1937. }
  1938.  
  1939. function DateTime() {
  1940. return (new Date().toLocaleString("en-US", {
  1941. year: 'numeric',
  1942. month: 'numeric',
  1943. day: 'numeric',
  1944. hour: "numeric",
  1945. minute: "numeric",
  1946. second: "numeric",
  1947. hour12: true
  1948. }));
  1949. }
  1950. //FEATURES
  1951. function StorageSupport() {
  1952. try {
  1953. if ("localStorage" in window && window.localStorage !== null) {
  1954. localStorage.setItem("CTS_StorageVerify", true);
  1955. localStorage.removeItem("CTS_StorageVerify");
  1956. return true;
  1957. }
  1958. } catch (e) {
  1959. return false;
  1960. }
  1961. }
  1962.  
  1963. function Export() {
  1964. var element = document.createElement("a");
  1965. element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(arguments[1]));
  1966. element.setAttribute("download", arguments[0]);
  1967. element.style.display = "none";
  1968. document.body.appendChild(element);
  1969. element.click();
  1970. document.body.removeChild(element);
  1971. }
  1972.  
  1973. function StyleSet() {
  1974. // Chat
  1975. var style = document.createElement("style");
  1976. style.setAttribute("id", CTS.ChatStyleCounter);
  1977. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][0] + ":host, #videolist {background-color:unset;}";
  1978. ChatLogElement.appendChild(style);
  1979. // Video
  1980. style = document.createElement("style");
  1981. style.setAttribute("id", CTS.ChatStyleCounter);
  1982. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][1] + ":host, #videolist {background-color:unset;}";
  1983. VideoListElement.appendChild(style);
  1984. // Side Menu
  1985. style = document.createElement("style");
  1986. style.setAttribute("id", CTS.ChatStyleCounter);
  1987. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][2] + ":host, #videolist {background-color:unset;}";
  1988. SideMenuElement.appendChild(style);
  1989. }
  1990.  
  1991. function ChatHeightToggled() {
  1992. CTS.OGStyle.HeightCounter++;
  1993. if (!CTS.ChatDisplay) {
  1994. CTS.ChatWidth += 5;
  1995. CTS.ChatDisplay = true;
  1996. }
  1997. CTS.ChatHeight -= 5;
  1998. CTS.UserListDisplay = true;
  1999. if (CTS.ChatHeight == 20) {
  2000. CTS.ChatHeight = 45;
  2001. CTS.UserListDisplay = false;
  2002. CTS.OGStyle.HeightCounter = 0;
  2003. }
  2004. 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;");
  2005. 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;");
  2006. 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;");
  2007. VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
  2008. 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;";
  2009. UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2010. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2011. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2012. PerformanceModeInit(CTS.PerformanceMode);
  2013. UpdateScroll(1, true);
  2014. UpdateScroll(2, true);
  2015. Resize();
  2016. }
  2017.  
  2018. function ChatWidthToggled() {
  2019. CTS.OGStyle.WidthCounter++;
  2020. CTS.ChatWidth += 5;
  2021. CTS.ChatDisplay = true;
  2022. if (CTS.ChatWidth == 25) {
  2023. CTS.ChatWidth = -5;
  2024. CTS.ChatDisplay = false;
  2025. CTS.OGStyle.WidthCounter = 0;
  2026. }
  2027. 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;");
  2028. 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;");
  2029. 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;");
  2030. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
  2031. 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;";
  2032. UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2033. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2034. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2035. CTS.PerformanceMode = false;
  2036. PerformanceModeInit(CTS.PerformanceMode);
  2037. UpdateScroll(1, true);
  2038. UpdateScroll(2, true);
  2039. Resize();
  2040. }
  2041.  
  2042. function ChatHide() {
  2043. CTS.NormalStyle.ChatHide = !CTS.NormalStyle.ChatHide;
  2044. ChatLogElement.querySelector("#chat-wrapper").style.display = (CTS.NormalStyle.ChatHide ? "none" : "block");
  2045. UpdateScroll(1, true);
  2046. UpdateScroll(2, true);
  2047. Resize();
  2048. }
  2049.  
  2050. function SoundMeter() {
  2051. //MICROPHONE INDICATOR
  2052. if (CTS.SoundMeterToggle) {
  2053. setTimeout(function() {
  2054. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2055. Featured = VideoListElement.querySelectorAll(".videos-items:first-child tc-video-item"),
  2056. videolist = window.TinychatApp.getInstance().defaultChatroom._videolist,
  2057. TCCameraList = videolist.items.length,
  2058. CameraLen = Camera.length,
  2059. users,
  2060. item;
  2061. if (Featured.length > 0) {
  2062. for (var x = 0; x < TCCameraList; x++) {
  2063. if (CameraLen < 1) break;
  2064. for (users = 0; users < CameraLen; users++) {
  2065. item = videolist.items[x];
  2066. if (item != undefined) {
  2067. if (Camera[users].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id") == item.userentity.path) {
  2068. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2069. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2070. break;
  2071. }
  2072. }
  2073. }
  2074. }
  2075. } else {
  2076. for (users = 0; users < CameraLen; users++) {
  2077. item = videolist.items[users];
  2078. if (item != undefined) {
  2079. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2080. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2081. }
  2082. }
  2083. }
  2084. //REPEAT
  2085. SoundMeter();
  2086. }, 300);
  2087. }
  2088. }
  2089.  
  2090. function RTC() {
  2091. if (null != arguments[0].rtc) {
  2092. let a = arguments[0].rtc;
  2093. arguments[0].rtc = null;
  2094. MS(arguments[0], a);
  2095. }
  2096. }
  2097.  
  2098. function Vote() {
  2099. var ChecksOut = CTS.VoteSystem,
  2100. len = CTS.WaitToVoteList.length;
  2101. if (len > 0 && ChecksOut) {
  2102. for (var i = 0; i < len; i++) {
  2103. if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
  2104. Send("msg", "Please wait several minutes till you can cast your vote again!");
  2105. ChecksOut = false;
  2106. break;
  2107. }
  2108. }
  2109. }
  2110. if (ChecksOut) {
  2111. if (isSafeListed(CTS.UserList[arguments[0]].username.toUpperCase())) {
  2112. var targetname = arguments[1].match(/^!vote ([a-z0-9]{1,16})$/i);
  2113. if (targetname !== null) {
  2114. var Target = UsernameToUser(targetname[1].toUpperCase());
  2115. if (Target !== -1) {
  2116. if (CTS.UserList[Target].broadcasting && CTS.UserList[Target].username !== "GUEST") {
  2117. if (CTS.Me.owner || !CTS.UserList[Target].mod) {
  2118. Send("msg", "Your vote has been cast, you may vote again shortly!");
  2119. CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
  2120. CTS.UserList[Target].vote += 1;
  2121. if (CTS.UserList[Target].vote === 3) {
  2122. CTS.UserList[Target].vote = 0;
  2123. Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
  2124. Send("stream_moder_close", CTS.UserList[Target].handle);
  2125. }
  2126. } else {
  2127. Send("msg", "I cannot do that!");
  2128. }
  2129. }
  2130. } else {
  2131. Send("msg", "The user is not broadcasting...");
  2132. }
  2133. } else {
  2134. Send("msg", "The nickname or username does not exist!");
  2135. }
  2136. }
  2137. }
  2138. }
  2139.  
  2140. function PMShow() {
  2141. ChatListElement.querySelector("#chatlist").style.display = ((CTS.enablePMs)?"block":"none");
  2142. }
  2143.  
  2144. function MessagePopUp() {
  2145. if (CTS.Popups) {
  2146. var push = false;
  2147. if (arguments[0] != -1) {
  2148. if (ChatListElement.querySelector(".list-item .active")) {
  2149. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  2150. if (arguments[2]) push = true;
  2151. } else {
  2152. push = true;
  2153. }
  2154. } else if (!arguments[2]) {
  2155. push = true;
  2156. }
  2157. }
  2158. if (arguments[3]) push = true;
  2159. if (push || !CTS.ChatDisplay) {
  2160. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  2161. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2162. clearTimeout(CTS.NotificationTimeOut[0]);
  2163. CTS.NotificationTimeOut.shift();
  2164. }
  2165. 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>");
  2166. CTS.NotificationTimeOut.push(setTimeout(function() {
  2167. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  2168. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2169. CTS.NotificationTimeOut.shift();
  2170. }
  2171. }, 11100));
  2172. }
  2173. }
  2174. }
  2175.  
  2176. function Reminder() {
  2177. var temp,
  2178. i,
  2179. len = CTS.ReminderServerInList.length;
  2180. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  2181. CTS.ReminderServerInList = [];
  2182. if (CTS.Reminder === true) {
  2183. var OffsetTime;
  2184. len = CTS.ReminderList.length;
  2185. for (i = 0; i < len; i++) {
  2186. temp = TimeToDate(CTS.ReminderList[i][0]);
  2187. CTS.RecentTime = new Date();
  2188. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  2189. OffsetTime = temp - CTS.RecentTime;
  2190. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, CTS.ReminderList[i][1]));
  2191. }
  2192. if (Addon.active("ReminderList")) {
  2193. len = Addon.get("ReminderList").length;
  2194. for (i = 0; i < len; i++) {
  2195. temp = TimeToDate(Addon.get("ReminderList")[i][0]);
  2196. CTS.RecentTime = new Date();
  2197. if (temp < CTS.RecentTime) temp.setDate(CTS.RecentTime.getDate() + 1);
  2198. OffsetTime = temp - CTS.RecentTime;
  2199. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, Addon.get("ReminderList")[i][1]));
  2200. }
  2201. }
  2202. }
  2203. }
  2204.  
  2205. function AddReminder() {
  2206. Send("msg", "📣 " + arguments[0]);
  2207. setTimeout(Reminder, 5000);
  2208. }
  2209.  
  2210. function ServerEvent() {
  2211. var temp,
  2212. i,
  2213. len = CTS.ServerEventServerInList.length;
  2214. for (i = 0; i < len; i++) clearTimeout(CTS.ServerEventServerInList[i]);
  2215. CTS.ServerEventServerInList = [];
  2216. var OffsetTime,
  2217. event = true;
  2218. len = CTS.ServerEventList.length;
  2219. for (i = 0; i < len; i++) {
  2220. temp = new Date(CTS.ServerEventList[i][1]);
  2221. CTS.RecentTime = new Date();
  2222. if (temp < CTS.RecentTime && CTS.ServerEventList[i][0]) {
  2223. temp.setDate(CTS.RecentTime.getDate());
  2224. temp.setYear(CTS.RecentTime.getFullYear());
  2225. }
  2226. OffsetTime = temp - CTS.RecentTime;
  2227. if (OffsetTime > 0 && OffsetTime < 3600000) {
  2228. event = false;
  2229. CTS.ServerEventServerInList.push(setTimeout(AddServerEvent, OffsetTime, CTS.ServerEventList[i][2], CTS.ServerEventList[i][3], CTS.ServerEventList[i][4]));
  2230. }
  2231. }
  2232. if (event) setTimeout(Events, 3600000);
  2233. }
  2234.  
  2235. function AddServerEvent() {
  2236. CreateServerEvent(GetActiveChat(), arguments[0], arguments[1], "📢 " + arguments[2]);
  2237. setTimeout(ServerEvent, 5000);
  2238. }
  2239.  
  2240. function NotificationDisplay() {
  2241. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2242. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2243. if (CTS.NotificationToggle == 0) {
  2244. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  2245. passive: true
  2246. });
  2247. } else {
  2248. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
  2249. passive: true
  2250. });
  2251. }
  2252. UpdateScroll(1, true);
  2253. UpdateScroll(2, true);
  2254. }
  2255.  
  2256. function NotificationResize() {
  2257. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  2258. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  2259. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  2260. ChatLogElement.querySelector("#chat").style.height = "50%%";
  2261. } else {
  2262. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  2263. ChatLogElement.querySelector("#chat").style.height = "100%";
  2264. }
  2265. UpdateScroll(1, false);
  2266. UpdateScroll(2, true);
  2267. }
  2268.  
  2269. function Dice() {
  2270. return String.fromCharCode("0x268" + Rand(0, 5));
  2271. }
  2272.  
  2273. function Rand() {
  2274. arguments[0] = Math.ceil(arguments[0]);
  2275. arguments[1] = Math.floor(arguments[1]);
  2276. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  2277. }
  2278.  
  2279. function OpenMicrophone() {
  2280. MicrophoneElement.initMouseEvent("mousedown");
  2281. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  2282. }
  2283.  
  2284. function Cameras() {
  2285. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2286. Len = Camera.length;
  2287. for (var num = 0; num < Len; num++) {
  2288. Camera[num].shadowRoot.querySelector(".video").style.padding = (CTS.CameraBorderToggle) ? "5px" : "0";
  2289. if (!Camera[num].shadowRoot.querySelector(".video #fixed")) {
  2290. var user = HandleToUser(Camera[num].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id"));
  2291. if (user != -1) {
  2292. if (CTS.HiddenCameraList.includes(CTS.UserList[user].username)) {
  2293. window.TinychatApp.BLL.Videolist.prototype.toggleHiddenVW(window.TinychatApp.getInstance().defaultChatroom._videolist.items[num], false);
  2294. Alert(GetActiveChat(), CTS.UserList[user].username + " has been auto-hidden!");
  2295. }
  2296. }
  2297. 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>");
  2298. }
  2299. }
  2300. Resize();
  2301. }
  2302.  
  2303. function FeaturedCameras() {
  2304. if (arguments[0] === true) {
  2305. if (VideoListElement.querySelector("#SmallFTYT")) {
  2306. Remove(VideoListElement, "#SmallFTYT");
  2307. }
  2308. } else {
  2309. var node = document.createElement("style");
  2310. node.appendChild(document.createTextNode(FeaturedCSS));
  2311. node.setAttribute("id", "SmallFTYT");
  2312. VideoListElement.appendChild(node);
  2313. }
  2314. }
  2315.  
  2316. function Resize() {
  2317. window.dispatchEvent(new Event("resize"));
  2318. }
  2319.  
  2320. function PerformanceModeInit() {
  2321. if (!CTS.ThemeChange) {
  2322. var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
  2323. ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
  2324. ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
  2325. ChatLogElement.querySelector("#chat-wrapper").style.width = value;
  2326. TitleElement.querySelector("#room-header").style.minWidth = value;
  2327. TitleElement.querySelector("#room-header").style.maxWidth = value;
  2328. TitleElement.querySelector("#room-header").style.width = value;
  2329. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2330. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2331. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
  2332. VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2333. VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2334. VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2335. SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
  2336. SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
  2337. SideMenuElement.querySelector("#sidemenu").style.width = value;
  2338. document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
  2339. VideoListElement.querySelector("#videos").style.display = ((!arguments[0]) ? "block!important" : "none!important");
  2340. } else {
  2341. if (arguments[0]) {
  2342. VideoListElement.querySelector("#videos-content").style.display = "none";
  2343. ChatLogElement.querySelector("#chat-wrapper").style.width = "100%";
  2344. ChatLogElement.querySelector("#chat-wrapper").style.position = "fixed";
  2345. ChatLogElement.querySelector("#chat-wrapper").style.left = "0";
  2346. ChatLogElement.querySelector("#chat-wrapper").style.bottom = "0";
  2347. ChatLogElement.querySelector("#chat-wrapper").style.minHeight = "100%";
  2348. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.display = "none";
  2349. VideoListElement.querySelector("#videos-header").style.display = "none";
  2350. VideoListElement.querySelector("#videos-footer").style.display = "none";
  2351. } else {
  2352. VideoListElement.querySelector("#videos-content").style.removeProperty("display");
  2353. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("width");
  2354. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("position");
  2355. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("left");
  2356. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("bottom");
  2357. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("min-height");
  2358. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.removeProperty("display");
  2359. VideoListElement.querySelector("#videos-header").style.removeProperty("display");
  2360. VideoListElement.querySelector("#videos-footer").style.removeProperty("display");
  2361. }
  2362. }
  2363. UpdateScroll(1, true);
  2364. UpdateScroll(2, true);
  2365. Resize();
  2366. }
  2367.  
  2368. function OwnerCommand() {
  2369. //MESSAGE FROM OWNER
  2370. if (isCommand(arguments[1])) {
  2371. if (CTS.UserList[arguments[0]].owner) {
  2372. if (!CTS.Me.owner) {
  2373. //PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
  2374. if (arguments[1].match(/^!raid /i)) {
  2375. // !raid https://tinychat.com/roomname
  2376. var raid = arguments[1].match(/^(?:!raid )(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})$/i);
  2377. if (raid !== null) {
  2378. if (CTS.RaidToggle) {
  2379. window.location.replace("https://tinychat.com/room/"+raid[1]);
  2380. } else {
  2381. Alert(GetActiveChat(), "[TIP]\nRaids are silenced. Refresh or !raidtoggle");
  2382. }
  2383. } else {
  2384. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nThis is not a valid link for raid.");
  2385. }
  2386. }
  2387. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + Ver(), CTS.UserList[arguments[0]].handle);
  2388. } else {
  2389. if (arguments[1].match(/^!closeall$/i)) {
  2390. for (var a = 0; a < CTS.Camera.List.length; a++) {
  2391. if (CTS.Me.handle !== CTS.Camera.List[a]) {
  2392. Send("stream_moder_close", CTS.Camera.List[a]);
  2393. } else {
  2394. CTS.SocketTarget.send(JSON.stringify({
  2395. "tc": "stream_close",
  2396. "handle": CTS.Me.handle
  2397. }));
  2398. }
  2399. }
  2400. }
  2401. if (arguments[1].match(/^!kickall$/i)) {
  2402. for (var b = 0; b < CTS.UserList.length; b++) {
  2403. if (CTS.Me.handle !== CTS.UserList[b].handle) Send("kick", CTS.UserList[b].handle);
  2404. }
  2405. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nIf you leave now, the entire room resets! GOGOGO~");
  2406. }
  2407. }
  2408. }
  2409. }
  2410. }
  2411.  
  2412. function Command() {
  2413. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?: ?)(.*)/i);
  2414. if (UserCommand) {
  2415. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  2416. debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
  2417. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  2418. }
  2419. }
  2420. }
  2421. //ALERT FUNCTIONS
  2422. function Settings() {
  2423. 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") + "\nReminder Mode: " + ((CTS.Reminder) ? "ON" : "OFF") + "\nGame View: " + ((CTS.CanSeeGames) ? "ON" : "OFF") + "\nTriva Game Host: " + ((CTS.CanHostTriviaGames) ? "ON" : "OFF") + "\nFish Game Host: " + ((CTS.CanHostFishGames) ? "ON" : "OFF") + "\n\nAvatar Display: " + ((CTS.Avatar) ? "SHOW" : "HIDE") + "\nNotification Display: " + ((CTS.NotificationToggle != 2) ? "SHOW(" + CTS.NotificationToggle + ")" : "HIDE") + "\nPopup Display: " + ((CTS.Popups) ? "SHOW" : "HIDE") + "\nFont Size: " + CTS.FontSize + "PX\n\nFOR LIST OF COMMANDS:\n!CTS</center>");
  2424. }
  2425.  
  2426. function Alert() {
  2427. CTS.Message[arguments[0]].push({
  2428. "time": Time(),
  2429. "namecolor": (arguments[2] !== undefined) ? "#000000" : "#3f69c0",
  2430. "avatar": (arguments[2] !== undefined) ? ("") : ("https://i.imgur.com/S09irS7.png"),
  2431. "username": "",
  2432. "nick": (arguments[2] !== undefined) ? (arguments[2]) : ("CTS Version: " + Ver()),
  2433. "msg": ((arguments[2] !== undefined) ? ("<div class=\"systemuser\">" + arguments[1] + "</div>") : arguments[1]),
  2434. "mention": true
  2435. });
  2436. var len = CTS.Message[arguments[0]].length - 1;
  2437. arguments[1] = CTS.Message[arguments[0]][len];
  2438. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[1].mention, arguments[0]);
  2439. }
  2440.  
  2441. function Ver() {
  2442. return window.CTSVersion.Major + "." + window.CTSVersion.Minor + "." + window.CTSVersion.Patch;
  2443. }
  2444.  
  2445. function AddUserNotification() {
  2446. if (CTS.FullLoad && CTS.ShowedSettings) {
  2447. var chat = ChatLogElement.querySelector("#notification-content"),
  2448. Notification;
  2449. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  2450. if (arguments[0] == 1) {
  2451. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  2452. } else if (arguments[0] == 2) {
  2453. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left.");
  2454. } else if (arguments[0] == 3) {
  2455. Notification = arguments[2] + "has mentioned you!";
  2456. 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>");
  2457. UpdateScroll(2, true);
  2458. } else if (arguments[0] == 4) {
  2459. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  2460. }
  2461. 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>");
  2462. if (CTS.NotificationToggle == 1) Alert(0, Notification, arguments[2]);
  2463. 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);
  2464. UpdateScroll(2, false);
  2465. var Notifications = ChatLogElement.querySelectorAll(".notification");
  2466. if (Notifications.length > CTS.NotificationLimit + 25) {
  2467. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  2468. }
  2469. }
  2470. }
  2471.  
  2472. function AddSystemNotification() {
  2473. if (CTS.FullLoad && CTS.ShowedSettings) {
  2474. if (CTS.NotificationToggle == 0) {
  2475. 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>");
  2476. } else if (CTS.NotificationToggle == 1) {
  2477. Alert(0, arguments[0], "SYSTEM");
  2478. }
  2479. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  2480. UpdateScroll(2, false);
  2481. }
  2482. }
  2483. //USER FUNCTION
  2484. function AddUser() {
  2485. CTS.UserList.push({
  2486. "handle": arguments[0],
  2487. "username": arguments[5],
  2488. "nick": arguments[4],
  2489. "owner": arguments[7],
  2490. "mod": arguments[1],
  2491. "namecolor": arguments[2],
  2492. "avatar": arguments[3],
  2493. "canGame": arguments[6],
  2494. "broadcasting": false,
  2495. "vote": 0,
  2496. "triviapoints": CTS.Game.Trivia.PlayerList[arguments[5]] || 0
  2497. });
  2498. if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  2499. }
  2500.  
  2501. function HandleToUser() {
  2502. for (var user = 0; user < CTS.UserList.length; user++) {
  2503. if (CTS.UserList[user].handle == arguments[0]) return user;
  2504. }
  2505. return -1;
  2506. }
  2507.  
  2508. function UsernameToHandle() {
  2509. for (var user = 0; user < CTS.UserList.length; user++) {
  2510. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2511. }
  2512. return -1;
  2513. }
  2514.  
  2515. function UsernameToUser() {
  2516. for (var user = 0; user < CTS.UserList.length; user++) {
  2517. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return user;
  2518. }
  2519. return -1;
  2520. }
  2521.  
  2522. function NicknameToHandle() {
  2523. for (var user = 0; user < CTS.UserList.length; user++) {
  2524. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2525. }
  2526. return -1;
  2527. }
  2528.  
  2529. function NicknameToUser() {
  2530. for (var user = 0; user < CTS.UserList.length; user++) {
  2531. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  2532. }
  2533. return -1;
  2534. }
  2535.  
  2536. function CheckUserListSafe() {
  2537. var len = CTS.UserList.length;
  2538. var temp = [];
  2539. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2540. for (var user = 0; user < len; user++) {
  2541. if (!CTS.UserList[user].mod && !isSafeListed(CTS.UserList[user].username)) CTS.KBQueue.push(CTS.UserList[user].handle);
  2542. }
  2543. len = CTS.KBQueue.length;
  2544. for (var kb = 0; kb < len; kb++) {
  2545. Send(arguments[0], CTS.KBQueue[kb]);
  2546. }
  2547. CTS.KBQueue = [];
  2548. }
  2549.  
  2550. function isSafeListed() {
  2551. var temp = [];
  2552. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2553. return (CTS.SafeList.includes(arguments[0]) || temp.includes(arguments[0]));
  2554. }
  2555.  
  2556. function CheckUserTempIgnore() {
  2557. if (CTS.TempIgnoreUserList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreNickList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  2558. return false;
  2559. }
  2560.  
  2561. function CheckUserIgnore() {
  2562. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username)) return true;
  2563. return false;
  2564. }
  2565.  
  2566. function CheckUserTouchScreen() {
  2567. if (/Mobi|Android/i.test(navigator.userAgent) || 'ontouchstart' in document.documentElement) {
  2568. CTS.Project.isTouchScreen = true;
  2569. CTS.ThemeChange = true;
  2570. }
  2571. }
  2572.  
  2573. function CheckUserAbuse() {
  2574. var action = false;
  2575. if (CTS.Me.mod) {
  2576. if (CTS.UserKickList.includes(arguments[1]) || CTS.NickKickList.includes(arguments[2].toUpperCase())) {
  2577. CTS.NoGreet = true;
  2578. Send("kick", arguments[0]);
  2579. action = true;
  2580. }
  2581. if (!action) {
  2582. if (CTS.UserBanList.includes(arguments[1]) || CTS.NickBanList.includes(arguments[2].toUpperCase())) {
  2583. CTS.NoGreet = true;
  2584. Send("ban", arguments[0]);
  2585. }
  2586. }
  2587. }
  2588. }
  2589.  
  2590. function CheckUserWordAbuse() {
  2591. if (CTS.UserList[arguments[0]].handle != CTS.Me.handle && !CTS.UserList[arguments[0]].mod) {
  2592. var action = false; //LETS NOT REPEAT/KICK
  2593. var len = CTS.KickKeywordList.length;
  2594. for (var i = 0; i < len; i++) {
  2595. if (arguments[1].includes(CTS.KickKeywordList[i])) {
  2596. Send("kick", CTS.UserList[arguments[0]].handle);
  2597. action = true;
  2598. break;
  2599. }
  2600. }
  2601. if (!action) {
  2602. len = CTS.BanKeywordList.length;
  2603. for (i = 0; i < len; i++) {
  2604. if (arguments[1].includes(CTS.BanKeywordList[i])) {
  2605. Send("ban", CTS.UserList[arguments[0]].handle);
  2606. break;
  2607. }
  2608. }
  2609. }
  2610. }
  2611. }
  2612.  
  2613. function RemoveUserCamera() {
  2614. var len = CTS.Camera.List.length;
  2615. if (len > 0) {
  2616. for (var i = 0; i < len; i++) {
  2617. if (CTS.Camera.List[i] === arguments[0]) {
  2618. CTS.Camera.List.splice(i, 1);
  2619. clearTimeout(CTS.Camera.clearRandom);
  2620. break;
  2621. }
  2622. }
  2623. }
  2624. }
  2625.  
  2626. function CheckUserStream() {
  2627. if (CTS.Me.mod) {
  2628. var user = HandleToUser(arguments[0]);
  2629. if (user != -1) {
  2630. if (arguments[1]) {
  2631. //PUSH UPDATE
  2632. CTS.Camera.List.push(CTS.UserList[user].handle);
  2633. CTS.UserList[user].broadcasting = true;
  2634. var len = CTS.Camera.List.length;
  2635. if (CTS.UserList[user].username !== "GUEST" && !CTS.GreenRoomList.includes(CTS.UserList[user].username)) {
  2636. CTS.GreenRoomList.push(CTS.UserList[user].username);
  2637. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  2638. }
  2639. //CLEAR TIMERS
  2640. clearTimeout(CTS.Camera.clearRandom);
  2641. //CAMERA SWEEP FUNCTION
  2642. if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
  2643. CTS.Camera.clearRandom = setTimeout(function() {
  2644. var rand = Rand(0, len - 1);
  2645. if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
  2646. var target = HandleToUser(CTS.Camera.List[rand]);
  2647. if (CTS.Me.owner || !CTS.UserList[target].mod) {
  2648. Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
  2649. Send("stream_moder_close", CTS.Camera.List[rand]);
  2650. CTS.Camera.List.splice(rand, 1);
  2651. }
  2652. }
  2653. }, CTS.Camera.SweepTimer * 60000);
  2654. }
  2655. } else {
  2656. clearTimeout(CTS.Camera.clearRandom);
  2657. RemoveUserCamera(CTS.UserList[user].handle);
  2658. CTS.UserList[user].broadcasting = false;
  2659. }
  2660. CTS.UserList[user].broadcasting = arguments[1];
  2661. if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  2662. }
  2663. }
  2664. }
  2665.  
  2666. function CheckUserName() {
  2667. return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
  2668. }
  2669.  
  2670. function CheckUserNameStrict() {
  2671. return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
  2672. }
  2673.  
  2674. function MSR() {
  2675. if (arguments[0]) {
  2676. arguments[1].videolist.RemoveVideoRemote(arguments[1].handle);
  2677. } else {
  2678. arguments[1].mediaStream.stop();
  2679. arguments[1].mediaStream = null;
  2680. }
  2681. }
  2682.  
  2683. function MS() {
  2684. if (arguments[0].mediaStream !== null) {
  2685. if (arguments[0].mediaStream.active && arguments[1].signalingState !== "closed" && typeof arguments[1].removeStream === "function" && arguments[1].removeStream(arguments[0].mediaStream)) MSR(false, arguments[0]);
  2686. } else {
  2687. MSR(true, arguments[0]);
  2688. }
  2689. if (arguments[1].signalingState !== "closed" && arguments[1].close());
  2690. }
  2691. //LOAD/SAVE FUNCTION
  2692. function Load() {
  2693. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  2694. if (null === val && "undefined" != typeof arguments[1]) {
  2695. Save(arguments[0], arguments[1]);
  2696. return arguments[1];
  2697. }
  2698. return val;
  2699. }
  2700.  
  2701. function Save() {
  2702. if (CTS.StorageSupport) {
  2703. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  2704. } else {
  2705. Alert(GetActiveChat(), "Looks like you don't have LocalStorage allowed on this device!\nYour options will not be saved!");
  2706. }
  2707. }
  2708.  
  2709. //SOCKET FUNCTION
  2710. function CTSWebSocket() {
  2711. if (window.Proxy === undefined) return;
  2712. var handler = {
  2713. set: function(Target, prop, value) {
  2714. if (prop == "onmessage") {
  2715. var oldMessage = value;
  2716. value = function(event) {
  2717. ServerMsg(JSON.parse(event.data), Target);
  2718. oldMessage(event);
  2719. };
  2720. }
  2721. return (Target[prop] = value);
  2722. },
  2723. get: function(Target, prop) {
  2724. var value = Target[prop];
  2725. if (prop == "send") {
  2726. value = function(event) {
  2727. ClientMsg(JSON.parse(event), Target);
  2728. Target.send(event);
  2729. };
  2730. } else if (typeof value == 'function') {
  2731. value = value.bind(Target);
  2732. }
  2733. return value;
  2734. }
  2735. };
  2736. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  2737. construct: function(Target, args) {
  2738. CTS.SocketTarget = new Target(args[0]);
  2739. debug("SOCKET::CONNECTING", args[0]);
  2740. return new window.Proxy(CTS.SocketTarget, handler);
  2741. }
  2742. });
  2743. window.WebSocket = WebSocketProxy;
  2744. }
  2745.  
  2746. function ModCommand() {
  2747. var name = arguments[1].match(/^!(?:userkick|nickkick|userban|nickban|userclose|nickclose) (guest-[0-9]{1,32}|[a-z0-9_]{1,32})$/i),
  2748. target;
  2749. if (name !== null) {
  2750. if (name[1].toUpperCase() !== "GUEST") {
  2751. target = ((arguments[2]) ? UsernameToUser(name[1].toUpperCase()) : NicknameToUser(name[1].toUpperCase()));
  2752. } else {
  2753. target = NicknameToUser(name[1].toUpperCase());
  2754. }
  2755. if (target != -1) { // USER ONLINE
  2756. if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
  2757. //IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
  2758. if (arguments[0] === "stream_moder_close") {
  2759. if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
  2760. } else {
  2761. Send(arguments[0], CTS.UserList[target].handle);
  2762. }
  2763. } else {
  2764. Send("msg", "This users authorization is similar or above yours!");
  2765. }
  2766. }
  2767. }
  2768. }
  2769.  
  2770. function BotCommand() {
  2771. var len = CTS.YouTube.MessageQueueList.length;
  2772. if (len <= 0) {
  2773. var check = true;
  2774. // Moderator Control
  2775. if (CTS.UserList[arguments[1]].mod) {
  2776. if (arguments[0] == 2) {
  2777. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2778. CTS.YouTube.Clear = true;
  2779. YouTubePlayList();
  2780. }
  2781. check = false;
  2782. }
  2783. if (arguments[0] == 5) {
  2784. SetBot(true);
  2785. check = false;
  2786. }
  2787. }
  2788. // User and Moderator Control
  2789. if (check){
  2790. if (VerifyYouTube(arguments[1])) {
  2791. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  2792. if (arguments[0] == 4) YouTubePlayList(true);
  2793. if (CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
  2794. if (arguments[0] == 6) YoutubeBypass(arguments[2]);
  2795. if (arguments[0] == 3) {
  2796. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2797. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  2798. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  2799. }
  2800. }
  2801. }
  2802. }
  2803. }
  2804. } else {
  2805. if (CTS.YouTube.ListBuilt === false) {
  2806. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  2807. } else {
  2808. Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  2809. }
  2810. }
  2811. }
  2812.  
  2813. function ServerMsg() {
  2814. if (typeof ServerInList[arguments[0].tc] == "function") {
  2815. debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2816. ServerInList[arguments[0].tc](arguments[0]);
  2817. }
  2818. }
  2819.  
  2820. function ClientMsg() {
  2821. if (typeof ServerOutList[arguments[0].tc] == "function") {
  2822. debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2823. ServerOutList[arguments[0].tc](arguments[0]);
  2824. }
  2825. }
  2826.  
  2827. function Send() {
  2828. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  2829. if (arguments[1] === undefined) arguments[1] = "Open Request";
  2830. debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  2831. }
  2832. //GAME FUNCTION
  2833. //FISHING BOAT
  2834. function FishUpgradeStatus() {
  2835. var msg = "[FISHING BOAT]\n";
  2836. if (arguments[1] != 7) msg += arguments[0].Nickname + ":\n";
  2837. 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");
  2838. 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";
  2839. 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";
  2840. 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";
  2841. 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";
  2842. Send("msg", msg);
  2843. }
  2844.  
  2845. function FishTimerCheck() {
  2846. if (new Date() - arguments[0].LastCheck >= 5000) {
  2847. arguments[0].LastCheck = new Date();
  2848. return true;
  2849. }
  2850. return false;
  2851. }
  2852.  
  2853. function FishCommandCheck() {
  2854. var command,
  2855. playerExist = Fish.GetPlayer(CTS.UserList[arguments[0]].handle, false, true),
  2856. FishCommand = arguments[1].match(/^!(fish(?:rob|slap|split|help|upgrade)?) ?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
  2857. if (FishCommand) {
  2858. if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
  2859. if (FishCommand[2] !== undefined) {
  2860. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  2861. }
  2862. } else {
  2863. command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
  2864. if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  2865. }
  2866. }
  2867. }
  2868.  
  2869. function FishTransfer() {
  2870. if (arguments[1] !== undefined && arguments[1] !== -1) {
  2871. if (arguments[0].Points > arguments[2]) {
  2872. if (arguments[4]) {
  2873. arguments[0].Points -= arguments[2];
  2874. if (arguments[1].Points <= arguments[3]) {
  2875. arguments[3] = arguments[1].Points;
  2876. arguments[1].Points -= arguments[3];
  2877. arguments[0].Points += arguments[3];
  2878. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " destroyed " + arguments[1].Nickname + "\nMoney made $" + arguments[3] + "!");
  2879. Fish.GetPlayer(arguments[1].Handle, true);
  2880. } else {
  2881. arguments[1].Points -= arguments[3];
  2882. arguments[0].Points += arguments[3];
  2883. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " robbed " + arguments[1].Nickname + " for $" + arguments[3] + "!");
  2884. }
  2885. } else {
  2886. arguments[0].Points = arguments[3];
  2887. arguments[1].Points += arguments[3];
  2888. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " split their money with " + arguments[1].Nickname + "!");
  2889. }
  2890. } else {
  2891. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " are you kidding me?\nTalk to me when you have money!");
  2892. }
  2893. }
  2894. }
  2895.  
  2896. function FishTransaction() {
  2897. if (arguments[0].Points > arguments[1]) {
  2898. arguments[0].Points -= arguments[1];
  2899. return true;
  2900. } else {
  2901. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + ", are you kidding me?\nTalk to me when you have money!");
  2902. return false;
  2903. }
  2904. }
  2905. //SERVER/CLIENT LIST FUNCTION
  2906. var CommandList = {
  2907. cts: function() {
  2908. 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!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>");
  2909. },
  2910. help: function() {
  2911. this.cts();
  2912. },
  2913. userlist: function() {
  2914. Alert(GetActiveChat(), SettingsList.UserList());
  2915. },
  2916. ytapi: function() {
  2917. if (arguments[0] === "") {
  2918. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2919. } else {
  2920. if (arguments[0].match(/^([0-9A-Z]*)/i)) {
  2921. CTS.YouTube.API_KEY = arguments[0];
  2922. Save("YouTubeAPI", JSON.stringify(CTS.YouTube.API_KEY));
  2923. Alert(GetActiveChat(), "✓ Command Accepted!");
  2924. } else {
  2925. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  2926. }
  2927. }
  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. };
  4174. if (CTS.Me.nick.match(/^guest(?:\-[0-9]{1,10})?/i) && CTS.Me.username !== "GUEST") Send("nick", CTS.Me.username); //AUTO CORRECT NAME
  4175. if (CTS.Me.mod && CTS.Bot && CTS.ScriptInit && CTS.SocketConnected) CheckHost();
  4176. CTS.Room = {
  4177. "Avatar": arguments[0].room.avatar,
  4178. "Bio": arguments[0].room.biography,
  4179. "Name": arguments[0].room.name,
  4180. "PTT": arguments[0].room.pushtotalk,
  4181. "Website": arguments[0].room.website,
  4182. "YT_ON": arguments[0].room.youtube_enabled,
  4183. "Recent_Gifts": arguments[0].room.recent_gifts
  4184. };
  4185. CTS.SocketConnected = true;
  4186. },
  4187. userlist: function() {
  4188. var len = arguments[0].users.length;
  4189. for (var user = 0; user < len; user++) {
  4190. AKBS(arguments[0].users[user]);
  4191. var username = (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase();
  4192. CheckUserAbuse(arguments[0].users[user].handle, username, arguments[0].users[user].nick);
  4193. CTS.UserList.push({
  4194. "handle": arguments[0].users[user].handle,
  4195. "username": username,
  4196. "nick": arguments[0].users[user].nick,
  4197. "owner": arguments[0].users[user].owner,
  4198. "mod": arguments[0].users[user].mod,
  4199. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  4200. "avatar": (arguments[0].users[user].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].users[user].avatar,
  4201. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
  4202. "broadcasting": false,
  4203. "vote": 0,
  4204. "triviapoints": CTS.Game.Trivia.PlayerList[username] || 0
  4205. });
  4206. }
  4207. RoomUsers();
  4208. debug();
  4209. },
  4210. join: function() {
  4211. AKBS(arguments[0]);
  4212. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  4213. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick);
  4214. if (CTS.HighlightList.includes(user) && CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) window.CTSSound.HIGHLIGHT.play();
  4215. if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
  4216. CTS.hasGreetedWC = true;
  4217. if (CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) window.CTSSound.C.play();
  4218. Send("msg", "HI! " + arguments[0].nick.toUpperCase() + "!");
  4219. } else {
  4220. if ((CTS.GreetList.includes(user) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  4221. 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!") : "!"));
  4222. if (CTS.enableSound === true) window.CTSSound.GREET.play();
  4223. }
  4224. }
  4225. CTS.NoGreet = false;
  4226. 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);
  4227. RoomUsers();
  4228. debug();
  4229. },
  4230. sysmsg: function() {
  4231. if (CTS.Me.mod) {
  4232. var action = arguments[0].text.match(/^([a-z0-9_]{1,32}):? (closed|banned|kicked) ([a-z0-9_]{1,32})$/i);
  4233. if (action !== null) {
  4234. var user;
  4235. if (action[2] == "closed" || action[2] == "banned" || action[2] == "kicked") {
  4236. user = NicknameToUser(action[3].toUpperCase());
  4237. if (user != -1) {
  4238. if (CTS.UserList[user].username !== "GUEST") {
  4239. var a = CTS.GreenRoomList.indexOf(CTS.UserList[user].username);
  4240. if (a !== -1) {
  4241. //REMOVE
  4242. debug("GREENROOMLIST::", "REMOVE USER " + CTS.UserList[user].username + " FROM GREENROOMLIST");
  4243. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[user].username + " from greenroomlist!");
  4244. CommandList.greenroomremove(a);
  4245. }
  4246. }
  4247. }
  4248. }
  4249. }
  4250. }
  4251. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  4252. debug();
  4253. },
  4254. nick: function() {
  4255. var user = HandleToUser(arguments[0].handle);
  4256. if (user != -1) {
  4257. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  4258. 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);
  4259. CTS.UserList[user].nick = arguments[0].nick;
  4260. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  4261. CheckUserAbuse(arguments[0].handle, CTS.UserList[user].username, arguments[0].nick);
  4262. }
  4263. debug();
  4264. },
  4265. stream_connected: function() {
  4266. 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)) {
  4267. //USER IS NOT ON CAMERA START AUTO ACCEPT PROCESS
  4268. var user = HandleToUser(arguments[0].handle);
  4269. if (user != -1) {
  4270. debug("CAMERA::WAITING", "nickname:" + CTS.UserList[user].nick);
  4271. if (!CTS.GreenRoomIgnoreList.includes(CTS.UserList[user].username) && CTS.GreenRoomList.includes(CTS.UserList[user].username)) Send("stream_moder_allow", CTS.UserList[user].handle);
  4272. }
  4273. }
  4274. debug();
  4275. },
  4276. stream_closed: function() {
  4277. debug();
  4278. },
  4279. publish: function() { //ADD GLOBAL CAMERA
  4280. CheckUserStream(arguments[0].handle, true);
  4281. debug();
  4282. },
  4283. unpublish: function() { //REMOVE GLOBAL CAMERA
  4284. CheckUserStream(arguments[0].handle, false);
  4285. debug();
  4286. },
  4287. ping: function() {
  4288. if (CTS.ScriptInit) {
  4289. var verify;
  4290. if (CTS.WatchList.length > 0) {
  4291. verify = new Date() - CTS.WatchList[0][2];
  4292. debug("WATCHLIST::LIST", CTS.WatchList);
  4293. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/700000");
  4294. if (CTS.SafeList.indexOf(CTS.WatchList[0][0]) === -1) { //LET'S NOT ADD TWICE
  4295. if (verify > 700000) {
  4296. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/700000");
  4297. CTS.SafeList.push(CTS.WatchList[0][0]);
  4298. CTS.WatchList.shift();
  4299. }
  4300. } else {
  4301. CTS.WatchList.shift();
  4302. }
  4303. }
  4304. if (CTS.WaitToVoteList.length > 0) {
  4305. verify = new Date() - CTS.WaitToVoteList[0][1];
  4306. debug("VOTE::LIST", CTS.WaitToVoteList);
  4307. debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4308. if (verify > 300000) {
  4309. debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4310. CTS.WaitToVoteList.shift();
  4311. }
  4312. }
  4313. }
  4314. //DISPOSE OF ITEMS
  4315. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  4316. window.TinychatApp.getInstance().defaultChatroom.packetWorker.queue = {};
  4317. debug();
  4318. },
  4319. quit: function() {
  4320. if (CTS.ScriptInit) {
  4321. if (CTS.WatchList.length > 0) {
  4322. var len = CTS.WatchList.length;
  4323. for (var i = 0; i < len; i++) {
  4324. if (CTS.WatchList[i][1] == arguments[0].handle) {
  4325. CTS.WatchList.splice(i, 1);
  4326. break;
  4327. }
  4328. }
  4329. }
  4330. if (CTS.Me.mod) RemoveUserCamera(arguments[0].handle);
  4331. var user = HandleToUser(arguments[0].handle);
  4332. if (user != -1) {
  4333. 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.");
  4334. //SEND THEM OUT
  4335. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4336. CTS.UserList.splice(user, 1);
  4337. }
  4338. RoomUsers();
  4339. if (CTS.Host == arguments[0].handle) {
  4340. CTS.Host = 0;
  4341. CTS.Camera.Sweep = false;
  4342. if (CTS.Me.mod && CTS.Bot) {
  4343. setTimeout(function() {
  4344. if (CTS.Host == 0) SetBot(false);
  4345. }, (Rand(10, 30) * 1000));
  4346. }
  4347. }
  4348. }
  4349. debug();
  4350. },
  4351. msg: function() {
  4352. if (CTS.ScriptInit) {
  4353. var user = HandleToUser(arguments[0].handle);
  4354. if (user != -1) {
  4355. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4356. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4357. var text = HTMLtoTXT(arguments[0].text);
  4358. //ALL USERS REPORT
  4359. OwnerCommand(user, arguments[0].text);
  4360. BotCheck(user, text, arguments[0]);
  4361. //MODERATORS
  4362. if (CTS.Me.mod) {
  4363. if (CTS.Host == CTS.Me.handle) BotCommandCheck(user, text);
  4364. CheckUserWordAbuse(user, arguments[0].text);
  4365. }
  4366.  
  4367. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4368. //PUSH MESSAGE
  4369. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4370. CTS.Message[0].push({
  4371. "time": Time(),
  4372. "namecolor": CTS.UserList[user].namecolor,
  4373. "avatar": CTS.UserList[user].avatar,
  4374. "username": CTS.UserList[user].username,
  4375. "nick": CTS.UserList[user].nick,
  4376. "msg": text,
  4377. "mention": false
  4378. });
  4379. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  4380. if (CTS.Me.handle !== arguments[0].handle) {
  4381. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  4382. Alert(GetActiveChat(), "✓ AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  4383. CTS.AutoKick = false;
  4384. CTS.AutoBan = false;
  4385. }
  4386. if (CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) {
  4387. if (CTS.UserList.length <= 14) window.CTSSound.MSG.play();
  4388. 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!"));
  4389. }
  4390. var len = CTS.MentionList.length;
  4391. for (var i = 0; i < len; i++) {
  4392. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  4393. if (CTS.enableSound === true) window.CTSSound.MENTION.play();
  4394. msg.mention = true;
  4395. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4396. }
  4397. }
  4398. }
  4399. if (GetActiveChat() === 0) CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  4400. MessagePopUp(user, text, true, false);
  4401. }
  4402. }
  4403. } else {
  4404. if (CTS.Host == CTS.Me.handle) {
  4405. Send("kick", arguments[0].handle);
  4406. } else if (CTS.Host == 0) {
  4407. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4408. }
  4409. }
  4410. }
  4411. }
  4412. debug();
  4413. },
  4414. pvtmsg: function() {
  4415. if (CTS.ScriptInit) {
  4416. if (CTS.enablePMs === true) {
  4417. if (arguments[0].handle != CTS.Me.handle) {
  4418. var user = HandleToUser(arguments[0].handle);
  4419. if (user != -1) {
  4420. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4421. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4422. var text = arguments[0].text;
  4423. if (CTS.Me.mod) CheckUserWordAbuse(user, arguments[0].text);
  4424. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4425. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4426. PushPM(arguments[0].handle, text, user);
  4427. if (CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) {
  4428. window.CTSSound.PVTMSG.play();
  4429. 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!"));
  4430. }
  4431. text = HTMLtoTXT(text);
  4432. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4433. MessagePopUp(user, text, false, false);
  4434. }
  4435. }
  4436. } else {
  4437. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4438. }
  4439. }
  4440. }
  4441. }
  4442. }
  4443. debug();
  4444. },
  4445. gift: function() {
  4446. window.CreateGift(arguments[0]);
  4447. debug();
  4448. },
  4449. yut_playlist_add: function() {
  4450. if (CTS.ScriptInit) {
  4451. if (!CTS.YouTube.Playing) {
  4452. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  4453. if (CTS.Host != CTS.Me.handle) {
  4454. Send("msg", "!play");
  4455. } else {
  4456. YouTubePlayList();
  4457. }
  4458. }
  4459. }
  4460. debug();
  4461. },
  4462. yut_playlist: function() {
  4463. if (CTS.ScriptInit) {
  4464. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  4465. if (CTS.YouTube.Clear === true) {
  4466. if (arguments[0].items !== null) Send("yut_playlist_clear");
  4467. CTS.YouTube.MessageQueueList = [];
  4468. Send("msg", "🎵YouTube cleared!🎵");
  4469. CTS.YouTube.Clear = false;
  4470. } else {
  4471. if (arguments[0].items === null) {
  4472. CTS.PlayListStart = true;
  4473. } else {
  4474. CTS.YouTube.PlayListCount = arguments[0].items.length;
  4475. CTS.PlayListStart = false;
  4476. if (CTS.YouTube.ShowQueue === true) {
  4477. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  4478. for (var i = 0; i < 3; i++) {
  4479. if (arguments[0].items[i] === undefined) break;
  4480. 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]";
  4481. }
  4482. Send("msg", msg);
  4483. }
  4484. }
  4485. 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);
  4486. }
  4487. CTS.YouTube.ShowQueue = false;
  4488. }
  4489. }
  4490. debug();
  4491. },
  4492. yut_play: function() {
  4493. if (CTS.ScriptInit) {
  4494. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  4495. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  4496. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  4497. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  4498. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  4499. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  4500. }
  4501. CTS.YouTube.Playing = true;
  4502. YouTubePlayList();
  4503. }
  4504. debug();
  4505. },
  4506. yut_stop: function() {
  4507. if (CTS.ScriptInit) {
  4508. CTS.YouTube.CurrentTrack.ID = undefined;
  4509. CTS.YouTube.CurrentTrack.duration = undefined;
  4510. CTS.YouTube.CurrentTrack.title = undefined;
  4511. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  4512. CTS.YouTube.Playing = false;
  4513. YouTubePlayList();
  4514. }
  4515. debug();
  4516. }
  4517. };
  4518. var ServerOutList = {
  4519. pvtmsg: function() {
  4520. if (CTS.ScriptInit) {
  4521. Command(arguments[0].text, true);
  4522. var text = arguments[0].text;
  4523. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4524. PushPM(arguments[0].handle, text);
  4525. }
  4526. debug();
  4527. },
  4528. msg: function() {
  4529. if (CTS.ScriptInit) {
  4530. CTS.LastMessage = new Date();
  4531. Command(arguments[0].text, false);
  4532. }
  4533. debug();
  4534. },
  4535. ban: function() {
  4536. CheckSafeList(arguments[0].handle, true);
  4537. debug();
  4538. },
  4539. kick: function() {
  4540. CheckSafeList(arguments[0].handle, true);
  4541. debug();
  4542. },
  4543. stream_moder_close: function() {
  4544. CheckSafeList(arguments[0].handle, true);
  4545. debug();
  4546. }
  4547. };
  4548. //ADDON
  4549. var Addon = {
  4550. active: function() {
  4551. if (window.CTSAddon !== undefined) {
  4552. if (window.CTSAddon[arguments[0]] !== undefined) {
  4553. return true;
  4554. }
  4555. }
  4556. return false;
  4557. },
  4558. get: function() {
  4559. return window.CTSAddon[arguments[0]];
  4560. }
  4561. };
  4562. //XMLHttpRequest
  4563. // YouTube Search V3 API (https://console.developers.google.com/)
  4564. CTS.YouTube.XHR.onload = function() {
  4565. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  4566. if (response.error) {
  4567. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  4568. } else {
  4569. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  4570. CTS.YouTube.ListBuilt = true;
  4571. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  4572. CTS.YouTube.DataReady = true;
  4573. CTS.YouTube.Busy = false;
  4574. YouTubeTrackAdd();
  4575. }
  4576. CTS.YouTube.DataReady = false;
  4577. if (response.items[0]) {
  4578. CTS.YouTube.Busy = true;
  4579. if (response.items[0].id) {
  4580. if (response.kind == "youtube#playlistItemListResponse") {
  4581. YouTubePlayListItems(response.items);
  4582. } else {
  4583. CTS.YouTube.VideoID = response.items[0].id.videoId;
  4584. 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);
  4585. CTS.YouTube.XHR.send();
  4586. }
  4587. } else if (response.items[0].contentDetails.duration) {
  4588. CTS.YouTube.DataReady = true;
  4589. }
  4590. if (CTS.YouTube.DataReady === false) {
  4591. CTS.YouTube.Busy = false;
  4592. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  4593. if (response.kind == "youtube#playlistItemListResponse") {
  4594. CTS.YouTube.ListBuilt = true;
  4595. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  4596. CTS.YouTube.Busy = false;
  4597. }
  4598. } else {
  4599. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  4600. if (CTS.YouTube.Playing === true) {
  4601. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  4602. 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]);
  4603. CTS.YouTube.Busy = false;
  4604. } else {
  4605. if (response.items[0].snippet.title !== undefined) {
  4606. 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]);
  4607. 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]);
  4608. CTS.YouTube.Playing = true;
  4609. }
  4610. CTS.YouTube.Busy = false;
  4611. }
  4612. }
  4613. }
  4614. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  4615. var title = "";
  4616. CTS.YouTube.SearchReturn = false;
  4617. CTS.YouTube.VideoReturn = false;
  4618. if (response.items[0] !== undefined) {
  4619. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  4620. }
  4621. if (response.items !== undefined) {
  4622. if (response.items.length > 0) title = response.items[0].snippet.title;
  4623. }
  4624. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  4625. }
  4626. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  4627. }
  4628. };
  4629. //Chuck Norris Jokes API (https://api.chucknorris.io/)
  4630. CTS.Chuck.XHR.onload = function() {
  4631. var resp = JSON.parse(CTS.Chuck.XHR.responseText),
  4632. msg = "[CHUCK NORRIS]\n" + resp.value;
  4633. if (resp !== null) Send("msg", msg.substr(0, 499));
  4634. };
  4635. //URB API (https://api.Urb.com/)
  4636. CTS.Urb.XHR.onload = function() {
  4637. var resp = JSON.parse(CTS.Urb.XHR.responseText),
  4638. msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
  4639. if (resp !== null) Send("msg", msg.substr(0, 499));
  4640. };
  4641. //ICanHazDadJoke's API (https://icanhazdadjoke.com/)
  4642. CTS.Dad.XHR.onload = function() {
  4643. var resp = JSON.parse(CTS.Dad.XHR.responseText),
  4644. msg = "[DAD JOKE]\n" + resp.joke;
  4645. if (resp !== null) Send("msg", msg.substr(0, 499));
  4646. };
  4647. //AdviceSlip API (https://api.adviceslip.com/advice)
  4648. CTS.Advice.XHR.onload = function() {
  4649. var resp = JSON.parse(CTS.Advice.XHR.responseText),
  4650. msg = "[ADVICE]\n" + resp.slip.advice;
  4651. if (resp !== null) Send("msg", msg.substr(0, 499));
  4652. };
  4653. //Events API (https://api.github.com/)
  4654. CTS.Events.XHR.onload = function() {
  4655. var resp = JSON.parse(CTS.Events.XHR.responseText);
  4656. if (resp !== null) {
  4657. if (resp.files.CTSJson.content !== null) {
  4658. try {
  4659. var parse = JSON.parse(resp.files.CTSJson.content);
  4660. CTS.ServerEventList = parse.serverevent;
  4661. } catch (e) {
  4662. CTS.ServerEventList = [];
  4663. }
  4664. ServerEvent();
  4665. }
  4666. }
  4667. };
  4668. // https://opentdb.com/api.php?amount=10
  4669. CTS.Game.Trivia.XHR.onload = function() {
  4670. var resp = JSON.parse(CTS.Game.Trivia.XHR.responseText);
  4671. if (resp !== null) {
  4672. if (resp.response_code == 0) {
  4673. CTS.Game.Trivia.QuestionList = resp.results;
  4674. Trivia.AskQuestion();
  4675. }
  4676. }
  4677. };
  4678. //GAME LIST FUNCTION
  4679. var Trivia = {
  4680. init: function() {
  4681. if (CTS.Me.handle == CTS.Host && CTS.CanHostTriviaGames) { // CHANGE BACK TO HOST NEEDED!!!!
  4682. this.Reset();
  4683. CTS.Game.Trivia.Started = true;
  4684. this.GetQuestion();
  4685. }
  4686. },
  4687. GetQuestion: function() {
  4688. CTS.Game.Trivia.XHR.open("GET", "https://opentdb.com/api.php?amount=50&type=multiple");
  4689. CTS.Game.Trivia.XHR.send();
  4690. },
  4691. AskQuestion: function() {
  4692. clearTimeout(CTS.Game.Trivia.Timer);
  4693. CTS.Game.Trivia.AttemptList = [];
  4694. CTS.Game.Trivia.Attempts = 0;
  4695. if (CTS.Game.Trivia.Started) {
  4696. if (CTS.Game.Trivia.QuestionList.length > 0) {
  4697. var RandSlot = Rand(0, 3),
  4698. msg,
  4699. incorrect = 0;
  4700. CTS.Game.Trivia.WaitCount++;
  4701. CTS.Game.Trivia.Correct = CTS.Game.Trivia.ANum[RandSlot];
  4702. 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));
  4703. CTS.Game.Trivia.Waiting = false;
  4704. msg = "[TRIVIA]\n"+CTS.Game.Trivia.QuestionList[0].question+"\n\nWorth:" + CTS.Game.Trivia.Worth + "IQ points!\n-------------";
  4705. for(var i = 0; i < 4; i++) {
  4706. msg += "\n\n" + CTS.Game.Trivia.ANum[i] + ") ";
  4707. if (i == RandSlot) {
  4708. msg += CTS.Game.Trivia.QuestionList[0].correct_answer;
  4709. } else {
  4710. msg += CTS.Game.Trivia.QuestionList[0].incorrect_answers[incorrect];
  4711. incorrect++;
  4712. }
  4713. }
  4714. CTS.Game.Trivia.QuestionList.shift();
  4715. Send("msg", DecodeTXT(msg));
  4716. CTS.Game.Trivia.Timer = setTimeout(function(g) {
  4717. Send("msg", "[TRIVIA]\nToo hard eh? Next question coming up in sixty seconds!\nThe answer however was: " + CTS.Game.Trivia.Correct);
  4718. g.Wait();
  4719. },240000, this);
  4720. } else {
  4721. CTS.Game.Trivia.WaitCount = 0;
  4722. this.GetQuestion();
  4723. }
  4724. if (CTS.Game.Trivia.WaitCount >= 4) {
  4725. CTS.Game.Trivia.WaitCount = 0;
  4726. this.Ranking();
  4727. }
  4728. }
  4729. },
  4730. Wait: function() {
  4731. CTS.Game.Trivia.Correct = "";
  4732. CTS.Game.Trivia.Waiting = true;
  4733. clearTimeout(CTS.Game.Trivia.Timer);
  4734. setTimeout(function() {
  4735. if (CTS.Game.Trivia.Started) Trivia.AskQuestion();
  4736. },60000);
  4737. },
  4738. Ranking: function() {
  4739. Send("msg", "[TRIVIA RANK]\n" + CTS.Game.Trivia.HighScore[0] + " has set the record of " + CTS.Game.Trivia.HighScore[1] + " IQ Points!");
  4740. },
  4741. Reset: function() {
  4742. clearTimeout(CTS.Game.Trivia.Timer);
  4743. CTS.Game.Trivia.Attempts = 0;
  4744. CTS.Game.Trivia.WaitCount = 0;
  4745. CTS.Game.Trivia.Started = false;
  4746. CTS.Game.Trivia.Correct = "";
  4747. CTS.Game.Trivia.AttemptList = [];
  4748. CTS.Game.Trivia.QuestionList = {};
  4749. CTS.Game.Trivia.Waiting = true;
  4750. }
  4751. };
  4752. var Fish = {
  4753. Init: function() {
  4754. if (CTS.Me.handle == CTS.Host && CTS.CanHostFishGames === true) {
  4755. 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!");
  4756. CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
  4757. g.StartRound();
  4758. }, 5000, this);
  4759. }
  4760. },
  4761. AddPlayer: function( ) {
  4762. if (!this.GetPlayer(arguments[0], false, false) && CTS.CanHostFishGames === true) {
  4763. if (isSafeListed(arguments[1])) {
  4764. CTS.Game.Fish.Player.push({
  4765. Handle: arguments[0],
  4766. Username: arguments[1],
  4767. Nickname: arguments[2],
  4768. LastCheck: new Date() - 5000,
  4769. Points: 5000,
  4770. Upgrades: {
  4771. Net: 1,
  4772. Store: 1,
  4773. Radar: 1,
  4774. Insurance: false
  4775. },
  4776. });
  4777. Send("msg", "[FISHING BOAT]\n" + arguments[2].substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  4778. if (this.GetPlayer() == 0) this.Init();
  4779. }
  4780. }
  4781. },
  4782. GetPlayer: function() {
  4783. var len = CTS.Game.Fish.Player.length;
  4784. if (arguments[0] !== undefined) {
  4785. for (var player = 0; player < len; player++) {
  4786. if (CTS.Game.Fish.Player[player].Handle == arguments[0]) {
  4787. if (arguments[2]) return CTS.Game.Fish.Player[player];
  4788. if (arguments[1]) {
  4789. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  4790. CTS.Game.Fish.Player.splice(player, 1);
  4791. }
  4792. if (!arguments[2]) return true;
  4793. }
  4794. }
  4795. if (!arguments[2]) {
  4796. return false;
  4797. } else {
  4798. return -1;
  4799. }
  4800. } else {
  4801. return len - 1;
  4802. }
  4803. },
  4804. Ranking: function() {
  4805. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
  4806. place = 0;
  4807. for (var u = arguments[0]; u >= 0; u--) {
  4808. place++;
  4809. if (u < 5) {
  4810. msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
  4811. }
  4812. CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
  4813. CTS.Game.Fish.Player[u].Points += 10000;
  4814. }
  4815. Send("msg", msg);
  4816. },
  4817. Winner: function() {
  4818. CTS.Game.Fish.Player.sort(function(a, b) {
  4819. return a.Points - b.Points;
  4820. });
  4821. if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
  4822. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
  4823. CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
  4824. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  4825. }
  4826. var len = CTS.Game.Fish.Player.length - 1;
  4827. 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!");
  4828. this.Ranking(len);
  4829. CTS.Game.Fish.RestockTimeout = setTimeout(function(g) {
  4830. g.reset(false, true);
  4831. }, 30000, this);
  4832. },
  4833. PriceList: function() {
  4834. if (arguments[1] == 0) { // net
  4835. return (1000 * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net);
  4836. } else if (arguments[1] == 1) { // radar
  4837. return (1000 * arguments[0].Upgrades.Radar * 2) + 3500;
  4838. } else if (arguments[1] == 2) { // shop
  4839. return (arguments[0].Upgrades.Store * arguments[0].Upgrades.Store * 25000);
  4840. } else if (arguments[1] == 3) { // insurance
  4841. return (20000);
  4842. } else if (arguments[1] == 4) { // rob
  4843. return (10000);
  4844. } else if (arguments[1] == 5) { // slap
  4845. return (50000);
  4846. } else if (arguments[1] == 6) { // split (min$) / gamble
  4847. return (1000);
  4848. }
  4849. },
  4850. StartRound: function() {
  4851. clearTimeout(CTS.Game.Fish.StartTimeout);
  4852. if (CTS.Host === CTS.Me.handle) {
  4853. if (this.GetPlayer() >= 0) {
  4854. if (CTS.Game.Fish.Round < 10) {
  4855. CTS.Game.Fish.Round++;
  4856. var playerlen,
  4857. fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
  4858. id,
  4859. type,
  4860. handle,
  4861. eliminate = false,
  4862. msgeliminate,
  4863. value,
  4864. msg = "[FISHING BOAT]\n";
  4865. for (var cast = 0; cast <= 2; cast++) {
  4866. playerlen = this.GetPlayer();
  4867. id = Rand(0, playerlen);
  4868. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  4869. if (Rand(0, 100) <= Rand(10, 70)) {
  4870. var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
  4871. value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
  4872. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  4873. CTS.Game.Fish.Player[id].Points += value;
  4874. 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");
  4875. } else {
  4876. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  4877. CTS.Game.Fish.Player[id].Points -= value;
  4878. 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");
  4879. } else {
  4880. 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");
  4881. }
  4882. }
  4883. } else {
  4884. cast--;
  4885. }
  4886. if (this.GetPlayer() == -1) break;
  4887. if (CTS.Game.Fish.Player[id].Points < 0) {
  4888. eliminate = true;
  4889. handle = CTS.Game.Fish.Player[id].Handle;
  4890. msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
  4891. CTS.Game.Fish.Player.splice(id, 1);
  4892. break;
  4893. }
  4894. }
  4895. if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
  4896. if (eliminate) {
  4897. eliminate = false;
  4898. Send("msg", msgeliminate);
  4899. }
  4900. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
  4901. g.StartRound();
  4902. }, Rand(90000, 120000), this);
  4903. } else {
  4904. this.Winner();
  4905. }
  4906. } else {
  4907. //RESTART
  4908. Fish.Stop();
  4909. }
  4910. }
  4911. },
  4912. Reset: function() {
  4913. var get = this.GetPlayer();
  4914. if (get !== undefined) {
  4915. if (get >= 0 && !CTS.Game.NoReset || arguments[1] !== undefined) {
  4916. CTS.Game.Fish.Round = 0;
  4917. clearTimeout(CTS.Game.Fish.StartTimeout);
  4918. clearTimeout(CTS.Game.Fish.RestockTimeout);
  4919. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  4920. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  4921. if (!arguments[0]) {
  4922. this.Init();
  4923. } else {
  4924. if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  4925. CTS.Game.Fish.Player = [];
  4926. }
  4927. }
  4928. }
  4929. },
  4930. Stop: function() {
  4931. CTS.Game.NoReset = false;
  4932. this.Reset(true, true);
  4933. }
  4934. };
  4935. var FishList = {
  4936. fish: function() {
  4937. Fish.AddPlayer(arguments[1].handle, arguments[1].username, arguments[1].nick);
  4938. },
  4939. fishbank: function() {
  4940. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname.substr(0, 16) + ", you have $" + arguments[0].Points + ".");
  4941. },
  4942. fishrob: function() {
  4943. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  4944. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  4945. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 4), Rand(5000, 20000), true);
  4946. }
  4947. },
  4948. fishgamble: function() {
  4949. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  4950. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 6))) {
  4951. var winnings;
  4952. if (Rand(1, 10) === 7) { // 10% chance
  4953. winnings = Rand(1000, 25000);
  4954. arguments[0].Points += winnings;
  4955. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  4956. } else {
  4957. if (Rand(1, 7) === 4) { // 15%
  4958. winnings = Rand(1000, 5000);
  4959. arguments[0].Points += winnings;
  4960. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  4961. } else {
  4962. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " tough luck, you lost $1000!");
  4963. }
  4964. }
  4965. }
  4966. }
  4967. },
  4968. fishslap: function() {
  4969. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  4970. var user = UsernameToUser(arguments[1].toUpperCase());
  4971. if (user !== -1) {
  4972. if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle && CTS.UserList[user].username !== "GUEST") {
  4973. if (CTS.Me.owner || !CTS.UserList[user].mod) {
  4974. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 5))) {
  4975. Send("stream_moder_close", CTS.UserList[user].handle);
  4976. Send("msg", arguments[0].Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
  4977. }
  4978. } else {
  4979. Send("msg", "Cannot close moderator!");
  4980. }
  4981. } else {
  4982. Send("msg", "Cannot close user!");
  4983. }
  4984. }
  4985. }
  4986. },
  4987. fishsplit: function() {
  4988. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  4989. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  4990. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 6), Math.round(arguments[0].Points / 2), false);
  4991. }
  4992. },
  4993. fishupgrade: function() {
  4994. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 0);
  4995. },
  4996. fishhelp: function() {
  4997. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 6);
  4998. },
  4999. fishupgradenet: function() {
  5000. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5001. if (arguments[0].Upgrades.Net >= 10) {
  5002. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5003. } else {
  5004. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 0))) {
  5005. arguments[0].Upgrades.Net += 1;
  5006. FishUpgradeStatus(arguments[0], 1);
  5007. }
  5008. }
  5009. }
  5010. },
  5011. fishupgradeshop: function() {
  5012. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5013. if (arguments[0].Upgrades.Store >= 6) {
  5014. Send("msg", arguments[0].Nickname + ", you own them all already!");
  5015. } else {
  5016. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 2))) {
  5017. arguments[0].Upgrades.Store += 1;
  5018. FishUpgradeStatus(arguments[0], 4);
  5019. }
  5020. }
  5021. }
  5022. },
  5023. fishupgraderadar: function() {
  5024. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5025. if (arguments[0].Upgrades.Radar >= 20) {
  5026. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5027. } else {
  5028. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 1))) {
  5029. arguments[0].Upgrades.Radar += 5;
  5030. FishUpgradeStatus(arguments[0], 2);
  5031. }
  5032. }
  5033. }
  5034. },
  5035. fishupgradeinsurance: function() {
  5036. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5037. if (arguments[0].Upgrades.Insurance === true) {
  5038. Send("msg", arguments[0].Nickname + ", you already have insurance!");
  5039. } else {
  5040. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 3))) {
  5041. arguments[0].Upgrades.Insurance = true;
  5042. FishUpgradeStatus(arguments[0], 3);
  5043. }
  5044. }
  5045. }
  5046. }
  5047. };
  5048. //MISC FUNCTION
  5049. function SetLocalValues() {
  5050. if (CTS.StorageSupport) {
  5051. //CTS SETTINGS
  5052. CTS.Game.Trivia.PlayerList = JSON.parse(Load("TriviaPlayerList", JSON.stringify({})));
  5053. CTS.Game.Trivia.HighScore = JSON.parse(Load("TriviaHighScore", JSON.stringify(["CosmosisT", 1])));
  5054. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
  5055. CTS.PublicCommandToggle = JSON.parse(Load("PublicCommandToggle", JSON.stringify(true)));
  5056. CTS.OGStyle.SavedHeight = JSON.parse(Load("OGStyleHeight", JSON.stringify(3)));
  5057. CTS.GreenRoomIgnoreList = JSON.parse(Load("GreenRoomIgnoreList", JSON.stringify([])));
  5058. CTS.CameraBorderToggle = JSON.parse(Load("CameraBorderToggle", JSON.stringify(true)));
  5059. CTS.OGStyle.SavedWidth = JSON.parse(Load("OGStyleWidth", JSON.stringify(1)));
  5060. CTS.NotificationToggle = JSON.parse(Load("NotificationToggle", JSON.stringify(0)));
  5061. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", JSON.stringify(14)));
  5062. CTS.SoundMeterToggle = JSON.parse(Load("SoundMeterToggle", JSON.stringify(true)));
  5063. CTS.HiddenCameraList = JSON.parse(Load("HiddenCameraList", JSON.stringify([])));
  5064. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  5065. CTS.PerformanceMode = JSON.parse(Load("PerformanceMode", JSON.stringify(false)));
  5066. CTS.TimeStampToggle = JSON.parse(Load("TimeStampToggle", JSON.stringify(true)));
  5067. CTS.YouTube.API_KEY = Load("YouTubeAPI", "AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs");
  5068. CTS.GreenRoomToggle = JSON.parse(Load("GreenRoomToggle", JSON.stringify(true)));
  5069. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  5070. CTS.FavoritedRooms = JSON.parse(Load("FavoritedRooms", JSON.stringify(["stonercircle", null, null, null, null])));
  5071. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/aS5RCaX.jpg) rgb(0, 0, 0) no-repeat");
  5072. CTS.GreenRoomList = JSON.parse(Load("GreenRoomList", JSON.stringify([])));
  5073. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  5074. CTS.CanHostTriviaGames = JSON.parse(Load("CanHostTriviaGames", JSON.stringify(false)));
  5075. CTS.CanHostFishGames = JSON.parse(Load("CanHostFishGames", JSON.stringify(false)));
  5076. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  5077. CTS.UserKickList = JSON.parse(Load("UserKickList", JSON.stringify([])));
  5078. CTS.NickKickList = JSON.parse(Load("NickKickList", JSON.stringify([])));
  5079. CTS.UserBanList = JSON.parse(Load("UserBanList", JSON.stringify([])));
  5080. CTS.NickBanList = JSON.parse(Load("NickBanList", JSON.stringify([])));
  5081. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  5082. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  5083. CTS.ThemeChange = JSON.parse(Load("ThemeChange", JSON.stringify(true)));
  5084. CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
  5085. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  5086. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  5087. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  5088. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  5089. CTS.FontSize = JSON.parse(Load("FontSize", JSON.stringify(20)));
  5090. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  5091. CTS.Featured = JSON.parse(Load("Featured", JSON.stringify(false)));
  5092. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  5093. CTS.ChatType = JSON.parse(Load("ChatType", JSON.stringify(true)));
  5094. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  5095. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  5096. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  5097. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  5098. CTS.Imgur = JSON.parse(Load("Imgur", JSON.stringify(true)));
  5099. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  5100. CTS.MediaStreamFilter = Load("MediaStreamFilter", "No Filter");
  5101. }
  5102. }
  5103.  
  5104. function debug() {
  5105. if (window.DebugClear === false) {
  5106. if (arguments[0] !== undefined) {
  5107. var msg = "CTS::" + arguments[0];
  5108. if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
  5109. console.log(msg);
  5110. }
  5111. } else {
  5112. console.clear();
  5113. 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");
  5114. }
  5115. }
  5116.  
  5117. function Reset() {
  5118. CTS.UserList = [];
  5119. CTS.Me = [];
  5120. CTS.Room = [];
  5121. CTS.SendQueue = [];
  5122. CTS.Camera.List = [];
  5123. CTS.Camera.List = [];
  5124. CTS.WaitToVoteList = [];
  5125. CTS.WatchList = [];
  5126. CTS.Host = 0;
  5127. CTS.HostAttempt = 0;
  5128. CTS.HostWaiting = false;
  5129. CTS.TempIgnoreUserList = [];
  5130. CTS.TempIgnoreNickList = [];
  5131. // Game Reset
  5132. Fish.Stop();
  5133. Trivia.Reset();
  5134. }
  5135.  
  5136. function Remove() {
  5137. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  5138. }
  5139. })();