CosmosisT's TinyChat Script (CTS V1.7.13)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-07-09 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.7.13)
  3. // @version 1.7.13
  4. // @description Modified TinyChat - Best Scripts; prepare to be amazed.
  5. // @author CosmosisT
  6. // @url https://gist.github.com/CosmosisT
  7. // @license Copyright (C) 2019-2020 CosmosisT
  8. // @icon https://i.imgur.com/XlkFjOK.png
  9. // @match https://tinychat.com/room/*
  10. // @match https://tinychat.com/*
  11. // @exclude https://tinychat.com/settings/*
  12. // @exclude https://tinychat.com/subscription/*
  13. // @exclude https://tinychat.com/promote/*
  14. // @exclude https://tinychat.com/coins/*
  15. // @exclude https://tinychat.com/gifts*
  16. // @grant none
  17. // @run-at document-start
  18. // jshint esversion: 6
  19. // @namespace https://greasyfork.org/users/395685
  20. // ==/UserScript==
  21. (function() {
  22. "use strict";
  23. //DEBUGGER
  24. window.DebugClear = true; // TRUE = CLEARS || FALSE = SHOWS
  25. window.CTSVersion = {
  26. Major: 1,
  27. Minor: 7,
  28. Patch: 13
  29. };
  30. var MainElement, ChatLogElement, VideoListElement, SideMenuElement, TitleElement, UserListElement, ModerationListElement, ChatListElement, UserContextElement, MicrophoneElement, TextAreaElement,
  31. FeaturedCSS, VideoCSS, SideMenuCSS, MainCSS, RoomCSS, TitleCSS, ContextMenuCSS, ModeratorCSS, UserListCSS, ChatListCSS, NotificationCSS, ChatboxCSS;
  32. //CTS MAIN VARIABLES
  33. var CTS = {
  34. Project: {
  35. Name: "CTS",
  36. Storage: "CTS_",
  37. isTouchScreen: false
  38. },
  39. Chuck: {
  40. XHR: new XMLHttpRequest()
  41. },
  42. Urb: {
  43. XHR: new XMLHttpRequest()
  44. },
  45. Dad: {
  46. XHR: new XMLHttpRequest()
  47. },
  48. Advice: {
  49. XHR: new XMLHttpRequest()
  50. },
  51. Events: {
  52. XHR: new XMLHttpRequest()
  53. },
  54. YouTube: {
  55. API_KEY: "",
  56. XHR: new XMLHttpRequest(),
  57. Playing: false,
  58. MessageQueueList: [],
  59. NotPlayable: ["Private video", "Deleted video"],
  60. VideoID: undefined,
  61. Busy: false,
  62. DataReady: false,
  63. Clear: false,
  64. VideoReturn: false,
  65. SearchReturn: false,
  66. ListBuilt: true,
  67. PlayListCount: undefined,
  68. ShowQueue: false,
  69. CurrentTrack: {
  70. ID: undefined,
  71. duration: undefined,
  72. title: undefined,
  73. thumbnail: undefined
  74. }
  75. },
  76. Discord: false,
  77. AnimationFrameWorker: undefined,
  78. WorkersAllowed: (typeof(Worker) !== "undefined"),
  79. Me: {},
  80. Room: {},
  81. ScriptInit: false,
  82. MainBackground: "url(https://i.imgur.com/aS5RCaX.jpg) rgb(0, 0, 0) no-repeat",
  83. MediaStreamFilter:"No Filter",
  84. OGStyle: {
  85. HeightCounter: 3,
  86. WidthCounter: 1,
  87. SavedHeight: undefined,
  88. SavedWidth: undefined
  89. },
  90. NormalStyle: {
  91. ChatHide: false
  92. },
  93. FontSize: 20,
  94. ChatStyleCounter: 0,
  95. ChatHeight: 30,
  96. ChatWidth: 0,
  97. ChatDisplay: true,
  98. UserListDisplay: true,
  99. ChatStyles: undefined,
  100. ChatType: true,
  101. MainBackgroundCounter: 0,
  102. NotificationLimit: 100,
  103. ChatScroll: true,
  104. CreateMessageLast:undefined,
  105. NotificationScroll: true,
  106. NoGreet: false,
  107. Featured: true,
  108. Bot: true,
  109. AutoKick: false,
  110. AutoBan: false,
  111. GreetMode: false,
  112. PerformanceMode: false,
  113. CanTTS: false,
  114. VoteSystem: false,
  115. Popups: true,
  116. Avatar: true,
  117. Reminder: true,
  118. ServerEvent: true,
  119. CanSeeTips:true,
  120. CanSeeGames: true,
  121. CanHostFishGames: false,
  122. CanHostTriviaGames: false,
  123. isFullScreen: false,
  124. Imgur: true,
  125. ImgurWarning: 0,
  126. Notification: true,
  127. UserYT: true,
  128. RaidToggle:true,
  129. ThemeChange: true,
  130. SoundMeterToggle: true,
  131. TimeStampToggle: true,
  132. AutoMicrophone: false,
  133. GreenRoomToggle: true,
  134. PublicCommandToggle: true,
  135. Game: {
  136. NoReset: false,
  137. Trivia: {
  138. XHR: new XMLHttpRequest(),
  139. QuestionList: [],
  140. Timer: undefined,
  141. ANum: ["A", "B", "C", "D"],
  142. Correct: "",
  143. Attempts: 0,
  144. AttemptList:[],
  145. WaitCount: 0,
  146. Waiting: true,
  147. HighScore:["CosmosisT", 2],
  148. Worth: 0,
  149. PlayerList:{},
  150. PriceList:{
  151. raid: 10000,
  152. spot: 500,
  153. ytbypass: 200
  154. }
  155. },
  156. Fish: {
  157. HighScore: ["CosmosisT", 13337],
  158. StartTimeout: undefined,
  159. RestockTimeout: undefined,
  160. ReCastTimeout: undefined,
  161. NotEnoughTimeout: undefined,
  162. Round: 0,
  163. Player: [],
  164. TypesOfFish: [
  165. ["frog", 1, true],
  166. ["sunfish", 2, true],
  167. ["goldfish", 3, true],
  168. ["fish swollowed hook", 4, false],
  169. ["family of sardine", 5, true],
  170. ["catfish", 6, true],
  171. ["spotted bass", 7, true],
  172. ["largemouth bass", 8, true],
  173. ["family of shrimp", 9, true],
  174. ["it pays to not drink,\ncrazy night however!", 10, false],
  175. ["cisco", 11, true],
  176. ["seaweed, still edible", 12, true],
  177. ["snagged a tire and lost rod", 13, false],
  178. ["snagged a tire and lost hook", 14, false],
  179. ["lost their rod to a shark", 15, false],
  180. ["rainbow trout", 16, true],
  181. ["It's your turn for dinner", 80, false],
  182. ["parrot fish", 17, true],
  183. ["snagged a plastic bag,\n their hook is gone", 18, false],
  184. ["walleye", 19, true],
  185. ["Round Whitefish", 20, true],
  186. ["family of clams", 21, true],
  187. ["family of oyster", 22, true],
  188. ["Round blackfish", 23, true],
  189. ["dolphin", 24, true],
  190. ["seagull,\n not a fish but will do", 25, true],
  191. ["pufferfish", 26, true],
  192. ["fined for smuggling\nmore than fish", 27, false],
  193. ["lobster", 28, true],
  194. ["tuna", 29, true],
  195. ["electric eel", 30, true],
  196. ["Eel electricuted you,\nrod is toast", 31, false],
  197. ["swordfish", 32, true],
  198. ["had bills at home to pay", 33, false],
  199. ["slipped and lost equipment", 34, false],
  200. ["bike, still good too", 35, true],
  201. ["great white", 36, true],
  202. ["octopus", 37, true],
  203. ["serpeant", 38, true],
  204. ["sea turtle", 39, true],
  205. ["cleaned garbage from the lake", 40, true],
  206. ["fined for capturing,\n a female whale", 41, false],
  207. ["male whale", 42, true],
  208. ["barracuda", 43, true],
  209. ["pike", 44, true],
  210. ["lochiness monster", 45, true],
  211. ["anglerfish", 46, true],
  212. ["small treasure chest", 47, true],
  213. ["golden tuna", 48, true],
  214. ["family of beautiful rims", 49, true],
  215. ["red snapper", 50, true],
  216. ["jaws", 51, true],
  217. ["mermaid", 52, true],
  218. ["holy grail,\nhow'd that get there?", 75, true],
  219. ["secret formula", 100, true]
  220. ]
  221. }
  222. },
  223. TTS: {
  224. synth: undefined,
  225. voices: undefined
  226. },
  227. hasGreetedWC: false,
  228. Host: 0,
  229. HostAttempt: 0,
  230. HostWaiting: false,
  231. StorageSupport: true,
  232. WaitToVoteList: [],
  233. UserList: [],
  234. MentionList: [],
  235. TempIgnoreNickList: [],
  236. TempIgnoreUserList: [],
  237. IgnoreList: [],
  238. UserBanList: [],
  239. NickBanList: [],
  240. UserKickList: [],
  241. NickKickList: [],
  242. BotOPList: [],
  243. BotModList: [],
  244. TTSList: [],
  245. BanKeywordList: [],
  246. KickKeywordList: [],
  247. HighlightList: [],
  248. GreetList: [],
  249. ServerEventList: [],
  250. ServerEventServerInList: [],
  251. ReminderList: [],
  252. ReminderServerInList: [],
  253. Favorited: ["stonercircle", null, null, null, null],
  254. SafeList: [],
  255. GreenRoomIgnoreList: [],
  256. GreenRoomList: [],
  257. WatchList: [],
  258. HiddenCameraList: [],
  259. KBQueue: [],
  260. Message: [
  261. []
  262. ],
  263. Clipboard:{
  264. Message: [""],
  265. Typing: false,
  266. Log: "",
  267. MessageLen: 0,
  268. Counter: 0
  269. },
  270. LastMessage: new Date(),
  271. ShowedSettings: false,
  272. SendQueue: [],
  273. MissedMsg: 0,
  274. Camera: {
  275. List: [],
  276. Sweep: false,
  277. SweepTimer: 5,
  278. clearRandom: undefined
  279. },
  280. NotificationTimeOut: [],
  281. };
  282.  
  283. CTS.StorageSupport = StorageSupport();
  284. SetLocalValues();
  285.  
  286. //IS USER TOUCHSCREEN
  287. CheckUserTouchScreen();
  288.  
  289. if (CTS.ThemeChange) {
  290. // TinyChat Style
  291. FeaturedCSS = "#videos.column>.videos-items{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%}";
  292. ChatListCSS = "#chatlist{background:#00000075;}.list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background:transparent;visibility:hidden;}.list-item>span>span{top:-4px;background:transparent;box-shadow:none;}.list-item>span>span[data-messages]:before{background:#53b6ef;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#chatlist>#header>.list-item>span.active{background:#53b6ef;}#chatlist>#header{height:60px;top:30px}#chatlist>div>span{font-weight: 600;border-radius:unset;color:#FFFFFF;height:22px;line-height:22px;}#chatlist>div{height:22px;line-height:22px;}";
  293. ChatboxCSS = "#chat-import-label{text-align: center;height: 20px;right: 70px;width:35px;cursor:pointer;}#chat-import{opacity: 0;position: absolute;z-index: -1;}.stackmessage:hover > .ctstimehighlight{display:block;}.ctstimehighlight{font-weight: 600;font-size: 16px;color: #FFF;position: absolute;right: 3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;display:none;}.stackmessage{background: #00000085;border-radius: 6px;margin: 5px 0 0 -5px;padding: 5px;border: #7672729e 1px solid;}.chat-discord{visibility:hidden;bottom: 0;height: calc(100% - 24px);position:absolute;}#chat-export{right:35px;width:35px;}#chat-download{right:0;width:35px;}#chat-discord{right:105px;width:95px;}#chat-import-label:hover, #chat-export:hover, #chat-discord:hover, #chat-download:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}.chat-button{outline:none;background: unset;border: unset;position: absolute;height: 22px;padding-top: 2px;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;}#chatlog-button{display:none!important;}@media screen and (max-width: 1200px){#chat-hide{top: -39px!important;left: 0!important;width: 100%!important;border-radius: 0!important;}}#chat-hide{top: calc(50% - 18px);position: absolute;display: block;height: 16px;width: 16px;left: -8px;margin-top: -20px;border-radius: 16px;font-size: 0;background:url(https://i.imgur.com/jFSLyDD.png) #000000 center no-repeat;background-size:16px;cursor: pointer;z-index: 1;-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;}#chat-instant.show{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(25, 29, 32)100%)!important;}#chat-wider:before{transition:.3s;margin: -4px 0 0 -4px;border-width: 6px 6px 6px 0;border-color: transparent #ffffff!important;}#chat-wider{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;z-index: 2;background:#000000!important}#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #10131494;}#input-user:checked ~ #user-menu{display:inline-block;}#user-menu > a:hover #user-menu > span > a:hover{color: #FFFFFF}#user-menu > a, #user-menu > span > a {font-weight: 600;position: relative;display: inline-block;width:calc(100% - 30px);box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;overflow:hidden;}#user-menu{border-radius: 6px;background: #000000b8;position: absolute;display: none;bottom: 50px;right: 0;box-sizing: border-box;border-radius: 6px;color: #FFFFFF;line-height: 1;z-index: 1;max-width:300px;padding:12px;}#user-menu > span {border-radius:6px;background:#000000c9;display: inline-block;width: 100%;padding: 6px;box-sizing: border-box;font-size: 16px;font-weight: 500;white-space: nowrap;text-overflow: ellipsis;cursor: default;overflow: hidden;}#label-user > img {position: absolute;height: 100%;left: -8px;vertical-align: top;}#label-user{position: relative;display: inline-block;height: 48px;width: 48px;border-radius: 100%;overflow: hidden;cursor: pointer;}#header-user{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;position: absolute;top: 10px;right: 0;}#chat-wrapper.full-screen #chat-instant, #chatf-wrapper.full-screen #chat-instant>.avatar>.status-icon,#chat-wrapper.full-screen #chat-content>.message>.avatar>.status-icon {background:unset;}.cts-message-unread{display:block;border-radius:6px;padding:1px 6px 1px 6px;background:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font:bold 16px sans-serif;cursor:pointer}.ctstime{position:absolute;right:3px;top:3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;}#chat-instant>.avatar>div>img,#cts-chat-content>.message>.avatar>div>img{position:relative;height:100%;left:-7px}.message>.systemuser{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgba(0, 0, 0, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.gift>a{background:black;}.serverevent{background: linear-gradient(0deg,rgb(13, 135, 200)0%,rgba(17, 107, 169, 0.85)50%,rgba(40, 118, 232, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.gift{border-radius:12px;background: #0165d0;-webkit-box-shadow: inset 0 0 5em 5px #000;box-shadow: inset 0 0 5em 5px #000;}.message{color:#FFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-family:sans-serif;font-weight:300;font-size:20px;white-space:pre-line;word-wrap:break-word}.message a, .message a:visited, .message a:hover, .message a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.message a:hover{text-decoration:underline;}#chat{will-change: transform;min-height:unset;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:6px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#243584a1;-webkit-box-shadow: inset 0 0 20px #000000;box-shadow: inset 0 0 20px 0 #000000;}#cts-chat-content>.message.common{min-height: 50px;padding:3px 3px 9px 50px;box-sizing:border-box;text-align:left}#chat-instant>.avatar,#cts-chat-content>.message>.avatar{position:absolute;height:40px;width:40px;top:3px;left:3px;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);pointer-events:none;}#chat-instant>.avatar>div,#cts-chat-content>.message>.avatar>div{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden}#notification-content .nickname{border-radius:6px;padding:1px 6px 1px 6px}.notification{padding:1px 0 1px 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black}.time{position:absolute;right:5px}.notifbtn:hover{background:linear-gradient(0deg,rgb(0, 135, 186)0%,rgba(0, 49, 64, 0.94)75%,rgba(0, 172, 255, 0.6)100%);}.notifbtn{cursor: pointer;border-radius: 0 0 12px 12px;outline: none;background:linear-gradient(0deg,rgba(0, 0, 0, 0)0%,rgba(37, 37, 37, 0.32)75%,rgba(255, 255, 255, 0.6)100%);border: none;color: white;width: 100%;}#notification-content.large{height:50%;}#notification-content{transition: .2s;will-change: transform;top:0;position:relative;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height:20%;min-height:38px;font:bold 16px sans-serif;color:#FFF;overflow-y:scroll;overflow-wrap:break-word;padding:0 6px 0 6px}#notification-content::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#chat-instant>.avatar>.status-icon,#cts-chat-content>.message>.avatar>.status-icon{left:0!important}#chat-instant>.nickname{color:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-size: 20px;font-weight: 800;}#chat-instant::after{content:unset;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{border:1px solid black;border-radius:6px;padding:1px 6px 1px 6px;word-wrap:break-word;max-width:calc(100% - 115px);font-weight:600;font-size:16px;color:#FFF;display:inline-block;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#input{padding-top:0}:host,#input>.waiting{background:#20262870}#input:before,#input:after{content:unset}#input>textarea::placeholder{color:#FFF}#input>textarea::-webkit-input-placeholder{color:#fff}#input>textarea:-moz-placeholder{color:#fff}#input>textarea{width: calc(100% - 57px);line-height:unset;min-height:65px;max-height:65px;border-radius:6px;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font-size:" + (CTS.FontSize - 4) + "px;font-family:sans-serif;font-weight:300;}#chat-position{top:22px;left:6px;right:6px;bottom:5px;}.on-white-scroll::webkit-scrollbar{width:0;background:transparent;}";
  294. MainCSS = "#mobile-app.show{display:none;}html{background:rgba(0,0,0,1);}#menu-icon{display:none;}body{background:" + CTS.MainBackground + ";background-position: center!important;background-size:cover!important;overflow:hidden;}#nav-static-wrapper {display:none;}#content{padding:0!important;}";
  295. VideoCSS = ".video>div{border-radius:10px;}@media screen and (max-width: 600px){#videos{top:38px;}#videos-header{position: unset;height: unset;width: unset;top: unset;bottom: unset;padding: 0 2px 10px 15px;box-sizing: border-box;}}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{height:unset;}#videolist[data-mode=\"dark\"]{background-color:unset;}@media screen and (max-width: 1200px){#videos-footer{right: unset!important;bottom: -22px!important;top: unset!important;}}#videos-footer-broadcast-wrapper{margin-top:16px;}#youtube.video > div > .overlay, .video > div > .overlay{display:block!important}.tcsettings{display:none}#videos-header{background:#101314;}#videos-footer-broadcast-wrapper.active>#videos-footer-broadcast,#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button,#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button:focus{background-color:#2d373a!important;}.js-video.broken{display:none;}.videos-header-volume {border-color:#202627;}.tcsettings:hover{background:#008cda;}.tcsettings{cursor: pointer;outline: none;background:#101314;border: none;color: white;}.music-radio-info>.description{cursor:default;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.music-radio-info>.volume{bottom: 0;position: absolute;background: #2a6a89;height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.music-radio-info{top: -50px;position: absolute;background: #071c19f0;height: 50px;width: 336px;line-height: 24px;}.ctsdrop{position:fixed;display:inline-block;top:3px;left:4px;z-index:5;min-width: 46px;}.ctsdrop-content{top:28px;right:0;background:#101314;width: 92px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{line-height: 22px;color: white;width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #10131475;border: none;padding: 5% 0;display: inline-block;}#youtube{padding: unset}#grab{left: 0;background:#2d373a;border-radius: 12px;visibility: hidden;top: -36px;position: absolute;display: flex}#videos-footer #music-radio .music-radio-playpause{position:absolute;top:0;left:30px;height:100%;width:60px;}#videos-footer #music-radio .music-radio-vol{position: absolute;right: 0;top: 0;}#videos-footer #music-radio button{line-height: 14px;background: #101314;border: none;font-size: 18px;color: white;height: 50%;display: block;width: 30px;}#videos-footer #videos-footer-youtube{left: 120px;border-radius: 0;display:none;}#videos-footer #videos-footer-soundcloud{display:none;border-radius: 0;left: 240px}#videos-footer #videos-footer-youtube,#videos-footer #videos-footer-soundcloud,#videos-footer #music-radio{transition: .2s;line-height: 33px;bottom: -64px;visibility: hidden;height: 36px;margin: unset;width: 120px;position: absolute;z-index: 1;}#videos-footer-push-to-talk{border-radius: unset}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{border-radius: unset;}#videos-footer-broadcast-wrapper.moderation>#videos-footer-broadcast{padding: unset}#videos-footer #music-radio button:hover{background: #53b6ef;cursor: pointer;}#videos-footer #music-radio{left: 0;border-radius: 12px;background: #101314;}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}#videos-footer{cursor:pointer;top:0;display:block;padding: 2px 0 0 11px;text-shadow: -1px 0 black,0 1px black,1px 0 black,0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;left: unset;right: -70px;height: 22px;min-height: 22px;z-index: 2;width: 70px;position: absolute}#videos-footer-broadcast{height:unset;border-radius:unset;z-index: 1;padding: unset!important;white-space: pre}span[title=\"Settings\"]>svg{padding:4px;height:24px;width:24px}#seek-duration{pointer-events: none;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 600 20px sans-serif}#videos{bottom: 0;left: 0;right: 0;top: 0}:host,#videolist{background:unset!important;}.video:after{content: unset;border:unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header>span{display:block;}#videos-header-sound>svg{padding: 4px}#videos-header-fullscreen > svg {padding: 7px 8px;}";
  296. RoomCSS = "tc-title{display:flex;}#room-content{padding-top:0!important;background:unset!important;}";
  297. TitleCSS = "#room-header-info > h1:after{content:unset;}@media screen and (max-width: 600px){#room-header-info{left:unset;right:unset;}}#room-header-info > span + span,#room-header-info > span{display:none;}#room-header-info > h1{width:unset;max-width:unset; position: relative;top: 8px;left: 60px;}#room-header-info{padding:unset;}#room-header-avatar{display:none}#room-header-gifts{display:none}#room-header-info-text{display:none}#room-header-info-details{display:none}#room-header-mobile-button{display:none}#room-header{width:100%;min-height:38px;max-height:38px;}";
  298. SideMenuCSS = "#sidemenu{left:0;z-index:3;}@media screen and (max-width: 1000px){#sidemenu{left:-270px;}}#sidemenu.full-screen{left:-270px;}#user-info{display:none;}#top-buttons-wrapper{display:none;}#sidemenu-content{scrollbar-width:none;padding-top:unset;}#sidemenu-wider:before{margin: -4px 0 0 -4px;border-width: 6px 6px 6px 0;border-color: transparent #ffffff;}#sidemenu-wider{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;z-index: 2;display:block;background-color: #000000;}#sidemenu-content::-webkit-scrollbar{display: none;}#sidemenu.wider {left: -270px;}";
  299. NotificationCSS = "#youtube.video{min-height:unset;min-width:unset;}@media screen and (max-width: 600px){#videos-header>span{line-height:50px;}}#videos-header > span {background-color: unset!important;}.PMTime{display:inline-block;padding:0 6px 0 0;margin:0 8px 0 0;border-right:4px groove #797979;}.PMName{display:inline-block;}#popup div{word-break: break-word;white-space: pre-line;word-wrap: break-word;user-select: text;-webkit-user-select: text;-moz-user-select: text;color:#FFFFFF;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font-weight: 300;font-size: 18px;font-family: sans-serif;z-index:1;}.PMOverlay{height: calc(100% - 92px);overflow: hidden;pointer-events:none;position:absolute;padding-top:12px;top:0;bottom:0;left:0;right:0;visibility:visible;}.PMPopup{pointer-events:all;margin:5px auto;width:50%;position:relative;color: #FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}.PMPopup a, .PMPopup a:visited, .PMPopup a:hover, .PMPopup a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.PMPopup a:hover{color:#FFFFFF;text-decoration:underline;}.PMPopup h2{border-radius:5px 5px 0 0;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0 0 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
  300. UserListCSS = "#contextmenu {top:unset!important;bottom:0!important;right:0!important;left:0!important;}.list-item>span>span{padding: 0 8px;top:-2px}.list-item > span:hover > span{background-color:unset;box-shadow:unset;}#userlist{background: #00000075;}.js-user-list-item{background: linear-gradient(0deg,rgb(0, 0, 0) 2px,rgba(0, 0, 0, 0.25) 2px,rgba(0, 0, 0, 0.59) 32%);}.list-item>span>span[data-cam=\"1\"]:after{height:15px;width:15px;background-image:url(https://i.imgur.com/QKSbq8d.png);}.list-item>span>span[data-moderator=\"1\"]:before{margin-right:3px;width:15px;height:15px;background-image:url(https://i.imgur.com/CEA9aro.png);}.list-item>span>span{background:transparent;box-shadow:none;}.list-item>span>span>.send-gift{top:5px;}.list-item>span>img{top:6px;}#button-banlist{border-radius:unset;top:-1px;right:10px;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#userlist>div{height:22px;}#userlist>div>span{font-weight: 600;color:#FFFFFF;height:22px;line-height:22px;}#userlist>#header{height:40px;top:10px;}";
  301. ModeratorCSS = ".video{width:100%}.video > div > .overlay{background-color:unset;}.video:hover{max-width:unset;}#moderatorlist:after{right:5px;color:#FFFFFF;background:#53b6ef;}#moderatorlist>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist>#header>span>button{top:-2px;background: #20262870;}#moderatorlist.show>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist{padding-left:unset;margin: 5px;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\"]{max-height:100%}";
  302. ContextMenuCSS = ".context[data-mode=\"dark\"] > span:hover{background-color:#04caff;}.context.show{height:100%;}.context:after{content:unset;}.context>span{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:800 14px sans-serif;color:#FFFFFF;display:inline-block;padding:1px 1%;line-height:17px;height:17px;}.context{background:#101314;position:unset;padding:0;height:0;transition:.25s;}";
  303. } else {
  304. //CTS Style
  305. FeaturedCSS = "#videos.column>.videos-items{background:#0000003b;height:20%}#videos.column>.videos-items+.videos-items{background:none;height:80%}#videos.row>.videos-items{background:#0000003b;width:20%}#videos.row>.videos-items+.videos-items{background:none;width:80%}#videos.row.featured-2>.videos-items{width:20%}#videos.row.featured-2>.videos-items+.videos-items{width:80%}#videos.column.featured-2>.videos-items{height:20%}#videos.column.featured-2>.videos-items+.videos-items{height:80%}#videos.row.featured-3>.videos-items{width:20%}#videos.row.featured-3>.videos-items+.videos-items{width:80%}#videos.column.featured-3>.videos-items{height:20%}#videos.column.featured-3>.videos-items+.videos-items{height:80%}";
  306. ChatListCSS = ".list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background:transparent;visibility:hidden;}.list-item>span>span{top:-4px;background:transparent;box-shadow:none;}.list-item>span>span[data-messages]:before{background:#53b6ef;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#chatlist>#header>.list-item>span.active{background:#53b6ef;}#chatlist>#header{height:60px;top:30px}#chatlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#chatlist>div{height:22px;line-height:22px;}";
  307. ChatboxCSS = "#chat-import-label{text-align: center;height: 20px;right: 70px;width:35px;cursor:pointer;}#chat-import{display: none;position: absolute;z-index: -1;}.stackmessage:hover > .ctstimehighlight{display:block;}.ctstimehighlight{font-weight: 600;font-size: 16px;color: #FFF;position: absolute;right: 3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;display:none;}.stackmessage{background: #00000085;border-radius: 6px;margin: 5px 0 0 -5px;padding: 5px;border:#7672729e 1px solid;}.chat-discord{visibility:hidden;bottom: 0;height: calc(100% - 24px);position:absolute;}#chat-export{right:35px;width:35px;}#chat-download{right:0;width:35px;}#chat-discord{right:105px;width:95px;}#chat-import-label:hover, #chat-export:hover, #chat-discord:hover, #chat-download:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}.chat-button{outline:none;background: unset;border: unset;position: absolute;height: 22px;padding-top: 2px;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;}#chatlog-button{display:none!important;}#chat-instant.show{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(25, 29, 32)100%)!important;}#chat-wider{display:none;}#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #10131494;}#input-user:checked ~ #user-menu{display:inline-block;}#user-menu > a:hover #user-menu > span > a:hover{color: #FFFFFF}#user-menu > a, #user-menu > span > a {font-weight: 600;position: relative;display: inline-block;width:calc(100% - 30px);box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;overflow:hidden;}#user-menu {border-radius: 6px;background: #000000b8;position: absolute;display: none;bottom: 50px;right: 0;box-sizing: border-box;border-radius: 6px;color: #FFFFFF;line-height: 1;z-index: 1;max-width:300px;padding:12px;}#user-menu > span {border-radius:6px;background:#000000c9;display: inline-block;width: 100%;padding: 6px;box-sizing: border-box;font-size: 16px;font-weight: 500;white-space: nowrap;text-overflow: ellipsis;cursor: default;overflow: hidden;}#label-user > img {position: absolute;height: 100%;left: -8px;vertical-align: top;}#label-user{position: relative;display: inline-block;height: 48px;width: 48px;border-radius: 100%;overflow: hidden;cursor: pointer;}#header-user{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;position: absolute;top: 10px;right: 0;}#chat-wrapper.full-screen #chat-instant, #chatf-wrapper.full-screen #chat-instant>.avatar>.status-icon,#chat-wrapper.full-screen #chat-content>.message>.avatar>.status-icon {background:unset;}.cts-message-unread{display:block;border-radius:6px;padding:1px 6px 1px 6px;background:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font:bold 16px sans-serif;cursor:pointer}.ctstime{position:absolute;right:3px;top:3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;}#chat-instant>.avatar>div>img,#cts-chat-content>.message>.avatar>div>img{position:relative;height:100%;left:-7px}.message>.systemuser{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgba(0, 0, 0, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.gift>a{background:black;}.serverevent{background: linear-gradient(0deg,rgb(13, 135, 200)0%,rgba(17, 107, 169, 0.85)50%,rgba(40, 118, 232, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.gift{border-radius:12px;background: #0165d0;-webkit-box-shadow: inset 0 0 5em 5px #000;box-shadow: inset 0 0 5em 5px #000;}.message{color:#FFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-family:sans-serif;font-weight:300;font-size:20px;white-space:pre-line;word-wrap:break-word}.message a, .message a:visited, .message a:hover, .message a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.message a:hover{text-decoration:underline;}#chat{will-change: transform;min-height:unset;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:6px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#243584a1;-webkit-box-shadow:inset 0 0 20px #000000;box-shadow: inset 0 0 20px 0 #000000;}#cts-chat-content>.message.common{min-height: 50px;padding:3px 3px 9px 50px;box-sizing:border-box;text-align:left}#chat-instant>.avatar,#cts-chat-content>.message>.avatar{position:absolute;height:40px;width:40px;top:3px;left:3px;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);pointer-events:none;}#chat-instant>.avatar>div,#cts-chat-content>.message>.avatar>div{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden}#notification-content .nickname{border-radius:6px;padding:1px 6px 1px 6px}.notification{padding:1px 0 1px 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black}.time{position:absolute;right:5px}.notifbtn:hover{background:linear-gradient(0deg,rgb(0, 135, 186)0%,rgba(0, 49, 64, 0.94)75%,rgba(0, 172, 255, 0.6)100%);}.notifbtn{cursor: pointer;border-radius: 0 0 12px 12px;outline: none;background:linear-gradient(0deg,rgba(0, 0, 0, 0)0%,rgba(37, 37, 37, 0.32)75%,rgba(255, 255, 255, 0.6)100%);border: none;color: white;width: 100%;}#notification-content.large{height:50%;}#notification-content{transition: .2s;will-change: transform;top:0;position:relative;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height: 15%;min-height:38px;font:bold 16px sans-serif;color:#FFF;overflow-y:scroll;overflow-wrap:break-word;padding:0 6px 0 6px}#notification-content::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#chat-instant>.avatar>.status-icon,#cts-chat-content>.message>.avatar>.status-icon{left:0!important}#chat-instant>.nickname{color:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-size: 20px;font-weight: 800;}#chat-instant::after{content:unset;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{border:1px solid black;border-radius:6px;padding:1px 6px 1px 6px;word-wrap:break-word;max-width:calc(100% - 115px);font-weight:600;font-size:16px;color:#FFF;display:inline-block;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#input{padding-top:0}:host,#input>.waiting{background:#20262870}#input:before,#input:after{content:unset}#input>textarea::placeholder{color:#FFF}#input>textarea::-webkit-input-placeholder{color:#fff}#input>textarea:-moz-placeholder{color:#fff}#input>textarea{width: calc(100% - 57px);line-height:unset;min-height:65px;max-height:65px;border-radius:6px;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font-size:" + (CTS.FontSize - 4) + "px;font-family:sans-serif;font-weight:300;}#chat-wrapper{border:none;transition:none;bottom:0;right:0!important;max-height:calc(70% - 119px)!important;min-height:calc(70% - 119px)!important;position:fixed!important;min-width:400px;max-width:400px;}#chat-position{top:22px;left:6px;right:6px;bottom:5px;}.on-white-scroll::webkit-scrollbar{width:0;background:transparent;}";
  308. MainCSS = ".container{display:none;}#mobile-app.show{display:none;}html{background:rgba(0,0,0,1);}#users-icon{display:none;}#menu-icon{display:none;}body{background:" + CTS.MainBackground + ";background-position: center!important;background-size:cover!important;overflow:hidden;}#content{width:calc(100% - 400px);padding:0!important;}#nav-static-wrapper, #nav-fixed-wrapper{display:none;}";
  309. VideoCSS = ".video>div{border-radius:10px;}@media screen and (max-width: 600px){#videos{top:38px;}}#videolist[data-mode=\"dark\"]{background-color:unset;}#youtube.video > div > .overlay, .video > div > .overlay{display:block!important}.js-video.broken{display:none;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-submenu{right:0;}#videos-footer-submenu{width: calc(100% - 14px);right:0;bottom:-2px;}.videos-header-volume {border-color:#202627;}.tcsettings:hover{background:#008cda;}.tcsettings{cursor: pointer;outline: none;background:#101314;border: none;color: white;}.music-radio-info>.description{cursor:default;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.music-radio-info>.volume{bottom: 0;position: absolute;background: #2a6a89;height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.music-radio-info{top: -50px;position: absolute;background: #071c19f0;height: 50px;width: 336px;line-height: 24px;}.ctsdrop{position:fixed;display:inline-block;top:3px;right:4px;z-index:5;min-width: 46px;}.ctsdrop-content{position:absolute;top:28px;right:0;background:#101314;width: 92px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{line-height: 22px;color: white;width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #101314;border: none;padding: 5% 0;display: inline-block;}#youtube{padding: unset}#grab{left: 0;background:#2d373a;border-radius: 12px;visibility: hidden;top: -36px;position: absolute;display: flex}#videos-footer-broadcast-wrapper>.video{position: fixed;display: none;width: 5%;top: 0;left: 0}#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button:hover{background: #1f2223!important}#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button{background: #2d373a!important}#videos-footer #music-radio .music-radio-playpause{position:absolute;top:0;left:30px;height:100%;width:60px;}#videos-footer #music-radio .music-radio-vol{position: absolute;right: 0;top: 0;}#videos-footer #music-radio button{line-height: 14px;background: #101314;border: none;font-size: 18px;color: white;height: 50%;display: block;width: 30px;}#videos-footer #videos-footer-youtube{left: 120px;border-radius: 0;display:none;}#videos-footer #videos-footer-soundcloud{display:none;border-radius: 0;left: 240px}#videos-footer #videos-footer-youtube,#videos-footer #videos-footer-soundcloud,#videos-footer #music-radio{transition: .2s;line-height: 33px;bottom: 21px;visibility: hidden;height: 36px;margin: unset;width: 120px;position: absolute;z-index: 1;}#videos-footer-push-to-talk{border-radius: unset}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{border-radius: unset;}#videos-footer-broadcast-wrapper.moderation>#videos-footer-broadcast{padding: unset}#videos-footer #music-radio button:hover{background: #53b6ef;cursor: pointer;}#videos-footer #music-radio{left: 0;border-radius: 12px;background: #101314;}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}#videos-footer{cursor:pointer;top: calc(30% + 119px);display:block;padding: 2px 0 0 11px;text-shadow: -1px 0 black,0 1px black,1px 0 black,0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;left: unset;right: -70px;height: 22px;min-height: 22px;z-index: 2;width: 70px;position: absolute}#videos-footer-broadcast{border-radius:unset;z-index: 1;padding: unset!important;white-space: pre}#videos-footer-broadcast-wrapper{z-index: 0;visibility: visible;height: 50px;min-height: 50px;width: 400px;padding: unset;right: 0;left: unset;position: fixed;top: calc(30% + 34px)}span[title=\"Settings\"]>svg{padding:4px;height:24px;width:24px}#seek-duration{pointer-events: none;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 600 20px sans-serif}#videos{bottom: 0;left: 0;right: 0;top: 0}:host,#videolist{background:unset!important;}.video:after{content: unset;border:unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header{z-index: 3;background:#101314;transition: none;left: unset;right: 0;width: 400px;top: calc(30%);position: fixed;max-height: 34px;min-height: 34px;}#videos-header>span{display:block;line-height: unset;}#videos-header-sound>svg{padding: 4px}#videos-header-fullscreen > svg {padding: 7px 8px;}";
  310. RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{padding-top:0!important;background:unset!important;}";
  311. TitleCSS = "#room-header-avatar{display:none}#room-header-gifts{display:none}#room-header-info-text{display:none}#room-header-info-details{display:none}#room-header-mobile-button{display:none}#room-header{border:unset;z-index:1;min-height:36px!important;max-height:36px!important;min-width:400px;max-width:400px;top:calc(30% + 84px);right:0;position:fixed;background: linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(9, 41, 57)100%);}#room-header-info>h1{height:100%;top: unset;left: unset;right: unset;text-transform:uppercase;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:600 20px sans-serif;color:#FFFFFF;}#room-header-info>h1:after{content:unset;}#room-header-info {padding: 7px 0 0 6px!important;box-sizing: border-box;width: 100%!important;top: 0!important;left: 0!important;right: 0!important;}#room-he#room-header-info>span{right: 8px;position: absolute;top:7px;margin-top:0!important;}";
  312. SideMenuCSS = "#close-users{display:none!important;}#user-info{display:none;}#top-buttons-wrapper{display:none;}@media screen and (max-width: 600px) {#sidemenu {top:unset;z-index:2;padding-bottom:0;margin-top:0;}}#sidemenu-wider{display:none;}#sidemenu-content::-webkit-scrollbar{width:0;background:transparent;}#sidemenu{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:300 20px sans-serif;left:unset!important;right:0!important;padding-bottom:0;height:30%!important;min-width:400px;max-width:400px;}#sidemenu-content{scrollbar-width:none;padding-top:unset;}";
  313. NotificationCSS = "#youtube.video{min-height:unset;min-width:unset;}#videos-header > span {background-color: unset!important;line-height: unset;}.PMTime{display:inline-block;padding:0 6px 0 0;margin:0 8px 0 0;border-right:4px groove #797979;}.PMName{display:inline-block;}#popup div{word-break: break-word;white-space: pre-line;word-wrap: break-word;user-select: text;-webkit-user-select: text;-moz-user-select: text;color:#FFFFFF;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font-weight: 300;font-size: 18px;font-family: sans-serif;z-index:1;}.PMOverlay{height: calc(100% - 92px);overflow: hidden;pointer-events:none;position:absolute;padding-top:12px;top:0;bottom:0;left:0;right:0;visibility:visible;}.PMPopup{pointer-events:all;margin:5px auto;width:50%;position:relative;color: #FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}.PMPopup a, .PMPopup a:visited, .PMPopup a:hover, .PMPopup a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.PMPopup a:hover{color:#FFFFFF;text-decoration:underline;}.PMPopup h2{border-radius:5px 5px 0 0;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0 0 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
  314. UserListCSS = "#userlist{padding-bottom:40px;}.list-item>span>span[data-cam=\"1\"]:after{height:15px;width:15px;background-image:url(https://i.imgur.com/QKSbq8d.png);}.list-item>span>span[data-moderator=\"1\"]:before{margin-right:3px;width:15px;height:15px;background-image:url(https://i.imgur.com/CEA9aro.png);}.list-item>span>span{background:transparent;box-shadow:none;}.list-item>span>span>.send-gift{top:4px;}.list-item>span>img{top:6px;}#button-banlist{color:#53b6ef;transition:none;top:calc(30% + 89px);right:3px;position:fixed;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#userlist>div{height:22px;}#userlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#userlist>#header{height:40px;top:10px;}#contextmenu {top:unset!important;bottom:0!important;right:0!important;left:0!important;}";
  315. ModeratorCSS = ".video{width: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{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:100%}";
  316. ContextMenuCSS = ".context[data-mode=\"dark\"] > span:hover{background-color:#04caff;}.context.show{height:100%;}.context:after{content:unset;}.context>span{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:800 14px sans-serif;color:#FFFFFF;display:inline-block;padding:1px 1%;line-height:17px;height:17px;}.context{background:#101314;position:unset;padding:0;height:0;transition:.25s;}";
  317. }
  318. //INITIATE
  319. CTSInit();
  320.  
  321. function CTSInit() {
  322. //INITIATE CTS
  323. var err_out = 0;
  324. CTS.ScriptLoading = setInterval(function() {
  325. err_out++;
  326. if (document.querySelector("tinychat-webrtc-app")) {
  327. if (document.querySelector("tinychat-webrtc-app").shadowRoot) CTSRoomInject();
  328. debug("TINYCHAT::LOAD", "ROOM");
  329. } else if (document.querySelector("#welcome-wrapper")) {
  330. CTSHomeInject();
  331. debug("TinyChat::LOAD", "HOME");
  332. } else {
  333. err_out++;
  334. }
  335. if (err_out == 50) {
  336. clearInterval(CTS.ScriptLoading);
  337. clearInterval(CTS.FullLoad);
  338. }
  339. }, 200);
  340. //WEBSOCKET HOOK
  341. if (!document.URL.match(/^https:\/\/tinychat\.com\/(?:$|#)/i)) {
  342. new MutationObserver(function() {
  343. this.disconnect();
  344. CTSWebSocket();
  345. }).observe(document, {
  346. subtree: true,
  347. childList: true
  348. });
  349. }
  350. //FULLY LOADED -> RUNALL
  351. CTS.FullLoad = setInterval(function() {
  352. if (CTS.ScriptInit && CTS.SocketConnected) {
  353. clearInterval(CTS.FullLoad);
  354. if (CTS.Me.mod) {
  355. if (CTS.Bot) CheckHost();
  356. if (CTS.Room.YT_ON) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  357. if (CTS.Room.YT_ON && CTS.Project.isTouchScreen) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").classList.toggle("hidden");
  358. //VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
  359. }
  360. //Discord
  361. Discord();
  362. //PTT AUTO
  363. if (CTS.Room.PTT) {
  364. VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
  365. e = e || window.event;
  366. if (e.which == 1) CTS.AutoMicrophone = false;
  367. if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  368. if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  369. }, {
  370. passive: true
  371. });
  372. }
  373. //FAVORITE ROOM
  374. var favorited_rooms = "",
  375. len = CTS.FavoritedRooms.length,
  376. script = document.createElement("script"),
  377. elem = document.getElementsByTagName("script")[0];
  378. script.text = 'function AddFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'FavoritedRooms"));\n val[index]=["' + CTS.Room.Name + '"];\n localStorage.setItem("' + CTS.Project.Storage + 'FavoritedRooms", JSON.stringify(val));\n obj.href ="https://tinychat.com/room/' + CTS.Room.Name + '";\n obj.innerText = "' + CTS.Room.Name + '";\n obj.onclick = null;\n return false;\n}';
  379. elem.parentNode.insertBefore(script, elem);
  380. for (var i = 0; i < len; i++) favorited_rooms += CTS.FavoritedRooms[i] !== null ? "<span>#" + (i + 1) + ' <a href="https://tinychat.com/room/' + CTS.FavoritedRooms[i] + '">' + CTS.FavoritedRooms[i] + "</a></span>" : "<span>#" + (i + 1) + ' <a href="#" onclick="return AddFavorite(this,' + i + ');">ADD ROOM</a></span>';
  381. ChatLogElement.querySelector("#input").insertAdjacentHTML("afterbegin", '<div id="header-user"><label id="label-user" for="input-user"><img class="switcher" src="' + (CTS.Me.avatar ? CTS.Me.avatar : "https://avatars.tinychat.com/standart/small/eyePink.png") + '"></label><input type="checkbox" id="input-user" hidden=""><div id="user-menu"><span id="nickname">FAVORITED ROOMS</span>' + favorited_rooms + '<span id="title">' + CTS.Me.username + '</span><span><a href="https://tinychat.com/settings/gifts"> My Gifts</a></span><span><a href="https://tinychat.com/settings/profile">Profile</a></span><span><a href="https://tinychat.com/room/' + CTS.Me.username + '">My Room</a></span><span><a href="https://tinychat.com/#">Directory</a></span></div></div>');
  382. //RECENT GIFTS
  383. var recent_gifts = "\n";
  384. for (var g = 0; g < CTS.Room.Recent_Gifts.length; g++) recent_gifts += "<img src=\"" + CTS.Room.Recent_Gifts[g] + "\" />";
  385. //ALERT
  386. Settings("<center><u>" + CTS.Room.Name.toUpperCase() + "</u>" + (CTS.Room.Avatar ? '\n<img src="' + CTS.Room.Avatar + '">' : "") + "\n" + CTS.Room.Bio + '\n<a href="' + CTS.Room.Website + '" target="_blank">' + CTS.Room.Website + "</a>" + ((recent_gifts != "") ? recent_gifts : "") + "\n\nROOM CONFIGURATION:\nYouTube Mode: " + ((CTS.Room.YT_ON) ? "ON" : "OFF") + "\n\n</center>");
  387. CTS.ShowedSettings = true;
  388. AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
  389. //FEATURE LAUNCH
  390. SoundMeter();
  391. Reminder();
  392. Events();
  393. PerformanceModeInit(CTS.PerformanceMode);
  394. }
  395. }, 500);
  396. }
  397.  
  398. function CTSHomeInject() {
  399. var HomeCSS = "@media screen and (max-width: 1000px){.nav-menu {background-color: #181e1f;}}.nav-sandwich-menu-button{background-color:unset;}#modalfree-wrapper{display: none;}.tile-header > img {transition:unset;}.tile-favroom-opt{cursor:pointer;position: absolute;right: 0;top: 0;padding: 1px;background:#10131494;}.tile-favroom-opt:hover{background:#ff00008c;}#content{padding-bottom:unset;}.tile-content{height:180px;}.cts-footer-contents .tile-info{height:20px}.cts-footer-contents .tile-header>img{cursor:pointer;height: 220px;}.tile-header>img{height: 230px;width: 100%;max-width: 100%;}.cts-footer:hover .cts-footer-contents .tile{font-size: 18px;font-weight: 800;width:20%;display:inline-block;}.cts-footer-contents .tile {background: #00a2ff;text-align: center;border:unset;height:unset;display:none;margin: unset;}.cts-footer {background:#10131494;width: 100%;position: fixed;bottom: 0;left: 0;}#catalog > div {display: inline-block;padding: 5px;box-sizing: border-box;}.tile[data-status=\"pro\"], .tile[data-status=\"extreme\"], .tile[data-status=\"gold\"] {margin-top: 12px;}.tile-header {border-radius: 12px 12px 0 0;}#promoted .tile-header > img{width:100%;}#navigation > label{border-radius:12px;}#welcome>div{padding-top:0}.tile-statistic{padding-top:0;padding-bottom:4px;background: #000000a6;}.tile-name{padding-top:unset;}#promote-button{border-radius: 12px 12px 0 0;}tile-name{padding-top:unset;}.tile-info{bottom:unset;top:0;height:28px;}.cts-footer > h2, #promoted-wrapper > h2, #trended-wrapper > h2, #header-for-all{text-align: center;font-size: 30px;font-weight: 800;}body{background:" + CTS.MainBackground + ";background-size:cover;background-attachment: fixed;}.tile-content-info-icon > img {display:none;}.tile-content-info{font-size: 14px;font-weight: 600;}#promoted .tile-content-info-text{word-break: break-word;max-height:95px;}.tile{border:2px solid #fff;margin-top: 13px;height:425px;}#loadmore-no-more {background:#101314;}.tile-content > img{display:none;}#welcome-wrapper{background: #10131494;border-bottom:unset;}#loadmore{background: #00a2ff;font-weight: 600;}#user-menu{background: #101314;}#nav-static-wrapper {-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background:#101314;}#up-button:hover > #up-button-content {background: #10131459;}#nav-fixed{border-bottom:unset;}#nav-fixed-wrapper{-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background: #101314;}#nav-static {border-bottom:unset;}#welcome{padding:12px 30px 24px;}.tile{border-radius: 12px;background: #101314b3;}div, span, a, h1, h2, h3, h4, h5, h6, p {text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color: #FFFFFF!important;}#promoted-wrapper > div, #trended-wrapper > div {background: #00a2ff;border-radius: 12px;}.tile-content-info-text {word-break: break-word;width:100%;}.tile-content-info.with-icon {display: contents;}#navigation > label:not([for=\"input-catalog-navigation\"]) {font-weight:600;background: #000000;}";
  400. //INSERT HTML/CSS
  401. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  402. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  403. //INSERT SCRIPT
  404. var script = document.createElement("script"),
  405. elem = document.getElementsByTagName("script")[0];
  406. script.text = 'function RemoveFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'FavoritedRooms"));\n val[index]=null;\n localStorage.setItem("' + CTS.Project.Storage + 'FavoritedRooms", JSON.stringify(val));\n return obj.parentNode.parentNode.remove();\n}';
  407. elem.parentNode.insertBefore(script, elem);
  408. var len = CTS.FavoritedRooms.length;
  409. for (var i = 0; i < len; i++) document.body.querySelector(".cts-footer-contents").insertAdjacentHTML("beforeend", CTS.FavoritedRooms[i] !== null ? '<div class="tile" data-room-name="' + CTS.FavoritedRooms[i] + '">Favorite #' + (i + 1) + ' <div class="tile-header"><img id="tile-header-image" src=\"https://upload.tinychat.com/pic/'+CTS.FavoritedRooms[i]+'\")' + '" onload="MasonryTails.Refresh();" onclick="locationTo(\'/room/' + CTS.FavoritedRooms[i] + '\');"><div class="tile-info"><div class="tile-favroom-opt" onclick="RemoveFavorite(this,' + i + ')">X</div><div class="tile-name">' + CTS.FavoritedRooms[i] + '</div><div class="tile-statistic"><svg width="18" height="14" viewBox="0 0 18 14" xmlns="https://www.w3.org/2000/svg"><path d="M9.333 5.667c0-.367-.3-.667-.666-.667h-8C.3 5 0 5.3 0 5.667v6.666C0 12.7.3 13 .667 13h8c.366 0 .666-.3.666-.667V10L12 12.667V5.333L9.333 8V5.667z" transform="translate(3 -3)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span><svg width="20" height="16" viewBox="0 0 20 16" xmlns="https://www.w3.org/2000/svg"><path d="M57 4c-3.182 0-5.9 2.073-7 5 1.1 2.927 3.818 5 7 5s5.9-2.073 7-5c-1.1-2.927-3.818-5-7-5zm0 8.495c1.93 0 3.495-1.565 3.495-3.495 0-1.93-1.565-3.495-3.495-3.495-1.93 0-3.495 1.565-3.495 3.495 0 1.93 1.565 3.495 3.495 3.495zm0-1.51c1.096 0 1.985-.89 1.985-1.985 0-1.096-.89-1.985-1.985-1.985-1.096 0-1.985.89-1.985 1.985 0 1.096.89 1.985 1.985 1.985z" transform="translate(-47 -2)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span></div></div></div></div>' : '<div class="tile">Favorite #' + (i + 1) + "</div>");
  410. //SCRIPT INIT -> PREPARE()
  411. clearInterval(CTS.ScriptLoading);
  412. CTS.ScriptInit = true;
  413. CTSHomePrepare();
  414. }
  415.  
  416. function CTSHomePrepare() {
  417. //FUNCTION BYPASS
  418. window.ModalFreeTrialPro = function() {};
  419. //REMOVE
  420. Remove(document, "#footer");
  421. Remove(document, ".nav-logo");
  422. }
  423.  
  424. function CTSRoomInject() {
  425. // PUBLIC / ADDON GRABBERS
  426. window.CTSImages = [
  427. "https://i.imgur.com/8M0NPCv.png", "https://i.imgur.com/6IAL4aM.png", "https://i.imgur.com/QdOTqIR.jpg", "https://i.imgur.com/qqFsein.jpg", "https://i.imgur.com/vVD5pUb.jpg", "https://i.imgur.com/Sux2Age.jpg", "https://i.imgur.com/cIKznlf.jpg", "https://i.imgur.com/iEMP5I6.jpg", "https://i.imgur.com/rEGy1tK.jpg", "https://i.imgur.com/JR6Ped5.jpg", "https://i.imgur.com/m3dX7yn.jpg", "https://i.imgur.com/2cJqV1K.jpg", "https://i.imgur.com/QL1M4yG.jpg", "https://i.imgur.com/Syy1mUU.jpg", "https://i.imgur.com/sRpDOp3.jpg", "https://i.imgur.com/Im7dWdM.jpg", "https://i.imgur.com/9uCdYyq.png", "https://i.imgur.com/X9Kp6ka.jpg", "https://i.imgur.com/TOZTx1M.jpg", "https://i.imgur.com/wcjxVjk.png", "https://i.imgur.com/UZfmih9.png", "https://i.imgur.com/mkauZUT.jpg", "https://i.imgur.com/GfPqv7d.jpg", "https://i.imgur.com/R7AOtjV.jpg", "https://i.imgur.com/Qso6n8k.jpg", "https://i.imgur.com/vVfj23z.jpg", "https://i.imgur.com/BYPsShX.jpg", "https://i.imgur.com/1EWYBQw.jpg", "https://i.imgur.com/Oaq0eip.jpg", "https://i.imgur.com/HVHaJ1r.jpg", "https://i.imgur.com/SImcSc2.png", "https://i.imgur.com/CgRDCdy.jpg", "https://i.imgur.com/VMtXsES.png", "https://i.imgur.com/oxHz9un.jpg", "https://i.imgur.com/VN6x9QA.jpg", "https://i.imgur.com/9KhjWvW.jpg", "https://i.imgur.com/fu0eiv4.jpg", "https://i.imgur.com/QgcvxZf.jpg", "https://i.imgur.com/2kz8Roz.jpg", "https://i.imgur.com/A2AdQd8.jpg", "https://i.imgur.com/zuNUJ4J.jpg", "https://i.imgur.com/CW4mVWE.jpg", "https://i.imgur.com/0NGecGX.jpg", "https://i.imgur.com/4IEcVlr.jpg", "https://i.imgur.com/JDnQzF4.jpg", "https://i.imgur.com/Ye6iIrw.jpg", "https://i.imgur.com/DVlwQFN.jpg", "https://i.imgur.com/G6Oa9s6.jpg", "https://i.imgur.com/cXpEHvX.jpg", "https://i.imgur.com/ANXRz54.jpg", "https://i.imgur.com/i7KvpAf.jpg", "https://i.imgur.com/kJ44IQQ.jpg", "https://i.imgur.com/5ONal5c.jpg", "https://i.imgur.com/nWuC5FK.jpg", "https://i.imgur.com/ZYNsEN6.jpg", "https://i.imgur.com/C3aVnBq.jpg", "https://i.imgur.com/8Kts9t7.jpg", "https://i.imgur.com/QiaDx3C.jpg", "https://i.imgur.com/wrt6zBN.jpg", "https://i.imgur.com/3YgGoV0.jpg", "https://i.imgur.com/HPsbhiF.jpg", "https://i.imgur.com/X4wSs8f.jpg", "https://i.imgur.com/cqeMox0.jpg", "https://i.imgur.com/apNgmSO.jpg", "https://i.imgur.com/YjYcyCn.jpg", "https://i.imgur.com/2hUFTDv.png", "https://i.imgur.com/7lDQKff.jpg", "https://i.imgur.com/yuQTkOy.png", "https://i.imgur.com/7zvCOpV.jpg", "https://i.imgur.com/L5v6bcs.jpg", "https://i.imgur.com/5h3N2HY.jpg", "https://i.imgur.com/AvhrIcv.jpg", "https://i.imgur.com/DsAMAG1.jpg", "https://i.imgur.com/dDvOwXi.jpg", "https://i.imgur.com/ii00Lnl.jpg",
  428. "https://i.imgur.com/vHDQY7N.jpg", "https://i.imgur.com/czfeyXQ.jpg", "https://i.imgur.com/pHEAee2.jpg", "https://i.imgur.com/txu4z7B.jpg", "https://i.imgur.com/NOapG69.jpg", "https://i.imgur.com/cxA4ist.jpg", "https://i.imgur.com/2keIszu.jpg", "https://i.imgur.com/q2Kpinf.jpg", "https://i.imgur.com/nDiFD2D.jpg", "https://i.imgur.com/Lvk0Lql.jpg", "https://i.imgur.com/QcRIeBr.jpg", "https://i.imgur.com/GlBONNB.jpg", "https://i.imgur.com/jVmJ9Iz.jpg", "https://i.imgur.com/9h2N288.png", "https://i.imgur.com/q0Rm3dS.jpg", "https://i.imgur.com/1tTKfKM.png", "https://i.imgur.com/nEwJBan.jpg", "https://i.imgur.com/NgE4lXY.jpg", "https://i.imgur.com/I4Pv5Zc.jpg", "https://i.imgur.com/QVDBSEm.jpg", "https://i.imgur.com/N9KfkgT.jpg", "https://i.imgur.com/mLIDP8a.jpg", "https://i.imgur.com/C8fAtMn.jpg", "https://i.imgur.com/e2Pubr3.jpg", "https://i.imgur.com/6drF4lG.jpg", "https://i.imgur.com/JcFhmPT.jpg", "https://i.imgur.com/wQQlX06.jpg", "https://i.imgur.com/qPTFnVp.jpg", "https://i.imgur.com/KWto7ab.jpg", "https://i.imgur.com/DHEdXnE.jpg", "https://i.imgur.com/49vqbrB.jpg", "https://i.imgur.com/TK4I9DI.jpg", "https://i.imgur.com/o5QNrcQ.jpg", "https://i.imgur.com/49adw4l.jpg", "https://i.imgur.com/vyYOZkE.jpg", "https://i.imgur.com/sBaXCoY.jpg", "https://i.imgur.com/dH0M8aN.png", "https://i.imgur.com/aqZ4VDh.jpg", "https://i.imgur.com/hMpMR84.jpg", "https://i.imgur.com/5zR2i8W.jpg", "https://i.imgur.com/oUPXbGf.jpg", "https://i.imgur.com/YW5tv1t.jpg", "https://i.imgur.com/JgKwHXs.jpg", "https://i.imgur.com/2k9JihV.jpg", "https://i.imgur.com/V5MUGj4.jpg", "https://i.imgur.com/3dUgoAf.jpg", "https://i.imgur.com/Q6aJgBM.jpg", "https://i.imgur.com/gRSmljE.jpg", "https://i.imgur.com/nkhsbE9.jpg", "https://i.imgur.com/I6LMqZq.jpg", "https://i.imgur.com/7OzdeRk.jpg", "https://i.imgur.com/wW94Pvc.jpg", "https://i.imgur.com/jQrTdv2.jpg", "https://i.imgur.com/UDgQ2Fh.jpg", "https://i.imgur.com/qjdMmPf.jpg", "https://i.imgur.com/yh7QoUN.jpg", "https://i.imgur.com/XchwuKo.jpg", "https://i.imgur.com/fdPaQbz.jpg", "https://i.imgur.com/zNfKy8I.jpg", "https://i.imgur.com/TaOf7dX.jpg", "https://i.imgur.com/bZxfyu8.jpg", "https://i.imgur.com/ccZRfsA.jpg", "https://i.imgur.com/wlbmT74.jpg", "https://i.imgur.com/29ffHeU.jpg", "https://i.imgur.com/30HbBAA.jpg", "https://i.imgur.com/4pO8b0B.jpg", "https://i.imgur.com/kD6BveQ.jpg", "https://i.imgur.com/LrCsiQj.jpg", "https://i.imgur.com/QN5NcXK.jpg", "https://i.imgur.com/MWW5cOv.jpg", "https://i.imgur.com/7LvskAH.jpg", "https://i.imgur.com/S7kLNct.jpg", "https://i.imgur.com/rL0olge.jpg", "https://i.imgur.com/0Apm59C.jpg", "https://i.imgur.com/ZMRBVvO.jpg",
  429. "https://i.imgur.com/xFNZTwS.jpg", "https://i.imgur.com/iqq8ECW.jpg", "https://i.imgur.com/xEth2qp.jpg", "https://i.imgur.com/8ijIZMj.jpg", "https://i.imgur.com/zSB1DOw.jpg", "https://i.imgur.com/6TzjZSd.jpg", "https://i.imgur.com/Gf9yAwP.jpg", "https://i.imgur.com/u5ifVZy.jpg", "https://i.imgur.com/4ibO4FN.jpg", "https://i.imgur.com/bDCygo7.jpg", "https://i.imgur.com/lqktMar.jpg", "https://i.imgur.com/b2jAXiC.jpg", "https://i.imgur.com/oPE32ni.jpg", "https://i.imgur.com/YRjfPjP.jpg", "https://i.imgur.com/1FRwNEb.jpg", "https://i.imgur.com/dzgvlEx.jpg", "https://i.imgur.com/3FCAMiu.jpg", "https://i.imgur.com/wF5k6Ux.jpg", "https://i.imgur.com/mkuNYYa.jpg", "https://i.imgur.com/Y2Yu3yA.jpg", "https://i.imgur.com/Zchlast.jpg", "https://i.imgur.com/2FbH2jq.jpg", "https://i.imgur.com/Bb4iyy0.jpg", "https://i.imgur.com/7rjAtTt.jpg", "https://i.imgur.com/g1rNC8Z.jpg", "https://i.imgur.com/RC3bKe7.jpg", "https://i.imgur.com/qloc683.jpg", "https://i.imgur.com/irmzqz7.jpg", "https://i.imgur.com/pvmhbwL.jpg", "https://i.imgur.com/Xti1aEf.jpg", "https://i.imgur.com/FqFYows.jpg", "https://i.imgur.com/92zz2Zu.jpg", "https://i.imgur.com/jWrqBga.jpg", "https://i.imgur.com/OMSQsDe.jpg", "https://i.imgur.com/bvTtaLQ.jpg", "https://i.imgur.com/vxt6B7Y.jpg", "https://i.imgur.com/siw7Ipn.jpg", "https://i.imgur.com/paQsmXk.jpg", "https://i.imgur.com/VLHs9cT.png", "https://i.imgur.com/6VSxbJY.jpg", "https://i.imgur.com/C3Xn1WD.jpg", "https://i.imgur.com/d6BBFfS.jpg", "https://i.imgur.com/HyK1BFP.jpg", "https://i.imgur.com/2InicOt.jpg", "https://i.imgur.com/IVM4luE.jpg", "https://i.imgur.com/VLE0zNA.jpg", "https://i.imgur.com/rfgwqVI.jpg", "https://i.imgur.com/GsTMYfk.jpg", "https://i.imgur.com/yMEdYBN.jpg", "https://i.imgur.com/LvrO8oB.jpg", "https://i.imgur.com/1VBNkJP.jpg", "https://i.imgur.com/beuJiKd.jpg", "https://i.imgur.com/61h9Twq.jpg", "https://i.imgur.com/mnszrZ3.jpg", "https://i.imgur.com/He8K7kF.jpg", "https://i.imgur.com/id5BSLh.jpg", "https://i.imgur.com/huazhWL.jpg", "https://i.imgur.com/ttc4EYq.jpg", "https://i.imgur.com/HTO5tGy.jpg", "https://i.imgur.com/Pg1NrT1.jpg", "https://i.imgur.com/HEubZeG.jpg", "https://i.imgur.com/yk4XVVu.jpg", "https://i.imgur.com/Q6xqV8U.jpg", "https://i.imgur.com/ROTOMPV.jpg", "https://i.imgur.com/5DBP49J.jpg", "https://i.imgur.com/1pafkRu.jpg", "https://i.imgur.com/ZYJW79s.jpg", "https://i.imgur.com/5hJnezu.jpg", "https://i.imgur.com/LHRwsur.jpg", "https://i.imgur.com/858hMb9.jpg", "https://i.imgur.com/WOtpN81.jpg", "https://i.imgur.com/ITCxNl1.jpg", "https://i.imgur.com/OvXfe6w.jpg", "https://i.imgur.com/EVYKONX.jpg", "https://i.imgur.com/9nP4KwW.jpg",
  430. "https://i.imgur.com/1SaESYp.jpg", "https://i.imgur.com/xBQlQKh.jpg", "https://i.imgur.com/yonFqV5.jpg", "https://i.imgur.com/go0xMSw.png", "https://i.imgur.com/jJhFpGw.jpg", "https://i.imgur.com/fcULcZq.jpg", "https://i.imgur.com/66l2lHM.jpg", "https://i.imgur.com/bujMfoQ.jpg", "https://i.imgur.com/JdbenHz.jpg", "https://i.imgur.com/merXbme.jpg", "https://i.imgur.com/ogrqxoQ.jpg", "https://i.imgur.com/fCstr3I.jpg", "https://i.imgur.com/t4d6ngW.jpg", "https://i.imgur.com/QzTlCSw.png", "https://i.imgur.com/CjrvvRI.jpg", "https://i.imgur.com/Du0abK6.jpg", "https://i.imgur.com/fZxRbtq.jpg", "https://i.imgur.com/zJB8VZc.jpg", "https://i.imgur.com/5lFG1Bf.jpg", "https://i.imgur.com/hvGzGNb.png", "https://i.imgur.com/UHZ8gC6.jpg", "https://i.imgur.com/ZIlJIIZ.png", "https://i.imgur.com/H7SjU1N.jpg", "https://i.imgur.com/yxxQsmf.jpg", "https://i.imgur.com/1TBkVzd.jpg", "https://i.imgur.com/3WffDw4.jpg", "https://i.imgur.com/XQU3W19.png", "https://i.imgur.com/2YxUgbQ.jpg", "https://i.imgur.com/8TVSB7D.jpg", "https://i.imgur.com/lNfEZwF.jpg", "https://i.imgur.com/2CgZewR.jpg", "https://i.imgur.com/ZJMFXGM.jpg", "https://i.imgur.com/9pZLYVF.jpg", "https://i.imgur.com/i9KaWdK.jpg", "https://i.imgur.com/X0hUxMg.jpg", "https://i.imgur.com/cWNLBLC.jpg", "https://i.imgur.com/oVQ1qmK.jpg", "https://i.imgur.com/MFa4WPr.jpg", "https://i.imgur.com/QalYWeA.png", "https://i.imgur.com/bLAlVzX.jpg", "https://i.imgur.com/OEXO2kT.jpg", "https://i.imgur.com/MnK5lmL.jpg", "https://i.imgur.com/dVMdMZh.jpg", "https://i.imgur.com/nNfOFvX.png", "https://i.imgur.com/yzoTLrK.jpg", "https://i.imgur.com/b1mTB58.jpg", "https://i.imgur.com/uWMQpMV.jpg", "https://i.imgur.com/TVGqTdH.jpg", "https://i.imgur.com/GFfZk0L.jpg", "https://i.imgur.com/aS5RCaX.jpg", "https://i.imgur.com/TTWYjDg.png", "https://i.imgur.com/OKUbuLl.jpg", "https://i.imgur.com/FyIJb7S.jpg", "https://i.imgur.com/KVTNHKB.jpg", "https://i.imgur.com/G9cpqNM.jpg", "https://i.imgur.com/cFf5e30.jpg", "https://i.imgur.com/1Nok0ho.jpg", "https://i.imgur.com/ozEWuPz.jpg", "https://i.imgur.com/QhHTLxc.jpg", "https://i.imgur.com/YYto1AX.jpg", "https://i.imgur.com/1THGvEA.jpg", "https://i.imgur.com/Rt3mp6H.jpg", "https://i.imgur.com/M2tiiNS.jpg", "https://i.imgur.com/lRtAxDM.jpg", "https://i.imgur.com/dlqkyFg.jpg", "https://i.imgur.com/lSLHeHM.png", "https://i.imgur.com/wKBOEof.png", "https://i.imgur.com/0aF2Si4.jpg", "https://i.imgur.com/bPDtdqH.jpg", "https://i.imgur.com/wZ08FwN.jpg", "https://i.imgur.com/gEtlvpr.jpg", "https://i.imgur.com/sTrwc9U.jpg", "https://i.imgur.com/nPEjErr.png", "https://i.imgur.com/bRaK26l.jpg", "https://i.imgur.com/vwJe85N.jpg",
  431. "https://i.imgur.com/F8RFA5t.jpg", "https://i.imgur.com/M08DwfB.jpg", "https://i.imgur.com/gvF4hmM.jpg", "https://i.imgur.com/vINAgNJ.jpg", "https://i.imgur.com/ZzIHnk7.png", "https://i.imgur.com/IaYE1SA.png", "https://i.imgur.com/h3uA809.jpg", "https://i.imgur.com/uSxy1TH.jpg", "https://i.imgur.com/ihUpL67.jpg", "https://i.imgur.com/JA5pSwV.jpg", "https://i.imgur.com/S5PaNRb.jpg", "https://i.imgur.com/vPKxrIj.jpg", "https://i.imgur.com/Zb2vtPA.jpg", "https://i.imgur.com/uUkxBYp.jpg", "https://i.imgur.com/fpsAui6.jpg", "https://i.imgur.com/Ns5gM3Y.jpg", "https://i.imgur.com/qUFLtvX.jpg", "https://i.imgur.com/JsVmBaH.jpg", "https://i.imgur.com/DUFEeDG.jpg", "https://i.imgur.com/VkT9WNe.jpg", "https://i.imgur.com/7rHa1t1.jpg", "https://i.imgur.com/6rt4Xsc.jpg", "https://i.imgur.com/1woJRNz.jpg", "https://i.imgur.com/DZizgSe.jpg", "https://i.imgur.com/WcPkq2p.jpg", "https://i.imgur.com/FWgshWM.jpg", "https://i.imgur.com/ce28KTw.jpg", "https://i.imgur.com/Z1kgLE9.jpg", "https://i.imgur.com/qmTDbVf.jpg", "https://i.imgur.com/Glfmlwk.jpg", "https://i.imgur.com/1ZlA3eI.jpg", "https://i.imgur.com/FyY9zQB.jpg", "https://i.imgur.com/5vION1i.jpg", "https://i.imgur.com/GN8VSLo.jpg", "https://i.imgur.com/fMHj9aD.png", "https://i.imgur.com/AZKVqlm.jpg", "https://i.imgur.com/N6yrNAp.jpg", "https://i.imgur.com/mzfGu1K.jpg", "https://i.imgur.com/PbDAvp8.jpg", "https://i.imgur.com/PeKxWNd.png", "https://i.imgur.com/q6HucmK.jpg", "https://i.imgur.com/PcpoEr9.jpg", "https://i.imgur.com/m8MKD34.jpg", "https://i.imgur.com/rEfHYFj.png", "https://i.imgur.com/YOnQC7m.jpg", "https://i.imgur.com/IKZ1dnz.png", "https://i.imgur.com/7dKl6GR.jpg", "https://i.imgur.com/7QTdYyC.jpg", "https://i.imgur.com/VY6CRU9.jpg", "https://i.imgur.com/JbbTXGZ.jpg", "https://i.imgur.com/LiWognc.jpg", "https://i.imgur.com/lAlCmCS.jpg", "https://i.imgur.com/tuoVfDz.jpg", "https://i.imgur.com/jDtr7VV.jpg", "https://i.imgur.com/Fmq1w0x.jpg", "https://i.imgur.com/SW9tEby.jpg", "https://i.imgur.com/OIeGtF1.jpg", "https://i.imgur.com/y28VX6l.jpg", "https://i.imgur.com/SmN01pH.jpg", "https://i.imgur.com/pYIHV3V.jpg", "https://i.imgur.com/4mefbZJ.jpg", "https://i.imgur.com/CrnksCn.jpg", "https://i.imgur.com/DqdQHU5.jpg", "https://i.imgur.com/Kyp7Mrq.jpg", "https://i.imgur.com/5uUI0FK.jpg", "https://i.imgur.com/nYyKnjc.jpg", "https://i.imgur.com/8yngY9r.png", "https://i.imgur.com/LXTztRk.jpg", "https://i.imgur.com/YW9f04H.jpg", "https://i.imgur.com/VEOTdF4.jpg", "https://i.imgur.com/CNcnljn.jpg", "https://i.imgur.com/cVyPQRQ.jpg", "https://i.imgur.com/QVnisWP.jpg", "https://i.imgur.com/xkOmSt2.jpg", "https://i.imgur.com/OWqkrGA.jpg",
  432. "https://i.imgur.com/407ypHE.jpg", "https://i.imgur.com/q7CBMPA.jpg", "https://i.imgur.com/jLgvLEB.jpg", "https://i.imgur.com/ZgRybJZ.jpg", "https://i.imgur.com/BCiqZoY.jpg", "https://i.imgur.com/C4FCE08.jpg", "https://i.imgur.com/mwQMddH.jpg", "https://i.imgur.com/c9Na9m7.jpg", "https://i.imgur.com/rvkOyhW.jpg", "https://i.imgur.com/fXikj5n.jpg", "https://i.imgur.com/B9nwfN2.jpg", "https://i.imgur.com/NitZTxZ.jpg", "https://i.imgur.com/4U7Wc6E.jpg", "https://i.imgur.com/wk2byhf.jpg", "https://i.imgur.com/kmeF9zK.jpg", "https://i.imgur.com/fpOurZh.jpg", "https://i.imgur.com/A6t86N6.jpg", "https://i.imgur.com/CnGthdb.jpg", "https://i.imgur.com/FgCA3uK.jpg", "https://i.imgur.com/sCYYhqf.jpg", "https://i.imgur.com/2NopGqw.jpg", "https://i.imgur.com/fzYZGdC.jpg", "https://i.imgur.com/nZufx8p.jpg", "https://i.imgur.com/IjMMreD.jpg", "https://i.imgur.com/HEpf4Eb.jpg", "https://i.imgur.com/jZeIfAc.jpg", "https://i.imgur.com/ZxaX4j0.jpg", "https://i.imgur.com/DXetwFt.jpg", "https://i.imgur.com/euIXHlP.jpg", "https://i.imgur.com/U4Mo2Hn.jpg", "https://i.imgur.com/w4pR6Hp.jpg", "https://i.imgur.com/79GciEk.jpg", "https://i.imgur.com/WpDbcAA.jpg", "https://i.imgur.com/YODAe6Z.jpg", "https://i.imgur.com/4It1NIe.jpg", "https://i.imgur.com/ALkfNHF.jpg", "https://i.imgur.com/xJOaHZP.jpg", "https://i.imgur.com/nFCIuJo.jpg", "https://i.imgur.com/oXgFh2K.jpg", "https://i.imgur.com/Vcs3jXT.jpg", "https://i.imgur.com/XGtJE58.jpg", "https://i.imgur.com/q4WalQY.jpg", "https://i.imgur.com/WFIyruV.jpg", "https://i.imgur.com/sItJMKv.jpg", "https://i.imgur.com/LAQ3Wpl.jpg", "https://i.imgur.com/C64XPAR.jpg", "https://i.imgur.com/hyehxek.jpg", "https://i.imgur.com/4XYBWKu.jpg", "https://i.imgur.com/KU1adf4.jpg", "https://i.imgur.com/L3sbodb.png", "https://i.imgur.com/JPMfbL9.jpg", "https://i.imgur.com/ieae2zo.jpg", "https://i.imgur.com/VVswQpo.jpg", "https://i.imgur.com/fWUr6ic.jpg", "https://i.imgur.com/juRIj2L.jpg", "https://i.imgur.com/2Mq8ZR8.jpg", "https://i.imgur.com/ibC5gSl.jpg", "https://i.imgur.com/63uHgyR.jpg", "https://i.imgur.com/xs3yEut.jpg", "https://i.imgur.com/0SYzA7u.jpg", "https://i.imgur.com/hRKhVTS.jpg", "https://i.imgur.com/IGv4V1p.jpg", "https://i.imgur.com/hmlxgXG.jpg", "https://i.imgur.com/q97Z7Nc.jpg", "https://i.imgur.com/1A6NPKj.jpg", "https://i.imgur.com/y97L14a.jpg", "https://i.imgur.com/DPohLPu.jpg", "https://i.imgur.com/JvXJ74s.jpg", "https://i.imgur.com/mA5b8Y1.jpg", "https://i.imgur.com/FVNerO1.jpg", "https://i.imgur.com/KNsh665.jpg", "https://i.imgur.com/Z9b0Gme.jpg", "https://i.imgur.com/z90LZmp.jpg", "https://i.imgur.com/tfXYXr7.png", "https://i.imgur.com/atHkjXl.jpg",
  433. "https://i.imgur.com/u1l34Vi.jpg", "https://i.imgur.com/X0yROLr.jpg", "https://i.imgur.com/EpHkJZI.jpg", "https://i.imgur.com/TIKipWb.jpg", "https://i.imgur.com/Lq4qnDF.jpg", "https://i.imgur.com/N1KmzQo.jpg", "https://i.imgur.com/pAReFTB.jpg", "https://i.imgur.com/ZKMQwxk.jpg", "https://i.imgur.com/aSDE7i4.jpg", "https://i.imgur.com/kabITqS.jpg", "https://i.imgur.com/W7oaDNe.jpg", "https://i.imgur.com/VHYmth8.jpg",
  434. ];
  435. window.CTSEightBall = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most Likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."];
  436. window.CTSWelcomes = ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "];
  437. window.CTSSound = {
  438. C: new Audio("https://media.vocaroo.com/mp3/e3VIvvFqdHe"),
  439. HIGHLIGHT: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  440. GREET: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  441. MENTION: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"),
  442. MSG: new Audio("https://tinychat.com" + window.rootDir + "/sound/pop.mp3"),
  443. GIFT: new Audio("https://tinychat.com" + window.rootDir + "/sound/magic.mp3"),
  444. PVTMSG: new Audio("https://media.vocaroo.com/mp3/1eX3L752VdQ")
  445. };
  446. window.CTSRadioStations = [
  447. ["Flex 98.5FM", "https://edge1-b.exa.live365.net/a23768"],
  448. ["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],
  449. ["HOT899", "https://newcap.leanstream.co/CIHTFM"],
  450. ["chillstep.info", "https://chillstep.info/listen.ogg"],
  451. ["HOT997", "https://ice5.securenetsystems.net/KHHK"],
  452. ["Dance365", "https://edge1-b.exa.live365.net/a93720"],
  453. ["kexp.org", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3"],
  454. ["Classic Deep Cuts", "https://edge1-b.exa.live365.net/a72496"],
  455. ["Divas Hustle Radio", "https://edge1-b.exa.live365.net/a72972"],
  456. ["Retro 8089", "https://edge1-b.exa.live365.net/a53202"],
  457. ["Teerex Radio Teerex", "https://edge1-b.exa.live365.net/a74387"],
  458. ["NGI Radio", "https://edge1-b.exa.live365.net/a24650"],
  459. ["Legend Oldies", "https://edge1-b.exa.live365.net/a88135"],
  460. ["Music City Roadhouse", "https://edge1-b.exa.live365.net/a73754"],
  461. ["Mashrup Reggae Radio", "https://edge1-b.exa.live365.net/a00564"],
  462. ["97.5 Dance Hits", "https://edge1-b.exa.live365.net/a50365"]
  463. ];
  464. window.CTSNameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  465. window.CTSChatCSS = [
  466. [ //STYLE #0
  467. ["#chat-wrapper{background:linear-gradient(0deg,rgba(32,38,40,0.59)0%,rgba(16,14,14,0.76)calc(100% - 62px),rgba(45,55,58,0.72)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  468. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  469. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  470. ],
  471. [ //STYLE #1
  472. ["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  473. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(58, 58, 58)8px,rgb(30, 30, 30)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  474. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
  475. ],
  476. [ //STYLE #2
  477. ["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  478. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(83, 17, 128)8px,rgb(68, 15, 103)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#7918bc;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#7918bc!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#460b6f!important;}#videos-footer-push-to-talk{background:#7918bc}#videos-footer-push-to-talk:hover{background:#460b6f}#videos-footer-broadcast:hover{background:#460b6f}#videos-footer-broadcast{background:#7918bc;}"],
  479. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
  480. ],
  481. [ //STYLE #3
  482. ["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  483. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(121, 3, 3)8px,rgb(176, 2, 2)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#c10101;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#c10101!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#6b0f0f!important;}#videos-footer-push-to-talk{background:#c10101}#videos-footer-push-to-talk:hover{background:#6b0f0f}#videos-footer-broadcast:hover{background:#6b0f0f}#videos-footer-broadcast{background:#c10101;}"],
  484. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
  485. ],
  486. [ //STYLE #4
  487. ["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  488. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(26, 59, 75)8px,rgb(59, 130, 170)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  489. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
  490. ],
  491. [ //STYLE #5
  492. ["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  493. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}"],
  494. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
  495. ],
  496. [ //STYLE #6
  497. ["#chat-wrapper{background:linear-gradient(0deg,rgba(0, 0, 0, 0.69)0%,rgba(0, 0, 0, 0.56)calc(100% - 62px),rgb(13, 179, 0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  498. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}"],
  499. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
  500. ],
  501. [ //STYLE #7
  502. ["#chat-wrapper{background: linear-gradient(0deg,rgb(255, 255, 255)0%,rgba(255, 255, 255, 0.82)calc(100% - 62px),rgb(255, 255, 255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  503. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  504. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
  505. ],
  506. [ //STYLE #8
  507. ["#chat-wrapper{background: linear-gradient(0deg,rgba(255, 255, 0, 1)0%,rgba(255, 255, 0, 0.82)calc(100% - 62px),rgba(255, 255, 0, 1)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  508. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(234, 236, 5)8px,rgb(180, 187, 15)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  509. ["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
  510. ],
  511. [ //STYLE #9
  512. ["#chat-wrapper{background: linear-gradient(0deg,rgb(119, 45, 2) 0%,rgb(24, 29, 30) 52%,rgb(234, 129, 38) 100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  513. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(226, 92, 19)8px,rgb(158, 73, 16)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  514. ["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
  515. ],
  516. [ //STYLE #10
  517. ["#chat-wrapper{background: linear-gradient(0deg,rgb(141, 36, 95)0%,rgba(191, 0, 255, 0.82)calc(100% - 62px),rgb(255, 0, 202)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  518. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(150, 0, 175)8px,rgb(176, 0, 226)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  519. ["#sidemenu{background: linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)100%);}"]
  520. ],
  521. [ //STYLE #11
  522. ["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  523. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  524. ["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}"]
  525. ],
  526. [ //STYLE #12
  527. [".stackmessage{background:#ffffff}#chat-wrapper{background: #fff!important;}.message>.systemuser{color:#FFFFFF}#cts-chat-content>.message{background:#00000000}.message{color:#000000;text-shadow: unset;}"],
  528. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  529. ["#sidemenu{background: #2d373a;}"]
  530. ],
  531. [ //STYLE #13
  532. ["#chat-wrapper{background: url(https://i.imgur.com/ek4TEsz.jpg)!important;}#cts-chat-content>.message{background:#17951a8c;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  533. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(37, 101, 27)8px,rgb(36, 98, 25)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  534. ["#sidemenu{background: url(https://i.imgur.com/LCOulGB.png) repeat-x bottom;}"]
  535. ],
  536. [ //STYLE #14
  537. ["#chat-wrapper{background:linear-gradient(0deg,rgba(32,38,40,0.59)0%,rgba(16,14,14,0.76)calc(100% - 62px),rgba(45,55,58,0.72)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  538. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  539. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  540. ],
  541. [ //STYLE #14
  542. ["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  543. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(58, 58, 58)8px,rgb(30, 30, 30)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  544. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  545. ],
  546. [ //STYLE #15
  547. ["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  548. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(83, 17, 128)8px,rgb(68, 15, 103)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#7918bc;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#7918bc!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#460b6f!important;}#videos-footer-push-to-talk{background:#7918bc}#videos-footer-push-to-talk:hover{background:#460b6f}#videos-footer-broadcast:hover{background:#460b6f}#videos-footer-broadcast{background:#7918bc;}"],
  549. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  550. ],
  551. [ //STYLE #16
  552. ["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  553. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(121, 3, 3)8px,rgb(176, 2, 2)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#c10101;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#c10101!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#6b0f0f!important;}#videos-footer-push-to-talk{background:#c10101}#videos-footer-push-to-talk:hover{background:#6b0f0f}#videos-footer-broadcast:hover{background:#6b0f0f}#videos-footer-broadcast{background:#c10101;}"],
  554. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  555. ],
  556. [ //STYLE #17
  557. ["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  558. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(26, 59, 75)8px,rgb(59, 130, 170)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  559. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  560. ],
  561. [ //STYLE #18
  562. ["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  563. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}"],
  564. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  565. ],
  566. [ //STYLE #19
  567. ["#chat-wrapper{background: linear-gradient(0deg,rgb(255, 255, 255)0%,rgba(255, 255, 255, 0.82)calc(100% - 62px),rgb(255, 255, 255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  568. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  569. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  570. ],
  571. [ //STYLE #20
  572. ["#chat-wrapper{background: linear-gradient(0deg,rgba(255, 255, 0, 1)0%,rgba(255, 255, 0, 0.82)calc(100% - 62px),rgba(255, 255, 0, 1)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  573. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(234, 236, 5)8px,rgb(180, 187, 15)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  574. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  575. ],
  576. [ //STYLE #21
  577. ["#chat-wrapper{background: linear-gradient(0deg,rgb(119, 45, 2) 0%,rgb(24, 29, 30) 52%,rgb(234, 129, 38) 100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  578. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(226, 92, 19)8px,rgb(158, 73, 16)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  579. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  580. ],
  581. [ //STYLE #22
  582. ["#chat-wrapper{background: linear-gradient(0deg,rgb(141, 36, 95)0%,rgba(191, 0, 255, 0.82)calc(100% - 62px),rgb(255, 0, 202)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  583. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(150, 0, 175)8px,rgb(176, 0, 226)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  584. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  585. ],
  586. [ //STYLE #23
  587. ["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  588. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  589. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  590. ],
  591. [ //STYLE #24
  592. ["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: #202628!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  593. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:#202628;}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
  594. ["#sidemenu{background:#202628;}"]
  595. ]
  596. ];
  597. //INSERT SCRIPT
  598. var script = document.createElement("script"),
  599. elem = document.getElementsByTagName("script")[0];
  600. script.text = 'var StationSelected = 0,\n StationPlay = false,\n StationVol = 1;\nfunction VolStation(elem, vol){\n var StationElem = elem.parentElement.nextSibling;\n var StationVolElem = elem.parentElement.querySelector(".music-radio-info>.volume");\nStationVol += vol;\n if (StationVol < 0){\n StationVol = 0;\n } else if (StationVol > 1) {\n StationVol = 1.0;\n }\n StationElem.volume = StationVol;\nStationVolElem.style.width=((StationVol * 100)+"%");}\nfunction PlayPauseStation(elem) {\n var StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n var StationElem=elem.parentElement.nextSibling;\nvar StationDescElem=elem.parentElement.querySelector(".music-radio-info>.description");\n StationPlay=!StationPlay;\n if (StationPlay) {\n StationElem.volume = StationVol;\n StationElem.play();\n StationPlayPauseBtn.innerText="❚❚"; StationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n} else {\n StationElem.pause();\nStationPlayPauseBtn.innerText="▶";\n StationDescElem.innerText = ("Paused: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);}\n}\nfunction SeekStation(elem, direction) {\n var StationElem = elem.parentElement.nextSibling;\n var StationDescElem = elem.parentElement.querySelector(".music-radio-info>.description");\nvar StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n StationPlay = true;\n StationSelected += direction;\n \n if (StationSelected > window.CTSRadioStations.length-1) {\n StationSelected = 0;\n } else if (StationSelected < 0){\n StationSelected = window.CTSRadioStations.length-1;\n }\n StationElem.pause();\n StationElem.setAttribute("src", window.CTSRadioStations[StationSelected][1]);\n StationElem.load();\n StationElem.volume = StationVol;\nStationPlayPauseBtn.innerText="❚❚";\n StationElem.play();\nStationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n}';
  601. elem.parentNode.insertBefore(script, elem);
  602. //LOCALSETTINGS
  603. CTS.enablePMs = window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enablePMs;
  604. CTS.enableSound = window.TinychatApp.BLL.SettingsFeature.prototype.getSettings().enableSound;
  605. //TTS (TEXT-TO-SPEECH)
  606. if (CTS.enableSound === true && "speechSynthesis" in window) {
  607. CTS.TTS.synth = window.speechSynthesis;
  608. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  609. }
  610. //ELEMENT DEFINE
  611. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  612. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  613. TextAreaElement = ChatLogElement.querySelector("#textarea");
  614. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  615. MicrophoneElement = document.createEvent("MouseEvent");
  616. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  617. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  618. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  619. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  620. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  621. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  622. var insert = TitleElement.querySelector('span[title="Settings"]');
  623. VideoListElement.querySelector("#videos-header").appendChild(insert);
  624. //INSERT HTML/CSS
  625. if (!CTS.Project.isTouchScreen) {
  626. insert = VideoListElement.querySelector("#videos-footer-broadcast-wrapper");
  627. VideoListElement.querySelector("#videolist").appendChild(insert);
  628. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  629. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("beforeend", '<div id="music-radio"><div class="music-radio-info"><div class="description">Playing: None<br>URL: None</div><div class="volume"></div></div><button class="music-radio-seek" onclick="SeekStation(this,-1);">&#8592;</button><button class="music-radio-seek" onclick="SeekStation(this,1);">&#8594;</button><button class="music-radio-playpause" onclick="PlayPauseStation(this);">&#9654;</button><button class="music-radio-vol" onclick="VolStation(this,.05);">&#43;</button><button class="music-radio-vol" style="top:50%" onclick="VolStation(this,-.05);">&#45;</button></div><audio id="music-radio-audio" src="' + window.CTSRadioStations[0][1] + '"></audio>');
  630. TitleCSS += "span[title=\"Follow\"], span[title=\"Share room\"]{display:none!important;}";
  631. } else {
  632. VideoCSS = ".video>div{border-radius:10px;}#youtube.video > div > .overlay, .video > div > .overlay {display: block!important;}#videos-footer-broadcast{border-radius:unset!important;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{border-radius:unset;}#videos-footer-push-to-talk{margin-left:0!important;border-radius:unset;}#videos-footer-youtube, #videos-footer-soundcloud{min-width:35px;border-radius:unset;margin-right: 0;}@media screen and (max-width: 600px){#videos{top:38px;}#videos-footer-broadcast, #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast {height:50px;line-height:50px;}#videos-footer{min-height: 50px;padding:0}}span[title=\"Settings\"]>svg{padding:7px 10px;height:24px;width:24px;}#videolist[data-mode=\"dark\"]{background-color:unset;}#videos-footer-broadcast-wrapper{display:contents;}.video:after{content: unset;border:unset;}#videos-header{padding:0;background:#181d1e;}.ctsdrop{position:fixed;display:inline-block;top:3px;left:4px;z-index:5;min-width: 46px;}.ctsdrop-content{top:28px;right:0;background:#181d1e;width: 92px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{line-height: 22px;color: white;width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #181d1e75;border: none;padding: 5% 0;display: inline-block;}";
  633. MainCSS += "body{overflow:auto;}";
  634. UserListCSS += "#contextmenu{top:unset;bottom:0;left:0;}";
  635. }
  636. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  637. StyleSet();
  638. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  639. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  640. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  641. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  642. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  643. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  644. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  645. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  646. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  647. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  648. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  649. VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin", "<button style=\"display:" + ((CTS.Project.isTouchScreen) ? "none" : "block") + "\" class=\"tcsettings\">←</button>");
  650. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  651. VideoListElement.querySelector("#videolist").insertAdjacentHTML("afterbegin", '<div class="ctsdrop"><button class="ctsoptions" title="CTS Options">🔧</button><div class="ctsdrop-content"><div style="height:6px;background:#624482;"></div><button id="BackgroundUpdateRight" class="ctsoptions" title="Background">➖</button><button id="BackgroundUpdateLeft" class="ctsoptions" title="Background">➕</button><div style="height:6px;background:#624482;"></div><button id="FontSizeUpdate" class="ctsoptions" title="Font Size">🔍</button><button id="ChatCompact" class="ctsoptions" title="Compact Chat">💬</button><div style="height:6px;background:#624482;"></div>' + ((!CTS.ThemeChange) ? '<button id="ChatWidthToggled" class="ctsoptions" title="Chat Resize">↔</button><button id="ChatHeightToggled" class="ctsoptions" title="Chat Resize">↕</button><div style="height:6px;background:#624482;"></div>' : '') + '<button id="ChatColor" class="ctsoptions" title="Chat Style">🔨</button><button id="CameraBorderToggled" class="ctsoptions" title="Camera Border">📷</button><button id="FeaturedToggled" class="ctsoptions" title="YouTube/Featured Resize">📺</button><button id="PerformanceModeToggled" class="ctsoptions" title="Performance Mode">🎮</button>' + ((!CTS.Project.isTouchScreen) ? '<div style="height:6px;background:#624482;"></div><button id="ThemeChange" class="ctsoptions" title="Switch CTS Theme Mode">🔄</button></div></div>' : ''));
  652. ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div><button class="notifbtn">▼</button>');
  653. ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
  654. ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
  655. //SCRIPT INIT -> PREPARE()
  656. clearInterval(CTS.ScriptLoading);
  657. CTS.ScriptInit = true;
  658. CTSRoomPrepare();
  659. }
  660.  
  661. function CTSRoomPrepare() {
  662. //FUNCTION BYPASS
  663. window.TinychatApp.BLL.Videolist.prototype.blurOtherVids = function() {};
  664. window.TinychatApp.BLL.SoundPlayer.playMessage = function() {};
  665. window.TinychatApp.BLL.SoundPlayer.playGift = function() {};
  666. window.TinychatApp.BLL.User.isSubscription = function() {
  667. return true;
  668. };
  669. window.TinychatApp.BLL.User.canUseFilters = function() {
  670. return true;
  671. };
  672. window.TinychatApp.BLL.MediaConnection.prototype.Close = function() {
  673. RTC(this);
  674. };
  675. window.TinychatApp.BLL.ChatRoom.prototype.sendPushForUnreadPrivateMessage = function() {};
  676. if (!CTS.Project.isTouchScreen) {
  677. window.TinychatApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  678. var b = this,
  679. d = this.settings.getSettings();
  680. if (d.video === null) {
  681. return void this.app.MediaSettings(() => {
  682. this.BroadcastStart();
  683. });
  684. }
  685. this.videolist.AddingVideoSelf(this.self_handle);
  686. var e = {};
  687. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  688. e.audio = true;
  689. e.video = {
  690. width: {
  691. min: 320,
  692. max: 4096
  693. },
  694. height: {
  695. min: 240,
  696. max: 2160
  697. },
  698. frameRate: {
  699. min: 15,
  700. ideal: 30,
  701. max: 60
  702. }
  703. };
  704. } else {
  705. navigator.mediaDevices.enumerateDevices().then(g => {
  706. var h = false;
  707. var len = g.length;
  708. for (var c = 0; c < len; c++) {
  709. if (g[c].kind === "videoinput") {
  710. if (e.video === void 0) e.video = {
  711. width: {
  712. min: 320,
  713. max: 4096
  714. },
  715. height: {
  716. min: 240,
  717. max: 2160
  718. },
  719. frameRate: {
  720. min: 15,
  721. ideal: 30,
  722. max: 60
  723. }
  724. };
  725. if (h) {
  726. d.video = g[c];
  727. h = false;
  728. this.settings.saveSettings(d);
  729. } else if (d.video === null) {
  730. d.video = g[c];
  731. this.settings.saveSettings(d);
  732. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  733. e.video.deviceId = {
  734. exact: d.video.deviceId
  735. };
  736. } else if (d.video.deviceId === a) {
  737. h = true;
  738. }
  739. }
  740. if (g[c].kind === "audioinput") {
  741. if (e.audio === void 0) e.audio = {};
  742. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) {
  743. e.audio = {
  744. deviceId: {
  745. exact: d.audio.deviceId
  746. },
  747. };
  748. }
  749. }
  750. }
  751. if (e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
  752. let i = navigator.mediaDevices.getSupportedConstraints();
  753. for (let a in i) {
  754. if (i.hasOwnProperty(a) && "echoCancellation" == a && e.audio) e.audio[a] = this.settings.isAcousticEchoCancelation();
  755. }
  756. if (!(e.audio || e.video)) {
  757. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  758. } else if ("https:" === location.protocol || this.app.isDebug()) {
  759. debug("BROADCAST", "Initiating Media...");
  760. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  761. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  762. b.mediaLastConstraints = e;
  763. navigator.mediaDevices.getUserMedia(e).then(m => {
  764. b.onMediaSuccessCallback(m);
  765. });
  766. }
  767. }).catch(er => {
  768. debug("CAMERA::ERROR", er);
  769. });
  770. }
  771. };
  772. }
  773. window.TinychatApp.BLL.Userlist.prototype.ignore = function(a) {
  774. var b = ((a.isUsername)?a.username:a.nickname);
  775. if (this.isIgnored(a) || this.ignored.push(b)) {
  776. var c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  777. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
  778. this.app.showToast(b + " ignored successfully till they leave or you refresh!");
  779. if (!a.isUsername) {
  780. CTS.TempIgnoreNickList.push(b.toUpperCase());
  781. } else {
  782. CTS.TempIgnoreUserList.push(b.toUpperCase());
  783. }
  784. }
  785. };
  786. window.TinychatApp.BLL.Userlist.prototype.unignore = function(a) {
  787. var b = ((a.isUsername)?a.username:a.nickname),
  788. index = this.ignored.indexOf(b);
  789. if (index != -1) this.ignored.splice(index, 1);
  790. if (!a.isUsername) {
  791. index = CTS.TempIgnoreNickList.indexOf(b.toUpperCase());
  792. if (index != -1) CTS.TempIgnoreNickList.splice(index, 1);
  793. } else {
  794. index = CTS.TempIgnoreUserList.indexOf(b.toUpperCase());
  795. if (index != -1) CTS.TempIgnoreUserList.splice(index, 1);
  796. }
  797. var e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  798. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
  799. this.app.showToast(a.username + " unignored");
  800. };
  801. window.TinychatApp.BLL.Userlist.prototype.generateUpdateEvent = function(a, b) {
  802. var c = -1,
  803. d = null,
  804. e = -1,
  805. f = null;
  806. Object.keys(this.items).forEach(b => {
  807. var e = this.items[b];
  808. if (e.handle === a) {
  809. c = Number.parseInt(b);
  810. d = Object.assign(new window.TinychatApp.DAL.UserEntity(), e);
  811. f = e;
  812. }
  813. });
  814. if(d != null && (b(f) || !Object.equals(d, f))) {
  815. this.sorting(this.items);
  816. e = this.items.indexOf(f);
  817. if (e != -1) this.EventBus.broadcast(window.TinychatApp.BLL.UserlistUpdateUserEvent.ID, new window.TinychatApp.BLL.UserlistUpdateUserEvent(c, d, e, f, this));
  818. }
  819. };
  820. window.TinychatApp.BLL.Userlist.prototype.sorting = function(a) {
  821. a.sort((c, a) => {
  822. return (a.subscriptionType - c.subscriptionType || (a.isOperator ? 1 : 0) - (c.isOperator ? 1 : 0) || (a.isBroadcasting ? 1 : 0) - (c.isBroadcasting ? 1 : 0) || c.nickname.toLowerCase().localeCompare(a.nickname.toLowerCase()) || c.handle - a.handle);
  823. });
  824. };
  825. if (CTS.StorageSupport) {
  826. window.TinychatApp.BLL.SettingsFeature.prototype.getSettings = function() {
  827. var A = this._get("tinychat_settings");
  828. try {
  829. A = Object.assign(new window.TinychatApp.DAL.SettingsEntity(), JSON.parse(A));
  830. } catch (E) {}
  831. if (A !== undefined) {
  832. CTS.enableSound = A.enableSound;
  833. if (CTS.enablePMs !== A.enablePMs) {
  834. CTS.enablePMs = A.enablePMs;
  835. PMShow();
  836. }
  837. }
  838. return ((void 0 == A || "object" !== typeof A) && (A = new window.TinychatApp.DAL.SettingsEntity()) || A);
  839. };
  840. }
  841. window.TinychatApp.BLL.ChatRoom.prototype.prepareStream = function(a) {
  842. function b() {
  843. if (null == c.mediaStreamCanvas) {
  844. if (CTS.AnimationFrameWorker != undefined) {
  845. CTS.AnimationFrameWorker.terminate();
  846. CTS.AnimationFrameWorker = undefined;
  847. }
  848. CTS.Me.broadcasting = false;
  849. return;
  850. }
  851. d.clearRect(0, 0, c.mediaStreamCanvas.width, c.mediaStreamCanvas.height);
  852. var a = c.mediaStreamVideo.videoHeight,
  853. e = c.mediaStreamVideo.videoWidth;
  854. c.mediaStreamCanvas.width = e;
  855. c.mediaStreamCanvas.height = a;
  856. window.TinychatApp.BLL.VideoFilters.getFilter(CTS.MediaStreamFilter).apply(d, e, a);
  857. d.drawImage(c.mediaStreamVideo, 0, 0, e, a, 0, 0, c.mediaStreamCanvas.width, c.mediaStreamCanvas.height);
  858. }
  859. this.mediaStreamOrigin = a;
  860. this.mediaStreamVideo = document.createElement("video");
  861. this.mediaStreamVideo.srcObject = this.mediaStreamOrigin;
  862. this.mediaStreamVideo.pause();
  863. this.mediaStreamVideo.oncanplay = function() {
  864. CTS.Me.broadcasting = true;
  865. if (CTS.WorkersAllowed) {
  866. if (CTS.AnimationFrameWorker == undefined) {
  867. CTS.AnimationFrameWorker = new Worker(window.URL.createObjectURL(new Blob(["function Counter() {self.postMessage(\"0\");}setInterval(function(){Counter();}, 1e3/"+CTS.FPS+");"])));
  868. CTS.AnimationFrameWorker.onmessage = function() {
  869. b();
  870. };
  871. }
  872. } else {
  873. requestAnimationFrame(b);
  874. }
  875. };
  876. this.mediaStreamVideo.autoplay = !0;
  877. this.mediaStreamVideo.muted = !0;
  878. this.mediaStreamCanvas = document.createElement("canvas");
  879. var c = this,
  880. d = this.mediaStreamCanvas.getContext("2d");
  881. this.mediaStreamVideo.play();
  882. var e = this.mediaStreamCanvas.captureStream(CTS.FPS);
  883. return (e.addTrack(this.mediaStreamOrigin.getAudioTracks()[0]) || e);
  884. };
  885. window.TinychatApp.BLL.ChatRoom.prototype.applyFilter = function(a) {
  886. this.mediaStreamFilter = a;
  887. CTS.MediaStreamFilter = a;
  888. Save("MediaStreamFilter", CTS.MediaStreamFilter);
  889. };
  890. window.TinychatApp.BLL.Videolist.prototype.toggleHiddenVW = function(a) {
  891. var b = window.TinychatApp.getInstance().defaultChatroom._videolist.items.indexOf(a);
  892. if (b != -1) {
  893. var username = a.userentity.username.toUpperCase(),
  894. index = CTS.HiddenCameraList.indexOf(username.toUpperCase());
  895. if(username === "GUEST") {
  896. a.hidden = !a.hidden;
  897. } else {
  898. if (a.hidden) {
  899. a.hidden = false;
  900. if (index !== -1) {
  901. //REMOVE
  902. if (arguments[1] === undefined) {
  903. debug("HIDDENCAMERALIST::", "REMOVE USER " + username + " FROM HIDDENCAMERALIST");
  904. Alert(GetActiveChat(), "✓ Removing " + username + " from hiddencameralist!");
  905. CommandList.hiddencameraremove(index);
  906. }
  907. }
  908. } else {
  909. a.hidden = true;
  910. if (index === -1) {
  911. //ADD
  912. if (arguments[1] === undefined) {
  913. debug("HIDDENCAMERALIST::", "ADD USER " + username + " TO HIDDEN CAMERA LIST");
  914. Alert(GetActiveChat(), "✓ Adding " + username + " to hidden camera list!");
  915. CommandList.hiddencameraadd(username);
  916. }
  917. }
  918. }
  919. }
  920. a.mute = ((CTS.Me.username === username) ? true : a.mute);
  921. window.TinychatApp.getInstance().defaultChatroom._videolist._pauseMediaStream(a.mediastream, a.hidden);
  922. if (!a.hidden) window.TinychatApp.getInstance().defaultChatroom._videolist._muteMediaStream(a.mediastream, a.mute);
  923. let d = new window.TinychatApp.BLL.VideolistEvent(window.TinychatApp.BLL.VideolistAction.Update,a,b);
  924. window.TinychatApp.getInstance().defaultChatroom._videolist.EventBus.broadcast(window.TinychatApp.BLL.VideolistEvent.ID, d);
  925. }
  926. };
  927. window.fullscreenManager.status = () =>{
  928. if (CTS.isFullScreen !== (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen)) {
  929. CTS.isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
  930. // Fix FullScreen
  931. MainElement.querySelector("#room").classList.toggle("full-screen");
  932. }
  933. return document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
  934. };
  935. //REMOVE
  936. Remove(ChatLogElement, 'span[id="input-unread"]');
  937. Remove(ChatLogElement, "#chat-content");
  938. //SETTINGS PREPARE
  939. if (CTS.enablePMs === false) PMShow();
  940. //LOAD
  941. CTSRoomLoad();
  942. }
  943.  
  944. function CTSRoomLoad() {
  945. var element;
  946. //EVENT LISTENERS
  947. if (!CTS.ThemeChange) {
  948. // BOOT UP OG THEME
  949. var finishoff = false;
  950. while (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter || CTS.OGStyle.SavedWidth !== CTS.OGStyle.WidthCounter) {
  951. if (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter) {
  952. ChatHeightToggled();
  953. } else {
  954. finishoff = true;
  955. }
  956. if (CTS.OGStyle.SaveWidth !== CTS.OGStyle.WidthCounter && finishoff) ChatWidthToggled();
  957. }
  958. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  959. ChatHeightToggled();
  960. Save("OGStyleHeight", CTS.OGStyle.HeightCounter);
  961. }, {
  962. passive: true
  963. });
  964. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  965. ChatWidthToggled();
  966. Save("OGStyleWidth", JSON.stringify(CTS.OGStyle.WidthCounter));
  967. }, {
  968. passive: true
  969. });
  970. } else {
  971. if (!CTS.Project.isTouchScreen) {
  972. element = document.createElement("div");
  973. element.setAttribute("id", "chat-hide");
  974. ChatLogElement.querySelector("#chat-wider").parentNode.insertBefore(element, ChatLogElement.querySelector("#chat-wider"));
  975. ChatLogElement.querySelector("#chat-hide").addEventListener("click", function() {
  976. ChatHide();
  977. }, {
  978. passive: true
  979. });
  980. }
  981. }
  982. element = document.createElement("button");
  983. element.setAttribute("id", "chat-download");
  984. element.setAttribute("class", "chat-button");
  985. element.setAttribute("title", "Download copy of chat-log");
  986. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  987. ChatLogElement.querySelector("#chat-download").textContent = "📋";
  988. ChatLogElement.querySelector("#chat-download").addEventListener("click", function() {
  989. var len = CTS.UserList.length,
  990. t = "Users : " + len + "\n",
  991. c;
  992. for (c = 0; c < len; c++) {
  993. if (c) { // 0 = false
  994. t += ", ";
  995. if (c % 10 === 0) t += "\n";
  996. }
  997. t += CTS.UserList[c].username + " (" + CTS.UserList[c].nick + ")";
  998. }
  999. t += "\n\n";
  1000. len = CTS.Message[GetActiveChat()].length;
  1001. 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");
  1002. Export("TinyChat_" + CTS.Room.Name.toUpperCase() + " " + DateTime() + ".log", "Room : " + CTS.Room.Name + "\n" + t);
  1003. }, {
  1004. passive: true
  1005. });
  1006. element = document.createElement("button");
  1007. element.setAttribute("id", "chat-export");
  1008. element.setAttribute("class", "chat-button");
  1009. element.setAttribute("title", "Export your saved CTS settings");
  1010. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1011. ChatLogElement.querySelector("#chat-export").textContent = "📤";
  1012. ChatLogElement.querySelector("#chat-export").addEventListener("click", function() {
  1013. var tempobj = {};
  1014. for (var i = 0; i < localStorage.length; i++){
  1015. if (localStorage.key(i).substring(0,4) == 'CTS_') tempobj[localStorage.key(i)] = localStorage[localStorage.key(i)];
  1016. }
  1017. Export("CTS_Settings_" + DateTime() + ".backup", JSON.stringify(tempobj));
  1018. }, {
  1019. passive: true
  1020. });
  1021. element = document.createElement("label");
  1022. element.setAttribute("for", "chat-import");
  1023. element.setAttribute("class", "chat-button");
  1024. element.setAttribute("title", "Import your saved CTS settings");
  1025. element.setAttribute("id", "chat-import-label");
  1026. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1027. ChatLogElement.querySelector("#chat-import-label").textContent = "📥";
  1028. element = document.createElement("input");
  1029. element.setAttribute("type", "file");
  1030. element.setAttribute("id", "chat-import");
  1031. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1032. ChatLogElement.querySelector("#chat-import").addEventListener('change', function(e) {
  1033. var file = ChatLogElement.querySelector("#chat-import").files[0],
  1034. reader = new FileReader();
  1035. reader.readAsText(file);
  1036. reader.onload = function() {
  1037. try {
  1038. var resp = JSON.parse(reader.result);
  1039. if (resp !== null) {
  1040. var keys = Object.keys(resp),
  1041. ready = true;
  1042. Alert(GetActiveChat(), "- Scanning backup!");
  1043. for (var a = 0; a < keys.length; a++) {
  1044. if (keys[a].substring(0,4) !== 'CTS_') ready = false;
  1045. }
  1046. if (ready) {
  1047. Alert(GetActiveChat(), "✓ Backup looks good!");
  1048. var localkeys = Object.keys(localStorage),
  1049. locallen = localkeys.length;
  1050. Alert(GetActiveChat(), "- Clearing Storage!");
  1051. for (var b = 0; b < locallen; b++) {
  1052. if (localkeys[b].substring(0, 4) === "CTS_") localStorage.removeItem(localkeys[b]);
  1053. }
  1054. Alert(GetActiveChat(), "✓ Storage cleared!\n- Applying CTS Backup!");
  1055. for (var c = 0; c < keys.length; c++) {
  1056. localStorage.setItem(keys[c], resp[keys[c]]);
  1057. }
  1058. Alert(GetActiveChat(), "✓ All done!\n\nYou'll auto-refresh shortly!");
  1059. setTimeout(function() {
  1060. location.reload();
  1061. }, 3000);
  1062. }
  1063. }
  1064. } catch (e) {
  1065. debug("BACKUP::ERROR", e);
  1066. }
  1067. };
  1068. reader.onerror = function() {
  1069. debug("BACKUP::ERROR", "Something went wrong...");
  1070. };
  1071. });
  1072.  
  1073. if (!CTS.Project.isTouchScreen) {
  1074. VideoListElement.querySelector("#ThemeChange").addEventListener("click", function() {
  1075. CTS.ThemeChange = !CTS.ThemeChange;
  1076. Save("ThemeChange", JSON.stringify(CTS.ThemeChange));
  1077. location.reload();
  1078. }, {
  1079. passive: true
  1080. });
  1081. }
  1082. VideoListElement.querySelector("#PerformanceModeToggled").addEventListener("click", function() {
  1083. if (CTS.ChatDisplay) {
  1084. CTS.PerformanceMode = !CTS.PerformanceMode;
  1085. Save("PerformanceMode", JSON.stringify(CTS.PerformanceMode));
  1086. PerformanceModeInit(CTS.PerformanceMode);
  1087. }
  1088. }, {
  1089. passive: true
  1090. });
  1091. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  1092. CTS.Featured = !CTS.Featured;
  1093. Save("Featured", JSON.stringify(CTS.Featured));
  1094. FeaturedCameras(CTS.Featured);
  1095. Resize();
  1096. }, {
  1097. passive: true
  1098. });
  1099. VideoListElement.querySelector("#CameraBorderToggled").addEventListener("click", function() {
  1100. CTS.CameraBorderToggle = !CTS.CameraBorderToggle;
  1101. Save("CameraBorderToggle", JSON.stringify(CTS.CameraBorderToggle));
  1102. Cameras();
  1103. Resize();
  1104. }, {
  1105. passive: true
  1106. });
  1107. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  1108. CTS.ChatStyleCounter++;
  1109. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1110. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1111. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  1112. var len = window.CTSChatCSS.length - 1;
  1113. if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
  1114. StyleSet();
  1115. Save("ChatStyle", CTS.ChatStyleCounter);
  1116. }, {
  1117. passive: true
  1118. });
  1119. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  1120. UpdateScroll(1, true);
  1121. CheckUnreadMessage();
  1122. }, {
  1123. passive: true
  1124. });
  1125. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  1126. var element = event.target;
  1127.  
  1128. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage(true);
  1129. }, {
  1130. passive: true
  1131. });
  1132. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  1133. var element = event.target;
  1134. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  1135. }, {
  1136. passive: true
  1137. });
  1138. if (CTS.NotificationToggle === 0) {
  1139. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  1140. passive: true
  1141. });
  1142. }
  1143. VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
  1144. var arg;
  1145. if (this.innerText === "→") {
  1146. this.innerText = "←";
  1147. arg = "block";
  1148. } else {
  1149. this.innerText = "→";
  1150. arg = "none";
  1151. }
  1152. VideoListElement.querySelector("#videos-header-sound").style.display = arg;
  1153. if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
  1154. //VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
  1155. VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
  1156. VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
  1157. }, {
  1158. passive: true
  1159. });
  1160. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  1161. if (!Addon.active("BGIMG")) {
  1162. CTS.MainBackgroundCounter++;
  1163. if (CTS.MainBackgroundCounter === window.CTSImages.length) CTS.MainBackgroundCounter = 0;
  1164. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  1165. document.body.style.background = background;
  1166. Save("MainBackground", background);
  1167. }
  1168. }, {
  1169. passive: true
  1170. });
  1171. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  1172. if (!Addon.active("BGIMG")) {
  1173. CTS.MainBackgroundCounter--;
  1174. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = window.CTSImages.length - 1;
  1175. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  1176. document.body.style.background = background;
  1177. Save("MainBackground", background);
  1178. }
  1179. }, {
  1180. passive: true
  1181. });
  1182. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  1183. CTS.FontSize += 5;
  1184. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  1185. Save("FontSize", CTS.FontSize);
  1186. TextAreaElement.style.fontSize = (CTS.FontSize - 4) + "px";
  1187. LoadMessage();
  1188. }, {
  1189. passive: true
  1190. });
  1191. VideoListElement.querySelector("button[id=\"ChatCompact\"]").addEventListener("click", function() {
  1192. CTS.ChatType = !CTS.ChatType;
  1193. Save("ChatType", CTS.ChatType);
  1194. LoadMessage();
  1195. }, {
  1196. passive: true
  1197. });
  1198.  
  1199. TextAreaElement.oninput = function() {
  1200. CTS.Clipboard.Log = TextAreaElement.value;
  1201. };
  1202. TextAreaElement.onkeyup = function(e) {
  1203. e = e || window.event;
  1204. if (e.keyCode == 13) {
  1205. // SAVE CLIPBOARD
  1206. CTS.Clipboard.Message.push(CTS.Clipboard.Log);
  1207. if (CTS.Clipboard.Message.length > 3) CTS.Clipboard.Message.shift();
  1208. CTS.Clipboard.MessageLen = CTS.Clipboard.Message.length-1;
  1209. } else if (e.keyCode == 40) {
  1210. // NAVIGATE CLIPBOARD (IF TYPING IS FALSE)
  1211. if (CTS.Clipboard.Message.includes(CTS.Clipboard.Log)) {
  1212. CTS.Clipboard.Counter = ((TextAreaElement.value == "") ? 0 : ((CTS.Clipboard.Counter >= CTS.Clipboard.MessageLen) ? 0 : (CTS.Clipboard.Counter + 1)));
  1213. TextAreaElement.value = CTS.Clipboard.Message[CTS.Clipboard.Counter];
  1214. }
  1215. } else if (e.keyCode == 38) {
  1216. // NAVIGATE CLIPBOARD (IF TYPING IS FALSE)
  1217. if (CTS.Clipboard.Message.includes(CTS.Clipboard.Log)) {
  1218. CTS.Clipboard.Counter = ((TextAreaElement.value == "") ? CTS.Clipboard.MessageLen : ((CTS.Clipboard.Counter <= 0) ? CTS.Clipboard.MessageLen : (CTS.Clipboard.Counter - 1)));
  1219. TextAreaElement.value = CTS.Clipboard.Message[CTS.Clipboard.Counter];
  1220. }
  1221. }
  1222. };
  1223. //MUTATION OBSERVERS
  1224. new MutationObserver(function() {
  1225. LoadMessage();
  1226. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  1227. attributes: true,
  1228. attributeFilter: ["class"],
  1229. childList: false,
  1230. characterData: false
  1231. });
  1232. new MutationObserver(function() {
  1233. Cameras();
  1234. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  1235. childList: true
  1236. });
  1237. new MutationObserver(function() {
  1238. Cameras();
  1239. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  1240. childList: true
  1241. });
  1242. new MutationObserver(function() {
  1243. if (CTS.AutoMicrophone) {
  1244. OpenMicrophone();
  1245. }
  1246. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  1247. attributes: true,
  1248. attributeFilter: ["class"]
  1249. });
  1250. //BOOT UP - FIRST START
  1251. NotificationDisplay();
  1252. FeaturedCameras(CTS.Featured);
  1253. Cameras();
  1254. }
  1255. //YOUTUBE FUNCTIONS
  1256. function VerifyYouTube() {
  1257. // Check Mod/JRMod
  1258. if (CTS.UserList[arguments[0]].mod || CTS.BotModList.includes(CTS.UserList[arguments[0]].username)) return true;
  1259. // Check OP
  1260. if(CTS.UserYT) {
  1261. if (CTS.BotOPList.includes(CTS.UserList[arguments[0]].username)) return true;
  1262. if (CTS.BotOPList.includes("-ALL") && isSafeListed(CTS.UserList[arguments[0]].username)) return true;
  1263. }
  1264. return false;
  1265. }
  1266.  
  1267. function CheckHost() {
  1268. if (CTS.Host === 0) {
  1269. Send("msg", "!whoisbot");
  1270. CTS.HostAttempt = 0;
  1271. CTS.HostWaiting = true;
  1272. }
  1273. }
  1274.  
  1275. function SetBot() {
  1276. if (arguments[0]) CTS.Game.NoReset = true;
  1277. Send("msg", "!bot");
  1278. CTS.HostWaiting = false;
  1279. }
  1280.  
  1281. function CheckYouTube() {
  1282. //CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
  1283. if (arguments[3] === undefined) arguments[3] = true;
  1284. CTS.YouTube.XHR.type = arguments[1];
  1285. 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);
  1286. if (videoid !== null) {
  1287. videoid = videoid[1].replace(/v\=/g, "");
  1288. //LINK IS PLAYLIST
  1289. if (videoid.match(/list\=/i)) {
  1290. if (arguments[3]) {
  1291. videoid = videoid.replace(/list\=/, "");
  1292. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  1293. 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);
  1294. CTS.YouTube.XHR.send();
  1295. }
  1296. } else {
  1297. //LINK IS REGULAR
  1298. CTS.YouTube.XHR.videoid = videoid;
  1299. CTS.YouTube.VideoReturn = true;
  1300. 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);
  1301. CTS.YouTube.XHR.send();
  1302. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  1303. }
  1304. } else {
  1305. //KEYWORD SEARCH
  1306. if (CTS.YouTube.MessageQueueList.length <= 0) {
  1307. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  1308. CTS.YouTube.SearchReturn = true;
  1309. 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");
  1310. CTS.YouTube.XHR.send();
  1311. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  1312. }
  1313. }
  1314. }
  1315.  
  1316. function YoutubeBypass() {
  1317. 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);
  1318. if (videoid !== null) {
  1319. CTS.SocketTarget.send(JSON.stringify({
  1320. "tc": "yut_play",
  1321. "item": {
  1322. "id": videoid[1],
  1323. "duration": 7200,
  1324. "offset": 0,
  1325. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1326. }
  1327. }));
  1328. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1329. }
  1330. }
  1331.  
  1332. function YouTubePlayList() {
  1333. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  1334. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  1335. }
  1336.  
  1337. function YouTubeTrackAdd() {
  1338. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  1339. if (CTS.YouTube.Busy === false) {
  1340. if (CTS.YouTube.MessageQueueList.length > 0) {
  1341. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  1342. 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);
  1343. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  1344. CTS.YouTube.XHR.send();
  1345. CTS.YouTube.MessageQueueList.shift();
  1346. }
  1347. }
  1348. }
  1349. }
  1350.  
  1351. function YouTubePlayListItems() {
  1352. var len = arguments[0].length;
  1353. for (var i = 0; i < len; i++) {
  1354. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  1355. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  1356. }
  1357. }
  1358. }
  1359.  
  1360. function YouTubeTimeConvert() {
  1361. //TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
  1362. var a = arguments[0].match(/\d+/g);
  1363. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  1364. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  1365. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  1366. var len = a.length;
  1367. arguments[0] = 0;
  1368. if (len == 3) {
  1369. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  1370. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  1371. arguments[0] = arguments[0] + parseInt(a[2]);
  1372. }
  1373. if (len == 2) {
  1374. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  1375. arguments[0] = arguments[0] + parseInt(a[1]);
  1376. }
  1377. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  1378. return arguments[0];
  1379. }
  1380.  
  1381. function BotCommandCheck() {
  1382. //USER COMMANDS TO HOST
  1383. if (isCommand(arguments[1])) {
  1384. if (arguments[1].match(/^!play$|^!yt |^!ytbypass |^!ytclear$|^!ytskip$|^!ytqueue$/i)) {
  1385. BotCommandCheckYT(arguments[0], arguments[1]);
  1386. } else if (arguments[1].match(/^!userkick |^!userban |^!userclose |^!nickkick |^!nickban |^!nickclose /i)) {
  1387. BotCommandCheckJR(arguments[0], arguments[1]);
  1388. } else if (arguments[1].match(/^!whoisbot$|^!8ball |^!vote |^!coin$|^!chuck$|^!urb |^!dad$|^!advice$/i)) {
  1389. BotCommandCheckPUB(arguments[0], arguments[1]);
  1390. } else if (CTS.UserList[arguments[0]].canGame && CTS.CanHostFishGames) {
  1391. FishCommandCheck(arguments[0], arguments[1]);
  1392. }
  1393. }
  1394. if (CTS.Game.Trivia.Started && CTS.CanHostTriviaGames && arguments[1].match(/^!iq$|^!triviahelp$|^!triviashop$|^!raid |^!ytbypass |^!spot$|^[a-d]$/i))TriviaCommandCheck(arguments[0], arguments[1]);
  1395. }
  1396.  
  1397. function TriviaCommandCheck() {
  1398. var User = CTS.UserList[arguments[0]];
  1399. if (User.canGame) {
  1400. if (isSafeListed(User.username)) {
  1401. if (!isCommand(arguments[1])) {
  1402. //NO CHEATERS
  1403. var Guessed = CTS.Game.Trivia.AttemptList.includes(User.username);
  1404. if (arguments[1].length == 1 && CTS.Game.Trivia.ANum.includes(arguments[1].toUpperCase()) && !Guessed && !CTS.Game.Trivia.Waiting) {
  1405. if (CTS.Game.Trivia.Correct === arguments[1].toUpperCase()) {
  1406. // Save Progress
  1407. User.triviapoints += CTS.Game.Trivia.Worth;
  1408. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1409. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1410. // Send Output
  1411. 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!");
  1412. if(User.triviapoints > CTS.Game.Trivia.HighScore[1]) {
  1413. CTS.Game.Trivia.HighScore[0] = User.username;
  1414. CTS.Game.Trivia.HighScore[1] = User.triviapoints;
  1415. // Save HighScore
  1416. Save("TriviaHighScore", JSON.stringify(CTS.Game.Trivia.HighScore));
  1417. }
  1418. // Wait
  1419. Trivia.Wait();
  1420. } else {
  1421. CTS.Game.Trivia.Attempts++;
  1422. CTS.Game.Trivia.AttemptList.push(User.username);
  1423. Send("msg", "[TRIVIA]\n" + User.username + " that's wrong however you may attempt next rounds question.");
  1424. if (CTS.Game.Trivia.Attempts == 3) {
  1425. Send("msg", "[TRIVIA]\nNobody got it!\nNext round will start in shortly.\nThe answer however was: " + CTS.Game.Trivia.Correct);
  1426. Trivia.Wait();
  1427. }
  1428. }
  1429. }
  1430. } else {
  1431. TriviaCommand(arguments[0], arguments[1]);
  1432. }
  1433. }
  1434. }
  1435. }
  1436.  
  1437. function TriviaCommand () {
  1438. var User = CTS.UserList[arguments[0]];
  1439. if(!User.mod && !CTS.BotModList.includes(User.username)) {
  1440. if (arguments[1].match(/^!ytbypass/i) && CTS.Room.YT_ON) {
  1441. if(CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.ytbypass) {
  1442. User.triviapoints -= CTS.Game.Trivia.PriceList.ytbypass;
  1443. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1444. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1445. Send("msg", "[TRIVIA]\n" + User.username + ",\nyou've just purchased ytbypass for "+CTS.Game.Trivia.PriceList.ytbypass+" IQ Points!\n\nHopefully you inserted the link right!:)");
  1446. YoutubeBypass(arguments[1]);
  1447. } else {
  1448. TriviaTooPoor(User.username);
  1449. }
  1450. }
  1451. }
  1452. if (CTS.Me.owner) {
  1453. if (!User.owner) {
  1454. if (arguments[1].match(/^!raid /i)) {
  1455. if(CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.raid) {
  1456. var raid = arguments[1].match(/^(?:!raid )(?:<a href=")(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})/i);
  1457. if (raid !== null) {
  1458. User.triviapoints -= CTS.Game.Trivia.PriceList.raid;
  1459. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1460. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1461. 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!");
  1462. Send("msg", "[TRIVIA]\nREMEMBER HAVE FUN IF YOU DON'T WARP CLICK THE LINK SHORTLY!\n\nhttps://tinychat.com/room/" + raid[1]);
  1463. // WAIT
  1464. setTimeout(function() {
  1465. Send("msg", "!raid https://tinychat.com/room/" + raid[1]);
  1466. }, 10000);
  1467. } else {
  1468. 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!");
  1469. }
  1470. } else {
  1471. TriviaTooPoor(User.username);
  1472. }
  1473. } else if (arguments[1].match(/^!spot$/i)) {
  1474. if(CTS.Game.Trivia.PlayerList[User.username] >= CTS.Game.Trivia.PriceList.spot) {
  1475. var rand = Rand(0, CTS.Camera.List.length - 1),
  1476. target = HandleToUser(CTS.Camera.List[rand]);
  1477. if (target != -1) {
  1478. User.triviapoints -= CTS.Game.Trivia.PriceList.spot;
  1479. CTS.Game.Trivia.PlayerList[User.username] = User.triviapoints;
  1480. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  1481. 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");
  1482. if (CTS.UserList[target].handle !== CTS.Me.handle) {
  1483. Send("stream_moder_close", CTS.Camera.List[rand]);
  1484. } else {
  1485. CTS.SocketTarget.send(JSON.stringify({
  1486. "tc": "stream_close",
  1487. "handle": CTS.Me.handle
  1488. }));
  1489. }
  1490. }
  1491. } else {
  1492. TriviaTooPoor(User.username);
  1493. }
  1494. }
  1495. }
  1496. }
  1497. if (arguments[1].match(/^!triviashop$/i)) {
  1498. 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]");
  1499. } else if (arguments[1].match(/^!triviahelp$/i)) {
  1500. Send("msg", "[TRIVIA]\n!iq\n!triviashop");
  1501. } else if (arguments[1].match(/^!iq$/i)) {
  1502. Send("msg", "[TRIVIA]\n" + User.username + ",\nYou have an IQ of " + User.triviapoints + ".");
  1503. }
  1504. }
  1505.  
  1506. function TriviaTooPoor() {
  1507. Send("msg", "[TRIVIA]\n" + arguments[0] + ",\nyou cannot afford this right now!");
  1508. }
  1509.  
  1510. function BotCommandCheckYT() {
  1511. //ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
  1512. if (CTS.Room.YT_ON) {
  1513. if (arguments[1].match(/^!play$/i)) {
  1514. if (CTS.UserList[arguments[0]].mod) YouTubePlayList();
  1515. } else if (arguments[1].match(/^!yt /i)) {
  1516. BotCommand(1, arguments[0], arguments[1]);
  1517. } else if (arguments[1].match(/^!ytbypass /i)) {
  1518. BotCommand(6, arguments[0], arguments[1]);
  1519. } else if (arguments[1].match(/^!ytclear$/i)) {
  1520. BotCommand(2, arguments[0]);
  1521. } else if (arguments[1].match(/^!ytskip$/i)) {
  1522. BotCommand(3, arguments[0]);
  1523. } else if (arguments[1].match(/^!ytqueue$/i)) {
  1524. BotCommand(4, arguments[0]);
  1525. }
  1526. }
  1527. }
  1528.  
  1529. function BotCommandCheckJR() {
  1530. //MOD/JR.MOD
  1531. if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
  1532. if (arguments[1].match(/^!userkick /i)) {
  1533. ModCommand("kick", arguments[1], true);
  1534. } else if (arguments[1].match(/^!userban /i)) {
  1535. ModCommand("ban", arguments[1], true);
  1536. } else if (arguments[1].match(/^!userclose /i)) {
  1537. ModCommand("stream_moder_close", arguments[1], true);
  1538. } else if (arguments[1].match(/^!nickkick /i)) {
  1539. ModCommand("kick", arguments[1], false);
  1540. } else if (arguments[1].match(/^!nickban /i)) {
  1541. ModCommand("ban", arguments[1], false);
  1542. } else if (arguments[1].match(/^!nickclose /i)) {
  1543. ModCommand("stream_moder_close", arguments[1], false);
  1544. }
  1545. }
  1546. }
  1547.  
  1548. function BotCommandCheckPUB() {
  1549. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  1550. if (arguments[1].match(/^!vote /i)) Vote(arguments[0], arguments[1]);
  1551. // PUBLIC COMMANDS
  1552. if (CTS.PublicCommandToggle) {
  1553. if (arguments[1].match(/^!8ball [\w\s]*\??/i)) {
  1554. if (CTS.UserList[arguments[0]].mod || isSafeListed(CTS.UserList[arguments[0]].username)) Send("msg", "[8BALL]\n" + window.CTSEightBall[Rand(0, window.CTSEightBall.length - 1)]);
  1555. } else if (arguments[1].match(/^!coin$/i)) {
  1556. 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") + "!");
  1557. } else {
  1558. if (arguments[1].match(/^!chuck$/i)) {
  1559. Chuck(CTS.UserList[arguments[0]].username);
  1560. } else if (arguments[1].match(/^!urb /i)) {
  1561. Urb(arguments[1], CTS.UserList[arguments[0]].username);
  1562. } else if (arguments[1].match(/^!dad$/i)) {
  1563. Dad(CTS.UserList[arguments[0]].username);
  1564. } else if (arguments[1].match(/^!advice$/i)) {
  1565. Advice(CTS.UserList[arguments[0]].username);
  1566. }
  1567. }
  1568. }
  1569. }
  1570.  
  1571. function BotCheck() {
  1572. if (CTS.UserList[arguments[0]].mod) {
  1573. //CHECK HOST
  1574. if (arguments[1].match(/^!bot$/i)) {
  1575. //SET HOST
  1576. CTS.Host = arguments[2].handle;
  1577. CTS.HostWaiting = false;
  1578. //RESET GAMES
  1579. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  1580. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  1581. if (CTS.Me.handle !== arguments[2].handle) {
  1582. CTS.Game.NoReset = false;
  1583. Fish.Reset(true);
  1584. // Reset Trivia
  1585. Trivia.Reset();
  1586. }
  1587. }
  1588. //IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
  1589. if (CTS.Me.handle == arguments[2].handle && CTS.Room.YT_ON) YouTubePlayList();
  1590. //ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
  1591. } else if (CTS.HostWaiting === true) {
  1592. CTS.HostAttempt++;
  1593. //SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
  1594. if (CTS.HostAttempt == 1) {
  1595. setTimeout(function() {
  1596. //CHECK WAITING STATE OR IF HOST HAS CHANGED
  1597. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  1598. }, 10000);
  1599. }
  1600. //SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
  1601. if (CTS.HostAttempt == 10) SetBot(false);
  1602. }
  1603. }
  1604. }
  1605.  
  1606. function Chuck() {
  1607. //OPEN REQUEST
  1608. if (isSafeListed(arguments[0])) {
  1609. CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
  1610. CTS.Chuck.XHR.send();
  1611. }
  1612. }
  1613.  
  1614. function Urb() {
  1615. //CHECK TERM
  1616. if (isSafeListed(arguments[1])) {
  1617. var urban = arguments[0].match(/^!urb ([\w ]*)/i);
  1618. if (urban !== null) {
  1619. //OPEN REQUEST
  1620. CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
  1621. CTS.Urb.XHR.send();
  1622. }
  1623. }
  1624. }
  1625.  
  1626. function Dad() {
  1627. //OPEN REQUEST
  1628. if (isSafeListed(arguments[0])) {
  1629. CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
  1630. CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
  1631. CTS.Dad.XHR.send();
  1632. }
  1633. }
  1634.  
  1635. function Advice() {
  1636. //OPEN REQUEST
  1637. if (isSafeListed(arguments[0])) {
  1638. CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
  1639. CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
  1640. CTS.Advice.XHR.send();
  1641. }
  1642. }
  1643.  
  1644. function Events() {
  1645. //OPEN REQUEST
  1646. CTS.Events.XHR.open("GET", "https://api.github.com/gists/c9bad840fb19bf2e6638126c8e430d40");
  1647. CTS.Events.XHR.setRequestHeader("Accept", "application/json");
  1648. CTS.Events.XHR.send();
  1649. }
  1650. //MESSAGE FUNCTION
  1651. function CreateMessage() {
  1652. //SCROLLED UP? MISSED A MESSAGE?
  1653. CheckUnreadMessage();
  1654. // POST NEW CHAT ITEM IF ACTIVECHAT IS OUR CURRENT CHAT
  1655. if (arguments[7] == GetActiveChat()) {
  1656. var stack = ChatLogElement.querySelector("#cts-chat-content>.message:last-child cts-message-html:last-child");
  1657. if (arguments[4] == CTS.CreateMessageLast && stack !== null && CTS.ChatType) {
  1658. // Stack
  1659. 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>");
  1660. } else {
  1661. CTS.CreateMessageLast = arguments[4];
  1662. ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(arguments[3]) || arguments[6]) ? "highlight" : "") + "\" " + ((arguments[2] === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((arguments[2] == "") ? "" : ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + arguments[2] + "\"></div></a>" : "")) + "<div class=\"nickname\" style=\"background:" + arguments[1] + ";\">" + arguments[4] + (CTS.TimeStampToggle ? "<div class=\"ctstime\"> " + arguments[0] + " </div>" : "") + "</div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\"style=\"font-size:" + CTS.FontSize + "px;\">" + arguments[5] + "</span></CTS-message-html></div></div>");
  1663. }
  1664. } else {
  1665. CTS.CreateMessageLast = undefined;
  1666. }
  1667. UpdateScroll(1, false);
  1668. }
  1669.  
  1670. function LoadMessage() {
  1671. var Chat = ChatLogElement.querySelector("#cts-chat-content");
  1672. CTS.ChatScroll = true;
  1673. Chat.innerHTML = "";
  1674. CheckUnreadMessage();
  1675. if (CTS.Message[GetActiveChat()]) {
  1676. //POST MESSAGE
  1677. var len = CTS.Message[GetActiveChat()].length,
  1678. LoadMessageLast;
  1679. for (var ChatIndex = 0; ChatIndex < len; ChatIndex++) {
  1680. if (CTS.Message[GetActiveChat()][ChatIndex].nick == LoadMessageLast && CTS.ChatType) {
  1681. // Stack
  1682. 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>");
  1683. } else {
  1684. LoadMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1685. ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(CTS.Message[GetActiveChat()][ChatIndex].username) || CTS.Message[GetActiveChat()][ChatIndex].mention) ? "highlight" : "") + "\" " + ((CTS.Message[GetActiveChat()][ChatIndex].avatar === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + (CTS.Message[GetActiveChat()][ChatIndex].avatar) + "\"></div></a>" : "") + "<div class=\"nickname\" style=\"-webkit-box-shadow: 0 0 6px " + CTS.Message[GetActiveChat()][ChatIndex].namecolor + ";box-shadow: 0 0 6px " + CTS.Message[GetActiveChat()][ChatIndex].namecolor + ";background:" + CTS.Message[GetActiveChat()][ChatIndex].namecolor + ";\">" + CTS.Message[GetActiveChat()][ChatIndex].nick + (CTS.TimeStampToggle ? "<div class=\"ctstime\"> " + CTS.Message[GetActiveChat()][ChatIndex].time + " </div>" : "") + "</div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\" style=\"font-size:" + CTS.FontSize + "px;\">" + CTS.Message[GetActiveChat()][ChatIndex].msg + "</span></CTS-message-html></div></div>");
  1686. }
  1687. if(ChatIndex == (len-1)) CTS.CreateMessageLast = CTS.Message[GetActiveChat()][ChatIndex].nick;
  1688. }
  1689. } else {
  1690. //START PM
  1691. CTS.Message[GetActiveChat()] = [];
  1692. }
  1693. UpdateScroll(1, false);
  1694. UpdateScroll(2, false);
  1695. }
  1696.  
  1697. function CreateServerEvent() {
  1698. CTS.Message[0].push({
  1699. "time": Time(),
  1700. "namecolor": "#3f69c0",
  1701. "avatar": "",
  1702. "username": "",
  1703. "nick": "SERVER EVENT",
  1704. "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>",
  1705. "mention": true
  1706. });
  1707. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1708. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, arguments[0]);
  1709. UpdateScroll(1, true);
  1710. }
  1711.  
  1712. function CreateGift() {
  1713. var gift = arguments[0].gift,
  1714. from = (!gift.anon) ? arguments[0].from.name : "ANONYMOUS",
  1715. to = arguments[0].to.name,
  1716. comment = (comment = gift.comment) ? gift.comment : "";
  1717. CTS.Message[0].push({
  1718. "time": Time(),
  1719. "namecolor": "#3f69c0",
  1720. "avatar": "",
  1721. "username": "",
  1722. "nick": "SPECIAL DELIVERY",
  1723. "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>",
  1724. "mention": true
  1725. });
  1726. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  1727. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  1728. if (CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) window.CTSSound.GIFT.play();
  1729. UpdateScroll(1, true);
  1730. }
  1731.  
  1732. function AKB() {
  1733. //WATCH OR REMOVE USERS
  1734. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  1735. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  1736. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  1737. } else {
  1738. if (CTS.Me.mod) {
  1739. if (CTS.AutoKick === true) {
  1740. CTS.NoGreet = true;
  1741. Send("kick", arguments[1]);
  1742. } else if (CTS.AutoBan === true) {
  1743. CTS.NoGreet = true;
  1744. Send("ban", arguments[1]);
  1745. }
  1746. }
  1747. }
  1748. }
  1749.  
  1750. function AKBS() {
  1751. if (arguments[0].username !== "") {
  1752. //EXTENDED SAFELIST
  1753. var temp = [];
  1754. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1755. //DEFAULT SAFELIST
  1756. if (!isSafeListed(arguments[0].username.toUpperCase())) {
  1757. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  1758. if (CTS.SafeList.length < 5000) {
  1759. CTS.SafeList.push(arguments[0].username.toUpperCase());
  1760. Save("AKB", JSON.stringify(CTS.SafeList));
  1761. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1762. }
  1763. } else {
  1764. if (arguments[0].lurker === false) {
  1765. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1766. } else {
  1767. AKB(false, arguments[0].handle);
  1768. }
  1769. }
  1770. }
  1771. } else {
  1772. AKB(false, arguments[0].handle);
  1773. }
  1774. }
  1775.  
  1776. function CheckSafeList() {
  1777. var target = HandleToUser(arguments[0]);
  1778. if (target !== -1) {
  1779. var a = CTS.SafeList.indexOf(CTS.UserList[target].username);
  1780. if (a !== -1) {
  1781. //REMOVE
  1782. if (arguments[1]) {
  1783. debug("SAFELIST::", "REMOVE USER " + CTS.UserList[target].username + " FROM SAFELIST");
  1784. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[target].username + " from safelist!");
  1785. CommandList.saferemove(a);
  1786. } else {
  1787. //GETID
  1788. return a;
  1789. }
  1790. }
  1791. }
  1792. }
  1793.  
  1794. function CheckUnreadMessage() {
  1795. if ((Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) || arguments[0] !== undefined) {
  1796. CTS.MissedMsg = 0;
  1797. CTS.ChatScroll = true;
  1798. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1799. } else {
  1800. CTS.MissedMsg++;
  1801. CTS.ChatScroll = false;
  1802. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1803. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1804. }
  1805. }
  1806.  
  1807. function GetActiveChat() {
  1808. var elem = ChatListElement.querySelector(".active");
  1809. if (elem) return elem.getAttribute("data-chat-id");
  1810. return 0;
  1811. }
  1812.  
  1813. function Discord() {
  1814. var element = document.createElement("button");
  1815. element.setAttribute("id", "chat-discord");
  1816. element.setAttribute("title", "CTS public chat");
  1817. element.setAttribute("class", "chat-button");
  1818. ChatLogElement.querySelector("#chat-wrapper").appendChild(element);
  1819. ChatLogElement.querySelector("#chat-discord").textContent = "💬Discord";
  1820. element = document.createElement("iframe");
  1821. element.setAttribute("class","chat-discord");
  1822. element.setAttribute("src","https://titanembeds.com/embed/662193343677333505?scrollbartheme=3d&theme=MetroEdge");
  1823. element.setAttribute("height","100%");
  1824. element.setAttribute("width","100%");
  1825. ChatLogElement.querySelector("#chat-discord").parentNode.insertBefore(element, ChatLogElement.querySelector("#chat-discord"));
  1826. ChatLogElement.querySelector("#chat-discord").addEventListener("click", DiscordToggle, {
  1827. passive: true
  1828. });
  1829. }
  1830.  
  1831. function DiscordToggle() {
  1832. CTS.Discord = !CTS.Discord;
  1833. ChatLogElement.querySelector(".chat-discord").style.visibility = ((CTS.Discord) ? "visible" : "hidden");
  1834. }
  1835.  
  1836. function CheckImgur() {
  1837. if (CTS.Imgur) {
  1838. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpeg|jpg|gif|png|mp4)/);
  1839. if (i !== null) {
  1840. CTS.ImgurWarning++;
  1841. 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>";
  1842. if (CTS.ImgurWarning < 2 && CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nYou can !imgurtoggle at anytime to stop unwanted images showing through.");
  1843. }
  1844. }
  1845. return arguments[0];
  1846. }
  1847.  
  1848. function TTS() {
  1849. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1850. utter.voice = CTS.TTS.voices[0];
  1851. utter.rate = 1.0;
  1852. utter.pitch = 0.5;
  1853. CTS.TTS.synth.speak(utter);
  1854. }
  1855.  
  1856. function isCommand() {
  1857. return arguments[0].match(/^!/);
  1858. }
  1859.  
  1860. function RoomUsers() {
  1861. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  1862. }
  1863.  
  1864. function LineSpam() {
  1865. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  1866. if (LineBreaks >= 14 && arguments[1] === false) return true;
  1867. return false;
  1868. }
  1869.  
  1870. function GamePrevention() {
  1871. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(FISHING BOAT|TRIVIA)\]/)) return false;
  1872. return true;
  1873. }
  1874.  
  1875. function UpdateScroll() {
  1876. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  1877. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true) && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  1878. }
  1879.  
  1880. function DecodeTXT() {
  1881. var txt = document.createElement("textarea");
  1882. txt.innerHTML = arguments[0];
  1883. return txt.value;
  1884. }
  1885.  
  1886. function HTMLtoTXT() {
  1887. var p = document.createElement("p");
  1888. var text = document.createTextNode(arguments[0]);
  1889. p.appendChild(text);
  1890. 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>");
  1891. }
  1892.  
  1893. function IgnoreText() {
  1894. if (arguments[0] !== "") {
  1895. if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
  1896. return true;
  1897. }
  1898. }
  1899.  
  1900. function TimeToDate() {
  1901. if (arguments[1] === undefined) arguments[1] = new Date();
  1902. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((?:am|pm))/i);
  1903. var t = {
  1904. hours: parseInt(match[1]),
  1905. minutes: parseInt(match[2]),
  1906. period: match[3].toLowerCase()
  1907. };
  1908. if (t.hours === 12) {
  1909. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  1910. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  1911. } else {
  1912. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  1913. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  1914. }
  1915. return arguments[1];
  1916. }
  1917.  
  1918. function PushPM() {
  1919. var text = HTMLtoTXT(arguments[1]),
  1920. list;
  1921. if (arguments[2] !== undefined) {
  1922. list = CTS.UserList[arguments[2]];
  1923. if (isSafeListed(CTS.UserList[arguments[2]].username)) text = CheckImgur(text);
  1924. } else {
  1925. list = CTS.Me;
  1926. text = CheckImgur(text);
  1927. }
  1928.  
  1929. CTS.Message[arguments[0]].push({
  1930. "time": Time(),
  1931. "namecolor": list.namecolor,
  1932. "avatar": list.avatar,
  1933. "username": list.username,
  1934. "nick": list.nick,
  1935. "msg": text,
  1936. "mention": false
  1937. });
  1938.  
  1939. if (arguments[0] == GetActiveChat()) {
  1940. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1941. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, msg.mention, arguments[0]);
  1942. UpdateScroll(1, false);
  1943. }
  1944. }
  1945.  
  1946. function Time() {
  1947. return (new Date().toLocaleString("en-US", {
  1948. hour: "numeric",
  1949. minute: "numeric",
  1950. second: "numeric",
  1951. hour12: true
  1952. }));
  1953. }
  1954.  
  1955. function DateTime() {
  1956. return (new Date().toLocaleString("en-US", {
  1957. year: 'numeric',
  1958. month: 'numeric',
  1959. day: 'numeric',
  1960. hour: "numeric",
  1961. minute: "numeric",
  1962. second: "numeric",
  1963. hour12: true
  1964. }));
  1965. }
  1966. //FEATURES
  1967. function StorageSupport() {
  1968. try {
  1969. if ("localStorage" in window && window.localStorage !== null) {
  1970. localStorage.setItem("CTS_StorageVerify", true);
  1971. localStorage.removeItem("CTS_StorageVerify");
  1972. return true;
  1973. }
  1974. } catch (e) {
  1975. return false;
  1976. }
  1977. }
  1978.  
  1979. function Export() {
  1980. var element = document.createElement("a");
  1981. element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(arguments[1]));
  1982. element.setAttribute("download", arguments[0]);
  1983. element.style.display = "none";
  1984. document.body.appendChild(element);
  1985. element.click();
  1986. document.body.removeChild(element);
  1987. }
  1988.  
  1989. function StyleSet() {
  1990. // Chat
  1991. var style = document.createElement("style");
  1992. style.setAttribute("id", CTS.ChatStyleCounter);
  1993. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][0] + ":host, #videolist {background-color:unset;}";
  1994. ChatLogElement.appendChild(style);
  1995. // Video
  1996. style = document.createElement("style");
  1997. style.setAttribute("id", CTS.ChatStyleCounter);
  1998. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][1] + ":host, #videolist {background-color:unset;}";
  1999. VideoListElement.appendChild(style);
  2000. // Side Menu
  2001. style = document.createElement("style");
  2002. style.setAttribute("id", CTS.ChatStyleCounter);
  2003. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][2] + ":host, #videolist {background-color:unset;}";
  2004. SideMenuElement.appendChild(style);
  2005. }
  2006.  
  2007. function ChatHeightToggled() {
  2008. CTS.OGStyle.HeightCounter++;
  2009. if (!CTS.ChatDisplay) {
  2010. CTS.ChatWidth += 5;
  2011. CTS.ChatDisplay = true;
  2012. }
  2013. CTS.ChatHeight -= 5;
  2014. CTS.UserListDisplay = true;
  2015. if (CTS.ChatHeight == 20) {
  2016. CTS.ChatHeight = 45;
  2017. CTS.UserListDisplay = false;
  2018. CTS.OGStyle.HeightCounter = 0;
  2019. }
  2020. 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;");
  2021. 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;");
  2022. 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;");
  2023. VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
  2024. 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;";
  2025. UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2026. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2027. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2028. PerformanceModeInit(CTS.PerformanceMode);
  2029. UpdateScroll(1, true);
  2030. UpdateScroll(2, true);
  2031. Resize();
  2032. }
  2033.  
  2034. function ChatWidthToggled() {
  2035. CTS.OGStyle.WidthCounter++;
  2036. CTS.ChatWidth += 5;
  2037. CTS.ChatDisplay = true;
  2038. if (CTS.ChatWidth == 25) {
  2039. CTS.ChatWidth = -5;
  2040. CTS.ChatDisplay = false;
  2041. CTS.OGStyle.WidthCounter = 0;
  2042. }
  2043. 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;");
  2044. 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;");
  2045. 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;");
  2046. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
  2047. 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;";
  2048. UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  2049. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  2050. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  2051. CTS.PerformanceMode = false;
  2052. PerformanceModeInit(CTS.PerformanceMode);
  2053. UpdateScroll(1, true);
  2054. UpdateScroll(2, true);
  2055. Resize();
  2056. }
  2057.  
  2058. function ChatHide() {
  2059. CTS.NormalStyle.ChatHide = !CTS.NormalStyle.ChatHide;
  2060. ChatLogElement.querySelector("#chat-wrapper").style.display = (CTS.NormalStyle.ChatHide ? "none" : "block");
  2061. UpdateScroll(1, true);
  2062. UpdateScroll(2, true);
  2063. Resize();
  2064. }
  2065.  
  2066. function SoundMeter() {
  2067. //MICROPHONE INDICATOR
  2068. if (CTS.SoundMeterToggle) {
  2069. setTimeout(function() {
  2070. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2071. Featured = VideoListElement.querySelectorAll(".videos-items:first-child tc-video-item"),
  2072. videolist = window.TinychatApp.getInstance().defaultChatroom._videolist,
  2073. TCCameraList = videolist.items.length,
  2074. CameraLen = Camera.length,
  2075. users,
  2076. item;
  2077. if (Featured.length > 0) {
  2078. for (var x = 0; x < TCCameraList; x++) {
  2079. if (CameraLen < 1) break;
  2080. for (users = 0; users < CameraLen; users++) {
  2081. item = videolist.items[x];
  2082. if (item != undefined) {
  2083. if (Camera[users].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id") == item.userentity.path) {
  2084. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2085. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2086. break;
  2087. }
  2088. }
  2089. }
  2090. }
  2091. } else {
  2092. for (users = 0; users < CameraLen; users++) {
  2093. item = videolist.items[users];
  2094. if (item != undefined) {
  2095. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", item.audiolevel);
  2096. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  2097. }
  2098. }
  2099. }
  2100. //REPEAT
  2101. SoundMeter();
  2102. }, 300);
  2103. }
  2104. }
  2105.  
  2106. function RTC() {
  2107. if (null != arguments[0].rtc) {
  2108. let a = arguments[0].rtc;
  2109. arguments[0].rtc = null;
  2110. MS(arguments[0], a);
  2111. }
  2112. }
  2113.  
  2114. function Vote() {
  2115. var ChecksOut = CTS.VoteSystem,
  2116. len = CTS.WaitToVoteList.length;
  2117. if (len > 0 && ChecksOut) {
  2118. for (var i = 0; i < len; i++) {
  2119. if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
  2120. Send("msg", "Please wait several minutes till you can cast your vote again!");
  2121. ChecksOut = false;
  2122. break;
  2123. }
  2124. }
  2125. }
  2126. if (ChecksOut) {
  2127. if (isSafeListed(CTS.UserList[arguments[0]].username.toUpperCase())) {
  2128. var targetname = arguments[1].match(/^!vote ([a-z0-9]{1,16})$/i);
  2129. if (targetname !== null) {
  2130. var Target = UsernameToUser(targetname[1].toUpperCase());
  2131. if (Target !== -1) {
  2132. if (CTS.UserList[Target].broadcasting && CTS.UserList[Target].username !== "GUEST") {
  2133. if (CTS.Me.owner || !CTS.UserList[Target].mod) {
  2134. Send("msg", "Your vote has been cast, you may vote again shortly!");
  2135. CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
  2136. CTS.UserList[Target].vote += 1;
  2137. if (CTS.UserList[Target].vote === 3) {
  2138. CTS.UserList[Target].vote = 0;
  2139. Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
  2140. Send("stream_moder_close", CTS.UserList[Target].handle);
  2141. }
  2142. } else {
  2143. Send("msg", "I cannot do that!");
  2144. }
  2145. }
  2146. } else {
  2147. Send("msg", "The user is not broadcasting...");
  2148. }
  2149. } else {
  2150. Send("msg", "The nickname or username does not exist!");
  2151. }
  2152. }
  2153. }
  2154. }
  2155.  
  2156. function PMShow() {
  2157. ChatListElement.querySelector("#chatlist").style.display = ((CTS.enablePMs)?"block":"none");
  2158. }
  2159.  
  2160. function MessagePopUp() {
  2161. if (CTS.Popups) {
  2162. var push = false;
  2163. if (arguments[0] != -1) {
  2164. if (ChatListElement.querySelector(".list-item .active")) {
  2165. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  2166. if (arguments[2]) push = true;
  2167. } else {
  2168. push = true;
  2169. }
  2170. } else if (!arguments[2]) {
  2171. push = true;
  2172. }
  2173. }
  2174. if (arguments[3]) push = true;
  2175. if (push || !CTS.ChatDisplay) {
  2176. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  2177. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2178. clearTimeout(CTS.NotificationTimeOut[0]);
  2179. CTS.NotificationTimeOut.shift();
  2180. }
  2181. 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>");
  2182. CTS.NotificationTimeOut.push(setTimeout(function() {
  2183. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  2184. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  2185. CTS.NotificationTimeOut.shift();
  2186. }
  2187. }, 11100));
  2188. }
  2189. }
  2190. }
  2191.  
  2192. function Reminder() {
  2193. var temp,
  2194. i,
  2195. len = CTS.ReminderServerInList.length;
  2196. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  2197. CTS.ReminderServerInList = [];
  2198. if (CTS.Reminder === true) {
  2199. var OffsetTime;
  2200. len = CTS.ReminderList.length;
  2201. for (i = 0; i < len; i++) {
  2202. temp = TimeToDate(CTS.ReminderList[i][0]);
  2203. CTS.RecentTime = new Date();
  2204. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  2205. OffsetTime = temp - CTS.RecentTime;
  2206. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, CTS.ReminderList[i][1]));
  2207. }
  2208. if (Addon.active("ReminderList")) {
  2209. len = Addon.get("ReminderList").length;
  2210. for (i = 0; i < len; i++) {
  2211. temp = TimeToDate(Addon.get("ReminderList")[i][0]);
  2212. CTS.RecentTime = new Date();
  2213. if (temp < CTS.RecentTime) temp.setDate(CTS.RecentTime.getDate() + 1);
  2214. OffsetTime = temp - CTS.RecentTime;
  2215. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, Addon.get("ReminderList")[i][1]));
  2216. }
  2217. }
  2218. }
  2219. }
  2220.  
  2221. function AddReminder() {
  2222. Send("msg", "📣 " + arguments[0]);
  2223. setTimeout(Reminder, 5000);
  2224. }
  2225.  
  2226. function ServerEvent() {
  2227. var temp,
  2228. i,
  2229. len = CTS.ServerEventServerInList.length;
  2230. for (i = 0; i < len; i++) clearTimeout(CTS.ServerEventServerInList[i]);
  2231. CTS.ServerEventServerInList = [];
  2232. var OffsetTime,
  2233. event = true;
  2234. len = CTS.ServerEventList.length;
  2235. for (i = 0; i < len; i++) {
  2236. temp = new Date(CTS.ServerEventList[i][1]);
  2237. CTS.RecentTime = new Date();
  2238. if (temp < CTS.RecentTime && CTS.ServerEventList[i][0]) {
  2239. temp.setDate(CTS.RecentTime.getDate());
  2240. temp.setYear(CTS.RecentTime.getFullYear());
  2241. }
  2242. OffsetTime = temp - CTS.RecentTime;
  2243. if (OffsetTime > 0 && OffsetTime < 3600000) {
  2244. event = false;
  2245. CTS.ServerEventServerInList.push(setTimeout(AddServerEvent, OffsetTime, CTS.ServerEventList[i][2], CTS.ServerEventList[i][3], CTS.ServerEventList[i][4]));
  2246. }
  2247. }
  2248. if (event) setTimeout(Events, 3600000);
  2249. }
  2250.  
  2251. function AddServerEvent() {
  2252. CreateServerEvent(GetActiveChat(), arguments[0], arguments[1], "📢 " + arguments[2]);
  2253. setTimeout(ServerEvent, 5000);
  2254. }
  2255.  
  2256. function NotificationDisplay() {
  2257. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2258. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  2259. if (CTS.NotificationToggle == 0) {
  2260. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  2261. passive: true
  2262. });
  2263. } else {
  2264. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
  2265. passive: true
  2266. });
  2267. }
  2268. UpdateScroll(1, true);
  2269. UpdateScroll(2, true);
  2270. }
  2271.  
  2272. function NotificationResize() {
  2273. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  2274. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  2275. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  2276. ChatLogElement.querySelector("#chat").style.height = "50%%";
  2277. } else {
  2278. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  2279. ChatLogElement.querySelector("#chat").style.height = "100%";
  2280. }
  2281. UpdateScroll(1, false);
  2282. UpdateScroll(2, true);
  2283. }
  2284.  
  2285. function Dice() {
  2286. return String.fromCharCode("0x268" + Rand(0, 5));
  2287. }
  2288.  
  2289. function Rand() {
  2290. arguments[0] = Math.ceil(arguments[0]);
  2291. arguments[1] = Math.floor(arguments[1]);
  2292. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  2293. }
  2294.  
  2295. function OpenMicrophone() {
  2296. MicrophoneElement.initMouseEvent("mousedown");
  2297. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  2298. }
  2299.  
  2300. function Cameras() {
  2301. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  2302. Len = Camera.length;
  2303. for (var num = 0; num < Len; num++) {
  2304. Camera[num].shadowRoot.querySelector(".video").style.padding = (CTS.CameraBorderToggle) ? "5px" : "0";
  2305. if (!Camera[num].shadowRoot.querySelector(".video #fixed")) {
  2306. var user = HandleToUser(Camera[num].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id"));
  2307. if (user != -1) {
  2308. if (CTS.HiddenCameraList.includes(CTS.UserList[user].username)) {
  2309. window.TinychatApp.BLL.Videolist.prototype.toggleHiddenVW(window.TinychatApp.getInstance().defaultChatroom._videolist.items[num], false);
  2310. Alert(GetActiveChat(), CTS.UserList[user].username + " has been auto-hidden!");
  2311. }
  2312. }
  2313. 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>");
  2314. }
  2315. }
  2316. Resize();
  2317. }
  2318.  
  2319. function FeaturedCameras() {
  2320. if (arguments[0] === true) {
  2321. if (VideoListElement.querySelector("#SmallFTYT")) {
  2322. Remove(VideoListElement, "#SmallFTYT");
  2323. }
  2324. } else {
  2325. var node = document.createElement("style");
  2326. node.appendChild(document.createTextNode(FeaturedCSS));
  2327. node.setAttribute("id", "SmallFTYT");
  2328. VideoListElement.appendChild(node);
  2329. }
  2330. }
  2331.  
  2332. function Resize() {
  2333. window.dispatchEvent(new Event("resize"));
  2334. }
  2335.  
  2336. function PerformanceModeInit() {
  2337. if (!CTS.ThemeChange) {
  2338. var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
  2339. ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
  2340. ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
  2341. ChatLogElement.querySelector("#chat-wrapper").style.width = value;
  2342. TitleElement.querySelector("#room-header").style.minWidth = value;
  2343. TitleElement.querySelector("#room-header").style.maxWidth = value;
  2344. TitleElement.querySelector("#room-header").style.width = value;
  2345. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2346. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  2347. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
  2348. VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2349. VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2350. VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  2351. SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
  2352. SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
  2353. SideMenuElement.querySelector("#sidemenu").style.width = value;
  2354. document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
  2355. VideoListElement.querySelector("#videos").style.display = ((!arguments[0]) ? "block!important" : "none!important");
  2356. } else {
  2357. if (arguments[0]) {
  2358. VideoListElement.querySelector("#videos-content").style.display = "none";
  2359. ChatLogElement.querySelector("#chat-wrapper").style.width = "100%";
  2360. ChatLogElement.querySelector("#chat-wrapper").style.position = "fixed";
  2361. ChatLogElement.querySelector("#chat-wrapper").style.left = "0";
  2362. ChatLogElement.querySelector("#chat-wrapper").style.bottom = "0";
  2363. ChatLogElement.querySelector("#chat-wrapper").style.minHeight = "100%";
  2364. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.display = "none";
  2365. VideoListElement.querySelector("#videos-header").style.display = "none";
  2366. VideoListElement.querySelector("#videos-footer").style.display = "none";
  2367. } else {
  2368. VideoListElement.querySelector("#videos-content").style.removeProperty("display");
  2369. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("width");
  2370. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("position");
  2371. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("left");
  2372. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("bottom");
  2373. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("min-height");
  2374. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.removeProperty("display");
  2375. VideoListElement.querySelector("#videos-header").style.removeProperty("display");
  2376. VideoListElement.querySelector("#videos-footer").style.removeProperty("display");
  2377. }
  2378. }
  2379. UpdateScroll(1, true);
  2380. UpdateScroll(2, true);
  2381. Resize();
  2382. }
  2383.  
  2384. function OwnerCommand() {
  2385. //MESSAGE FROM OWNER
  2386. if (isCommand(arguments[1])) {
  2387. if (CTS.UserList[arguments[0]].owner) {
  2388. if (!CTS.Me.owner) {
  2389. //PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
  2390. if (arguments[1].match(/^!raid /i)) {
  2391. // !raid https://tinychat.com/roomname
  2392. var raid = arguments[1].match(/^(?:!raid )(?:https?:\/\/)?tinychat\.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?([a-z0-9]{3,16})$/i);
  2393. if (raid !== null) {
  2394. if (CTS.RaidToggle) {
  2395. window.location.replace("https://tinychat.com/room/"+raid[1]);
  2396. } else {
  2397. Alert(GetActiveChat(), "[TIP]\nRaids are silenced. Refresh or !raidtoggle");
  2398. }
  2399. } else {
  2400. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nThis is not a valid link for raid.");
  2401. }
  2402. }
  2403. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + Ver(), CTS.UserList[arguments[0]].handle);
  2404. } else {
  2405. if (arguments[1].match(/^!closeall$/i)) {
  2406. for (var a = 0; a < CTS.Camera.List.length; a++) {
  2407. if (CTS.Me.handle !== CTS.Camera.List[a]) {
  2408. Send("stream_moder_close", CTS.Camera.List[a]);
  2409. } else {
  2410. CTS.SocketTarget.send(JSON.stringify({
  2411. "tc": "stream_close",
  2412. "handle": CTS.Me.handle
  2413. }));
  2414. }
  2415. }
  2416. }
  2417. if (arguments[1].match(/^!kickall$/i)) {
  2418. for (var b = 0; b < CTS.UserList.length; b++) {
  2419. if (CTS.Me.handle !== CTS.UserList[b].handle) Send("kick", CTS.UserList[b].handle);
  2420. }
  2421. if (CTS.CanSeeTips) Alert(GetActiveChat(), "[TIP]\nIf you leave now, the entire room resets! GOGOGO~");
  2422. }
  2423. }
  2424. }
  2425. }
  2426. }
  2427.  
  2428. function Command() {
  2429. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?: ?)(.*)/i);
  2430. if (UserCommand) {
  2431. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  2432. debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
  2433. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  2434. }
  2435. }
  2436. }
  2437. //ALERT FUNCTIONS
  2438. function Settings() {
  2439. 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>");
  2440. }
  2441.  
  2442. function Alert() {
  2443. CTS.Message[arguments[0]].push({
  2444. "time": Time(),
  2445. "namecolor": (arguments[2] !== undefined) ? "#000000" : "#3f69c0",
  2446. "avatar": (arguments[2] !== undefined) ? ("") : ("https://i.imgur.com/S09irS7.png"),
  2447. "username": "",
  2448. "nick": (arguments[2] !== undefined) ? (arguments[2]) : ("CTS Version: " + Ver()),
  2449. "msg": ((arguments[2] !== undefined) ? ("<div class=\"systemuser\">" + arguments[1] + "</div>") : arguments[1]),
  2450. "mention": true
  2451. });
  2452. var len = CTS.Message[arguments[0]].length - 1;
  2453. arguments[1] = CTS.Message[arguments[0]][len];
  2454. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[1].mention, arguments[0]);
  2455. }
  2456.  
  2457. function Ver() {
  2458. return window.CTSVersion.Major + "." + window.CTSVersion.Minor + "." + window.CTSVersion.Patch;
  2459. }
  2460.  
  2461. function AddUserNotification() {
  2462. if (CTS.FullLoad && CTS.ShowedSettings) {
  2463. var chat = ChatLogElement.querySelector("#notification-content"),
  2464. Notification;
  2465. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  2466. if (arguments[0] == 1) {
  2467. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  2468. } else if (arguments[0] == 2) {
  2469. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left.");
  2470. } else if (arguments[0] == 3) {
  2471. Notification = arguments[2] + "has mentioned you!";
  2472. 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>");
  2473. UpdateScroll(2, true);
  2474. } else if (arguments[0] == 4) {
  2475. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  2476. }
  2477. 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>");
  2478. if (CTS.NotificationToggle == 1) Alert(0, Notification, arguments[2]);
  2479. 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);
  2480. UpdateScroll(2, false);
  2481. var Notifications = ChatLogElement.querySelectorAll(".notification");
  2482. if (Notifications.length > CTS.NotificationLimit + 25) {
  2483. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  2484. }
  2485. }
  2486. }
  2487.  
  2488. function AddSystemNotification() {
  2489. if (CTS.FullLoad && CTS.ShowedSettings) {
  2490. if (CTS.NotificationToggle == 0) {
  2491. 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>");
  2492. } else if (CTS.NotificationToggle == 1) {
  2493. Alert(0, arguments[0], "SYSTEM");
  2494. }
  2495. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  2496. UpdateScroll(2, false);
  2497. }
  2498. }
  2499. //USER FUNCTION
  2500. function AddUser() {
  2501. CTS.UserList.push({
  2502. "handle": arguments[0],
  2503. "username": arguments[5],
  2504. "nick": arguments[4],
  2505. "owner": arguments[7],
  2506. "mod": arguments[1],
  2507. "namecolor": arguments[2],
  2508. "avatar": arguments[3],
  2509. "canGame": arguments[6],
  2510. "broadcasting": false,
  2511. "vote": 0,
  2512. "triviapoints": CTS.Game.Trivia.PlayerList[arguments[5]] || 0
  2513. });
  2514. if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  2515. }
  2516.  
  2517. function HandleToUser() {
  2518. for (var user = 0; user < CTS.UserList.length; user++) {
  2519. if (CTS.UserList[user].handle == arguments[0]) return user;
  2520. }
  2521. return -1;
  2522. }
  2523.  
  2524. function UsernameToHandle() {
  2525. for (var user = 0; user < CTS.UserList.length; user++) {
  2526. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2527. }
  2528. return -1;
  2529. }
  2530.  
  2531. function UsernameToUser() {
  2532. for (var user = 0; user < CTS.UserList.length; user++) {
  2533. if (CTS.UserList[user].username.toUpperCase() == arguments[0]) return user;
  2534. }
  2535. return -1;
  2536. }
  2537.  
  2538. function NicknameToHandle() {
  2539. for (var user = 0; user < CTS.UserList.length; user++) {
  2540. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  2541. }
  2542. return -1;
  2543. }
  2544.  
  2545. function NicknameToUser() {
  2546. for (var user = 0; user < CTS.UserList.length; user++) {
  2547. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  2548. }
  2549. return -1;
  2550. }
  2551.  
  2552. function CheckUserListSafe() {
  2553. var len = CTS.UserList.length;
  2554. var temp = [];
  2555. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2556. for (var user = 0; user < len; user++) {
  2557. if (!CTS.UserList[user].mod && !isSafeListed(CTS.UserList[user].username)) CTS.KBQueue.push(CTS.UserList[user].handle);
  2558. }
  2559. len = CTS.KBQueue.length;
  2560. for (var kb = 0; kb < len; kb++) {
  2561. Send(arguments[0], CTS.KBQueue[kb]);
  2562. }
  2563. CTS.KBQueue = [];
  2564. }
  2565.  
  2566. function isSafeListed() {
  2567. var temp = [];
  2568. if (Addon.active("AKB")) temp = Addon.get("AKB");
  2569. return (CTS.SafeList.includes(arguments[0]) || temp.includes(arguments[0]));
  2570. }
  2571.  
  2572. function CheckUserTempIgnore() {
  2573. if (CTS.TempIgnoreUserList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreNickList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  2574. return false;
  2575. }
  2576.  
  2577. function CheckUserIgnore() {
  2578. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username)) return true;
  2579. return false;
  2580. }
  2581.  
  2582. function CheckUserTouchScreen() {
  2583. if (/Mobi|Android/i.test(navigator.userAgent) || 'ontouchstart' in document.documentElement) {
  2584. CTS.Project.isTouchScreen = true;
  2585. CTS.ThemeChange = true;
  2586. }
  2587. }
  2588.  
  2589. function CheckUserAbuse() {
  2590. var action = false;
  2591. if (CTS.Me.mod) {
  2592. if (CTS.UserKickList.includes(arguments[1]) || CTS.NickKickList.includes(arguments[2].toUpperCase())) {
  2593. CTS.NoGreet = true;
  2594. Send("kick", arguments[0]);
  2595. action = true;
  2596. }
  2597. if (!action) {
  2598. if (CTS.UserBanList.includes(arguments[1]) || CTS.NickBanList.includes(arguments[2].toUpperCase())) {
  2599. CTS.NoGreet = true;
  2600. Send("ban", arguments[0]);
  2601. }
  2602. }
  2603. }
  2604. }
  2605.  
  2606. function CheckUserWordAbuse() {
  2607. if (CTS.UserList[arguments[0]].handle != CTS.Me.handle && !CTS.UserList[arguments[0]].mod) {
  2608. var action = false; //LETS NOT REPEAT/KICK
  2609. var len = CTS.KickKeywordList.length;
  2610. for (var i = 0; i < len; i++) {
  2611. if (arguments[1].includes(CTS.KickKeywordList[i])) {
  2612. Send("kick", CTS.UserList[arguments[0]].handle);
  2613. action = true;
  2614. break;
  2615. }
  2616. }
  2617. if (!action) {
  2618. len = CTS.BanKeywordList.length;
  2619. for (i = 0; i < len; i++) {
  2620. if (arguments[1].includes(CTS.BanKeywordList[i])) {
  2621. Send("ban", CTS.UserList[arguments[0]].handle);
  2622. break;
  2623. }
  2624. }
  2625. }
  2626. }
  2627. }
  2628.  
  2629. function RemoveUserCamera() {
  2630. var len = CTS.Camera.List.length;
  2631. if (len > 0) {
  2632. for (var i = 0; i < len; i++) {
  2633. if (CTS.Camera.List[i] === arguments[0]) {
  2634. CTS.Camera.List.splice(i, 1);
  2635. clearTimeout(CTS.Camera.clearRandom);
  2636. break;
  2637. }
  2638. }
  2639. }
  2640. }
  2641.  
  2642. function CheckUserStream() {
  2643. var user = HandleToUser(arguments[0]);
  2644. if (user != -1) {
  2645. if (CTS.Me.mod) {
  2646. if (arguments[1]) {
  2647. //PUSH UPDATE
  2648. CTS.Camera.List.push(CTS.UserList[user].handle);
  2649. CTS.UserList[user].broadcasting = true;
  2650. var len = CTS.Camera.List.length;
  2651. if (CTS.UserList[user].username !== "GUEST" && !CTS.GreenRoomList.includes(CTS.UserList[user].username)) {
  2652. CTS.GreenRoomList.push(CTS.UserList[user].username);
  2653. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  2654. }
  2655. //CLEAR TIMERS
  2656. clearTimeout(CTS.Camera.clearRandom);
  2657. //CAMERA SWEEP FUNCTION
  2658. if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
  2659. CTS.Camera.clearRandom = setTimeout(function() {
  2660. var rand = Rand(0, len - 1);
  2661. if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
  2662. var target = HandleToUser(CTS.Camera.List[rand]);
  2663. if (CTS.Me.owner || !CTS.UserList[target].mod) {
  2664. Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
  2665. Send("stream_moder_close", CTS.Camera.List[rand]);
  2666. CTS.Camera.List.splice(rand, 1);
  2667. }
  2668. }
  2669. }, CTS.Camera.SweepTimer * 60000);
  2670. }
  2671. } else {
  2672. clearTimeout(CTS.Camera.clearRandom);
  2673. RemoveUserCamera(CTS.UserList[user].handle);
  2674. CTS.UserList[user].broadcasting = false;
  2675. }
  2676. CTS.UserList[user].broadcasting = arguments[1];
  2677. }
  2678. if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  2679. }
  2680. }
  2681.  
  2682. function CheckUserName() {
  2683. return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
  2684. }
  2685.  
  2686. function CheckUserNameStrict() {
  2687. return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
  2688. }
  2689.  
  2690. function MSR() {
  2691. if (arguments[0]) {
  2692. arguments[1].videolist.RemoveVideoRemote(arguments[1].handle);
  2693. } else {
  2694. arguments[1].mediaStream.stop();
  2695. arguments[1].mediaStream = null;
  2696. }
  2697. }
  2698.  
  2699. function MS() {
  2700. if (arguments[0].mediaStream !== null) {
  2701. if (arguments[0].mediaStream.active && arguments[1].signalingState !== "closed" && typeof arguments[1].removeStream === "function" && arguments[1].removeStream(arguments[0].mediaStream)) MSR(false, arguments[0]);
  2702. } else {
  2703. MSR(true, arguments[0]);
  2704. }
  2705. if (arguments[1].signalingState !== "closed" && arguments[1].close());
  2706. }
  2707. //LOAD/SAVE FUNCTION
  2708. function Load() {
  2709. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  2710. if (null === val && "undefined" != typeof arguments[1]) {
  2711. Save(arguments[0], arguments[1]);
  2712. return arguments[1];
  2713. }
  2714. return val;
  2715. }
  2716.  
  2717. function Save() {
  2718. if (CTS.StorageSupport) {
  2719. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  2720. } else {
  2721. Alert(GetActiveChat(), "Looks like you don't have LocalStorage allowed on this device!\nYour options will not be saved!");
  2722. }
  2723. }
  2724.  
  2725. //SOCKET FUNCTION
  2726. function CTSWebSocket() {
  2727. if (window.Proxy === undefined) return;
  2728. var handler = {
  2729. set: function(Target, prop, value) {
  2730. if (prop == "onmessage") {
  2731. var oldMessage = value;
  2732. value = function(event) {
  2733. ServerMsg(JSON.parse(event.data), Target);
  2734. oldMessage(event);
  2735. };
  2736. }
  2737. return (Target[prop] = value);
  2738. },
  2739. get: function(Target, prop) {
  2740. var value = Target[prop];
  2741. if (prop == "send") {
  2742. value = function(event) {
  2743. ClientMsg(JSON.parse(event), Target);
  2744. Target.send(event);
  2745. };
  2746. } else if (typeof value == 'function') {
  2747. value = value.bind(Target);
  2748. }
  2749. return value;
  2750. }
  2751. };
  2752. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  2753. construct: function(Target, args) {
  2754. CTS.SocketTarget = new Target(args[0]);
  2755. debug("SOCKET::CONNECTING", args[0]);
  2756. return new window.Proxy(CTS.SocketTarget, handler);
  2757. }
  2758. });
  2759. window.WebSocket = WebSocketProxy;
  2760. }
  2761.  
  2762. function ModCommand() {
  2763. var name = arguments[1].match(/^!(?:userkick|nickkick|userban|nickban|userclose|nickclose) (guest-[0-9]{1,32}|[a-z0-9_]{1,32})$/i),
  2764. target;
  2765. if (name !== null) {
  2766. if (name[1].toUpperCase() !== "GUEST") {
  2767. target = ((arguments[2]) ? UsernameToUser(name[1].toUpperCase()) : NicknameToUser(name[1].toUpperCase()));
  2768. } else {
  2769. target = NicknameToUser(name[1].toUpperCase());
  2770. }
  2771. if (target != -1) { // USER ONLINE
  2772. if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
  2773. //IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
  2774. if (arguments[0] === "stream_moder_close") {
  2775. if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
  2776. } else {
  2777. Send(arguments[0], CTS.UserList[target].handle);
  2778. }
  2779. } else {
  2780. Send("msg", "This users authorization is similar or above yours!");
  2781. }
  2782. }
  2783. }
  2784. }
  2785.  
  2786. function BotCommand() {
  2787. var len = CTS.YouTube.MessageQueueList.length;
  2788. if (len <= 0) {
  2789. var check = true;
  2790. // Moderator Control
  2791. if (CTS.UserList[arguments[1]].mod) {
  2792. if (arguments[0] == 2) {
  2793. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2794. CTS.YouTube.Clear = true;
  2795. YouTubePlayList();
  2796. }
  2797. check = false;
  2798. }
  2799. if (arguments[0] == 5) {
  2800. SetBot(true);
  2801. check = false;
  2802. }
  2803. }
  2804. // User and Moderator Control
  2805. if (check){
  2806. if (VerifyYouTube(arguments[1])) {
  2807. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  2808. if (arguments[0] == 4) YouTubePlayList(true);
  2809. if (CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
  2810. if (arguments[0] == 6) YoutubeBypass(arguments[2]);
  2811. if (arguments[0] == 3) {
  2812. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  2813. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  2814. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  2815. }
  2816. }
  2817. }
  2818. }
  2819. }
  2820. } else {
  2821. if (CTS.YouTube.ListBuilt === false) {
  2822. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  2823. } else {
  2824. Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  2825. }
  2826. }
  2827. }
  2828.  
  2829. function ServerMsg() {
  2830. if (typeof ServerInList[arguments[0].tc] == "function") {
  2831. debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2832. ServerInList[arguments[0].tc](arguments[0]);
  2833. }
  2834. }
  2835.  
  2836. function ClientMsg() {
  2837. if (typeof ServerOutList[arguments[0].tc] == "function") {
  2838. debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2839. ServerOutList[arguments[0].tc](arguments[0]);
  2840. }
  2841. }
  2842.  
  2843. function Send() {
  2844. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  2845. if (arguments[1] === undefined) arguments[1] = "Open Request";
  2846. debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  2847. }
  2848. //GAME FUNCTION
  2849. //FISHING BOAT
  2850. function FishUpgradeStatus() {
  2851. var msg = "[FISHING BOAT]\n";
  2852. if (arguments[1] != 7) msg += arguments[0].Nickname + ":\n";
  2853. 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");
  2854. 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";
  2855. 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";
  2856. 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";
  2857. 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";
  2858. Send("msg", msg);
  2859. }
  2860.  
  2861. function FishTimerCheck() {
  2862. if (new Date() - arguments[0].LastCheck >= 5000) {
  2863. arguments[0].LastCheck = new Date();
  2864. return true;
  2865. }
  2866. return false;
  2867. }
  2868.  
  2869. function FishCommandCheck() {
  2870. var command,
  2871. playerExist = Fish.GetPlayer(CTS.UserList[arguments[0]].handle, false, true),
  2872. FishCommand = arguments[1].match(/^!(fish(?:rob|slap|split|help|upgrade)?) ?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
  2873. if (FishCommand) {
  2874. if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
  2875. if (FishCommand[2] !== undefined) {
  2876. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  2877. }
  2878. } else {
  2879. command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
  2880. if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  2881. }
  2882. }
  2883. }
  2884.  
  2885. function FishTransfer() {
  2886. if (arguments[1] !== undefined && arguments[1] !== -1) {
  2887. if (arguments[0].Points > arguments[2]) {
  2888. if (arguments[4]) {
  2889. arguments[0].Points -= arguments[2];
  2890. if (arguments[1].Points <= arguments[3]) {
  2891. arguments[3] = arguments[1].Points;
  2892. arguments[1].Points -= arguments[3];
  2893. arguments[0].Points += arguments[3];
  2894. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " destroyed " + arguments[1].Nickname + "\nMoney made $" + arguments[3] + "!");
  2895. Fish.GetPlayer(arguments[1].Handle, true);
  2896. } else {
  2897. arguments[1].Points -= arguments[3];
  2898. arguments[0].Points += arguments[3];
  2899. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " robbed " + arguments[1].Nickname + " for $" + arguments[3] + "!");
  2900. }
  2901. } else {
  2902. arguments[0].Points = arguments[3];
  2903. arguments[1].Points += arguments[3];
  2904. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " split their money with " + arguments[1].Nickname + "!");
  2905. }
  2906. } else {
  2907. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " are you kidding me?\nTalk to me when you have money!");
  2908. }
  2909. }
  2910. }
  2911.  
  2912. function FishTransaction() {
  2913. if (arguments[0].Points > arguments[1]) {
  2914. arguments[0].Points -= arguments[1];
  2915. return true;
  2916. } else {
  2917. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + ", are you kidding me?\nTalk to me when you have money!");
  2918. return false;
  2919. }
  2920. }
  2921. //SERVER/CLIENT LIST FUNCTION
  2922. var CommandList = {
  2923. cts: function() {
  2924. 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>");
  2925. },
  2926. help: function() {
  2927. this.cts();
  2928. },
  2929. userlist: function() {
  2930. Alert(GetActiveChat(), SettingsList.UserList());
  2931. },
  2932. ytapi: function() {
  2933. if (arguments[0] === "") {
  2934. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2935. } else {
  2936. if (arguments[0].match(/^([0-9A-Z]*)/i)) {
  2937. CTS.YouTube.API_KEY = arguments[0];
  2938. Save("YouTubeAPI", arguments[0]);
  2939. Alert(GetActiveChat(), "✓ Command Accepted!");
  2940. } else {
  2941. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  2942. }
  2943. }
  2944. },
  2945. fps: function() {
  2946. CTS.FPS = (arguments[0] === "" || isNaN(arguments[0])) ? 30 : (arguments[0] > 60) ? 60 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  2947. Save("FPS", CTS.FPS);
  2948. Alert(GetActiveChat(), "✓ Command Accepted!");
  2949. if (CTS.Me.broadcasting) Alert(GetActiveChat(), "Settings will not change till you re-cam!");
  2950. },
  2951. mentionadd: function() {
  2952. if (arguments[0] === "") {
  2953. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2954. } else {
  2955. if (CheckUserNameStrict(arguments[0])) {
  2956. if (!CTS.MentionList.includes(arguments[0].toUpperCase())) {
  2957. CTS.MentionList.push(arguments[0].toUpperCase());
  2958. Save("MentionList", JSON.stringify(CTS.MentionList));
  2959. Alert(GetActiveChat(), "✓ Command Accepted!");
  2960. } else {
  2961. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  2962. }
  2963. } else {
  2964. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  2965. }
  2966. }
  2967. },
  2968. mentionremove: function() {
  2969. if (arguments[0] === "" || isNaN(arguments[0])) {
  2970. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2971. } else {
  2972. if (CTS.MentionList[arguments[0]] !== undefined) {
  2973. CTS.MentionList.splice(arguments[0], 1);
  2974. Save("MentionList", JSON.stringify(CTS.MentionList));
  2975. Alert(GetActiveChat(), "✓ Command Accepted!");
  2976. } else {
  2977. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  2978. }
  2979. }
  2980. },
  2981. mentionlistclear: function() {
  2982. CTS.MentionList = [];
  2983. Save("MentionList", JSON.stringify(CTS.MentionList));
  2984. Alert(GetActiveChat(), "✓ Command Accepted!");
  2985. },
  2986. mentionlist: function() {
  2987. Alert(GetActiveChat(), SettingsList.MentionList());
  2988. },
  2989. hiddencameraadd: function() {
  2990. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") {
  2991. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2992. } else {
  2993. if (CheckUserNameStrict(arguments[0])) {
  2994. if (!CTS.HiddenCameraList.includes(arguments[0].toUpperCase())) {
  2995. CTS.HiddenCameraList.push(arguments[0].toUpperCase());
  2996. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  2997. Alert(GetActiveChat(), "✓ Command Accepted!");
  2998. } else {
  2999. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3000. }
  3001. } else {
  3002. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3003. }
  3004. }
  3005. },
  3006. hiddencameraremove: function() {
  3007. if (arguments[0] === "" || isNaN(arguments[0])) {
  3008. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3009. } else {
  3010. if (CTS.HiddenCameraList[arguments[0]] !== undefined) {
  3011. CTS.HiddenCameraList.splice(arguments[0], 1);
  3012. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3013. Alert(GetActiveChat(), "✓ Command Accepted!");
  3014. } else {
  3015. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3016. }
  3017. }
  3018. },
  3019. hiddencameralistclear: function() {
  3020. CTS.HiddenCameraList = [];
  3021. Save("HiddenCameraList", JSON.stringify(CTS.HiddenCameraList));
  3022. Alert(GetActiveChat(), "✓ Command Accepted!");
  3023. },
  3024. hiddencameralist: function() {
  3025. Alert(GetActiveChat(), SettingsList.HiddenCameraList());
  3026. },
  3027. ignoreadd: function() {
  3028. if (arguments[0] === "") {
  3029. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3030. } else {
  3031. if (CheckUserNameStrict(arguments[0])) {
  3032. if (!CTS.IgnoreList.includes(arguments[0].toUpperCase())) {
  3033. CTS.IgnoreList.push(arguments[0].toUpperCase());
  3034. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3035. Alert(GetActiveChat(), "✓ Command Accepted!");
  3036. } else {
  3037. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3038. }
  3039. } else {
  3040. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3041. }
  3042. }
  3043. },
  3044. ignoreremove: function() {
  3045. if (arguments[0] === "" || isNaN(arguments[0])) {
  3046. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3047. } else {
  3048. if (CTS.IgnoreList[arguments[0]] !== undefined) {
  3049. CTS.IgnoreList.splice(arguments[0], 1);
  3050. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3051. Alert(GetActiveChat(), "✓ Command Accepted!");
  3052. } else {
  3053. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3054. }
  3055. }
  3056. },
  3057. ignorelistclear: function() {
  3058. CTS.IgnoreList = [];
  3059. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3060. Alert(GetActiveChat(), "✓ Command Accepted!");
  3061. },
  3062. ignorelist: function() {
  3063. Alert(GetActiveChat(), SettingsList.IgnoreList());
  3064. },
  3065. userbanadd: function() {
  3066. if (arguments[0] === "") {
  3067. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3068. } else {
  3069. if (CheckUserNameStrict(arguments[0])) {
  3070. if (!CTS.UserBanList.includes(arguments[0].toUpperCase())) {
  3071. CTS.UserBanList.push(arguments[0].toUpperCase());
  3072. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3073. Alert(GetActiveChat(), "✓ Command Accepted!");
  3074. var check = UsernameToHandle(arguments[0].toUpperCase());
  3075. if (check != -1 && CTS.Me.mod) Send("ban", check);
  3076. } else {
  3077. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3078. }
  3079. } else {
  3080. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3081. }
  3082. }
  3083. },
  3084. userbanremove: function() {
  3085. if (arguments[0] === "" || isNaN(arguments[0])) {
  3086. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3087. } else {
  3088. if (CTS.UserBanList[arguments[0]] !== undefined) {
  3089. CTS.UserBanList.splice(arguments[0], 1);
  3090. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3091. Alert(GetActiveChat(), "✓ Command Accepted!");
  3092. } else {
  3093. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3094. }
  3095. }
  3096. },
  3097. userbanlistclear: function() {
  3098. CTS.UserBanList = [];
  3099. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3100. Alert(GetActiveChat(), "✓ Command Accepted!");
  3101. },
  3102. userbanlist: function() {
  3103. Alert(GetActiveChat(), SettingsList.UserBanList());
  3104. },
  3105. nickbanadd: function() {
  3106. if (arguments[0] === "") {
  3107. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3108. } else {
  3109. if (CheckUserNameStrict(arguments[0])) {
  3110. if (!CTS.NickBanList.includes(arguments[0].toUpperCase())) {
  3111. CTS.NickBanList.push(arguments[0].toUpperCase());
  3112. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3113. Alert(GetActiveChat(), "✓ Command Accepted!");
  3114. var check = NicknameToHandle(arguments[0].toUpperCase());
  3115. if (check != -1 && CTS.Me.mod) Send("ban", check);
  3116. } else {
  3117. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3118. }
  3119. } else {
  3120. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3121. }
  3122. }
  3123. },
  3124. nickbanremove: function() {
  3125. if (arguments[0] === "" || isNaN(arguments[0])) {
  3126. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3127. } else {
  3128. if (CTS.NickBanList[arguments[0]] !== undefined) {
  3129. CTS.NickBanList.splice(arguments[0], 1);
  3130. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3131. Alert(GetActiveChat(), "✓ Command Accepted!");
  3132. } else {
  3133. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3134. }
  3135. }
  3136. },
  3137. nickbanlistclear: function() {
  3138. CTS.NickBanList = [];
  3139. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3140. Alert(GetActiveChat(), "✓ Command Accepted!");
  3141. },
  3142. nickbanlist: function() {
  3143. Alert(GetActiveChat(), SettingsList.NickBanList());
  3144. },
  3145. userkickadd: function() {
  3146. if (arguments[0] === "") {
  3147. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3148. } else {
  3149. if (CheckUserNameStrict(arguments[0])) {
  3150. if (!CTS.UserKickList.includes(arguments[0].toUpperCase())) {
  3151. CTS.UserKickList.push(arguments[0].toUpperCase());
  3152. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3153. Alert(GetActiveChat(), "✓ Command Accepted!");
  3154. var check = UsernameToHandle(arguments[0].toUpperCase());
  3155. if (check != -1 && CTS.Me.mod) Send("kick", check);
  3156. } else {
  3157. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3158. }
  3159. } else {
  3160. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3161. }
  3162. }
  3163. },
  3164. userkickremove: function() {
  3165. if (arguments[0] === "" || isNaN(arguments[0])) {
  3166. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3167. } else {
  3168. if (CTS.UserKickList[arguments[0]] !== undefined) {
  3169. CTS.UserKickList.splice(arguments[0], 1);
  3170. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3171. Alert(GetActiveChat(), "✓ Command Accepted!");
  3172. } else {
  3173. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3174. }
  3175. }
  3176. },
  3177. userkicklistclear: function() {
  3178. CTS.UserKickList = [];
  3179. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3180. Alert(GetActiveChat(), "✓ Command Accepted!");
  3181. },
  3182. userkicklist: function() {
  3183. Alert(GetActiveChat(), SettingsList.UserKickList());
  3184. },
  3185. nickkickadd: function() {
  3186. if (arguments[0] === "") {
  3187. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3188. } else {
  3189. if (CheckUserNameStrict(arguments[0])) {
  3190. if (!CTS.NickKickList.includes(arguments[0].toUpperCase())) {
  3191. CTS.NickKickList.push(arguments[0].toUpperCase());
  3192. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3193. Alert(GetActiveChat(), "✓ Command Accepted!");
  3194. var check = NicknameToHandle(arguments[0].toUpperCase());
  3195. if (check != -1 && CTS.Me.mod) Send("kick", check);
  3196. } else {
  3197. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3198. }
  3199. } else {
  3200. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3201. }
  3202. }
  3203. },
  3204. nickkickremove: function() {
  3205. if (arguments[0] === "" || isNaN(arguments[0])) {
  3206. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3207. } else {
  3208. if (CTS.NickKickList[arguments[0]] !== undefined) {
  3209. CTS.NickKickList.splice(arguments[0], 1);
  3210. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3211. Alert(GetActiveChat(), "✓ Command Accepted!");
  3212. } else {
  3213. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3214. }
  3215. }
  3216. },
  3217. nickkicklistclear: function() {
  3218. CTS.NickKickList = [];
  3219. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3220. Alert(GetActiveChat(), "✓ Command Accepted!");
  3221. },
  3222. nickkicklist: function() {
  3223. Alert(GetActiveChat(), SettingsList.NickKickList());
  3224. },
  3225. bankeywordadd: function() {
  3226. if (arguments[0] === "") {
  3227. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3228. } else {
  3229. if (!CTS.BanKeywordList.includes(arguments[0])) {
  3230. CTS.BanKeywordList.push(arguments[0]);
  3231. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3232. Alert(GetActiveChat(), "✓ Command Accepted!");
  3233. } else {
  3234. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3235. }
  3236. }
  3237. },
  3238. bankeywordremove: function() {
  3239. if (arguments[0] === "" || isNaN(arguments[0])) {
  3240. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3241. } else {
  3242. if (CTS.BanKeywordList[arguments[0]] !== undefined) {
  3243. CTS.BanKeywordList.splice(arguments[0], 1);
  3244. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3245. Alert(GetActiveChat(), "✓ Command Accepted!");
  3246. } else {
  3247. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3248. }
  3249. }
  3250. },
  3251. bankeywordlistclear: function() {
  3252. CTS.BanKeywordList = [];
  3253. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3254. Alert(GetActiveChat(), "✓ Command Accepted!");
  3255. },
  3256. bankeywordlist: function() {
  3257. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  3258. },
  3259. kickkeywordadd: function() {
  3260. if (arguments[0] === "") {
  3261. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3262. } else {
  3263. if (!CTS.KickKeywordList.includes(arguments[0])) {
  3264. CTS.KickKeywordList.push(arguments[0]);
  3265. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3266. Alert(GetActiveChat(), "✓ Command Accepted!");
  3267. } else {
  3268. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3269. }
  3270. }
  3271. },
  3272. kickkeywordremove: function() {
  3273. if (arguments[0] === "" || isNaN(arguments[0])) {
  3274. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3275. } else {
  3276. if (CTS.KickKeywordList[arguments[0]] !== undefined) {
  3277. CTS.KickKeywordList.splice(arguments[0], 1);
  3278. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3279. Alert(GetActiveChat(), "✓ Command Accepted!");
  3280. } else {
  3281. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3282. }
  3283. }
  3284. },
  3285. kickkeywordlistclear: function() {
  3286. CTS.KickKeywordList = [];
  3287. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3288. Alert(GetActiveChat(), "✓ Command Accepted!");
  3289. },
  3290. kickkeywordlist: function() {
  3291. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  3292. },
  3293. greetadd: function() {
  3294. if (arguments[0] === "") {
  3295. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3296. } else {
  3297. if (CheckUserName(arguments[0])) {
  3298. if (!CTS.GreetList.includes(arguments[0].toUpperCase())) {
  3299. CTS.GreetList.push(arguments[0].toUpperCase());
  3300. Save("GreetList", JSON.stringify(CTS.GreetList));
  3301. Alert(GetActiveChat(), "✓ Command Accepted!");
  3302. } else {
  3303. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3304. }
  3305. } else {
  3306. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3307. }
  3308. }
  3309. },
  3310. greetremove: function() {
  3311. if (arguments[0] === "" || isNaN(arguments[0])) {
  3312. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3313. } else {
  3314. if (CTS.GreetList[arguments[0]] !== undefined) {
  3315. CTS.GreetList.splice(arguments[0], 1);
  3316. Save("GreetList", JSON.stringify(CTS.GreetList));
  3317. Alert(GetActiveChat(), "✓ Command Accepted!");
  3318. } else {
  3319. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3320. }
  3321. }
  3322. },
  3323. greetlistclear: function() {
  3324. CTS.GreetList = [];
  3325. Save("GreetList", JSON.stringify(CTS.GreetList));
  3326. Alert(GetActiveChat(), "✓ Command Accepted!");
  3327. },
  3328. greetlist: function() {
  3329. Alert(GetActiveChat(), SettingsList.GreetList());
  3330. },
  3331. highlightadd: function() {
  3332. if (arguments[0] === "") {
  3333. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3334. } else {
  3335. if (CheckUserNameStrict(arguments[0])) {
  3336. if (!CTS.HighlightList.includes(arguments[0].toUpperCase())) {
  3337. CTS.HighlightList.push(arguments[0].toUpperCase());
  3338. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3339. Alert(GetActiveChat(), "✓ Command Accepted!");
  3340. } else {
  3341. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3342. }
  3343. } else {
  3344. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3345. }
  3346. }
  3347. },
  3348. highlightremove: function() {
  3349. if (arguments[0] === "" || isNaN(arguments[0])) {
  3350. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3351. } else {
  3352. if (CTS.HighlightList[arguments[0]] !== undefined) {
  3353. CTS.HighlightList.splice(arguments[0], 1);
  3354. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3355. Alert(GetActiveChat(), "✓ Command Accepted!");
  3356. } else {
  3357. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3358. }
  3359. }
  3360. },
  3361. highlightlistclear: function() {
  3362. CTS.HighlightList = [];
  3363. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3364. Alert(GetActiveChat(), "✓ Command Accepted!");
  3365. },
  3366. highlightlist: function() {
  3367. Alert(GetActiveChat(), SettingsList.HighlightList());
  3368. },
  3369. opadd: function() {
  3370. if (arguments[0] === "") {
  3371. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3372. } else {
  3373. if (CheckUserName(arguments[0])) {
  3374. if (!CTS.BotOPList.includes(arguments[0].toUpperCase())) {
  3375. CTS.BotOPList.push(arguments[0].toUpperCase());
  3376. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3377. Alert(GetActiveChat(), "✓ Command Accepted!");
  3378. } else {
  3379. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3380. }
  3381. } else {
  3382. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3383. }
  3384. }
  3385. },
  3386. opremove: function() {
  3387. if (arguments[0] === "" || isNaN(arguments[0])) {
  3388. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3389. } else {
  3390. if (CTS.BotOPList[arguments[0]] !== undefined) {
  3391. CTS.BotOPList.splice(arguments[0], 1);
  3392. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3393. Alert(GetActiveChat(), "✓ Command Accepted!");
  3394. } else {
  3395. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3396. }
  3397. }
  3398. },
  3399. oplistclear: function() {
  3400. CTS.BotOPList = [];
  3401. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3402. Alert(GetActiveChat(), "✓ Command Accepted!");
  3403. },
  3404. oplist: function() {
  3405. Alert(GetActiveChat(), SettingsList.BotOPList());
  3406. },
  3407. modadd: function() {
  3408. if (arguments[0] === "") {
  3409. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3410. } else {
  3411. if (CheckUserNameStrict(arguments[0])) {
  3412. if (!CTS.BotModList.includes(arguments[0].toUpperCase())) {
  3413. CTS.BotModList.push(arguments[0].toUpperCase());
  3414. Save("BotModList", JSON.stringify(CTS.BotModList));
  3415. Alert(GetActiveChat(), "✓ Command Accepted!");
  3416. } else {
  3417. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3418. }
  3419. } else {
  3420. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3421. }
  3422. }
  3423. },
  3424. modremove: function() {
  3425. if (arguments[0] === "" || isNaN(arguments[0])) {
  3426. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3427. } else {
  3428. if (CTS.BotModList[arguments[0]] !== undefined) {
  3429. CTS.BotModList.splice(arguments[0], 1);
  3430. Save("BotModList", JSON.stringify(CTS.BotModList));
  3431. Alert(GetActiveChat(), "✓ Command Accepted!");
  3432. } else {
  3433. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3434. }
  3435. }
  3436. },
  3437. modlistclear: function() {
  3438. CTS.BotModList = [];
  3439. Save("BotModList", JSON.stringify(CTS.BotModList));
  3440. Alert(GetActiveChat(), "✓ Command Accepted!");
  3441. },
  3442. modlist: function() {
  3443. Alert(GetActiveChat(), SettingsList.BotModList());
  3444. },
  3445. ttsadd: function() {
  3446. if (arguments[0] === "") {
  3447. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3448. } else {
  3449. if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  3450. if (!CTS.TTSList.includes(arguments[0].toUpperCase())) {
  3451. CTS.TTSList.push(arguments[0].toUpperCase());
  3452. Save("TTSList", JSON.stringify(CTS.TTSList));
  3453. Alert(GetActiveChat(), "✓ Command Accepted!");
  3454. } else {
  3455. Alert(GetActiveChat(), "X Command Rejected!\nItem is already entered!");
  3456. }
  3457. } else {
  3458. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3459. }
  3460. }
  3461. },
  3462. ttsremove: function() {
  3463. if (arguments[0] === "" || isNaN(arguments[0])) {
  3464. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3465. } else {
  3466. if (CTS.TTSList[arguments[0]] !== undefined) {
  3467. CTS.TTSList.splice(arguments[0], 1);
  3468. Save("TTSList", JSON.stringify(CTS.TTSList));
  3469. Alert(GetActiveChat(), "✓ Command Accepted!");
  3470. } else {
  3471. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3472. }
  3473. }
  3474. },
  3475. ttslistclear: function() {
  3476. CTS.TTSList = [];
  3477. Save("TTSList", JSON.stringify(CTS.TTSList));
  3478. Alert(GetActiveChat(), "✓ Command Accepted!");
  3479. },
  3480. ttslist: function() {
  3481. Alert(GetActiveChat(), SettingsList.TTSList());
  3482. },
  3483. reminderadd: function() {
  3484. if (arguments[0] === "") {
  3485. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3486. } else {
  3487. var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9]) ?(?:am|pm)) ([\w\d\s|[^\x00-\x7F]*]*)/i);
  3488. if (reminder === null) {
  3489. Alert(GetActiveChat(), "X Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  3490. } else {
  3491. CTS.ReminderList.push([reminder[1], reminder[2]]);
  3492. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3493. Alert(GetActiveChat(), "✓ Command Accepted!");
  3494. Reminder();
  3495. }
  3496. }
  3497. },
  3498. reminderremove: function() {
  3499. if (arguments[0] === "" || isNaN(arguments[0])) {
  3500. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3501. } else {
  3502. if (CTS.ReminderList[arguments[0]] !== undefined) {
  3503. CTS.ReminderList.splice(arguments[0], 1);
  3504. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3505. Reminder();
  3506. Alert(GetActiveChat(), "✓ Command Accepted!");
  3507. } else {
  3508. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3509. }
  3510. }
  3511. },
  3512. reminderlistclear: function() {
  3513. CTS.ReminderList = [];
  3514. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3515. Alert(GetActiveChat(), "✓ Command Accepted!");
  3516. },
  3517. reminderlist: function() {
  3518. Alert(GetActiveChat(), SettingsList.ReminderList());
  3519. },
  3520. remindertoggle: function() {
  3521. CTS.Reminder = !CTS.Reminder;
  3522. Save("Reminder", JSON.stringify(CTS.Reminder));
  3523. Reminder();
  3524. Settings();
  3525. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  3526. },
  3527. soundmetertoggle: function() {
  3528. CTS.SoundMeterToggle = !CTS.SoundMeterToggle;
  3529. Save("SoundMeterToggle", JSON.stringify(CTS.SoundMeterToggle));
  3530. SoundMeter();
  3531. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.SoundMeterToggle) ? "Sound meter is now on!\n" : "Sound meter is now off!\n "));
  3532. },
  3533. timestamptoggle: function() {
  3534. CTS.TimeStampToggle = !CTS.TimeStampToggle;
  3535. Save("TimeStampToggle", JSON.stringify(CTS.TimeStampToggle));
  3536. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.TimeStampToggle) ? "Timestamps are now on!\n" : "Timestamps are now off\n "));
  3537. LoadMessage();
  3538. },
  3539. raidtoggle: function() {
  3540. CTS.RaidToggle = !CTS.RaidToggle;
  3541. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.RaidToggle) ? "You'll listen for raid call by room owners!\n" : "You've temporarily silenced raids!\n"));
  3542. },
  3543. safeadd: function() {
  3544. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3545. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3546. } else {
  3547. if (CheckUserNameStrict(arguments[0])) {
  3548. if (!CTS.SafeList.includes(arguments[0].toUpperCase())) {
  3549. CTS.SafeList.push(arguments[0].toUpperCase());
  3550. Save("AKB", JSON.stringify(CTS.SafeList));
  3551. Alert(GetActiveChat(), "✓ Command Accepted!");
  3552. } else {
  3553. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3554. }
  3555. } else {
  3556. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3557. }
  3558. }
  3559. },
  3560. saferemove: function() {
  3561. if (arguments[0] === "" || isNaN(arguments[0])) {
  3562. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3563. } else {
  3564. if (CTS.SafeList[arguments[0]] !== undefined) {
  3565. CTS.SafeList.splice(arguments[0], 1);
  3566. Save("AKB", JSON.stringify(CTS.SafeList));
  3567. Alert(GetActiveChat(), "✓ Command Accepted!");
  3568. } else {
  3569. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3570. }
  3571. }
  3572. },
  3573. safelistclear: function() {
  3574. CTS.SafeList = [];
  3575. Save("AKB", JSON.stringify(CTS.SafeList));
  3576. Alert(GetActiveChat(), "✓ Command Accepted!");
  3577. },
  3578. safelist: function() {
  3579. Alert(GetActiveChat(), SettingsList.SafeList());
  3580. },
  3581. greenroomadd: function() {
  3582. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3583. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3584. } else {
  3585. if (CheckUserNameStrict(arguments[0])) {
  3586. if (!CTS.GreenRoomList.includes(arguments[0].toUpperCase())) {
  3587. CTS.GreenRoomList.push(arguments[0].toUpperCase());
  3588. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3589. Alert(GetActiveChat(), "✓ Command Accepted!");
  3590. } else {
  3591. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3592. }
  3593. } else {
  3594. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3595. }
  3596. }
  3597. },
  3598. greenroomremove: function() {
  3599. if (arguments[0] === "" || isNaN(arguments[0])) {
  3600. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3601. } else {
  3602. if (CTS.GreenRoomList[arguments[0]] !== undefined) {
  3603. CTS.GreenRoomList.splice(arguments[0], 1);
  3604. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3605. Alert(GetActiveChat(), "✓ Command Accepted!");
  3606. } else {
  3607. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3608. }
  3609. }
  3610. },
  3611. greenroomlistclear: function() {
  3612. CTS.GreenRoomList = [];
  3613. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  3614. Alert(GetActiveChat(), "✓ Command Accepted!");
  3615. },
  3616. greenroomlist: function() {
  3617. Alert(GetActiveChat(), SettingsList.GreenRoomList());
  3618. },
  3619. greenroomignoreadd: function() {
  3620. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  3621. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3622. } else {
  3623. if (CheckUserNameStrict(arguments[0])) {
  3624. if (!CTS.GreenRoomIgnoreList.includes(arguments[0].toUpperCase())) {
  3625. CTS.GreenRoomIgnoreList.push(arguments[0].toUpperCase());
  3626. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3627. Alert(GetActiveChat(), "✓ Command Accepted!");
  3628. } else {
  3629. Alert(GetActiveChat(), "X Command Rejected!\nUser is already entered!");
  3630. }
  3631. } else {
  3632. Alert(GetActiveChat(), "X Command Rejected!\nArgument passed didn't match criteria!");
  3633. }
  3634. }
  3635. },
  3636. greenroomignoreremove: function() {
  3637. if (arguments[0] === "" || isNaN(arguments[0])) {
  3638. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3639. } else {
  3640. if (CTS.GreenRoomIgnoreList[arguments[0]] !== undefined) {
  3641. CTS.GreenRoomIgnoreList.splice(arguments[0], 1);
  3642. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3643. Alert(GetActiveChat(), "✓ Command Accepted!");
  3644. } else {
  3645. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3646. }
  3647. }
  3648. },
  3649. greenroomignorelistclear: function() {
  3650. CTS.GreenRoomIgnoreList = [];
  3651. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  3652. Alert(GetActiveChat(), "✓ Command Accepted!");
  3653. },
  3654. greenroomignorelist: function() {
  3655. Alert(GetActiveChat(), SettingsList.GreenRoomIgnoreList());
  3656. },
  3657. optoggle: function() {
  3658. CTS.UserYT = !CTS.UserYT;
  3659. Save("UserYT", JSON.stringify(CTS.UserYT));
  3660. Settings();
  3661. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  3662. },
  3663. avatartoggle: function() {
  3664. CTS.Avatar = !CTS.Avatar;
  3665. Save("Avatar", JSON.stringify(CTS.Avatar));
  3666. Settings();
  3667. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  3668. LoadMessage();
  3669. },
  3670. popuptoggle: function() {
  3671. CTS.Popups = !CTS.Popups;
  3672. Save("Popups", JSON.stringify(CTS.Popups));
  3673. Settings();
  3674. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  3675. },
  3676. notificationtoggle: function() {
  3677. CTS.NotificationToggle++;
  3678. if (CTS.NotificationToggle >= 3) CTS.NotificationToggle = 0;
  3679. Save("NotificationToggle", JSON.stringify(CTS.NotificationToggle));
  3680. NotificationDisplay();
  3681. Settings();
  3682. Alert(GetActiveChat(), "✓ Command Accepted!\nNotifications " + ((CTS.NotificationToggle == 0) ? "above chat enabled" : (CTS.NotificationToggle == 1) ? "in chat enabled" : "disabled") + ".");
  3683. },
  3684. greetmodetoggle: function() {
  3685. CTS.GreetMode = !CTS.GreetMode;
  3686. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  3687. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  3688. },
  3689. imgurtoggle: function() {
  3690. CTS.Imgur = !CTS.Imgur;
  3691. Save("Imgur", JSON.stringify(CTS.Imgur));
  3692. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  3693. },
  3694. publiccommandtoggle: function() {
  3695. CTS.PublicCommandToggle = !CTS.PublicCommandToggle;
  3696. Save("PublicCommandToggle", JSON.stringify(CTS.PublicCommandToggle));
  3697. Settings();
  3698. 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."));
  3699. },
  3700. greenroomtoggle: function() {
  3701. CTS.GreenRoomToggle = !CTS.GreenRoomToggle;
  3702. Save("GreenRoomToggle", JSON.stringify(CTS.GreenRoomToggle));
  3703. Settings();
  3704. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.GreenRoomToggle) ? "Green Room Auto Allow ON!" : "Green Room Auto Allow OFF!"));
  3705. },
  3706. clr: function() {
  3707. CTS.Message[GetActiveChat()] = [];
  3708. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  3709. },
  3710. clrall: function() {
  3711. CTS.Message = [];
  3712. CTS.Message[0] = [];
  3713. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  3714. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  3715. },
  3716. autokick: function() {
  3717. if (arguments[1] === false && CTS.Me.mod) {
  3718. CTS.AutoKick = !CTS.AutoKick;
  3719. CTS.AutoBan = false;
  3720. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  3721. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  3722. }
  3723. },
  3724. autoban: function() {
  3725. if (arguments[1] === false && CTS.Me.mod) {
  3726. CTS.AutoBan = !CTS.AutoBan;
  3727. CTS.AutoKick = false;
  3728. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  3729. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  3730. }
  3731. },
  3732. camsweep: function() {
  3733. if (CTS.Me.mod && CTS.Host === CTS.Me.handle) {
  3734. CTS.Camera.SweepTimer = (arguments[0] === "" || isNaN(arguments[0])) ? 5 : (arguments[0] > 30) ? 30 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  3735. CTS.Camera.Sweep = !CTS.Camera.Sweep;
  3736. clearTimeout(CTS.Camera.clearRandom);
  3737. Settings();
  3738. 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!"));
  3739. }
  3740. },
  3741. bottoggle: function() {
  3742. CTS.Bot = !CTS.Bot;
  3743. Save("Bot", JSON.stringify(CTS.Bot));
  3744. Settings();
  3745. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  3746. },
  3747. votetoggle: function() {
  3748. if (CTS.Me.mod) {
  3749. CTS.VoteSystem = !CTS.VoteSystem;
  3750. CTS.WaitToVoteList = [];
  3751. var len = CTS.UserList.length;
  3752. if (len > 0) {
  3753. for (var i = 0; i < len; i++) CTS.UserList[i].vote = 0;
  3754. }
  3755. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.VoteSystem) ? "VOTING IS NOW ON!" : "VOTING IS NOW OFF!"));
  3756. }
  3757. },
  3758. bot: function() {
  3759. if (arguments[1] === false && CTS.Me.mod) Alert(0, "✓ Command Accepted!\nBot bypass was called!");
  3760. },
  3761. share: function() {
  3762. 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";
  3763. if (GetActiveChat() !== 0) {
  3764. Send("pvtmsg", msg, GetActiveChat());
  3765. PushPM(GetActiveChat(), msg);
  3766. } else {
  3767. Send("msg", msg);
  3768. }
  3769. },
  3770. gameview: function() {
  3771. CTS.CanSeeGames = !CTS.CanSeeGames;
  3772. Save("CanSeeGames", JSON.stringify(CTS.CanSeeGames));
  3773. Settings();
  3774. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
  3775. },
  3776. fishhost: function() {
  3777. CTS.CanHostFishGames = !CTS.CanHostFishGames;
  3778. Save("CanHostFishGames", JSON.stringify(CTS.CanHostFishGames));
  3779. Fish.Reset(true, true);
  3780. Settings();
  3781. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanHostFishGames) ? "FISH GAME HOSTING IS NOW ON!" : "FISH GAME HOSTING IS NOW OFF!"));
  3782. },
  3783. triviahost: function() {
  3784. CTS.CanHostTriviaGames = !CTS.CanHostTriviaGames;
  3785. Save("CanHostTriviaGames", JSON.stringify(CTS.CanHostTriviaGames));
  3786. Trivia.Reset();
  3787. Settings();
  3788. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.CanHostTriviaGames) ? "TRIVIA GAME HOSTING IS NOW ON!" : "TRIVIA GAME HOSTING IS NOW OFF!"));
  3789. },
  3790. trivia: function() {
  3791. if (CTS.Host === CTS.Me.handle && CTS.CanHostTriviaGames) {
  3792. CTS.Game.Trivia.Started = !CTS.Game.Trivia.Started;
  3793. Alert(GetActiveChat(), "✓ Command Accepted!\n" + ((CTS.Game.Trivia.Started) ? "Trivia is now on!\n" : "Trivia is now off!\n"));
  3794. if (CTS.Game.Trivia.Started) {
  3795. Trivia.init();
  3796. } else {
  3797. Trivia.Reset();
  3798. }
  3799. }
  3800. },
  3801. triviaplayeradd: function() {
  3802. if (arguments[0] === "") {
  3803. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3804. } else {
  3805. var player = arguments[0].match(/^([a-z0-9_]{1,32}) ([0-9]{1,10})/i);
  3806. if (player === null) {
  3807. Alert(GetActiveChat(), "X Command Rejected!\n!triviaplayeradd cosmosist 2000\nThis is an example you can try!");
  3808. } else {
  3809. if (CTS.Game.Trivia.PlayerList[player[1].toUpperCase()] === undefined) {
  3810. var point = parseInt(player[2]);
  3811. CTS.Game.Trivia.PlayerList[player[1].toUpperCase()] = point;
  3812. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3813. var user = UsernameToUser(player[1].toUpperCase());
  3814. if (user != -1) CTS.UserList[user].triviapoints = point;
  3815. Alert(GetActiveChat(), "✓ Command Accepted!");
  3816. } else {
  3817. Alert(GetActiveChat(), "X Command Rejected!\nUsername is already entered!");
  3818. }
  3819. }
  3820. }
  3821. },
  3822. triviaplayerremove: function() {
  3823. if (arguments[0] === "" || isNaN(arguments[0])) {
  3824. Alert(GetActiveChat(), "X Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  3825. } else {
  3826. var user = Object.keys(CTS.Game.Trivia.PlayerList);
  3827. if (CTS.Game.Trivia.PlayerList[user[arguments[0]]] !== undefined) {
  3828. delete CTS.Game.Trivia.PlayerList[user[arguments[0]]];
  3829. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3830. var useron = UsernameToUser(user[arguments[0]]);
  3831. if (useron != -1) CTS.UserList[useron].triviapoints = 0;
  3832. Alert(GetActiveChat(), "✓ Command Accepted!");
  3833. } else {
  3834. Alert(GetActiveChat(), "X Command Rejected!\nID was not found!");
  3835. }
  3836. }
  3837. },
  3838. triviaplayerlistclear: function() {
  3839. CTS.Game.Trivia.PlayerList = {};
  3840. Save("TriviaPlayerList", JSON.stringify(CTS.Game.Trivia.PlayerList));
  3841. for(var i = 0; i < CTS.UserList.length; i++) CTS.UserList[i].triviapoints = 0;
  3842. Alert(GetActiveChat(), "✓ Command Accepted!");
  3843. },
  3844. triviaplayerlist: function() {
  3845. Alert(GetActiveChat(), SettingsList.TriviaPlayerList());
  3846. },
  3847. version: function() {
  3848. if (!CTS.Me.owner) {
  3849. var msg = "I am using " + CTS.Project.Name + "v" + Ver();
  3850. if (GetActiveChat() !== 0) {
  3851. Send("pvtmsg", msg, GetActiveChat());
  3852. PushPM(GetActiveChat(), msg);
  3853. } else {
  3854. Send("msg", msg);
  3855. }
  3856. }
  3857. },
  3858. roll: function() {
  3859. var dice,
  3860. msg = "";
  3861. dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
  3862. for (var i = 0; i < dice; i++) msg += Dice();
  3863. if (GetActiveChat() !== 0) {
  3864. Send("pvtmsg", msg, GetActiveChat());
  3865. PushPM(GetActiveChat(), msg);
  3866. } else {
  3867. Send("msg", msg);
  3868. }
  3869. },
  3870. coin: function() {
  3871. if (CTS.Host == 0 || GetActiveChat() !== 0) {
  3872. var msg = "The coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!";
  3873. if (GetActiveChat() !== 0) {
  3874. Send("pvtmsg", msg, GetActiveChat());
  3875. } else {
  3876. Send("msg", msg);
  3877. }
  3878. }
  3879. },
  3880. settings: function() {
  3881. Settings();
  3882. },
  3883. lists: function() {
  3884. 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());
  3885. },
  3886. listsclear: function() {
  3887. CTS.MentionList = [];
  3888. CTS.IgnoreList = [];
  3889. CTS.HiddenCameraList = [];
  3890. CTS.UserBanList = [];
  3891. CTS.UserKickList = [];
  3892. CTS.NickBanList = [];
  3893. CTS.NickKickList = [];
  3894. CTS.BanKeywordList = [];
  3895. CTS.KickKeywordList = [];
  3896. CTS.GreetList = [];
  3897. CTS.HighlightList = [];
  3898. CTS.ReminderList = [];
  3899. CTS.TTSList = [];
  3900. CTS.BotOPList = [];
  3901. CTS.BotModList = [];
  3902. Save("MentionList", JSON.stringify(CTS.MentionList));
  3903. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  3904. Save("HiddenCameraList", JSON.stringify(CTS.IgnoreList));
  3905. Save("UserBanList", JSON.stringify(CTS.UserBanList));
  3906. Save("UserKickList", JSON.stringify(CTS.UserKickList));
  3907. Save("NickBanList", JSON.stringify(CTS.NickBanList));
  3908. Save("NickKickList", JSON.stringify(CTS.NickKickList));
  3909. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  3910. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  3911. Save("GreetList", JSON.stringify(CTS.GreetList));
  3912. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  3913. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  3914. Save("TTSList", JSON.stringify(CTS.TTSList));
  3915. Save("BotModList", JSON.stringify(CTS.BotModList));
  3916. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  3917. Alert(GetActiveChat(), "✓ Command Accepted!\nItems Mentionlist, igore");
  3918. },
  3919. ytqueue: function() {},
  3920. ytclear: function() {},
  3921. ytskip: function() {},
  3922. yt: function() {},
  3923. ytbypass: function() {}
  3924. };
  3925. var SettingsList = {
  3926. UserList: function() {
  3927. var index,
  3928. msg,
  3929. len = CTS.UserList.length;
  3930. msg = "<b style=\"color:#ffffff;\"><u>User list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3931. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserList[index].username + "\n(" + CTS.UserList[index].nick + ")\n";
  3932. return msg;
  3933. },
  3934. UserBanList: function() {
  3935. var index,
  3936. msg,
  3937. len = CTS.UserBanList.length;
  3938. msg = "<b style=\"color:#ffffff;\"><u>User Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3939. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserBanList[index] + "\n";
  3940. return msg;
  3941. },
  3942. NickBanList: function() {
  3943. var index,
  3944. msg,
  3945. len = CTS.NickBanList.length;
  3946. msg = "<b style=\"color:#ffffff;\"><u>Nick Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3947. for (index = 0; index < len; index++) msg += index + " : " + CTS.NickBanList[index] + "\n";
  3948. return msg;
  3949. },
  3950. BanKeywordList: function() {
  3951. var index,
  3952. msg,
  3953. len = CTS.BanKeywordList.length;
  3954. msg = "<b style=\"color:#ffffff;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3955. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  3956. return msg;
  3957. },
  3958. UserKickList: function() {
  3959. var index,
  3960. msg,
  3961. len = CTS.UserKickList.length;
  3962. msg = "<b style=\"color:#ffffff;\"><u>User Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3963. for (index = 0; index < len; index++) msg += index + " : " + CTS.UserKickList[index] + "\n";
  3964. return msg;
  3965. },
  3966. NickKickList: function() {
  3967. var index,
  3968. msg,
  3969. len = CTS.NickKickList.length;
  3970. msg = "<b style=\"color:#ffffff;\"><u>Nick Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3971. for (index = 0; index < len; index++) msg += index + " : " + CTS.NickKickList[index] + "\n";
  3972. return msg;
  3973. },
  3974. KickKeywordList: function() {
  3975. var index,
  3976. msg,
  3977. len = CTS.KickKeywordList.length;
  3978. msg = "<b style=\"color:#ffffff;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3979. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  3980. return msg;
  3981. },
  3982. BotOPList: function() {
  3983. var index,
  3984. msg,
  3985. len = CTS.BotOPList.length;
  3986. msg = "<b style=\"color:#ffffff;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3987. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  3988. return msg;
  3989. },
  3990. BotModList: function() {
  3991. var index,
  3992. msg,
  3993. len = CTS.BotModList.length;
  3994. msg = "<b style=\"color:#ffffff;\"><u>Bot Mod list:</u></b>\n" + ((!len) ? "empty\n" : "");
  3995. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotModList[index] + "\n";
  3996. return msg;
  3997. },
  3998. MentionList: function() {
  3999. var index,
  4000. msg,
  4001. len = CTS.MentionList.length;
  4002. msg = "<b style=\"color:#ffffff;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4003. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  4004. return msg;
  4005. },
  4006. IgnoreList: function() {
  4007. var index,
  4008. msg,
  4009. len = CTS.IgnoreList.length;
  4010. msg = "<b style=\"color:#ffffff;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4011. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  4012. return msg;
  4013. },
  4014. HiddenCameraList: function() {
  4015. var index,
  4016. msg,
  4017. len = CTS.IgnoreList.length;
  4018. msg = "<b style=\"color:#ffffff;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4019. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  4020. return msg;
  4021. },
  4022. GreetList: function() {
  4023. var index,
  4024. msg,
  4025. len = CTS.GreetList.length;
  4026. msg = "<b style=\"color:#ffffff;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4027. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  4028. return msg;
  4029. },
  4030. TTSList: function() {
  4031. var index,
  4032. msg,
  4033. len = CTS.TTSList.length;
  4034. msg = "<b style=\"color:#ffffff;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4035. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  4036. return msg;
  4037. },
  4038. HighlightList: function() {
  4039. var index,
  4040. msg,
  4041. len = CTS.HighlightList.length;
  4042. msg = "<b style=\"color:#ffffff;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4043. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  4044. return msg;
  4045. },
  4046. ReminderList: function() {
  4047. var index,
  4048. msg,
  4049. len = CTS.ReminderList.length;
  4050. msg = "<b style=\"color:#ffffff;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4051. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  4052. return msg;
  4053. },
  4054. SafeList: function() {
  4055. var index,
  4056. msg,
  4057. len = CTS.SafeList.length;
  4058. msg = "<b style=\"color:#ffffff;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4059. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  4060. return msg;
  4061. },
  4062. GreenRoomList: function() {
  4063. var index,
  4064. msg,
  4065. len = CTS.GreenRoomList.length;
  4066. msg = "<b style=\"color:#ffffff;\"><u>Green Room list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4067. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomList[index] + "\n";
  4068. return msg;
  4069. },
  4070. GreenRoomIgnoreList: function() {
  4071. var index,
  4072. msg,
  4073. len = CTS.GreenRoomIgnoreList.length;
  4074. msg = "<b style=\"color:#ffffff;\"><u>Green Room Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4075. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomIgnoreList[index] + "\n";
  4076. return msg;
  4077. },
  4078. TriviaPlayerList: function() {
  4079. var index,
  4080. msg,
  4081. user = Object.keys(CTS.Game.Trivia.PlayerList),
  4082. len = user.length;
  4083. msg = "<b style=\"color:#ffffff;\"><u>Trivia Player List list:</u></b>\n" + ((!len) ? "empty\n" : "");
  4084. for (index = 0; index < len; index++) msg += index + ": "+user[index] +"@"+ CTS.Game.Trivia.PlayerList[user[index]] + "IQ\n";
  4085. return msg;
  4086. }
  4087. };
  4088. var MessageQueueList = {
  4089. add: function() {
  4090. CTS.SendQueue.push(arguments[0]);
  4091. MessageQueueList.run();
  4092. },
  4093. run: function() {
  4094. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  4095. setTimeout(function() {
  4096. var temp = new Date();
  4097. var OffsetTime = temp - CTS.LastMessage;
  4098. if (OffsetTime >= 1500) {
  4099. CTS.LastMessage = new Date();
  4100. CTS.SocketTarget.send(CTS.SendQueue[0]);
  4101. CTS.SendQueue.shift();
  4102. }
  4103. MessageQueueList.run();
  4104. }, 1600, CTS.LastMessage);
  4105. }
  4106. }
  4107. };
  4108. var ServerSendList = {
  4109. msg: function() {
  4110. var obj = {
  4111. "tc": arguments[0]
  4112. };
  4113. if (arguments[2] !== undefined) {
  4114. obj.handle = arguments[1];
  4115. CTS.SocketTarget.send(JSON.stringify(obj));
  4116. } else {
  4117. if (arguments[1] !== undefined) {
  4118. obj.text = arguments[1];
  4119. MessageQueueList.add(JSON.stringify(obj));
  4120. } else {
  4121. CTS.SocketTarget.send(JSON.stringify(obj));
  4122. }
  4123. }
  4124. },
  4125. pvtmsg: function() {
  4126. var obj = {
  4127. "tc": arguments[0],
  4128. "text": arguments[1],
  4129. "handle": Number(arguments[2])
  4130. };
  4131. MessageQueueList.add(JSON.stringify(obj));
  4132. },
  4133. kick: function() {
  4134. CheckSafeList(arguments[1], true);
  4135. ServerSendList.msg(arguments[0], arguments[1], "kick");
  4136. },
  4137. ban: function() {
  4138. CheckSafeList(arguments[1], true);
  4139. ServerSendList.msg(arguments[0], arguments[1], "ban");
  4140. },
  4141. nick: function() {
  4142. var obj = {
  4143. "tc": "nick",
  4144. "nick": arguments[1]
  4145. };
  4146. CTS.SocketTarget.send(JSON.stringify(obj));
  4147. },
  4148. stream_moder_close: function() {
  4149. CheckSafeList(arguments[1], true);
  4150. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_close");
  4151. },
  4152. stream_moder_allow: function() {
  4153. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_allow");
  4154. },
  4155. yut_playlist_add: function() {
  4156. var obj = {
  4157. "tc": arguments[0],
  4158. "item": {
  4159. "id": arguments[1][0],
  4160. "duration": arguments[1][1] + 10,
  4161. "title": arguments[1][2],
  4162. "image": arguments[1][3]
  4163. }
  4164. };
  4165. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  4166. CTS.SocketTarget.send(JSON.stringify(obj));
  4167. },
  4168. yut_playlist_remove: function() {
  4169. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4170. },
  4171. yut_stop: function() {
  4172. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4173. },
  4174. yut_play: function() {
  4175. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  4176. },
  4177. yut_playlist: function() {
  4178. ServerSendList.msg("yut_playlist");
  4179. },
  4180. yut_playlist_clear: function() {
  4181. ServerSendList.msg("yut_playlist_clear");
  4182. }
  4183. };
  4184. var ServerInList = {
  4185. joined: function() {
  4186. Reset();
  4187. CTS.Me = {
  4188. "handle": arguments[0].self.handle,
  4189. "username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
  4190. "nick": arguments[0].self.nick,
  4191. "owner": arguments[0].self.owner,
  4192. "mod": arguments[0].self.mod,
  4193. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  4194. "avatar": arguments[0].self.avatar,
  4195. "broadcasting": false
  4196. };
  4197. if (CTS.Me.nick.match(/^guest(?:\-[0-9]{1,10})?/i) && CTS.Me.username !== "GUEST") Send("nick", CTS.Me.username); //AUTO CORRECT NAME
  4198. if (CTS.Me.mod && CTS.Bot && CTS.ScriptInit && CTS.SocketConnected) CheckHost();
  4199. CTS.Room = {
  4200. "Avatar": arguments[0].room.avatar,
  4201. "Bio": arguments[0].room.biography,
  4202. "Name": arguments[0].room.name,
  4203. "PTT": arguments[0].room.pushtotalk,
  4204. "Website": arguments[0].room.website,
  4205. "YT_ON": arguments[0].room.youtube_enabled,
  4206. "Recent_Gifts": arguments[0].room.recent_gifts
  4207. };
  4208. CTS.SocketConnected = true;
  4209. },
  4210. userlist: function() {
  4211. var len = arguments[0].users.length;
  4212. for (var user = 0; user < len; user++) {
  4213. AKBS(arguments[0].users[user]);
  4214. var username = (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase();
  4215. CheckUserAbuse(arguments[0].users[user].handle, username, arguments[0].users[user].nick);
  4216. CTS.UserList.push({
  4217. "handle": arguments[0].users[user].handle,
  4218. "username": username,
  4219. "nick": arguments[0].users[user].nick,
  4220. "owner": arguments[0].users[user].owner,
  4221. "mod": arguments[0].users[user].mod,
  4222. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  4223. "avatar": (arguments[0].users[user].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].users[user].avatar,
  4224. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
  4225. "broadcasting": false,
  4226. "vote": 0,
  4227. "triviapoints": CTS.Game.Trivia.PlayerList[username] || 0
  4228. });
  4229. }
  4230. RoomUsers();
  4231. debug();
  4232. },
  4233. join: function() {
  4234. AKBS(arguments[0]);
  4235. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  4236. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick);
  4237. if (CTS.HighlightList.includes(user) && CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) window.CTSSound.HIGHLIGHT.play();
  4238. if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
  4239. CTS.hasGreetedWC = true;
  4240. window.CTSSound.C.play();
  4241. Send("msg", "HI! " + arguments[0].nick.toUpperCase() + "!");
  4242. } else {
  4243. if ((CTS.GreetList.includes(user) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  4244. 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!") : "!"));
  4245. if (CTS.enableSound === true) window.CTSSound.GREET.play();
  4246. }
  4247. }
  4248. CTS.NoGreet = false;
  4249. 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);
  4250. RoomUsers();
  4251. debug();
  4252. },
  4253. sysmsg: function() {
  4254. if (CTS.Me.mod) {
  4255. var action = arguments[0].text.match(/^([a-z0-9_]{1,32}):? (closed|banned|kicked) ([a-z0-9_]{1,32})$/i);
  4256. if (action !== null) {
  4257. var user;
  4258. if (action[2] == "closed" || action[2] == "banned" || action[2] == "kicked") {
  4259. user = NicknameToUser(action[3].toUpperCase());
  4260. if (user != -1) {
  4261. if (CTS.UserList[user].username !== "GUEST") {
  4262. var a = CTS.GreenRoomList.indexOf(CTS.UserList[user].username);
  4263. if (a !== -1) {
  4264. //REMOVE
  4265. debug("GREENROOMLIST::", "REMOVE USER " + CTS.UserList[user].username + " FROM GREENROOMLIST");
  4266. Alert(GetActiveChat(), "✓ Removing " + CTS.UserList[user].username + " from greenroomlist!");
  4267. CommandList.greenroomremove(a);
  4268. }
  4269. }
  4270. }
  4271. }
  4272. }
  4273. }
  4274. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  4275. debug();
  4276. },
  4277. nick: function() {
  4278. var user = HandleToUser(arguments[0].handle);
  4279. if (user != -1) {
  4280. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  4281. 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);
  4282. CTS.UserList[user].nick = arguments[0].nick;
  4283. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  4284. CheckUserAbuse(arguments[0].handle, CTS.UserList[user].username, arguments[0].nick);
  4285. }
  4286. debug();
  4287. },
  4288. stream_connected: function() {
  4289. 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)) {
  4290. //USER IS NOT ON CAMERA START AUTO ACCEPT PROCESS
  4291. var user = HandleToUser(arguments[0].handle);
  4292. if (user != -1) {
  4293. debug("CAMERA::WAITING", "nickname:" + CTS.UserList[user].nick);
  4294. if (!CTS.GreenRoomIgnoreList.includes(CTS.UserList[user].username) && CTS.GreenRoomList.includes(CTS.UserList[user].username)) Send("stream_moder_allow", CTS.UserList[user].handle);
  4295. }
  4296. }
  4297. debug();
  4298. },
  4299. stream_closed: function() {
  4300. debug();
  4301. },
  4302. publish: function() { //ADD GLOBAL CAMERA
  4303. CheckUserStream(arguments[0].handle, true);
  4304. debug();
  4305. },
  4306. unpublish: function() { //REMOVE GLOBAL CAMERA
  4307. CheckUserStream(arguments[0].handle, false);
  4308. debug();
  4309. },
  4310. ping: function() {
  4311. if (CTS.ScriptInit) {
  4312. var verify;
  4313. if (CTS.WatchList.length > 0) {
  4314. verify = new Date() - CTS.WatchList[0][2];
  4315. debug("WATCHLIST::LIST", CTS.WatchList);
  4316. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/700000");
  4317. if (CTS.SafeList.indexOf(CTS.WatchList[0][0]) === -1) { //LET'S NOT ADD TWICE
  4318. if (verify > 700000) {
  4319. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/700000");
  4320. CTS.SafeList.push(CTS.WatchList[0][0]);
  4321. CTS.WatchList.shift();
  4322. }
  4323. } else {
  4324. CTS.WatchList.shift();
  4325. }
  4326. }
  4327. if (CTS.WaitToVoteList.length > 0) {
  4328. verify = new Date() - CTS.WaitToVoteList[0][1];
  4329. debug("VOTE::LIST", CTS.WaitToVoteList);
  4330. debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4331. if (verify > 300000) {
  4332. debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  4333. CTS.WaitToVoteList.shift();
  4334. }
  4335. }
  4336. }
  4337. //DISPOSE OF ITEMS
  4338. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  4339. window.TinychatApp.getInstance().defaultChatroom.packetWorker.queue = {};
  4340. debug();
  4341. },
  4342. quit: function() {
  4343. if (CTS.ScriptInit) {
  4344. if (CTS.WatchList.length > 0) {
  4345. var len = CTS.WatchList.length;
  4346. for (var i = 0; i < len; i++) {
  4347. if (CTS.WatchList[i][1] == arguments[0].handle) {
  4348. CTS.WatchList.splice(i, 1);
  4349. break;
  4350. }
  4351. }
  4352. }
  4353. if (CTS.Me.mod) RemoveUserCamera(arguments[0].handle);
  4354. var user = HandleToUser(arguments[0].handle);
  4355. if (user != -1) {
  4356. 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.");
  4357. //SEND THEM OUT
  4358. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4359. CTS.UserList.splice(user, 1);
  4360. }
  4361. RoomUsers();
  4362. if (CTS.Host == arguments[0].handle) {
  4363. CTS.Host = 0;
  4364. CTS.Camera.Sweep = false;
  4365. if (CTS.Me.mod && CTS.Bot) {
  4366. setTimeout(function() {
  4367. if (CTS.Host == 0) SetBot(false);
  4368. }, (Rand(10, 30) * 1000));
  4369. }
  4370. }
  4371. }
  4372. debug();
  4373. },
  4374. msg: function() {
  4375. if (CTS.ScriptInit) {
  4376. var user = HandleToUser(arguments[0].handle);
  4377. if (user != -1) {
  4378. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4379. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4380. var text = HTMLtoTXT(arguments[0].text);
  4381. //ALL USERS REPORT
  4382. OwnerCommand(user, arguments[0].text);
  4383. BotCheck(user, text, arguments[0]);
  4384. //MODERATORS
  4385. if (CTS.Me.mod) {
  4386. if (CTS.Host == CTS.Me.handle) BotCommandCheck(user, text);
  4387. CheckUserWordAbuse(user, arguments[0].text);
  4388. }
  4389.  
  4390. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4391. //PUSH MESSAGE
  4392. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4393. CTS.Message[0].push({
  4394. "time": Time(),
  4395. "namecolor": CTS.UserList[user].namecolor,
  4396. "avatar": CTS.UserList[user].avatar,
  4397. "username": CTS.UserList[user].username,
  4398. "nick": CTS.UserList[user].nick,
  4399. "msg": text,
  4400. "mention": false
  4401. });
  4402. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  4403. if (CTS.Me.handle !== arguments[0].handle) {
  4404. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  4405. Alert(GetActiveChat(), "✓ AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  4406. CTS.AutoKick = false;
  4407. CTS.AutoBan = false;
  4408. }
  4409. if (CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) {
  4410. if (CTS.UserList.length <= 14) window.CTSSound.MSG.play();
  4411. 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!"));
  4412. }
  4413. var len = CTS.MentionList.length;
  4414. for (var i = 0; i < len; i++) {
  4415. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  4416. if (CTS.enableSound === true) window.CTSSound.MENTION.play();
  4417. msg.mention = true;
  4418. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  4419. }
  4420. }
  4421. }
  4422. if (GetActiveChat() === 0) CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  4423. MessagePopUp(user, text, true, false);
  4424. }
  4425. }
  4426. } else {
  4427. if (CTS.Host == CTS.Me.handle) {
  4428. Send("kick", arguments[0].handle);
  4429. } else if (CTS.Host == 0) {
  4430. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4431. }
  4432. }
  4433. }
  4434. }
  4435. debug();
  4436. },
  4437. pvtmsg: function() {
  4438. if (CTS.ScriptInit) {
  4439. if (CTS.enablePMs === true) {
  4440. if (arguments[0].handle != CTS.Me.handle) {
  4441. var user = HandleToUser(arguments[0].handle);
  4442. if (user != -1) {
  4443. if (!LineSpam(arguments[0].text, CTS.UserList[user].mod)) {
  4444. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  4445. var text = arguments[0].text;
  4446. if (CTS.Me.mod) CheckUserWordAbuse(user, arguments[0].text);
  4447. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  4448. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4449. PushPM(arguments[0].handle, text, user);
  4450. if (CTS.enableSound === true && window.TinychatApp.getInstance().defaultChatroom.volume > 0) {
  4451. window.CTSSound.PVTMSG.play();
  4452. 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!"));
  4453. }
  4454. text = HTMLtoTXT(text);
  4455. if (isSafeListed(CTS.UserList[user].username)) text = CheckImgur(text);
  4456. MessagePopUp(user, text, false, false);
  4457. }
  4458. }
  4459. } else {
  4460. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  4461. }
  4462. }
  4463. }
  4464. }
  4465. }
  4466. debug();
  4467. },
  4468. gift: function() {
  4469. CreateGift(arguments[0]);
  4470. debug();
  4471. },
  4472. yut_playlist_add: function() {
  4473. if (CTS.ScriptInit) {
  4474. if (!CTS.YouTube.Playing) {
  4475. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  4476. if (CTS.Host != CTS.Me.handle) {
  4477. Send("msg", "!play");
  4478. } else {
  4479. YouTubePlayList();
  4480. }
  4481. }
  4482. }
  4483. debug();
  4484. },
  4485. yut_playlist: function() {
  4486. if (CTS.ScriptInit) {
  4487. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  4488. if (CTS.YouTube.Clear === true) {
  4489. if (arguments[0].items !== null) Send("yut_playlist_clear");
  4490. CTS.YouTube.MessageQueueList = [];
  4491. Send("msg", "🎵YouTube cleared!🎵");
  4492. CTS.YouTube.Clear = false;
  4493. } else {
  4494. if (arguments[0].items === null) {
  4495. CTS.PlayListStart = true;
  4496. } else {
  4497. CTS.YouTube.PlayListCount = arguments[0].items.length;
  4498. CTS.PlayListStart = false;
  4499. if (CTS.YouTube.ShowQueue === true) {
  4500. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  4501. for (var i = 0; i < 3; i++) {
  4502. if (arguments[0].items[i] === undefined) break;
  4503. 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]";
  4504. }
  4505. Send("msg", msg);
  4506. }
  4507. }
  4508. 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);
  4509. }
  4510. CTS.YouTube.ShowQueue = false;
  4511. }
  4512. }
  4513. debug();
  4514. },
  4515. yut_play: function() {
  4516. if (CTS.ScriptInit) {
  4517. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  4518. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  4519. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  4520. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  4521. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  4522. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  4523. }
  4524. CTS.YouTube.Playing = true;
  4525. YouTubePlayList();
  4526. }
  4527. debug();
  4528. },
  4529. yut_stop: function() {
  4530. if (CTS.ScriptInit) {
  4531. CTS.YouTube.CurrentTrack.ID = undefined;
  4532. CTS.YouTube.CurrentTrack.duration = undefined;
  4533. CTS.YouTube.CurrentTrack.title = undefined;
  4534. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  4535. CTS.YouTube.Playing = false;
  4536. YouTubePlayList();
  4537. }
  4538. debug();
  4539. }
  4540. };
  4541. var ServerOutList = {
  4542. pvtmsg: function() {
  4543. if (CTS.ScriptInit) {
  4544. Command(arguments[0].text, true);
  4545. var text = arguments[0].text;
  4546. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  4547. PushPM(arguments[0].handle, text);
  4548. }
  4549. debug();
  4550. },
  4551. msg: function() {
  4552. if (CTS.ScriptInit) {
  4553. CTS.LastMessage = new Date();
  4554. Command(arguments[0].text, false);
  4555. }
  4556. debug();
  4557. },
  4558. ban: function() {
  4559. CheckSafeList(arguments[0].handle, true);
  4560. debug();
  4561. },
  4562. kick: function() {
  4563. CheckSafeList(arguments[0].handle, true);
  4564. debug();
  4565. },
  4566. stream_moder_close: function() {
  4567. CheckSafeList(arguments[0].handle, true);
  4568. debug();
  4569. }
  4570. };
  4571. //ADDON
  4572. var Addon = {
  4573. active: function() {
  4574. if (window.CTSAddon !== undefined) {
  4575. if (window.CTSAddon[arguments[0]] !== undefined) {
  4576. return true;
  4577. }
  4578. }
  4579. return false;
  4580. },
  4581. get: function() {
  4582. return window.CTSAddon[arguments[0]];
  4583. }
  4584. };
  4585. //XMLHttpRequest
  4586. // YouTube Search V3 API (https://console.developers.google.com/)
  4587. CTS.YouTube.XHR.onload = function() {
  4588. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  4589. if (response.error) {
  4590. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  4591. } else {
  4592. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  4593. CTS.YouTube.ListBuilt = true;
  4594. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  4595. CTS.YouTube.DataReady = true;
  4596. CTS.YouTube.Busy = false;
  4597. YouTubeTrackAdd();
  4598. }
  4599. CTS.YouTube.DataReady = false;
  4600. if (response.items[0]) {
  4601. CTS.YouTube.Busy = true;
  4602. if (response.items[0].id) {
  4603. if (response.kind == "youtube#playlistItemListResponse") {
  4604. YouTubePlayListItems(response.items);
  4605. } else {
  4606. CTS.YouTube.VideoID = response.items[0].id.videoId;
  4607. 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);
  4608. CTS.YouTube.XHR.send();
  4609. }
  4610. } else if (response.items[0].contentDetails.duration) {
  4611. CTS.YouTube.DataReady = true;
  4612. }
  4613. if (CTS.YouTube.DataReady === false) {
  4614. CTS.YouTube.Busy = false;
  4615. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  4616. if (response.kind == "youtube#playlistItemListResponse") {
  4617. CTS.YouTube.ListBuilt = true;
  4618. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  4619. CTS.YouTube.Busy = false;
  4620. }
  4621. } else {
  4622. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  4623. if (CTS.YouTube.Playing === true) {
  4624. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  4625. 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]);
  4626. CTS.YouTube.Busy = false;
  4627. } else {
  4628. if (response.items[0].snippet.title !== undefined) {
  4629. 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]);
  4630. 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]);
  4631. CTS.YouTube.Playing = true;
  4632. }
  4633. CTS.YouTube.Busy = false;
  4634. }
  4635. }
  4636. }
  4637. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  4638. var title = "";
  4639. CTS.YouTube.SearchReturn = false;
  4640. CTS.YouTube.VideoReturn = false;
  4641. if (response.items[0] !== undefined) {
  4642. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  4643. }
  4644. if (response.items !== undefined) {
  4645. if (response.items.length > 0) title = response.items[0].snippet.title;
  4646. }
  4647. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  4648. }
  4649. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  4650. }
  4651. };
  4652. //Chuck Norris Jokes API (https://api.chucknorris.io/)
  4653. CTS.Chuck.XHR.onload = function() {
  4654. var resp = JSON.parse(CTS.Chuck.XHR.responseText),
  4655. msg = "[CHUCK NORRIS]\n" + resp.value;
  4656. if (resp !== null) Send("msg", msg.substr(0, 499));
  4657. };
  4658. //URB API (https://api.Urb.com/)
  4659. CTS.Urb.XHR.onload = function() {
  4660. var resp = JSON.parse(CTS.Urb.XHR.responseText),
  4661. msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
  4662. if (resp !== null) Send("msg", msg.substr(0, 499));
  4663. };
  4664. //ICanHazDadJoke's API (https://icanhazdadjoke.com/)
  4665. CTS.Dad.XHR.onload = function() {
  4666. var resp = JSON.parse(CTS.Dad.XHR.responseText),
  4667. msg = "[DAD JOKE]\n" + resp.joke;
  4668. if (resp !== null) Send("msg", msg.substr(0, 499));
  4669. };
  4670. //AdviceSlip API (https://api.adviceslip.com/advice)
  4671. CTS.Advice.XHR.onload = function() {
  4672. var resp = JSON.parse(CTS.Advice.XHR.responseText),
  4673. msg = "[ADVICE]\n" + resp.slip.advice;
  4674. if (resp !== null) Send("msg", msg.substr(0, 499));
  4675. };
  4676. //Events API (https://api.github.com/)
  4677. CTS.Events.XHR.onload = function() {
  4678. var resp = JSON.parse(CTS.Events.XHR.responseText);
  4679. if (resp !== null) {
  4680. if (resp.files.CTSJson.content !== null) {
  4681. try {
  4682. var parse = JSON.parse(resp.files.CTSJson.content);
  4683. CTS.ServerEventList = parse.serverevent;
  4684. } catch (e) {
  4685. CTS.ServerEventList = [];
  4686. }
  4687. ServerEvent();
  4688. }
  4689. }
  4690. };
  4691. // https://opentdb.com/api.php?amount=10
  4692. CTS.Game.Trivia.XHR.onload = function() {
  4693. var resp = JSON.parse(CTS.Game.Trivia.XHR.responseText);
  4694. if (resp !== null) {
  4695. if (resp.response_code == 0) {
  4696. CTS.Game.Trivia.QuestionList = resp.results;
  4697. Trivia.AskQuestion();
  4698. }
  4699. }
  4700. };
  4701. //GAME LIST FUNCTION
  4702. var Trivia = {
  4703. init: function() {
  4704. if (CTS.Me.handle == CTS.Host && CTS.CanHostTriviaGames) { // CHANGE BACK TO HOST NEEDED!!!!
  4705. this.Reset();
  4706. CTS.Game.Trivia.Started = true;
  4707. this.GetQuestion();
  4708. }
  4709. },
  4710. GetQuestion: function() {
  4711. CTS.Game.Trivia.XHR.open("GET", "https://opentdb.com/api.php?amount=50&type=multiple");
  4712. CTS.Game.Trivia.XHR.send();
  4713. },
  4714. AskQuestion: function() {
  4715. clearTimeout(CTS.Game.Trivia.Timer);
  4716. CTS.Game.Trivia.AttemptList = [];
  4717. CTS.Game.Trivia.Attempts = 0;
  4718. if (CTS.Game.Trivia.Started) {
  4719. if (CTS.Game.Trivia.QuestionList.length > 0) {
  4720. var RandSlot = Rand(0, 3),
  4721. msg,
  4722. incorrect = 0;
  4723. CTS.Game.Trivia.WaitCount++;
  4724. CTS.Game.Trivia.Correct = CTS.Game.Trivia.ANum[RandSlot];
  4725. 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));
  4726. CTS.Game.Trivia.Waiting = false;
  4727. msg = "[TRIVIA]\n"+CTS.Game.Trivia.QuestionList[0].question+"\n\nWorth:" + CTS.Game.Trivia.Worth + "IQ points!\n-------------";
  4728. for(var i = 0; i < 4; i++) {
  4729. msg += "\n\n" + CTS.Game.Trivia.ANum[i] + ") ";
  4730. if (i == RandSlot) {
  4731. msg += CTS.Game.Trivia.QuestionList[0].correct_answer;
  4732. } else {
  4733. msg += CTS.Game.Trivia.QuestionList[0].incorrect_answers[incorrect];
  4734. incorrect++;
  4735. }
  4736. }
  4737. CTS.Game.Trivia.QuestionList.shift();
  4738. Send("msg", DecodeTXT(msg));
  4739. CTS.Game.Trivia.Timer = setTimeout(function(g) {
  4740. Send("msg", "[TRIVIA]\nToo hard eh? Next question coming up in sixty seconds!\nThe answer however was: " + CTS.Game.Trivia.Correct);
  4741. g.Wait();
  4742. },240000, this);
  4743. } else {
  4744. CTS.Game.Trivia.WaitCount = 0;
  4745. this.GetQuestion();
  4746. }
  4747. if (CTS.Game.Trivia.WaitCount >= 4) {
  4748. CTS.Game.Trivia.WaitCount = 0;
  4749. this.Ranking();
  4750. }
  4751. }
  4752. },
  4753. Wait: function() {
  4754. CTS.Game.Trivia.Correct = "";
  4755. CTS.Game.Trivia.Waiting = true;
  4756. clearTimeout(CTS.Game.Trivia.Timer);
  4757. setTimeout(function() {
  4758. if (CTS.Game.Trivia.Started) Trivia.AskQuestion();
  4759. },60000);
  4760. },
  4761. Ranking: function() {
  4762. Send("msg", "[TRIVIA RANK]\n" + CTS.Game.Trivia.HighScore[0] + " has set the record of " + CTS.Game.Trivia.HighScore[1] + " IQ Points!");
  4763. },
  4764. Reset: function() {
  4765. clearTimeout(CTS.Game.Trivia.Timer);
  4766. CTS.Game.Trivia.Attempts = 0;
  4767. CTS.Game.Trivia.WaitCount = 0;
  4768. CTS.Game.Trivia.Started = false;
  4769. CTS.Game.Trivia.Correct = "";
  4770. CTS.Game.Trivia.AttemptList = [];
  4771. CTS.Game.Trivia.QuestionList = {};
  4772. CTS.Game.Trivia.Waiting = true;
  4773. }
  4774. };
  4775. var Fish = {
  4776. Init: function() {
  4777. if (CTS.Me.handle == CTS.Host && CTS.CanHostFishGames === true) {
  4778. 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!");
  4779. CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
  4780. g.StartRound();
  4781. }, 5000, this);
  4782. }
  4783. },
  4784. AddPlayer: function( ) {
  4785. if (!this.GetPlayer(arguments[0], false, false) && CTS.CanHostFishGames === true) {
  4786. if (isSafeListed(arguments[1])) {
  4787. CTS.Game.Fish.Player.push({
  4788. Handle: arguments[0],
  4789. Username: arguments[1],
  4790. Nickname: arguments[2],
  4791. LastCheck: new Date() - 5000,
  4792. Points: 5000,
  4793. Upgrades: {
  4794. Net: 1,
  4795. Store: 1,
  4796. Radar: 1,
  4797. Insurance: false
  4798. },
  4799. });
  4800. Send("msg", "[FISHING BOAT]\n" + arguments[2].substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  4801. if (this.GetPlayer() == 0) this.Init();
  4802. }
  4803. }
  4804. },
  4805. GetPlayer: function() {
  4806. var len = CTS.Game.Fish.Player.length;
  4807. if (arguments[0] !== undefined) {
  4808. for (var player = 0; player < len; player++) {
  4809. if (CTS.Game.Fish.Player[player].Handle == arguments[0]) {
  4810. if (arguments[2]) return CTS.Game.Fish.Player[player];
  4811. if (arguments[1]) {
  4812. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  4813. CTS.Game.Fish.Player.splice(player, 1);
  4814. }
  4815. if (!arguments[2]) return true;
  4816. }
  4817. }
  4818. if (!arguments[2]) {
  4819. return false;
  4820. } else {
  4821. return -1;
  4822. }
  4823. } else {
  4824. return len - 1;
  4825. }
  4826. },
  4827. Ranking: function() {
  4828. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
  4829. place = 0;
  4830. for (var u = arguments[0]; u >= 0; u--) {
  4831. place++;
  4832. if (u < 5) {
  4833. msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
  4834. }
  4835. CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
  4836. CTS.Game.Fish.Player[u].Points += 10000;
  4837. }
  4838. Send("msg", msg);
  4839. },
  4840. Winner: function() {
  4841. CTS.Game.Fish.Player.sort(function(a, b) {
  4842. return a.Points - b.Points;
  4843. });
  4844. if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
  4845. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
  4846. CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
  4847. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  4848. }
  4849. var len = CTS.Game.Fish.Player.length - 1;
  4850. 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!");
  4851. this.Ranking(len);
  4852. CTS.Game.Fish.RestockTimeout = setTimeout(function(g) {
  4853. g.reset(false, true);
  4854. }, 30000, this);
  4855. },
  4856. PriceList: function() {
  4857. if (arguments[1] == 0) { // net
  4858. return (1000 * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net * arguments[0].Upgrades.Net);
  4859. } else if (arguments[1] == 1) { // radar
  4860. return (1000 * arguments[0].Upgrades.Radar * 2) + 3500;
  4861. } else if (arguments[1] == 2) { // shop
  4862. return (arguments[0].Upgrades.Store * arguments[0].Upgrades.Store * 25000);
  4863. } else if (arguments[1] == 3) { // insurance
  4864. return (20000);
  4865. } else if (arguments[1] == 4) { // rob
  4866. return (10000);
  4867. } else if (arguments[1] == 5) { // slap
  4868. return (50000);
  4869. } else if (arguments[1] == 6) { // split (min$) / gamble
  4870. return (1000);
  4871. }
  4872. },
  4873. StartRound: function() {
  4874. clearTimeout(CTS.Game.Fish.StartTimeout);
  4875. if (CTS.Host === CTS.Me.handle) {
  4876. if (this.GetPlayer() >= 0) {
  4877. if (CTS.Game.Fish.Round < 10) {
  4878. CTS.Game.Fish.Round++;
  4879. var playerlen,
  4880. fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
  4881. id,
  4882. type,
  4883. handle,
  4884. eliminate = false,
  4885. msgeliminate,
  4886. value,
  4887. msg = "[FISHING BOAT]\n";
  4888. for (var cast = 0; cast <= 2; cast++) {
  4889. playerlen = this.GetPlayer();
  4890. id = Rand(0, playerlen);
  4891. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  4892. if (Rand(0, 100) <= Rand(10, 70)) {
  4893. var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
  4894. value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
  4895. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  4896. CTS.Game.Fish.Player[id].Points += value;
  4897. 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");
  4898. } else {
  4899. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  4900. CTS.Game.Fish.Player[id].Points -= value;
  4901. 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");
  4902. } else {
  4903. 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");
  4904. }
  4905. }
  4906. } else {
  4907. cast--;
  4908. }
  4909. if (this.GetPlayer() == -1) break;
  4910. if (CTS.Game.Fish.Player[id].Points < 0) {
  4911. eliminate = true;
  4912. handle = CTS.Game.Fish.Player[id].Handle;
  4913. msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
  4914. CTS.Game.Fish.Player.splice(id, 1);
  4915. break;
  4916. }
  4917. }
  4918. if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
  4919. if (eliminate) {
  4920. eliminate = false;
  4921. Send("msg", msgeliminate);
  4922. }
  4923. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
  4924. g.StartRound();
  4925. }, Rand(90000, 120000), this);
  4926. } else {
  4927. this.Winner();
  4928. }
  4929. } else {
  4930. //RESTART
  4931. Fish.Stop();
  4932. }
  4933. }
  4934. },
  4935. Reset: function() {
  4936. var get = this.GetPlayer();
  4937. if (get !== undefined) {
  4938. if (get >= 0 && !CTS.Game.NoReset || arguments[1] !== undefined) {
  4939. CTS.Game.Fish.Round = 0;
  4940. clearTimeout(CTS.Game.Fish.StartTimeout);
  4941. clearTimeout(CTS.Game.Fish.RestockTimeout);
  4942. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  4943. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  4944. if (!arguments[0]) {
  4945. this.Init();
  4946. } else {
  4947. if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  4948. CTS.Game.Fish.Player = [];
  4949. }
  4950. }
  4951. }
  4952. },
  4953. Stop: function() {
  4954. CTS.Game.NoReset = false;
  4955. this.Reset(true, true);
  4956. }
  4957. };
  4958. var FishList = {
  4959. fish: function() {
  4960. Fish.AddPlayer(arguments[1].handle, arguments[1].username, arguments[1].nick);
  4961. },
  4962. fishbank: function() {
  4963. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname.substr(0, 16) + ", you have $" + arguments[0].Points + ".");
  4964. },
  4965. fishrob: function() {
  4966. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  4967. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  4968. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 4), Rand(5000, 20000), true);
  4969. }
  4970. },
  4971. fishgamble: function() {
  4972. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  4973. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 6))) {
  4974. var winnings;
  4975. if (Rand(1, 10) === 7) { // 10% chance
  4976. winnings = Rand(1000, 25000);
  4977. arguments[0].Points += winnings;
  4978. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  4979. } else {
  4980. if (Rand(1, 7) === 4) { // 15%
  4981. winnings = Rand(1000, 5000);
  4982. arguments[0].Points += winnings;
  4983. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " you've won $" + winnings);
  4984. } else {
  4985. Send("msg", "[FISHING BOAT]\n" + arguments[0].Nickname + " tough luck, you lost $1000!");
  4986. }
  4987. }
  4988. }
  4989. }
  4990. },
  4991. fishslap: function() {
  4992. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  4993. var user = UsernameToUser(arguments[1].toUpperCase());
  4994. if (user !== -1) {
  4995. if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle && CTS.UserList[user].username !== "GUEST") {
  4996. if (CTS.Me.owner || !CTS.UserList[user].mod) {
  4997. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 5))) {
  4998. Send("stream_moder_close", CTS.UserList[user].handle);
  4999. Send("msg", arguments[0].Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
  5000. }
  5001. } else {
  5002. Send("msg", "Cannot close moderator!");
  5003. }
  5004. } else {
  5005. Send("msg", "Cannot close user!");
  5006. }
  5007. }
  5008. }
  5009. },
  5010. fishsplit: function() {
  5011. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5012. var CanEliminate = Fish.GetPlayer(UsernameToHandle(arguments[1].toUpperCase()), false, true);
  5013. FishTransfer(arguments[0], CanEliminate, Fish.PriceList(arguments[0], 6), Math.round(arguments[0].Points / 2), false);
  5014. }
  5015. },
  5016. fishupgrade: function() {
  5017. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 0);
  5018. },
  5019. fishhelp: function() {
  5020. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) FishUpgradeStatus(arguments[0], 6);
  5021. },
  5022. fishupgradenet: function() {
  5023. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5024. if (arguments[0].Upgrades.Net >= 10) {
  5025. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5026. } else {
  5027. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 0))) {
  5028. arguments[0].Upgrades.Net += 1;
  5029. FishUpgradeStatus(arguments[0], 1);
  5030. }
  5031. }
  5032. }
  5033. },
  5034. fishupgradeshop: function() {
  5035. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5036. if (arguments[0].Upgrades.Store >= 6) {
  5037. Send("msg", arguments[0].Nickname + ", you own them all already!");
  5038. } else {
  5039. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 2))) {
  5040. arguments[0].Upgrades.Store += 1;
  5041. FishUpgradeStatus(arguments[0], 4);
  5042. }
  5043. }
  5044. }
  5045. },
  5046. fishupgraderadar: function() {
  5047. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5048. if (arguments[0].Upgrades.Radar >= 20) {
  5049. Send("msg", arguments[0].Nickname + ", you own all upgrades.");
  5050. } else {
  5051. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 1))) {
  5052. arguments[0].Upgrades.Radar += 5;
  5053. FishUpgradeStatus(arguments[0], 2);
  5054. }
  5055. }
  5056. }
  5057. },
  5058. fishupgradeinsurance: function() {
  5059. if (arguments[0] !== -1 && FishTimerCheck(arguments[0])) {
  5060. if (arguments[0].Upgrades.Insurance === true) {
  5061. Send("msg", arguments[0].Nickname + ", you already have insurance!");
  5062. } else {
  5063. if (FishTransaction(arguments[0], Fish.PriceList(arguments[0], 3))) {
  5064. arguments[0].Upgrades.Insurance = true;
  5065. FishUpgradeStatus(arguments[0], 3);
  5066. }
  5067. }
  5068. }
  5069. }
  5070. };
  5071. //MISC FUNCTION
  5072. function SetLocalValues() {
  5073. if (CTS.StorageSupport) {
  5074. //CTS SETTINGS
  5075. CTS.Game.Trivia.PlayerList = JSON.parse(Load("TriviaPlayerList", JSON.stringify({})));
  5076. CTS.Game.Trivia.HighScore = JSON.parse(Load("TriviaHighScore", JSON.stringify(["CosmosisT", 1])));
  5077. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
  5078. CTS.PublicCommandToggle = JSON.parse(Load("PublicCommandToggle", JSON.stringify(true)));
  5079. CTS.OGStyle.SavedHeight = JSON.parse(Load("OGStyleHeight", JSON.stringify(3)));
  5080. CTS.GreenRoomIgnoreList = JSON.parse(Load("GreenRoomIgnoreList", JSON.stringify([])));
  5081. CTS.CameraBorderToggle = JSON.parse(Load("CameraBorderToggle", JSON.stringify(true)));
  5082. CTS.OGStyle.SavedWidth = JSON.parse(Load("OGStyleWidth", JSON.stringify(1)));
  5083. CTS.NotificationToggle = JSON.parse(Load("NotificationToggle", JSON.stringify(0)));
  5084. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", JSON.stringify(14)));
  5085. CTS.SoundMeterToggle = JSON.parse(Load("SoundMeterToggle", JSON.stringify(true)));
  5086. CTS.HiddenCameraList = JSON.parse(Load("HiddenCameraList", JSON.stringify([])));
  5087. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  5088. CTS.PerformanceMode = JSON.parse(Load("PerformanceMode", JSON.stringify(false)));
  5089. CTS.TimeStampToggle = JSON.parse(Load("TimeStampToggle", JSON.stringify(true)));
  5090. CTS.YouTube.API_KEY = Load("YouTubeAPI", "AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs");
  5091. CTS.GreenRoomToggle = JSON.parse(Load("GreenRoomToggle", JSON.stringify(true)));
  5092. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  5093. CTS.FavoritedRooms = JSON.parse(Load("FavoritedRooms", JSON.stringify(["stonercircle", null, null, null, null])));
  5094. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/aS5RCaX.jpg) rgb(0, 0, 0) no-repeat");
  5095. CTS.GreenRoomList = JSON.parse(Load("GreenRoomList", JSON.stringify([])));
  5096. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  5097. CTS.CanHostTriviaGames = JSON.parse(Load("CanHostTriviaGames", JSON.stringify(false)));
  5098. CTS.CanHostFishGames = JSON.parse(Load("CanHostFishGames", JSON.stringify(false)));
  5099. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  5100. CTS.UserKickList = JSON.parse(Load("UserKickList", JSON.stringify([])));
  5101. CTS.NickKickList = JSON.parse(Load("NickKickList", JSON.stringify([])));
  5102. CTS.UserBanList = JSON.parse(Load("UserBanList", JSON.stringify([])));
  5103. CTS.NickBanList = JSON.parse(Load("NickBanList", JSON.stringify([])));
  5104. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  5105. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  5106. CTS.ThemeChange = JSON.parse(Load("ThemeChange", JSON.stringify(true)));
  5107. CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
  5108. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  5109. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  5110. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  5111. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  5112. CTS.FontSize = JSON.parse(Load("FontSize", JSON.stringify(20)));
  5113. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  5114. CTS.Featured = JSON.parse(Load("Featured", JSON.stringify(false)));
  5115. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  5116. CTS.ChatType = JSON.parse(Load("ChatType", JSON.stringify(true)));
  5117. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  5118. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  5119. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  5120. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  5121. CTS.Imgur = JSON.parse(Load("Imgur", JSON.stringify(true)));
  5122. CTS.FPS = JSON.parse(Load("FPS", JSON.stringify(30)));
  5123. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  5124. CTS.MediaStreamFilter = Load("MediaStreamFilter", "No Filter");
  5125. }
  5126. }
  5127.  
  5128. function debug() {
  5129. if (window.DebugClear === false) {
  5130. if (arguments[0] !== undefined) {
  5131. var msg = "CTS::" + arguments[0];
  5132. if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
  5133. console.log(msg);
  5134. }
  5135. } else {
  5136. console.clear();
  5137. 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");
  5138. }
  5139. }
  5140.  
  5141. function Reset() {
  5142. CTS.UserList = [];
  5143. CTS.Me = [];
  5144. CTS.Room = [];
  5145. CTS.SendQueue = [];
  5146. CTS.Camera.List = [];
  5147. CTS.Camera.List = [];
  5148. CTS.WaitToVoteList = [];
  5149. CTS.WatchList = [];
  5150. CTS.Host = 0;
  5151. CTS.HostAttempt = 0;
  5152. CTS.HostWaiting = false;
  5153. CTS.TempIgnoreUserList = [];
  5154. CTS.TempIgnoreNickList = [];
  5155. // Game Reset
  5156. Fish.Stop();
  5157. Trivia.Reset();
  5158. }
  5159.  
  5160. function Remove() {
  5161. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  5162. }
  5163. })();