CosmosisT's TinyChat Script (CTS V1.7.20)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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