CosmosisT's TinyChat Script (CTS V1.7.21)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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