CosmosisT's TinyChat Script (CTS V1.5.8)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.5.8)
  3. // @version 1.5.8
  4. // @description Modified TinyChat - Best Scripts; prepare to be amazed.
  5. // @author CosmosisT
  6. // @url https://gist.github.com/CosmosisT
  7. // @license Copyright (C) 2019-2020 CosmosisT
  8. // @icon https://tinychat.com/webrtc/2.0.0-81/images/favicon.png
  9. // @match https://tinychat.com/room/*
  10. // @match https://tinychat.com/*
  11. // @exclude https://tinychat.com/settings/*
  12. // @exclude https://tinychat.com/subscription/*
  13. // @exclude https://tinychat.com/promote/*
  14. // @exclude https://tinychat.com/coins/*
  15. // @exclude https://tinychat.com/gifts*
  16. // @grant none
  17. // @run-at document-start
  18. // jshint esversion: 6
  19. // @namespace https://greasyfork.org/users/395685
  20. // ==/UserScript==
  21. (function() {
  22. "use strict";
  23. //CTS
  24. // TO TURN DEBUG OFF IN CONSOLE PASTE DebugClear = false; For on the go testing!
  25. var CTS = {
  26. Project: {
  27. Version: "1.5.8",
  28. Name: "CTS",
  29. Storage: "CTS_"
  30. },
  31. Chuck: {
  32. XHR: new XMLHttpRequest(),
  33. bot: false,
  34. activepm: undefined,
  35. chat: undefined
  36. },
  37. Urb: {
  38. XHR: new XMLHttpRequest(),
  39. bot: false,
  40. activepm: undefined,
  41. chat: undefined
  42. },
  43. Dad: {
  44. XHR: new XMLHttpRequest(),
  45. bot: false,
  46. activepm: undefined,
  47. chat: undefined
  48. },
  49. Advice: {
  50. XHR: new XMLHttpRequest(),
  51. bot: false,
  52. activepm: undefined,
  53. chat: undefined,
  54. toggle: false,
  55. timer: undefined
  56. },
  57. YouTube: {
  58. API_KEY: "", //INSERT YOUR YOUTUBE API CODE HERE
  59. XHR: new XMLHttpRequest(),
  60. Playing: false,
  61. MessageQueueList: [],
  62. NotPlayable: ["Private video", "Deleted video"],
  63. VideoID: undefined,
  64. Busy: false,
  65. DataReady: false,
  66. Clear: false,
  67. VideoReturn: false,
  68. SearchReturn: false,
  69. ListBuilt: true,
  70. PlayListCount: undefined,
  71. ShowQueue: false,
  72. CurrentTrack: {
  73. ID: undefined,
  74. duration: undefined,
  75. title: undefined,
  76. thumbnail: undefined
  77. },
  78. },
  79. Me: [],
  80. Room: "",
  81. ScriptInit: false,
  82. MainBackground: undefined,
  83. MainBackgroundColorCounter: 0,
  84. FontSize: 20,
  85. ChatStyleCounter: 0,
  86. ChatHeight: 30,
  87. ChatWidth: 0,
  88. ChatDisplay: true,
  89. UserListDisplay: true,
  90. ChatStyles: undefined,
  91. NameColors: undefined,
  92. MainBackgroundCounter: 0,
  93. ChatCSS: [],
  94. ChatLimit: 250,
  95. NotificationLimit: 100,
  96. ChatScroll: true,
  97. NotificationScroll: true,
  98. NoGreet: false,
  99. Featured: true,
  100. Bot: true,
  101. AutoKick: false,
  102. AutoBan: false,
  103. GreetMode: false,
  104. PerformanceMode: false,
  105. CanTTS: false,
  106. VoteSystem: false,
  107. Popups: true,
  108. Avatar: true,
  109. Reminder: true,
  110. CanSeeGames: true,
  111. CanHostGames: false,
  112. imgur: true,
  113. Notification: true,
  114. UserYT: true,
  115. AutoMicrophone: false,
  116. Game: {
  117. NoReset: false,
  118. Fish: {
  119. HighScore: ["CosmosisT", 13337],
  120. StartTimeout: undefined,
  121. RestockTimeout: undefined,
  122. ReCastTimeout: undefined,
  123. NotEnoughTimeout: undefined,
  124. Round: 0,
  125. Player: [],
  126. Multiplier: 10,
  127. TypesOfFish: [
  128. ["frog", 1, true],
  129. ["sunfish", 2, true],
  130. ["goldfish", 3, true],
  131. ["fish swollowed hook", 4, false],
  132. ["family of sardine", 5, true],
  133. ["catfish", 6, true],
  134. ["spotted bass", 7, true],
  135. ["largemouth bass", 8, true],
  136. ["family of shrimp", 9, true],
  137. ["it pays to not drink,\ncrazy night however!", 10, false],
  138. ["cisco", 11, true],
  139. ["seaweed, still edible", 12, true],
  140. ["snagged a tire and lost rod", 13, false],
  141. ["snagged a tire and lost hook", 14, false],
  142. ["lost their rod to a shark", 15, false],
  143. ["rainbow trout", 16, true],
  144. ["It's your turn for dinner", 80, false],
  145. ["parrot fish", 17, true],
  146. ["snagged a plastic bag,\n their hook is gone", 18, false],
  147. ["walleye", 19, true],
  148. ["Round Whitefish", 20, true],
  149. ["family of clams", 21, true],
  150. ["family of oyster", 22, true],
  151. ["Round blackfish", 23, true],
  152. ["dolphin", 24, true],
  153. ["seagull,\n not a fish but will do", 25, true],
  154. ["pufferfish", 26, true],
  155. ["fined for smuggling\nmore than fish", 27, false],
  156. ["lobster", 28, true],
  157. ["tuna", 29, true],
  158. ["electric eel", 30, true],
  159. ["Eel electricuted you,\nrod is toast", 31, false],
  160. ["swordfish", 32, true],
  161. ["had bills at home to pay", 33, false],
  162. ["slipped and lost equipment", 34, false],
  163. ["bike, still good too", 35, true],
  164. ["great white", 36, true],
  165. ["octopus", 37, true],
  166. ["serpeant", 38, true],
  167. ["sea turtle", 39, true],
  168. ["cleaned garbage from the lake", 40, true],
  169. ["fined for capturing,\n a female whale", 41, false],
  170. ["male whale", 42, true],
  171. ["barracuda", 43, true],
  172. ["pike", 44, true],
  173. ["lochiness monster", 45, true],
  174. ["anglerfish", 46, true],
  175. ["small treasure chest", 47, true],
  176. ["golden tuna", 48, true],
  177. ["family of beautiful rims", 49, true],
  178. ["red snapper", 50, true],
  179. ["jaws", 51, true],
  180. ["mermaid", 52, true],
  181. ["holy grail,\nhow'd that get there?", 75, true],
  182. ["secret formula", 100, true]
  183. ]
  184. }
  185. },
  186. Radio: {
  187. station: [
  188. ["Flex 98.5FM", "https://edge1-b.exa.live365.net/a23768"],
  189. ["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],
  190. ["HOT899", "https://newcap.leanstream.co/CIHTFM"],
  191. ["chillstep.info", "https://chillstep.info/listen.ogg"],
  192. ["HOT997", "https://ice5.securenetsystems.net/KHHK"],
  193. ["Dance365", "https://edge1-b.exa.live365.net/a93720"],
  194. ["kexp.org", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3"],
  195. ["Classic Deep Cuts", "https://edge1-b.exa.live365.net/a72496"],
  196. ["Divas Hustle Radio", "https://edge1-b.exa.live365.net/a72972"],
  197. ["Retro 8089", "https://edge1-b.exa.live365.net/a53202"],
  198. ["Paragon Broadcasting", "https://edge1-b.exa.live365.net/a49350"],
  199. ["Teerex Radio Teerex", "https://edge1-b.exa.live365.net/a74387"],
  200. ["NGI Radio", "https://edge1-b.exa.live365.net/a24650"],
  201. ["BYB Network", "https://edge1-b.exa.live365.net/a60276"],
  202. ["Legend Oldies", "https://edge1-b.exa.live365.net/a88135"],
  203. ["Music City Roadhouse", "https://edge1-b.exa.live365.net/a73754"],
  204. ["Mashrup Reggae Radio", "https://edge1-b.exa.live365.net/a00564"],
  205. ["97.5 Dance Hits", "https://edge1-b.exa.live365.net/a50365"]
  206. ]
  207. },
  208. EightBall: ["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."],
  209. TTS: {
  210. synth: undefined,
  211. voices: undefined
  212. },
  213. hasGreetedWC: false,
  214. hasGreetedOwner: false,
  215. Host: 0,
  216. HostAttempt: 0,
  217. HostWaiting: false,
  218. HostStartUp: false,
  219. WaitToVoteList: [],
  220. UserList: [],
  221. MentionList: [],
  222. TempIgnoreList: [],
  223. IgnoreList: [],
  224. BanList: [],
  225. KickList: [],
  226. BotOPList: [],
  227. BotModList: [],
  228. TTSList: [],
  229. BanKeywordList: [],
  230. KickKeywordList: [],
  231. HighlightList: [],
  232. GreetList: [],
  233. ReminderList: [],
  234. ReminderServerInList: [],
  235. Favorited: [],
  236. SafeList: [],
  237. WatchList: [],
  238. KBQueue: [],
  239. MessageCallback: [],
  240. Message: [
  241. []
  242. ],
  243. LastMessage: new Date(),
  244. SendQueue: [],
  245. MissedMsg: 0,
  246. ActiveMessage: 0,
  247. Camera: {
  248. List: [],
  249. Sweep: false,
  250. SweepTimer: 5,
  251. clearRandom: undefined
  252. },
  253. NotificationTimeOut: [],
  254. Sound: {
  255. C: new Audio("https://media.vocaroo.com/mp3/e3VIvvFqdHe"),
  256. HIGHLIGHT: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  257. GREET: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  258. MENTION: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"),
  259. MSG: new Audio("https://tinychat.com/webrtc/2.0.20-420/sound/pop.mp3"),
  260. PVTMSG: new Audio("https://tinychat.com/webrtc/2.0.20-420/sound/pop.mp3")
  261. },
  262. Welcomes: ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "]
  263. };
  264. //ELEMENTS
  265. var MainElement,
  266. ChatLogElement,
  267. VideoListElement,
  268. SideMenuElement,
  269. TitleElement,
  270. UserListElement,
  271. ModerationListElement,
  272. ChatListElement,
  273. UserContextElement,
  274. MicrophoneElement;
  275. //SAVE API
  276. if (CTS.YouTube.API_KEY !== "") Save("YouTubeAPI", CTS.YouTube.API_KEY); // IF API ISN'T BLANK SAVE IT!
  277. //CTS SETTINGS
  278. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
  279. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", 0));
  280. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  281. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  282. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/RC3bKe7.jpg) rgb(0, 0, 0) no-repeat");
  283. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  284. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  285. CTS.Notification = JSON.parse(Load("Notification", JSON.stringify(true)));
  286. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  287. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  288. CTS.Advice.toggle = JSON.parse(Load("Advice", JSON.stringify(false)));
  289. CTS.CanHostGames = JSON.parse(Load("CanHostGames", JSON.stringify(false)));
  290. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  291. CTS.Favorited = JSON.parse(Load("Favorited", JSON.stringify([
  292. ["stonercircle", "https://avatars.tinychat.com/da/838b96/5f/medium/phpKXAdEn.jpeg"], null, null, null, null
  293. ])));
  294. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  295. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  296. CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
  297. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  298. CTS.FontSize = JSON.parse(Load("FontSize", 20));
  299. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  300. CTS.KickList = JSON.parse(Load("KickList", JSON.stringify([])));
  301. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  302. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  303. CTS.BanList = JSON.parse(Load("BanList", JSON.stringify([])));
  304. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  305. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  306. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  307. CTS.imgur = JSON.parse(Load("imgur", JSON.stringify(true)));
  308. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  309. CTS.YouTube.API_KEY = Load("YouTubeAPI", ""); // PRIVATE KEY USE YOUR OWN (YTBYPASS or WITH YOUR OWN USE YT AGAIN)
  310.  
  311. //ROOM CSS
  312. var NameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  313. var Colors = ["#CD5C5C", "#F08080", "#FA8072", "#E9967A", "#DC143C", "#FF0000", "#B22222", "#8B0000", "#000000", "#FFFFFF", "#FFC0CB", "#FFB6C1", "#FF69B4", "#FF1493", "#C71585", "#DB7093", "#000000", "#FFFFFF", "#FFA07A", "#FF7F50", "#FF6347", "#FF4500", "#FF8C00", "#FFA500", "#000000", "#FFFFFF", "#FFD700", "#FFFF00", "#FFFFE0", "#FFFACD", "#FAFAD2", "#FFEFD5", "#FFE4B5", "#FFDAB9", "#EEE8AA", "#F0E68C", "#BDB76B", "#000000", "#FFFFFF", "#E6E6FA", "#D8BFD8", "#DDA0DD", "#EE82EE", "#DA70D6", "#FF00FF", "#BA55D3", "#9370DB", "#9966CC", "#8A2BE2", "#9400D3", "#9932CC", "#8B008B", "#800080", "#4B0082", "#6A5ACD", "#483D8B", "#7B68EE", "#000000", "#FFFFFF", "#ADFF2F", "#7FFF00", "#7CFC00", "#00FF00", "#32CD32", "#98FB98", "#90EE90", "#00FA9A", "#00FF7F", "#3CB371", "#2E8B57", "#228B22", "#008000", "#006400", "#9ACD32", "#6B8E23", "#808000", "#556B2F", "#66CDAA", "#8FBC8F", "#20B2AA", "#008B8B", "#008080", "#000000", "#FFFFFF", "#00FFFF", "#E0FFFF", "#AFEEEE", "#7FFFD4", "#40E0D0", "#48D1CC", "#00CED1", "#5F9EA0", "#4682B4", "#B0C4DE", "#B0E0E6", "#ADD8E6", "#87CEEB", "#87CEFA", "#00BFFF", "#1E90FF", "#6495ED", "#4169E1", "#0000FF", "#0000CD", "#00008B", "#000080", "#191970", "#000000", "#FFFFFF", "#FFF8DC", "#FFEBCD", "#FFE4C4", "#FFDEAD", "#F5DEB3", "#DEB887", "#D2B48C", "#BC8F8F", "#F4A460", "#DAA520", "#B8860B", "#CD853F", "#D2691E", "#8B4513", "#A0522D", "#A52A2A", "#800000", "#000000", "#FFFFFF", "#FFFFFF", "#FFFAFA", "#F0FFF0", "#F5FFFA", "#F0FFFF", "#F0F8FF", "#F8F8FF", "#F5F5F5", "#FFF5EE", "#F5F5DC", "#FDF5E6", "#FFFAF0", "#FFFFF0", "#FAEBD7", "#FAF0E6", "#FFF0F5", "#FFE4E1", "#000000", "#FFFFFF", "#DCDCDC", "#D3D3D3", "#C0C0C0", "#A9A9A9", "#808080", "#696969", "#778899", "#708090", "#2F4F4F", "#000000", "#FFFFFF"];
  314. var Images = ["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",
  315. "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",
  316. "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",
  317. "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",
  318. "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",
  319. "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",
  320. "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",
  321. ];
  322.  
  323. var 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%}";
  324. var VideoCSS = "#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;}@media screen and (max-width: 600px) {#videos-footer-broadcast, #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast {height: 50px;line-height: 50px;text-align: center;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;}#videos-header > span {background-color: unset;line-height: unset;}}.tcsettings:hover{background:#008cda;}.tcsettings{cursor: pointer;outline: none;background:#181d1e;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;}#videolist.full-screen, #videolist.full-screen > #videos-header, #videolist.full-screen .videos-header-volume:before {background:unset;}.ctsdrop{position:fixed;display:inline-block;top:3px;right:4px;z-index:4;min-width: 46px;}.ctsdrop-content{border-radius: 12px;position:absolute;top:28px;right:0;background:#181d1e;min-width:46px;width: 46px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{width:100%;height:28px;line-height:22px;z-index: 2;cursor: pointer;top: 4px;background: #181d1e;border: none;color: #ffffff;padding: 4px 8px;text-align: center;text-decoration: none;display: inline-block;font-size: 22px}#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: #181d1e;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: #181d1e;}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer:hover{background:linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgb(83, 182, 239)100%);}#videos-footer{background: linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgba(200, 200, 200, 0.26)100%);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;}.video:after{content: unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header{z-index: 3;background:#181d1e;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;}";
  325. var SideMenuCSS = "@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;min-height:calc(100% - 50px)!important;max-height:calc(100% - 50px)!important;}";
  326. var MainCSS = "#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;}";
  327. var RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{padding-top:0!important;background:unset!important;}";
  328. var TitleCSS = "#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;}";
  329. var ContextMenuCSS = ".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:#20262870;position:unset;padding:0;}";
  330. var ModeratorCSS = ".video{min-width: 114px;max-width: 114px;}#moderatorlist:after{right:5px;color:#FFFFFF;background:#53b6ef;}#moderatorlist>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist>#header>span>button{top:-2px;background: #20262870;}#moderatorlist.show>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist{max-height:60px;}#moderatorlist>#header{height:60px;font-size:16px;font-weight:600;font-family:sans-serif;color:#FFFFFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}#moderatorlist.show[data-videos-count=\"1\"], #moderatorlist.show[data-videos-count=\"2\"] {max-height:205px;}#moderatorlist.show[data-videos-count=\"3\"], #moderatorlist.show[data-videos-count=\"4\"] {max-height:290px;}#moderatorlist.show[data-videos-count=\"5\"], #moderatorlist.show[data-videos-count=\"6\"] {max-height:400px;}#moderatorlist.show[data-videos-count=\"7\"], #moderatorlist.show[data-videos-count=\"8\"] {max-height:460px;}#moderatorlist.show[data-videos-count=\"9\"], #moderatorlist.show[data-videos-count=\"10\"] {max-height:545px;}#moderatorlist.show[data-videos-count=\"11\"], #moderatorlist.show[data-videos-count=\"12\"] {max-height:630px;}";
  331. var UserListCSS = ".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:calc(100% - 45px)!important;right:5px!important;left:5px!important;}";
  332. var 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;}";
  333. var NotificationCSS = ".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{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;}.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;}";
  334. var ChatboxCSS = "#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #181d1e94;}#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);padding: 6px;box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;}#user-menu {position: absolute;display: none;bottom: 50px;right: 0;border: 1px solid rgba(0, 0, 0, .06);box-sizing: border-box;border-radius: 3px;color: #FFFFFF;background: #181d1e;line-height: 1;box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .09);z-index: 1;}#user-menu > span {display: inline-block;width: 100%;padding: 12px;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{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;position:absolute;right:3px;top:3px;background: #181d1e;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{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:3px 3px;background:#181d1ea8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#e24c05;-webkit-box-shadow: 0 0 20px #ffffff;box-shadow: inset 0 0 20px 0 #ffffff;}#cts-chat-content>.message.common{min-height: 50px;padding:3px 3px 3px 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-event: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:100%;}#notification-content{will-change: transform;top:0;position:relative;scrollbar-width:none;background:#181d1e;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height:80px;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-position>#chat-instant>a{display:none;}#chat-instant{padding-left:50px;background:transparent!important;}#chat-instant::after{background:none;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{-webkit-box-shadow: 0 0 6px #ffffff;box-shadow: 0 0 6px #ffffff;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:#181d1e;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;}";
  335. //CHATSTYLES
  336. CTS.ChatCSS.push([
  337. //STYLE #0
  338. ["#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%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  339. [".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;}"],
  340. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  341. ], [ //STYLE #1
  342. ["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  343. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)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;}"],
  344. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
  345. ], [ //STYLE #2
  346. ["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  347. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)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;}"],
  348. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
  349. ], [ //STYLE #3
  350. ["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  351. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)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;}"],
  352. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
  353. ], [ //STYLE #4
  354. ["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  355. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)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;}"],
  356. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
  357. ], [ //STYLE #5
  358. ["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  359. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)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;}"],
  360. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
  361. ], [ //STYLE #6
  362. ["#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%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  363. [".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)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;}"],
  364. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
  365. ], [ //STYLE #7
  366. ["#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%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  367. [".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;}"],
  368. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
  369. ], [ //STYLE #8
  370. ["#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%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  371. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)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;}"],
  372. ["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
  373. ], [ //STYLE #9
  374. ["#chat-wrapper{background: linear-gradient(0deg,rgb(119, 45, 2) 0%,rgb(24, 29, 30) 52%,rgb(234, 129, 38) 100%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  375. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup -h2{background:linear-gradient(0deg,rgb(56, 24, 6)0%,rgb(158, 78, 22)8px,rgb(255, 118, 0)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;}"],
  376. ["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
  377. ], [ //STYLE #10
  378. ["#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%);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  379. [".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)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;}"],
  380. ["#sidemenu{background: linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)100%);}"]
  381. ], [ //STYLE #11
  382. ["#cts-chat-content>.message{background:#181d1e;}#chat-wrapper{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}#cts-chat-content>.message{background:#181d1ea8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
  383. [".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;}"],
  384. ["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}"]
  385. ], [ //STYLE #12
  386. ["#chat-wrapper{background: #fff;}#cts-chat-content>.message{background:#00000000}.message{color:#000;text-shadow: unset;}"],
  387. [".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;}"],
  388. ["#sidemenu{background: #2d373a;}"]
  389. ]);
  390. //GLOBAL DECLARE
  391. window.DebugClear = true;
  392. window.RADIO_STATIONS = CTS.Radio.station;
  393. window.CTS = {
  394. "NameColor": NameColor,
  395. "BGColors": Colors,
  396. "BGImages": Images,
  397. "ChatCSS": CTS.ChatCSS,
  398. "Welcomes": CTS.Welcomes,
  399. "Sound": CTS.Sound,
  400. "EightBall": CTS.EightBall,
  401. "Radio": CTS.Radio,
  402. };
  403. //INITIATE
  404. CTSInit();
  405.  
  406. function CTSInit() {
  407. //INITIATE CTS
  408. CTS.ScriptLoading = setInterval(function() {
  409. if (document.querySelector("tinychat-webrtc-app")) {
  410. if (document.querySelector("tinychat-webrtc-app").shadowRoot) {
  411. CTSRoomInject();
  412. }
  413. debug("TINYCHAT::LOAD", "ROOM");
  414. } else if (document.querySelector("#welcome-wrapper")) {
  415. CTSHomeInject();
  416. debug("TinyChat::LOAD", "HOME");
  417. }
  418. }, 500);
  419. //WEBSOCKET HOOK
  420. if (!document.URL.match(/^https:\/\/tinychat.com(\/$|\/#)/i)) {
  421. new MutationObserver(function() {
  422. this.disconnect();
  423. CTSWebSocket();
  424. }).observe(document, {
  425. subtree: true,
  426. childList: true
  427. });
  428. }
  429. //FULLY LOADED -> RUNALL
  430. CTS.FullLoad = setInterval(function() {
  431. if (CTS.ScriptInit === true && CTS.SocketConnected === true) {
  432. clearInterval(CTS.FullLoad);
  433. 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>\nROOM CONFIGURATION:\nYouTube Mode: " + ((CTS.Room.YT_ON) ? "ON" : "OFF") + "\n\n</center>");
  434. AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
  435. if (CTS.Room.PTT === true) {
  436. VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
  437. if (e.which == 1) CTS.AutoMicrophone = false;
  438. if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  439. if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  440. }, {
  441. passive: true
  442. });
  443. }
  444. var favorited_rooms = "",
  445. len = CTS.Favorited.length,
  446. script = document.createElement("script"),
  447. elem = document.getElementsByTagName("script")[0];
  448. script.text = 'function AddFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'Favorited"));\n val[index]=["' + CTS.Room.Name + '","' + CTS.Room.Avatar + '"];\n localStorage.setItem("' + CTS.Project.Storage + 'Favorited", 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}';
  449. elem.parentNode.insertBefore(script, elem);
  450. for (var i = 0; i < len; i++) favorited_rooms += CTS.Favorited[i] !== null ? "#" + (i + 1) + '<a href="https://tinychat.com/room/' + CTS.Favorited[i][0] + '">' + CTS.Favorited[i][0] + "</a>" : "#" + (i + 1) + '<a href="#" onclick="return AddFavorite(this,' + i + ');">ADD ROOM</a>';
  451. 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://i.imgur.com/4Q4Lgzf.png") + '"></label><input type="checkbox" id="input-user" hidden=""><div id="user-menu"><span id="nickname">FAVORITED ROOMS</span>' + favorited_rooms + '<span id="nickname">' + CTS.Me.username + '</span><a href="https://tinychat.com/settings/gifts"> My Gifts</a><a href="https://tinychat.com/settings/profile">Profile</a><a href="https://tinychat.com/room/' + CTS.Me.username + '">My Room</a><a href="https://tinychat.com/#">Directory</a></div></div>');
  452. }
  453. }, 500);
  454. }
  455.  
  456. function CTSHomeInject() {
  457. var HomeCSS = '#modalfree-wrapper{display: none;}.tile-header > img {transition:unset;}.tile-favroom-opt{cursor:pointer;position: absolute;right: 0;top: 0;padding: 12px;background:#181d1e94;}.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:#181d1e94;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:#181d1e;}.tile-content > img{display:none;}#welcome-wrapper{background: #181d1e94;border-bottom:unset;}#loadmore{background: #00a2ff;font-weight: 600;}#user-menu{background: #181d1e;}#nav-static-wrapper {-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background:#181d1e;}#up-button:hover > #up-button-content {background: #181d1e59;}#nav-fixed{border-bottom:unset;}#nav-fixed-wrapper{-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background: #181d1e;}#nav-static {border-bottom:unset;}#welcome{padding:12px 30px 24px;}.tile{border-radius: 12px;background: #181d1eb3;}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;}';
  458. //INSERT HTML/CSS
  459. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  460. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  461. //INSERT SCRIPT
  462. var script = document.createElement("script"),
  463. elem = document.getElementsByTagName("script")[0];
  464. script.text = 'function RemoveFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'Favorited"));\n val[index]=null;\n localStorage.setItem("' + CTS.Project.Storage + 'Favorited", JSON.stringify(val));\n return obj.parentNode.parentNode.remove();\n}';
  465. elem.parentNode.insertBefore(script, elem);
  466. var len = CTS.Favorited.length;
  467. for (var i = 0; i < len; i++) document.body.querySelector(".cts-footer-contents").insertAdjacentHTML("beforeend", CTS.Favorited[i] !== null ? '<div class="tile" data-room-name="' + CTS.Favorited[i][0] + '">Favorite #' + (i + 1) + ' <div class="tile-header"><img id="tile-header-image" src="' + (CTS.Favorited[i][1] ? CTS.Favorited[i][1] : "https://i.imgur.com/VnVFEv7.png") + '" onload="MasonryTails.Refresh();" onclick="locationTo(\'/room/' + CTS.Favorited[i][0] + '\');"><div class="tile-info"><div class="tile-favroom-opt" onclick="RemoveFavorite(this,' + i + ')">X</div><div class="tile-name">' + CTS.Favorited[i][0] + '</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>");
  468. //SCRIPT INIT -> PREPARE()
  469. clearInterval(CTS.ScriptLoading);
  470. CTS.ScriptInit = true;
  471. CTSHomePrepare();
  472. }
  473.  
  474. function CTSHomePrepare() {
  475. //FUNCTION BYPASS
  476. window.ModalFreeTrialPro = function() {};
  477. //REMOVE
  478. Remove(document, "#footer");
  479. Remove(document, ".nav-logo");
  480. }
  481.  
  482. function CTSRoomInject() {
  483. //INSERT SCRIPT
  484. var script = document.createElement("script"),
  485. elem = document.getElementsByTagName("script")[0];
  486. script.text = 'var StationSelected = 0,\n StationPlay = false,\n StationVol = 1;\nfunction VolStation(elem, vol){\n var StationElem = elem.parentElement.nextSibling;\n var StationVolElem = elem.parentElement.querySelector(".music-radio-info>.volume");\nStationVol += vol;\n if (StationVol < 0){\n StationVol = 0;\n } else if (StationVol > 1) {\n StationVol = 1.0;\n }\n StationElem.volume = StationVol;\nStationVolElem.style.width=((StationVol * 100)+"%");}\nfunction PlayPauseStation(elem) {\n var StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n var StationElem=elem.parentElement.nextSibling;\nvar StationDescElem=elem.parentElement.querySelector(".music-radio-info>.description");\n StationPlay=!StationPlay;\n if (StationPlay) {\n StationElem.volume = StationVol;\n StationElem.play();\n StationPlayPauseBtn.innerText="❚❚"; StationDescElem.innerText = ("Playing: "+window.RADIO_STATIONS[StationSelected][0]+"\\nURL: "+window.RADIO_STATIONS[StationSelected][1]);\n} else {\n StationElem.pause();\nStationPlayPauseBtn.innerText="▶";\n StationDescElem.innerText = ("Paused: "+window.RADIO_STATIONS[StationSelected][0]+"\\nURL: "+window.RADIO_STATIONS[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.RADIO_STATIONS.length-1) {\n StationSelected = 0;\n } else if (StationSelected < 0){\n StationSelected = window.RADIO_STATIONS.length-1;\n }\n StationElem.pause();\n StationElem.setAttribute("src", window.RADIO_STATIONS[StationSelected][1]);\n StationElem.load();\n StationElem.volume = StationVol;\nStationPlayPauseBtn.innerText="❚❚";\n StationElem.play();\nStationDescElem.innerText = ("Playing: "+window.RADIO_STATIONS[StationSelected][0]+"\\nURL: "+window.RADIO_STATIONS[StationSelected][1]);\n}';
  487. elem.parentNode.insertBefore(script, elem);
  488. //LOCALSETTINGS
  489. CTS.enablePMs = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enablePMs : true;
  490. CTS.enableSound = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enableSound : true;
  491. //TTS (TEXT-TO-SPEECH)
  492. if (CTS.enableSound === true && "speechSynthesis" in window) {
  493. CTS.TTS.synth = window.speechSynthesis;
  494. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  495. }
  496. //ELEMENT DEFINE
  497. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  498. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  499. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  500. MicrophoneElement = document.createEvent("MouseEvent");
  501. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  502. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  503. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  504. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  505. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  506. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  507. //INSERTHTML/CSS
  508. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  509. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  510. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  511. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  512. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  513. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  514. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  515. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  516. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  517. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  518. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  519. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  520. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  521. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  522. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  523. 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);">←</button><button class="music-radio-seek" onclick="SeekStation(this,1);">→</button><button class="music-radio-playpause" onclick="PlayPauseStation(this);">▶</button><button class="music-radio-vol" onclick="VolStation(this,.05);">+</button><button class="music-radio-vol" style="top:50%" onclick="VolStation(this,-.05);">-</button></div><audio id="music-radio-audio" src="' + CTS.Radio.station[0][1] + '"></audio>');
  524. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  525. VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin", "<button class=\"tcsettings\">⯇</button>");
  526. VideoListElement.querySelector("#videos-header").appendChild(TitleElement.querySelector('span[title="Settings"]'));
  527. VideoListElement.querySelector("#videolist").appendChild(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"));
  528. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  529. VideoListElement.querySelector("#videolist").insertAdjacentHTML("afterbegin", '<div class="ctsdrop"><button class="ctsoptions" title="CTS Options">⚙</button><div class="ctsdrop-content"><button id="BackgroundUpdateRight" class="ctsoptions" title="Background">+</button><button id="BackgroundUpdateColor" class="ctsoptions" title="Background Color">BG</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><div style="height:6px;background:#624482;"></div><button id="ChatColor" class="ctsoptions" title="Chat Style">🖉</button><button id="FeaturedToggled" class="ctsoptions" title="YouTube/Featured Resize">⛶</button><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="PerformanceModeToggled" class="ctsoptions" title="Performance Mode">🎮</button></div></div>');
  530. ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div><button class="notifbtn">▼</button>');
  531. ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
  532. ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
  533. //SCRIPT INIT -> PREPARE()
  534. clearInterval(CTS.ScriptLoading);
  535. CTS.ScriptInit = true;
  536. CTSRoomPrepare();
  537. }
  538.  
  539. function CTSRoomPrepare() {
  540. var TCApp = window.TinychatApp;
  541. //FUNCTION BYPASS
  542. TCApp.BLL.SoundPlayer.playMessage = function() {};
  543. TCApp.BLL.SoundPlayer.playGift = function() {};
  544. TCApp.BLL.User.isSubscription = function() {
  545. return true;
  546. };
  547. TCApp.BLL.User.canUseFilters = function() {
  548. return true;
  549. };
  550. TCApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  551. var b = this,
  552. d = this.settings.getSettings();
  553. if (d.video === null) {
  554. return void this.app.MediaSettings(() => {
  555. this.BroadcastStart();
  556. });
  557. }
  558. this.videolist.AddingVideoSelf(this.self_handle);
  559. var e = {};
  560. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  561. e.audio = true;
  562. e.video = {
  563. width: {
  564. min: 320,
  565. max: 4096
  566. },
  567. height: {
  568. min: 240,
  569. max: 2160
  570. },
  571. frameRate: {
  572. min: 15,
  573. ideal: 30,
  574. max: 60
  575. }
  576. };
  577. } else {
  578. navigator.mediaDevices.enumerateDevices().then(g => {
  579. var h = false;
  580. var len = g.length;
  581. for (var c = 0; c < len; c++) {
  582. if (g[c].kind === "videoinput") {
  583. if (e.video === void 0) {
  584. e.video = {
  585. width: {
  586. min: 320,
  587. max: 4096
  588. },
  589. height: {
  590. min: 240,
  591. max: 2160
  592. },
  593. frameRate: {
  594. min: 15,
  595. ideal: 30,
  596. max: 60
  597. }
  598. };
  599. }
  600. if (h) {
  601. d.video = g[c];
  602. h = false;
  603. this.settings.saveSettings(d);
  604. } else if (d.video === null) {
  605. d.video = g[c];
  606. this.settings.saveSettings(d);
  607. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  608. e.video.deviceId = {
  609. exact: d.video.deviceId
  610. };
  611. } else if (d.video.deviceId === a) {
  612. h = true;
  613. }
  614. }
  615. if (g[c].kind === "audioinput") {
  616. if (e.audio === void 0) e.audio = {};
  617. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) {
  618. e.audio.deviceId = {
  619. exact: d.audio.deviceId
  620. };
  621. }
  622. }
  623. }
  624. if (e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
  625. if (!(e.audio || e.video)) {
  626. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  627. } else if ("https:" === location.protocol || this.app.isDebug()) {
  628. debug("BROADCAST", "Initiating Media...");
  629. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  630. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  631. b.mediaLastConstraints = e;
  632. navigator.mediaDevices.getUserMedia(e).then(m => {
  633. b.onMediaSuccessCallback(m);
  634. });
  635. }
  636. }).catch(er => {
  637. debug("CAMERA::ERROR", er);
  638. });
  639. }
  640. };
  641. TCApp.BLL.Userlist.prototype.ignore = function(a) {
  642. var b = a.isUsername ? a.username : a.nickname;
  643. if (this.isIgnored(a) || this.ignored.push(b)) {
  644. var c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  645. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
  646. this.app.showToast(b + " ignored successfully till they leave or you refresh!");
  647. CTS.TempIgnoreList.push(b.toUpperCase());
  648. }
  649. };
  650. TCApp.BLL.Userlist.prototype.unignore = function(a) {
  651. var b = a.isUsername ? a.username : a.nickname,
  652. len = this.ignored.length;
  653. for (var TI = 0; TI < len; TI++) {
  654. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  655. this.ignored.splice(TI, 1);
  656. break;
  657. }
  658. }
  659. len = CTS.TempIgnoreList.length;
  660. for (TI = 0; TI < len; TI++) {
  661. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  662. CTS.TempIgnoreList.splice(TI, 1);
  663. break;
  664. }
  665. }
  666. var e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  667. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
  668. this.app.showToast(a.username + " unignored");
  669. };
  670. //REMOVE
  671. Remove(ChatLogElement, 'span[id="input-unread"]');
  672. Remove(ChatLogElement, "#chat-content");
  673. Remove(ChatLogElement, "#chat-wider");
  674. Remove(ChatLogElement, "#chatlog-button");
  675. Remove(SideMenuElement, "#top-buttons-wrapper");
  676. Remove(SideMenuElement, "#user-info");
  677. Remove(SideMenuElement, "#close-users");
  678. Remove(TitleElement, "#room-header-avatar");
  679. Remove(TitleElement, "#room-header-gifts");
  680. Remove(TitleElement, "#room-header-info-text");
  681. Remove(TitleElement, "#room-header-info-details");
  682. Remove(TitleElement, "#room-header-mobile-button");
  683. Remove(TitleElement, 'span[title="Follow"]');
  684. Remove(TitleElement, 'span[title="Share room"]');
  685. Remove(VideoListElement, "#youtube-overlay");
  686. Remove(document, "#users-icon");
  687. //PARAM REMOVE
  688. if (CTS.enablePMs === false) Remove(ChatListElement, "#chatlist");
  689. //LOAD
  690. CTSRoomLoad();
  691. }
  692.  
  693. function CTSRoomLoad() {
  694. //EVENT LISTENERS
  695. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  696. if (!CTS.ChatDisplay) {
  697. CTS.ChatWidth += 5;
  698. CTS.ChatDisplay = true;
  699. }
  700. CTS.ChatHeight -= 5;
  701. CTS.UserListDisplay = true;
  702. if (CTS.ChatHeight == 20) {
  703. CTS.ChatHeight = 45;
  704. CTS.UserListDisplay = false;
  705. }
  706. 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;");
  707. 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;");
  708. 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;");
  709. VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
  710. 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;";
  711. UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  712. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  713. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  714. PerformanceModeInit(CTS.PerformanceMode);
  715. UpdateScroll(1, true);
  716. Resize();
  717. }, {
  718. passive: true
  719. });
  720. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  721. CTS.ChatWidth += 5;
  722. CTS.ChatDisplay = true;
  723. if (CTS.ChatWidth == 25) {
  724. CTS.ChatWidth = -5;
  725. CTS.ChatDisplay = false;
  726. }
  727. 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;");
  728. 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;");
  729. 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;");
  730. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
  731. 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;";
  732. UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  733. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  734. if (CTS.Me.mod) VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  735. CTS.PerformanceMode = false;
  736. PerformanceModeInit(CTS.PerformanceMode);
  737. UpdateScroll(1, true);
  738. Resize();
  739. }, {
  740. passive: true
  741. });
  742. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  743. CTS.Featured = !CTS.Featured;
  744. if (CTS.Featured === true) {
  745. Remove(VideoListElement, "#SmallFTYT");
  746. } else {
  747. var node = document.createElement("style");
  748. node.appendChild(document.createTextNode(FeaturedCSS));
  749. node.setAttribute("id", "SmallFTYT");
  750. VideoListElement.appendChild(node);
  751. }
  752. Resize();
  753. }, {
  754. passive: true
  755. });
  756. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  757. CTS.ChatStyleCounter++;
  758. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  759. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  760. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  761. var len = CTS.ChatCSS.length - 1;
  762. if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
  763. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  764. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  765. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  766. Save("ChatStyle", CTS.ChatStyleCounter);
  767. }, {
  768. passive: true
  769. });
  770. VideoListElement.querySelector("#PerformanceModeToggled").addEventListener("click", function() {
  771. if (CTS.ChatDisplay) {
  772. CTS.PerformanceMode = !CTS.PerformanceMode;
  773. PerformanceModeInit(CTS.PerformanceMode);
  774. }
  775. }, {
  776. passive: true
  777. });
  778. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  779. UpdateScroll(1, true);
  780. CheckUnreadMessage();
  781. }, {
  782. passive: true
  783. });
  784. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  785. var element = event.target;
  786. if (Math.floor(element.scrollTop + 25) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage();
  787. }, {
  788. passive: true
  789. });
  790. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  791. var element = event.target;
  792. if (Math.floor(element.scrollTop + 25) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  793. }, {
  794. passive: true
  795. });
  796. if (CTS.Notification) {
  797. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  798. passive: true
  799. });
  800. }
  801. VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
  802. var arg;
  803. if (this.innerText === "⯈") {
  804. this.innerText = "⯇";
  805. arg = "block";
  806. } else {
  807. this.innerText = "⯈";
  808. arg = "none";
  809. }
  810. VideoListElement.querySelector("#videos-header-sound").style.display = arg;
  811. if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
  812. //VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
  813. VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
  814. VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
  815. }, {
  816. passive: true
  817. });
  818. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  819. CTS.MainBackgroundCounter++;
  820. if (CTS.MainBackgroundCounter === Images.length) CTS.MainBackgroundCounter = 0;
  821. var background = "url(\"" + Images[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  822. document.body.style.background = background;
  823. Save("MainBackground", background);
  824. }, {
  825. passive: true
  826. });
  827. VideoListElement.querySelector("button[id=\"BackgroundUpdateColor\"]").addEventListener("click", function() {
  828. CTS.MainBackgroundColorCounter++;
  829. if (CTS.MainBackgroundColorCounter === Colors.length) CTS.MainBackgroundColorCounter = 0;
  830. var background = Colors[CTS.MainBackgroundColorCounter];
  831. document.body.style.background = background;
  832. Save("MainBackground", background);
  833. }, {
  834. passive: true
  835. });
  836. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  837. CTS.MainBackgroundCounter--;
  838. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = Images.length - 1;
  839. var background = "url(\"" + Images[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  840. document.body.style.background = background;
  841. Save("MainBackground", background);
  842. }, {
  843. passive: true
  844. });
  845. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  846. CTS.FontSize += 5;
  847. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  848. Save("FontSize", CTS.FontSize);
  849. ChatLogElement.querySelector("#textarea").style.fontSize = (CTS.FontSize - 4) + "px";
  850. }, {
  851. passive: true
  852. });
  853. //MUTATION OBSERVERS
  854. new MutationObserver(function() {
  855. LoadMessage();
  856. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  857. attributes: true,
  858. attributeFilter: ["class"],
  859. childList: false,
  860. characterData: false
  861. });
  862. new MutationObserver(function() {
  863. Cameras();
  864. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  865. childList: true
  866. });
  867. new MutationObserver(function() {
  868. Cameras();
  869. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  870. childList: true
  871. });
  872. new MutationObserver(function() {
  873. if (CTS.AutoMicrophone) {
  874. OpenMicrophone();
  875. }
  876. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  877. attributes: true,
  878. attributeFilter: ["class"]
  879. });
  880. //REFRESH VIEW
  881. NotificationDisplay();
  882. Cameras();
  883. }
  884.  
  885. //YOUTUBE FUNCTIONS
  886. function CheckHost() {
  887. if (CTS.Host === 0) {
  888. Send("msg", "!whoisbot");
  889. CTS.HostAttempt = 0;
  890. CTS.HostWaiting = true;
  891. }
  892. }
  893.  
  894. function SetBot() {
  895. if (arguments[0]) CTS.Game.NoReset = true;
  896. Send("msg", "!bot");
  897. CTS.HostWaiting = false;
  898. }
  899.  
  900. function CheckYouTube() {
  901. //CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
  902. if (arguments[3] === undefined) arguments[3] = true;
  903. CTS.YouTube.XHR.type = arguments[1];
  904. 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);
  905. if (videoid !== null) {
  906. videoid = videoid[1].replace(/v\=/g, "");
  907. //LINK IS PLAYLIST
  908. if (videoid.match(/list\=/i)) {
  909. if (arguments[3]) {
  910. videoid = videoid.replace(/list\=/, "");
  911. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  912. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/playlistItems?playlistId=" + videoid + "&part=snippet&maxResults=50" + ((arguments[2] !== undefined) ? "&pageToken=" + arguments[2] : "") + "&type=video&eventType=completed&key=" + CTS.YouTube.API_KEY);
  913. CTS.YouTube.XHR.playlistid = videoid;
  914. CTS.YouTube.XHR.send();
  915. }
  916. } else {
  917. //LINK IS REGULAR
  918. CTS.YouTube.XHR.videoid = videoid;
  919. CTS.YouTube.VideoReturn = true;
  920. 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);
  921. CTS.YouTube.XHR.send();
  922. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  923. }
  924. } else {
  925. //KEYWORD SEARCH
  926. if (CTS.YouTube.MessageQueueList.length <= 0) {
  927. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  928. CTS.YouTube.SearchReturn = true;
  929. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/search?key=" + CTS.YouTube.API_KEY + "&maxResults=50&q=" + encodeURI(arguments[0]) + "&type=video&part=snippet");
  930. CTS.YouTube.XHR.send();
  931. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  932. }
  933. }
  934. }
  935.  
  936. function YouTubePlayList() {
  937. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  938. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  939. }
  940.  
  941. function YouTubeTrackAdd() {
  942. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  943. if (CTS.YouTube.Busy === false) {
  944. if (CTS.YouTube.MessageQueueList.length > 0) {
  945. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  946. 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);
  947. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  948. CTS.YouTube.XHR.send();
  949. CTS.YouTube.MessageQueueList.shift();
  950. }
  951. }
  952. }
  953. }
  954.  
  955. function YouTubePlayListItems() {
  956. var len = arguments[0].length;
  957. for (var i = 0; i < len; i++) {
  958. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  959. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  960. }
  961. }
  962. }
  963.  
  964. function YouTubeTimeConvert() {
  965. //TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
  966. var a = arguments[0].match(/\d+/g);
  967. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  968. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  969. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  970. var len = a.length;
  971. arguments[0] = 0;
  972. if (len == 3) {
  973. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  974. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  975. arguments[0] = arguments[0] + parseInt(a[2]);
  976. }
  977. if (len == 2) {
  978. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  979. arguments[0] = arguments[0] + parseInt(a[1]);
  980. }
  981. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  982. return arguments[0];
  983. }
  984.  
  985. function BotCommandCheck() {
  986. //USER COMMANDS TO HOST
  987. if (arguments[1].match(/^!8ball\s.*\??/i)) Send("msg", "[8BALL]\n" + CTS.EightBall[Rand(0, CTS.EightBall.length - 1)]);
  988. if (arguments[1].match(/^!coin$/i)) Send("msg", "[COIN FLIP]\nThe coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!");
  989. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  990. if (arguments[1].match(/^!chuck$/i)) Chuck();
  991. if (arguments[1].match(/^!urb\s/i)) Urb(arguments[1]);
  992. if (arguments[1].match(/^!dad$/i)) Dad();
  993. if (arguments[1].match(/^!advice$/i)) Advice();
  994. if (arguments[1].match(/^!vote\s/i)) Vote(arguments[0], arguments[1]);
  995. //Junior Moderator/Moderator
  996. if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
  997. if (arguments[1].match(/^!kick\s/i)) ModCommand("kick", arguments[1]);
  998. if (arguments[1].match(/^!ban\s/i)) ModCommand("ban", arguments[1]);
  999. if (arguments[1].match(/^!close\s/i)) ModCommand("stream_moder_close", arguments[1]);
  1000. }
  1001. //ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
  1002. if (CTS.Room.YT_ON) {
  1003. if (arguments[1].match(/^!play$/i)) YouTubePlayList();
  1004. if (arguments[1].match(/^!yt\s/i)) BotCommand(1, arguments[0], arguments[1]);
  1005. if (arguments[1].match(/^!ytbypass\s/i)) BotCommand(6, arguments[0], arguments[1]);
  1006. if (arguments[1].match(/^!ytclear$/i)) BotCommand(2, arguments[0]);
  1007. if (arguments[1].match(/^!ytskip$/i)) BotCommand(3, arguments[0]);
  1008. if (arguments[1].match(/^!ytqueue$/i)) BotCommand(4, arguments[0]);
  1009. }
  1010. //USER CAN GAME THEY'VE BEEN VERIFIED
  1011. if (CTS.UserList[arguments[0]].canGame) FishCommandCheck(arguments[0], arguments[1]);
  1012. }
  1013.  
  1014. function BotCheck() {
  1015. if (CTS.UserList[arguments[0]].mod) {
  1016. //CHECK HOST
  1017. if (arguments[1].match(/^!bot$/i)) {
  1018. CTS.HostStartUp = false; // unset
  1019. if (CTS.Host === CTS.Me.handle && arguments[2].handle === CTS.Me.handle) {
  1020. //STILL HOSTING DON'T WORRY
  1021. CTS.HostStartUp = true; // SKIP BOT STARTUP
  1022. } else {
  1023. CTS.HostStartUp = false; // STATE 1 = I WASN'T HOST PRIOR OR NOW JUST ASKING FOR IT (FRESH START)
  1024. }
  1025. //SET HOST
  1026. CTS.Host = arguments[2].handle;
  1027. CTS.HostWaiting = false;
  1028. //RESET GAMES
  1029. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  1030. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  1031. if (CTS.Me.handle !== arguments[2].handle) {
  1032. CTS.Game.Fish.GameStart = false;
  1033. CTS.Game.NoReset = false;
  1034. Fish.reset(true);
  1035. }
  1036. }
  1037. //IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
  1038. if (CTS.Me.handle == arguments[2].handle) {
  1039. if (!CTS.HostStartUp) AutoAdvice();
  1040. if (CTS.Room.YT_ON) YouTubePlayList();
  1041. }
  1042. //ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
  1043. } else if (CTS.HostWaiting === true) {
  1044. CTS.HostAttempt++;
  1045. //SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
  1046. if (CTS.HostAttempt == 1) {
  1047. setTimeout(function() {
  1048. //CHECK WAITING STATE OR IF HOST HAS CHANGED
  1049. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  1050. }, 10000);
  1051. }
  1052. //SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
  1053. if (CTS.HostAttempt == 10) SetBot(false);
  1054. }
  1055. }
  1056. }
  1057.  
  1058. function Chuck() {
  1059. //OPEN REQUEST
  1060. CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
  1061. CTS.Chuck.XHR.send();
  1062. }
  1063.  
  1064. function Urb() {
  1065. //CHECK TERM
  1066. var urban = arguments[0].match(/\!urb\s(.*)/i);
  1067. if (urban !== null) {
  1068. //OPEN REQUEST
  1069. CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
  1070. CTS.Urb.XHR.send();
  1071. }
  1072. }
  1073.  
  1074. function Dad() {
  1075. //OPEN REQUEST
  1076. CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
  1077. CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
  1078. CTS.Dad.XHR.send();
  1079. }
  1080.  
  1081. function Advice() {
  1082. //OPEN REQUEST
  1083. CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
  1084. CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
  1085. CTS.Advice.XHR.send();
  1086. }
  1087. // Message Functions
  1088. function CreateMessage() {
  1089. //SCROLLED UP? MISSED A MESSAGE?
  1090. CheckUnreadMessage();
  1091. // POST NEW CHAT ITEM AND IF ACTIVECHAT IS OUR CURRENT
  1092. if (arguments[6] == GetActiveChat()) ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(arguments[3]) || CTS.HighlightList.includes(arguments[4].toUpperCase())) ? "highlight" : "") + "\" " + ((arguments[2] === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + arguments[2] + "\"></div></a>" : "") + "<div class=\"nickname\" style=\"-webkit-box-shadow: 0 0 6px " + arguments[1] + ";box-shadow: 0 0 6px " + arguments[1] + ";background:" + arguments[1] + ";\">" + arguments[4] + "<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>");
  1093. //CHAT CLEANUP
  1094. var Chat = ChatLogElement.querySelectorAll("#cts-chat-content>.message");
  1095. var len = Chat.length;
  1096. if (len > CTS.ChatLimit + 50) {
  1097. CTS.ChatScroll = true;
  1098. //REMOVE 50 MESSAGES (CAN BE DONE CLEANER BUT NO BIG DEAL FOR OUR USE)
  1099. len = Chat.length - CTS.ChatLimit;
  1100. var ChatIndex = 0;
  1101. for (ChatIndex; ChatIndex < len; ChatIndex++) {
  1102. Chat[ChatIndex].parentNode.removeChild(Chat[ChatIndex]);
  1103. CTS.Message[arguments[6]].shift();
  1104. //CLEANING TC ITEMS THAT FILL UP OVERTIME
  1105. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  1106. }
  1107. }
  1108. UpdateScroll(1, false);
  1109. }
  1110.  
  1111. function AKB() {
  1112. //WATCH OR REMOVE USERS
  1113. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  1114. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  1115. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  1116. } else {
  1117. if (CTS.Me.mod) {
  1118. if (CTS.AutoKick === true) {
  1119. CTS.NoGreet = true;
  1120. Send("kick", arguments[1]);
  1121. } else if (CTS.AutoBan === true) {
  1122. CTS.NoGreet = true;
  1123. Send("ban", arguments[1]);
  1124. }
  1125. }
  1126. }
  1127. }
  1128.  
  1129. function AISB() {
  1130. if (arguments[0].username !== "") {
  1131. if (!CTS.SafeList.includes(arguments[0].username.toUpperCase())) {
  1132. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  1133. if (CTS.SafeList.length < 1000) {
  1134. CTS.SafeList.push(arguments[0].username.toUpperCase());
  1135. Save("AKB", JSON.stringify(CTS.SafeList));
  1136. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1137. }
  1138. } else {
  1139. if (arguments[0].lurker === false) {
  1140. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1141. } else {
  1142. AKB(false, arguments[0].handle);
  1143. }
  1144. }
  1145. }
  1146. } else {
  1147. AKB(false, arguments[0].handle);
  1148. }
  1149. }
  1150.  
  1151. function LoadMessage() {
  1152. var ChatIndex, index, Chat = ChatLogElement.querySelector("#cts-chat-content");
  1153. CTS.ChatScroll = true;
  1154. if (!CTS.MessageCallback[CTS.ActiveMessage]) CTS.MessageCallback[CTS.ActiveMessage] = [];
  1155. CTS.MessageCallback[CTS.ActiveMessage].html = Chat.innerHTML;
  1156. CTS.MessageCallback[CTS.ActiveMessage].len = (Chat.innerHTML === "") ? 0 : CTS.Message[CTS.ActiveMessage].length;
  1157. Chat.innerHTML = "";
  1158. CheckUnreadMessage();
  1159. CTS.ActiveMessage = GetActiveChat();
  1160. if (CTS.Message[CTS.ActiveMessage]) {
  1161. index = (CTS.MessageCallback[CTS.ActiveMessage]) ? CTS.MessageCallback[CTS.ActiveMessage].len : 0;
  1162. if (index > 0) Chat.innerHTML = CTS.MessageCallback[CTS.ActiveMessage].html;
  1163. var len = CTS.Message[CTS.ActiveMessage].length;
  1164. for (ChatIndex = index; ChatIndex < len; ChatIndex++) ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(CTS.Message[CTS.ActiveMessage][ChatIndex].username)) ? "highlight" : "") + "\" " + ((CTS.Message[CTS.ActiveMessage][ChatIndex].avatar === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + (CTS.Message[CTS.ActiveMessage][ChatIndex].avatar) + "\"></div></a>" : "") + "<div class=\"nickname\" style=\"-webkit-box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";background:" + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";\">" + CTS.Message[CTS.ActiveMessage][ChatIndex].nick + "<div class=\"ctstime\"> " + CTS.Message[CTS.ActiveMessage][ChatIndex].time + " </div></div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\" style=\"font-size:" + CTS.FontSize + "px;\">" + CTS.Message[CTS.ActiveMessage][ChatIndex].msg + "</span></CTS-message-html></div></div>");
  1165. } else {
  1166. CTS.Message[CTS.ActiveMessage] = [];
  1167. }
  1168. UpdateScroll(1, false);
  1169. }
  1170.  
  1171. function CheckUnreadMessage() {
  1172. if (Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) {
  1173. CTS.MissedMsg = 0;
  1174. CTS.ChatScroll = true;
  1175. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1176. } else {
  1177. CTS.MissedMsg++;
  1178. CTS.ChatScroll = false;
  1179. if (ChatLogElement.querySelector(".cts-message-unread").style.display == "none") {
  1180. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1181. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1182. }
  1183. }
  1184. }
  1185.  
  1186. function GetActiveChat() {
  1187. var elem = ChatListElement.querySelector(".active");
  1188. if (elem) return elem.getAttribute("data-chat-id");
  1189. return 0;
  1190. }
  1191.  
  1192. function CheckImgur() {
  1193. if (CTS.imgur) {
  1194. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpg|gif|png|mp4)/);
  1195. if (i !== null) {
  1196. arguments[0] = (i[1] == "mp4") ? "<center>(Video Below)\n<video onclick=\"if (this.paused) {this.play();}else{this.pause();}\" oncontextmenu=\"return false;\" width=\"320px\" height=\"240px\"><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>";
  1197. }
  1198. }
  1199. return arguments[0];
  1200. }
  1201.  
  1202. function TTS() {
  1203. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1204. utter.voice = CTS.TTS.voices[0];
  1205. utter.rate = 1.0;
  1206. utter.pitch = 0.5;
  1207. CTS.TTS.synth.speak(utter);
  1208. }
  1209.  
  1210. function RoomUsers() {
  1211. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  1212. }
  1213.  
  1214. function SpamPrevention() {
  1215. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  1216. if (LineBreaks >= 14 && arguments[1] === false) return true;
  1217. return false;
  1218. }
  1219.  
  1220. function GamePrevention() {
  1221. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(?:FISHING\sBOAT)\]/i)) return false;
  1222. return true;
  1223. }
  1224.  
  1225. function UpdateScroll() {
  1226. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  1227. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true)) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  1228. }
  1229.  
  1230. function DecodeTXT() {
  1231. var txt = document.createElement("textarea");
  1232. txt.innerHTML = arguments[0];
  1233. return txt.value;
  1234. }
  1235.  
  1236. function HTMLtoTXT() {
  1237. var p = document.createElement("p");
  1238. p.appendChild(document.createTextNode(arguments[0]));
  1239. 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>");
  1240. }
  1241.  
  1242. function IgnoreText() {
  1243. if (arguments[0] !== "") {
  1244. if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
  1245. return true;
  1246. }
  1247. }
  1248.  
  1249. function TimeToDate() {
  1250. if (arguments[1] === undefined) arguments[1] = new Date();
  1251. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((am|AM|aM|Am)|(pm|PM|pM|Pm))/);
  1252. var t = {
  1253. hours: parseInt(match[1]),
  1254. minutes: parseInt(match[2]),
  1255. period: match[3].toLowerCase()
  1256. };
  1257. if (t.hours === 12) {
  1258. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  1259. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  1260. } else {
  1261. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  1262. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  1263. }
  1264. return arguments[1];
  1265. }
  1266.  
  1267. function PushPM() {
  1268. var list = (arguments[2] !== undefined) ? CTS.UserList[arguments[2]] : CTS.Me;
  1269.  
  1270. CTS.Message[arguments[0]].push({
  1271. "time": Time(),
  1272. "namecolor": list.namecolor,
  1273. "avatar": list.avatar,
  1274. "username": list.username,
  1275. "nick": list.nick,
  1276. "msg": CheckImgur(HTMLtoTXT(arguments[1]))
  1277. });
  1278.  
  1279. if (arguments[0] == GetActiveChat()) {
  1280. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1281. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, arguments[0]);
  1282. UpdateScroll(1, false);
  1283. }
  1284. }
  1285.  
  1286. function Time() {
  1287. return (new Date().toLocaleString("en-US", {
  1288. hour: "numeric",
  1289. minute: "numeric",
  1290. second: "numeric",
  1291. hour12: true
  1292. }));
  1293. }
  1294. // Features
  1295. function Vote() {
  1296. var ChecksOut = CTS.VoteSystem,
  1297. len = CTS.WaitToVoteList.length;
  1298. if (len > 0 && ChecksOut) {
  1299. for (var i = 0; i < len; i++) {
  1300. if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
  1301. Send("msg", "Please wait several minutes till you can cast your vote again!");
  1302. ChecksOut = false;
  1303. break;
  1304. }
  1305. }
  1306. }
  1307. if (ChecksOut) {
  1308. if (CTS.SafeList.includes(CTS.UserList[arguments[0]].username.toUpperCase())) {
  1309. var targetname = arguments[1].match(/\!vote\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
  1310. if (targetname !== null) {
  1311. var Target = UsernameToUser(targetname[1].toUpperCase());
  1312. if (Target !== -1) {
  1313. if (CTS.UserList[Target].broadcasting) {
  1314. if (CTS.Me.owner || !CTS.UserList[Target].mod) {
  1315. Send("msg", "Your vote has been cast, you may vote again shortly!");
  1316. CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
  1317. CTS.UserList[Target].vote += 1;
  1318. if (CTS.UserList[Target].vote === 3) {
  1319. CTS.UserList[Target].vote = 0;
  1320. Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
  1321. Send("stream_moder_close", CTS.UserList[Target].handle);
  1322. }
  1323. } else {
  1324. Send("msg", "I cannot do that!");
  1325. }
  1326. }
  1327. } else {
  1328. Send("msg", "The user is not broadcasting...");
  1329. }
  1330. } else {
  1331. Send("msg", "The nickname or username does not exist!");
  1332. }
  1333. }
  1334. }
  1335. }
  1336.  
  1337. function MessagePopUp() {
  1338. if (CTS.Popups) {
  1339. var push = false;
  1340. if (arguments[0] != -1) {
  1341. if (ChatListElement.querySelector(".list-item .active")) {
  1342. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  1343. if (arguments[2]) push = true;
  1344. } else {
  1345. push = true;
  1346. }
  1347. } else if (!arguments[2]) {
  1348. push = true;
  1349. }
  1350. }
  1351. if (arguments[3]) push = true;
  1352. if (push || !CTS.ChatDisplay) {
  1353. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  1354. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1355. clearTimeout(CTS.NotificationTimeOut[0]);
  1356. CTS.NotificationTimeOut.shift();
  1357. }
  1358. VideoListElement.querySelector(".PMOverlay").insertAdjacentHTML("beforeend", "<div class=\"PMPopup\"><h2><div class=\"PMTime\">" + Time() + "</div><div class=\"PMName\">" + ((arguments[3]) ? "YouTube Bot" : (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>");
  1359. CTS.NotificationTimeOut.push(setTimeout(function() {
  1360. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  1361. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1362. CTS.NotificationTimeOut.shift();
  1363. }
  1364. }, 11100));
  1365. }
  1366. }
  1367. }
  1368. function AutoAdvice() {
  1369. if (CTS.Advice.toggle) {
  1370. CTS.Advice.timer = setInterval(Advice, 300000);
  1371. } else {
  1372. clearInterval(CTS.Advice.timer);
  1373. }
  1374. }
  1375.  
  1376. function Reminder() {
  1377. var temp,
  1378. i,
  1379. len = CTS.ReminderServerInList.length;
  1380. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  1381. CTS.ReminderServerInList = [];
  1382. if (CTS.Reminder === true) {
  1383. len = CTS.ReminderList.length;
  1384. for (i = 0; i < len; i++) {
  1385. temp = TimeToDate(CTS.ReminderList[i][0]);
  1386. CTS.RecentTime = new Date();
  1387. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  1388. var OffsetTime = temp - CTS.RecentTime;
  1389. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, arguments[0], CTS.ReminderList[i][1], i));
  1390. }
  1391. }
  1392. }
  1393.  
  1394. function AddReminder() {
  1395. Send("msg", "🕬 " + arguments[1]);
  1396. setTimeout(Reminder, 5000, arguments[0]);
  1397. }
  1398.  
  1399. function NotificationDisplay() {
  1400. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.Notification) ? "block" : "none") + ";";
  1401. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.Notification) ? "block" : "none") + ";";
  1402. if (CTS.Notification) {
  1403. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  1404. passive: true
  1405. });
  1406. } else {
  1407. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
  1408. passive: true
  1409. });
  1410. }
  1411. }
  1412.  
  1413. function NotificationResize() {
  1414. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  1415. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  1416. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  1417. ChatLogElement.querySelector("#chat").style.height = "0%";
  1418. ChatLogElement.querySelector("#input").style.display = "none";
  1419. } else {
  1420. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  1421. ChatLogElement.querySelector("#chat").style.height = "100%";
  1422. ChatLogElement.querySelector("#input").style.display = "block";
  1423. }
  1424. }
  1425.  
  1426. function Dice() {
  1427. return String.fromCharCode("0x268" + Rand(0, 5));
  1428. }
  1429.  
  1430. function Rand() {
  1431. arguments[0] = Math.ceil(arguments[0]);
  1432. arguments[1] = Math.floor(arguments[1]);
  1433. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  1434. }
  1435.  
  1436. function OpenMicrophone() {
  1437. MicrophoneElement.initMouseEvent("mousedown");
  1438. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  1439. }
  1440.  
  1441. function Cameras() {
  1442. var Camera = VideoListElement.querySelectorAll(".videos-items:first-child>.js-video");
  1443. for (var featured = 1; featured < Camera.length; featured++) {
  1444. if (!Camera[featured].querySelector("tc-video-item").shadowRoot.querySelector(".video #fixed")) {
  1445. Camera[featured].querySelector("tc-video-item").shadowRoot.querySelector(".video").insertAdjacentHTML("afterbegin", "<style id=\"fixed\">.video.large{position: absolute;left:20%;top: 0;z-index: 2;width: 60%;}.video{padding:0;}.video>div>.overlay{box-shadow:unset!important;}.video:after{content:unset;}</style>");
  1446. }
  1447. }
  1448. Camera = VideoListElement.querySelectorAll(".videos-items:last-child>.js-video");
  1449. for (var normal = 0; normal < Camera.length; normal++) {
  1450. if (!Camera[normal].querySelector("tc-video-item").shadowRoot.querySelector(".video #fixed")) {
  1451. Camera[normal].querySelector("tc-video-item").shadowRoot.querySelector(".video").insertAdjacentHTML("afterbegin", "<style id=\"fixed\">.video.large{position: absolute;left:20%;top: 0;z-index: 2;width: 60%;}.video{padding:0;}.video>div>.overlay{box-shadow:unset!important;}.video:after{content:unset;}</style>");
  1452. }
  1453. }
  1454. Resize();
  1455. }
  1456.  
  1457. function Resize() {
  1458. window.dispatchEvent(new Event("resize"));
  1459. }
  1460.  
  1461. function PerformanceModeInit() {
  1462. var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
  1463. ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
  1464. ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
  1465. ChatLogElement.querySelector("#chat-wrapper").style.width = value;
  1466. TitleElement.querySelector("#room-header").style.minWidth = value;
  1467. TitleElement.querySelector("#room-header").style.maxWidth = value;
  1468. TitleElement.querySelector("#room-header").style.width = value;
  1469. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  1470. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  1471. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
  1472. VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1473. VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1474. VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1475. SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
  1476. SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
  1477. SideMenuElement.querySelector("#sidemenu").style.width = value;
  1478. document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
  1479. VideoListElement.querySelector("#videos").style.display = ((!arguments[0]) ? "block!important" : "none!important");
  1480. UpdateScroll(1, true);
  1481. Resize();
  1482. }
  1483.  
  1484. function OwnerCommand() {
  1485. if (CTS.UserList[arguments[0]].owner) {
  1486. if(!CTS.Me.owner) {
  1487. //PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
  1488. if (arguments[1].match(/^!raid\s/i)) {
  1489. var raid = arguments[1].match(/^(?:\!raid\s)(https?:\/\/tinychat.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?(?:[a-z0-9_]){1,32})/i);
  1490. if (raid !== undefined) window.location.replace(raid[1]);
  1491. }
  1492. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + CTS.Project.Version, CTS.UserList[arguments[0]].handle);
  1493. } else {
  1494. if (arguments[1].match(/^!closeall$/i)) {
  1495. for (var a = 0; a < CTS.Camera.List.length; a++) {
  1496. if (CTS.Me.handle !== CTS.Camera.List[a]) {
  1497. Send("stream_moder_close", CTS.Camera.List[a]);
  1498. }
  1499. }
  1500. }
  1501. if (arguments[1].match(/^!kickall$/i)) {
  1502. for (var b = 0; b < CTS.UserList.length; b++) {
  1503. if (CTS.Me.handle !== CTS.UserList[b].handle) {
  1504. Send("kick", CTS.UserList[b].handle);
  1505. }
  1506. }
  1507. }
  1508. }
  1509. }
  1510. }
  1511.  
  1512. function Command() {
  1513. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?:\s?)(.*)/i);
  1514. if (UserCommand) {
  1515. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  1516. debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
  1517. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  1518. }
  1519. }
  1520. }
  1521. // Alert Functions
  1522. function Settings() {
  1523. Alert(GetActiveChat(), ((arguments[0] !== undefined) ? arguments[0] : "") + "<center>CTS BOT CONFIGURATION:\nBot Mode: " + ((CTS.Bot) ? "ON" : "OFF") + "\nOperator Mode: " + ((CTS.UserYT) ? "ON" : "OFF") + "\nAdvice Mode: " + ((CTS.Advice.toggle) ? "ON" : "OFF") + "\nReminder Mode: " + ((CTS.Reminder) ? "ON" : "OFF") + "\nGame View: " + ((CTS.CanSeeGames) ? "ON" : "OFF") + "\nGame Host: " + ((CTS.CanHostGames) ? "ON" : "OFF") + "\n\nAvatar Display: " + ((CTS.Avatar) ? "SHOW" : "HIDE") + "\nNotification Display: " + ((CTS.Notification) ? "SHOW" : "HIDE") + "\nPopup Display: " + ((CTS.Popups) ? "SHOW" : "HIDE") + "\nFont Size: " + CTS.FontSize + "PX\n\nFOR LIST OF COMMANDS:\n!CTS</center>");
  1524. }
  1525.  
  1526. function Alert() {
  1527. CTS.Message[arguments[0]].push({
  1528. "time": Time(),
  1529. "namecolor": "#3f69c0",
  1530. "avatar": "https://i.imgur.com/S09irS7.png",
  1531. "username": "",
  1532. "nick": ("CTS Version: " + CTS.Project.Version),
  1533. "msg": arguments[1]
  1534. });
  1535. var len = CTS.Message[arguments[0]].length - 1;
  1536. arguments[1] = CTS.Message[arguments[0]][len];
  1537. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[0]);
  1538. }
  1539.  
  1540. function AddUserNotification() {
  1541. if (CTS.ScriptInit) {
  1542. var chat = ChatLogElement.querySelector("#notification-content"),
  1543. Notification;
  1544. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  1545. if (arguments[0] == 1) {
  1546. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  1547. } else if (arguments[0] == 2) {
  1548. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left");
  1549. } else if (arguments[0] == 3) {
  1550. Notification = arguments[2] + "has mentioned you!";
  1551. ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span style=\"background:" + arguments[1] + "\" class=\"nickname\">" + arguments[2] + "</span><span class=\"time\"> " + Time() + " </span><br/> has mentioned you.</div></div>");
  1552. UpdateScroll(2, true);
  1553. } else if (arguments[0] == 4) {
  1554. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  1555. }
  1556. if (arguments[0] != 3) ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span class=\"nickname\" style=\"background:" + arguments[1] + ";\">" + arguments[2] + "</span><span class=\"time\"> " + Time() + " </span><br/>" + Notification + "</div></div>");
  1557. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(arguments[2].toUpperCase()) || CTS.TTSList.includes(arguments[3]) || CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[2] + ((arguments[0] == 4) ? " " : "as ") + Notification);
  1558. UpdateScroll(2, false);
  1559. var Notifications = ChatLogElement.querySelectorAll(".notification");
  1560. if (Notifications.length > CTS.NotificationLimit + 10) {
  1561. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  1562. }
  1563. }
  1564. }
  1565.  
  1566. function AddSystemNotification() {
  1567. if (CTS.ScriptInit) {
  1568. ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><span class=\"nickname\"style=\"background:#F00\">SYSTEM</span><span class=\"time\"> " + Time() + " </span><br/>" + arguments[0] + "</div>");
  1569. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  1570. UpdateScroll(2, false);
  1571. }
  1572. }
  1573. // User Functions
  1574. function AddUser() {
  1575. CTS.UserList.push({
  1576. "handle": arguments[0],
  1577. "username": arguments[5],
  1578. "nick": arguments[4],
  1579. "owner": arguments[7],
  1580. "mod": arguments[1],
  1581. "namecolor": arguments[2],
  1582. "avatar": arguments[3],
  1583. "canGame": arguments[6],
  1584. "broadcasting": false,
  1585. "vote": 0,
  1586. });
  1587. console.log(arguments[5]+ " as handle: "+ arguments[0]);
  1588. if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  1589. }
  1590.  
  1591. function User() {
  1592. for (var user = 0; user < CTS.UserList.length; user++) {
  1593. if (CTS.UserList[user].handle == arguments[0]) return user;
  1594. }
  1595. return -1;
  1596. }
  1597.  
  1598. function UsernameToHandle() {
  1599. for (var user = 0; user < CTS.UserList.length; user++) {
  1600. if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  1601. }
  1602. return -1;
  1603. }
  1604.  
  1605. function UsernameToUser() {
  1606. for (var user = 0; user < CTS.UserList.length; user++) {
  1607. if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  1608. }
  1609. return -1;
  1610. }
  1611.  
  1612. function CheckUserListSafe() {
  1613. var len = CTS.UserList.length;
  1614. for (var user = 0; user < len; user++) {
  1615. if (!CTS.SafeList.includes(CTS.UserList[user].username)) {
  1616. CTS.KBQueue.push(CTS.UserList[user].handle);
  1617. }
  1618. }
  1619. len = CTS.KBQueue.length;
  1620. for (var kb = 0; kb < len; kb++) {
  1621. Send(arguments[0], CTS.KBQueue[kb]);
  1622. }
  1623. CTS.KBQueue = [];
  1624. }
  1625.  
  1626. function CheckUserTempIgnore() {
  1627. if (CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1628. return false;
  1629. }
  1630.  
  1631. function CheckUserIgnore() {
  1632. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.IgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1633. return false;
  1634. }
  1635.  
  1636. function CheckUserAbuse() {
  1637. if (CTS.Me.mod) {
  1638. if ((CTS.KickList.includes(arguments[1]) || CTS.KickList.includes(arguments[2]))) {
  1639. CTS.NoGreet = true;
  1640. Send("kick", arguments[0]);
  1641. }
  1642. if ((CTS.BanList.includes(arguments[1]) || CTS.BanList.includes(arguments[2]))) {
  1643. CTS.NoGreet = true;
  1644. Send("ban", arguments[0]);
  1645. }
  1646. }
  1647. }
  1648.  
  1649. function CheckUserKeywordAbuse() {
  1650. if (arguments[0] != CTS.Me.handle) {
  1651. var len = CTS.KickKeywordList.length;
  1652. for (var i = 0; i < len; i++) {
  1653. if (arguments[1].includes(CTS.KickKeywordList[i])) Send("kick", arguments[0]);
  1654. }
  1655. len = CTS.BanKeywordList.length;
  1656. for (i = 0; i < len; i++) {
  1657. if (arguments[1].includes(CTS.BanKeywordList[i])) Send("ban", arguments[0]);
  1658. }
  1659. }
  1660. }
  1661.  
  1662. function RemoveUserCamera(handle) {
  1663. var len = CTS.Camera.List.length;
  1664. if (len > 0) {
  1665. for (var i = 0; i < len; i++) {
  1666. if (CTS.Camera.List[i] === handle) {
  1667. CTS.Camera.List.splice(i, 1);
  1668. clearTimeout(CTS.Camera.clearRandom);
  1669. break;
  1670. }
  1671. }
  1672. }
  1673. }
  1674.  
  1675. function CheckUserStream() {
  1676. var user = User(arguments[0]);
  1677. if (user != -1) {
  1678. if (arguments[1]) {
  1679. CTS.Camera.List.push(CTS.UserList[user].handle);
  1680. CTS.UserList[user].broadcasting = true;
  1681. var len = CTS.Camera.List.length;
  1682. clearTimeout(CTS.Camera.clearRandom);
  1683. if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
  1684. CTS.Camera.clearRandom = setTimeout(function() {
  1685. var rand = Rand(0, len - 1);
  1686. if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
  1687. var target = User(CTS.Camera.List[rand]);
  1688. if (CTS.Me.owner || !CTS.UserList[target].mod) {
  1689. Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
  1690. Send("stream_moder_close", CTS.Camera.List[rand]);
  1691. CTS.Camera.List.splice(rand, 1);
  1692. }
  1693. }
  1694. }, CTS.Camera.SweepTimer * 60000);
  1695. }
  1696. } else {
  1697. clearTimeout(CTS.Camera.clearRandom);
  1698. RemoveUserCamera(CTS.UserList[user].handle);
  1699. CTS.UserList[user].broadcasting = false;
  1700. }
  1701. CTS.UserList[user].broadcasting = arguments[1];
  1702. if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  1703. }
  1704. }
  1705.  
  1706. function CheckUserName() {
  1707. return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
  1708. }
  1709.  
  1710. function CheckUserNameStrict() {
  1711. return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
  1712. }
  1713. // Load/Save Function
  1714. function Load() {
  1715. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  1716. if (null === val && "undefined" != typeof arguments[1]) {
  1717. Save(arguments[0], arguments[1]);
  1718. return arguments[1];
  1719. }
  1720. return val;
  1721. }
  1722.  
  1723. function Save() {
  1724. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  1725. }
  1726. // Socket functions
  1727. function CTSWebSocket() {
  1728. if (window.Proxy === undefined) return;
  1729. var handler = {
  1730. set: function(Target, prop, value) {
  1731. if (prop == "onmessage") {
  1732. var oldMessage = value;
  1733. value = function(event) {
  1734. var parse = JSON.parse(event.data);
  1735. ServerMsg(parse, Target);
  1736. oldMessage(event);
  1737. };
  1738. }
  1739. return (Target[prop] = value);
  1740. },
  1741. get: function(Target, prop) {
  1742. var value = Target[prop];
  1743. if (prop == "send") {
  1744. value = function(event) {
  1745. var parse = JSON.parse(event);
  1746. ClientMsg(parse, Target);
  1747. Target.send(event);
  1748. };
  1749. }
  1750. return value;
  1751. }
  1752. };
  1753. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  1754. construct: function(Target, args) {
  1755. CTS.SocketTarget = new Target(args[0]);
  1756. debug("SOCKET::CONNECTING", args[0]);
  1757. return new window.Proxy(CTS.SocketTarget, handler);
  1758. }
  1759. });
  1760. window.WebSocket = WebSocketProxy;
  1761. }
  1762.  
  1763. function ModCommand() {
  1764. var name = arguments[1].match(/\!(?:kick|ban|close)\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
  1765. if (name !== null) {
  1766. var target = UsernameToUser(name[1].toUpperCase());
  1767. if (target != -1) { // USER ONLINE
  1768. if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
  1769. //IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
  1770. if (arguments[0] === "stream_moder_close") {
  1771. if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
  1772. } else {
  1773. Send(arguments[0], CTS.UserList[target].handle);
  1774. }
  1775. } else {
  1776. Send("msg", "This users authorization is similar or above yours!");
  1777. }
  1778. }
  1779. }
  1780. }
  1781.  
  1782. function BotCommand() {
  1783. var len = CTS.YouTube.MessageQueueList.length;
  1784. if (len <= 0) {
  1785. // Moderator Control
  1786. if (CTS.UserList[arguments[1]].mod) {
  1787. if (arguments[0] == 2) {
  1788. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1789. CTS.YouTube.Clear = true;
  1790. YouTubePlayList();
  1791. }
  1792. }
  1793. if (arguments[0] == 5) SetBot(true);
  1794. }
  1795. // User and Moderator Control
  1796. if ((CTS.UserYT && (CTS.BotOPList.includes(CTS.UserList[arguments[1]].username) || CTS.BotOPList.includes("-ALL"))) || CTS.UserList[arguments[1]].mod) {
  1797. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  1798. if (arguments[0] == 4) YouTubePlayList(true);
  1799. if (arguments[0] == 6) {
  1800. if (CTS.UserList[arguments[1]].mod) {
  1801. var videoid = arguments[2].match(/http(?:s)?(?:\:\/\/)(?:w{1,3}\.)?(?:youtu(?:\.be|be.com))(?:\/v\/|\/)?(?:watch\?|embed\/|user\/|v\/|\/)(?:v\=)?([a-z0-9\-\_]{1,11})/i);
  1802. if (videoid !== null) {
  1803. CTS.SocketTarget.send(JSON.stringify({
  1804. "tc": "yut_play",
  1805. "item": {
  1806. "id": videoid[1],
  1807. "duration": 7200,
  1808. "offset": 0,
  1809. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1810. }
  1811. }));
  1812. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1813. }
  1814. } else {
  1815. Send("msg", "Ask a moderator to play your request.");
  1816. }
  1817. }
  1818. if (arguments[0] == 3) {
  1819. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1820. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  1821. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  1822. }
  1823. }
  1824. }
  1825. } else {
  1826. if (CTS.YouTube.ListBuilt === false) {
  1827. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  1828. } else {
  1829. Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  1830. }
  1831. }
  1832. }
  1833.  
  1834. function ServerMsg() {
  1835. if (typeof ServerInList[arguments[0].tc] == "function") {
  1836. debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  1837. ServerInList[arguments[0].tc](arguments[0]);
  1838. }
  1839. }
  1840.  
  1841. function ClientMsg() {
  1842. if (typeof ServerOutList[arguments[0].tc] == "function") {
  1843. debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  1844. ServerOutList[arguments[0].tc](arguments[0]);
  1845. }
  1846. }
  1847.  
  1848. function Send() {
  1849. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  1850. if (arguments[1] === undefined) arguments[1] = "Open Request";
  1851. debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  1852. }
  1853. // Game Functions
  1854. // Fishing Boat
  1855. function FishUpgradeStatus(playerExist, type) {
  1856. var msg = "[FISHING BOAT]\n";
  1857. if (type != 7) msg += playerExist.Nickname + ":\n";
  1858. if (type == 0 || type == 1) msg += "[NET]Lv. " + playerExist.Upgrades.Net + "\n" + ((playerExist.Upgrades.Net >= 10) ? "[MAXED]" : "[$" + Fish.pricelist(playerExist, 0) + " to UPGRADE]\n\n");
  1859. if (type == 0 || type == 2) msg += "[RADAR]Lv. " + playerExist.Upgrades.Radar + "\n" + ((playerExist.Upgrades.Radar >= 20) ? "[MAXED]" : "[$" + Fish.pricelist(playerExist, 1) + " to UPGRADE]") + "\n\n";
  1860. if (type == 0 || type == 3) msg += "[INSURANCE]\n" + ((playerExist.Upgrades.Insurance) ? "[OWNED]" : "[$" + Fish.pricelist(playerExist, 3) + " per ROUND]") + "\n\n";
  1861. if (type == 0 || type == 4) msg += "[SHOP]Lv. " + playerExist.Upgrades.Store + "\n" + ((playerExist.Upgrades.Store >= 6) ? "[MAXED]" : "[$" + Fish.pricelist(playerExist, 2) + " to UPGRADE]") + "\n\n";
  1862. if (type == 6) msg += "HELP:\n!fish\n!fishbank\n!fishsplit user|nick\n!fishgamble\n[$" + Fish.pricelist(playerExist, 6) + "]\n!fishrob user|nick\n[$" + Fish.pricelist(playerExist, 4) + "]\n!fishslap user|nick\n[$" + Fish.pricelist(playerExist, 5) + "]\n!fishupgrade\n!fishupgrade\n[Net|Radar|Insurance|Shop]\n\n";
  1863. Send("msg", msg);
  1864. }
  1865.  
  1866. function FishTimerCheck(playerExist) {
  1867. if (new Date() - playerExist.LastCheck >= 5000) {
  1868. playerExist.LastCheck = new Date();
  1869. return true;
  1870. }
  1871. return false;
  1872. }
  1873.  
  1874. function FishCommandCheck() {
  1875. var command,
  1876. playerExist = Fish.getPlayer(CTS.UserList[arguments[0]].handle, false, true),
  1877. FishCommand = arguments[1].match(/^\!(fish(?:rob|slap|split|help|upgrade)?)\s?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
  1878.  
  1879. if (FishCommand) {
  1880. if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
  1881. if (FishCommand[2] !== undefined) {
  1882. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  1883. }
  1884. } else {
  1885. command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
  1886. if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  1887. }
  1888. }
  1889. }
  1890.  
  1891. function FishTransfer(playerExist, target, cost, deduct, rob) {
  1892. if (target !== undefined && target !== -1) {
  1893. if (playerExist.Points > cost) {
  1894. if (rob) {
  1895. playerExist.Points -= cost;
  1896. if (target.Points <= deduct) {
  1897. deduct = target.Points;
  1898. target.Points -= deduct;
  1899. playerExist.Points += deduct;
  1900. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " destroyed " + target.Nickname + "\nMoney made $" + deduct + "!");
  1901. Fish.getPlayer(target.Handle, true);
  1902. } else {
  1903. target.Points -= deduct;
  1904. playerExist.Points += deduct;
  1905. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " robbed " + target.Nickname + " for $" + deduct + "!");
  1906. }
  1907. } else {
  1908. playerExist.Points = deduct;
  1909. target.Points += deduct;
  1910. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " split their money with " + target.Nickname + "!");
  1911. }
  1912. } else {
  1913. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " are you kidding me?\nTalk to me when you have money!");
  1914. }
  1915. }
  1916. }
  1917.  
  1918. function FishTransaction(playerExist, cost, status) {
  1919. if (playerExist.Points > cost) {
  1920. playerExist.Points -= cost;
  1921. return true;
  1922. } else {
  1923. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + ", are you kidding me?\nTalk to me when you have money!");
  1924. return false;
  1925. }
  1926. }
  1927. // Server / Client List Functions
  1928. var UnicodeConversionList = {
  1929. convert: function() {
  1930. return this.numerical(arguments[0]).replace(/[A-Za-z]/g, this.alphabet);
  1931. },
  1932. alphabet: function() {
  1933. return String.fromCodePoint(arguments[0].codePointAt(0) + ((/[A-Z]/.test(arguments[0])) ? "𝗔".codePointAt(0) - "A".codePointAt(0) : "𝗮".codePointAt(0) - "a".codePointAt(0)));
  1934. },
  1935. numerical: function() {
  1936. return arguments[0].replace(/\d/g, function(c) {
  1937. return String.fromCodePoint(0x1D79E + c.charCodeAt(0));
  1938. });
  1939. }
  1940. };
  1941.  
  1942. var CommandList = {
  1943. cts: function() {
  1944. Alert(GetActiveChat(), "<b style=\"color:#ee3636;\">Owner Commands:</b>\n!raid <b style=\"color:#ffff00;\">tc link</b>\n!closeall\n!kickall\n!version\n\n<b style=\"color:#ee3636;\">Moderator Commands:</b>\n!whoisbot\n!bot\n!bottoggle\n!camsweep\n!advicetoggle\n!votetoggle\n!autokick (be careful!)\n!autoban (be careful!)\n\n!ytbypass <b style=\"color:#ffff00;\">link (no playlists)</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytclear\n\n!banlist\n!banlistclear\n!banadd <b style=\"color:#ffff00;\">user | nick</b>\n!banremove <b style=\"color:#ffff00;\">#</b>\n\n!bankeywordlist\n!bankeywordlistclear\n!bankeywordadd <b style=\"color:#ffff00;\">keyword</b>\n!bankeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!kicklist\n!kicklistclear\n!kickadd <b style=\"color:#ffff00;\">user | nick</b>\n!kickremove <b style=\"color:#ffff00;\">#</b>\n\n!kickkeywordlist\n!kickkeywordlistclear\n!kickkeywordadd <b style=\"color:#ffff00;\">keyword</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<b style=\"color:#ee3636;\">Jr. Moderator Commands:</b>\n!ban <b style=\"color:#ffff00;\">user | nick</b>\n!kick <b style=\"color:#ffff00;\">user | nick</b>\n!close <b style=\"color:#ffff00;\">user | nick</b>\n\n<b style=\"color:#ee3636;\">User Commands:</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytskip\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 | nick</b>\n!ignoreremove <b style=\"color:#ffff00;\">#</b>\n\n!greetlist\n!greetlistclear\n!greetadd <b style=\"color:#ffff00;\">user | nick | -all</b>\n!greetremove <b style=\"color:#ffff00;\">#</b>\n\n!ttslist\n!ttslistclear\n!ttsadd <b style=\"color:#ffff00;\">user | nick | -all | -event</b>\n!ttsremove <b style=\"color:#ffff00;\">#</b>\n\n!highlightlist\n!highlightlistclear\n!highlightadd <b style=\"color:#ffff00;\">user | nick</b>\n!highlightremove <b style=\"color:#ffff00;\">#</b>\n\n!reminderlist\n!reminderlistclear\n!reminderadd <b style=\"color:#ffff00;\">user | nick</b>\n!reminderremove <b style=\"color:#ffff00;\">#</b>\n!remindertoggle\n\n!safelist\n!safelistclear\n!safelistadd <b style=\"color:#ffff00;\">user</b>\n!safelistremove <b style=\"color:#ffff00;\">#</b>\n\n!lists\n!listsclear\n\n!greetmode\n!imgurtoggle\n!avatartoggle\n!notificationtoggle\n!popuptoggle\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 | nick</b>\n\n!clr\n!settings\n!share\n\n<b style=\"color:#ee3636;\">Game Commands:</b>\n!gamehost\n!gameview\n!fish");
  1945. },
  1946. help: function() {
  1947. this.cts();
  1948. },
  1949. mentionadd: function() {
  1950. if (arguments[0] === "") {
  1951. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1952. } else {
  1953. if (CheckUserName(arguments[0])) {
  1954. CTS.MentionList.push(arguments[0].toUpperCase());
  1955. Save("MentionList", JSON.stringify(CTS.MentionList));
  1956. Alert(GetActiveChat(), "🗹Command Accepted!");
  1957. } else {
  1958. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  1959. }
  1960. }
  1961. },
  1962. mentionremove: function() {
  1963. if (arguments[0] === "" || isNaN(arguments[0])) {
  1964. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1965. } else {
  1966. if (CTS.MentionList[arguments[0]] !== undefined) {
  1967. CTS.MentionList.splice(arguments[0], 1);
  1968. Save("MentionList", JSON.stringify(CTS.MentionList));
  1969. Alert(GetActiveChat(), "🗹Command Accepted!");
  1970. } else {
  1971. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1972. }
  1973. }
  1974. },
  1975. mentionlistclear: function() {
  1976. CTS.MentionList = [];
  1977. Save("MentionList", JSON.stringify(CTS.MentionList));
  1978. Alert(GetActiveChat(), "🗹Command Accepted!");
  1979. },
  1980. mentionlist: function() {
  1981. Alert(GetActiveChat(), SettingsList.MentionList());
  1982. },
  1983. ignoreadd: function() {
  1984. if (arguments[0] === "") {
  1985. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1986. } else {
  1987. if (CheckUserName(arguments[0])) {
  1988. CTS.IgnoreList.push(arguments[0].toUpperCase());
  1989. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1990. Alert(GetActiveChat(), "🗹Command Accepted!");
  1991. } else {
  1992. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  1993. }
  1994. }
  1995. },
  1996. ignoreremove: function() {
  1997. if (arguments[0] === "" || isNaN(arguments[0])) {
  1998. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1999. } else {
  2000. if (CTS.IgnoreList[arguments[0]] !== undefined) {
  2001. CTS.IgnoreList.splice(arguments[0], 1);
  2002. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2003. Alert(GetActiveChat(), "🗹Command Accepted!");
  2004. } else {
  2005. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2006. }
  2007. }
  2008. },
  2009. ignorelistclear: function() {
  2010. CTS.IgnoreList = [];
  2011. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2012. Alert(GetActiveChat(), "🗹Command Accepted!");
  2013. },
  2014. ignorelist: function() {
  2015. Alert(GetActiveChat(), SettingsList.IgnoreList());
  2016. },
  2017. banadd: function() {
  2018. if (arguments[0] === "") {
  2019. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2020. } else {
  2021. if (CheckUserName(arguments[0])) {
  2022. CTS.BanList.push(arguments[0].toUpperCase());
  2023. Save("BanList", JSON.stringify(CTS.BanList));
  2024. Alert(GetActiveChat(), "🗹Command Accepted!");
  2025. var check = UsernameToHandle(arguments[0].toUpperCase());
  2026. if (check != -1 && CTS.Me.mod) Send("ban", check);
  2027. } else {
  2028. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2029. }
  2030. }
  2031. },
  2032. banremove: function() {
  2033. if (arguments[0] === "" || isNaN(arguments[0])) {
  2034. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2035. } else {
  2036. if (CTS.BanList[arguments[0]] !== undefined) {
  2037. CTS.BanList.splice(arguments[0], 1);
  2038. Save("BanList", JSON.stringify(CTS.BanList));
  2039. Alert(GetActiveChat(), "🗹Command Accepted!");
  2040. } else {
  2041. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2042. }
  2043. }
  2044. },
  2045. banlistclear: function() {
  2046. CTS.BanList = [];
  2047. Save("BanList", JSON.stringify(CTS.BanList));
  2048. Alert(GetActiveChat(), "🗹Command Accepted!");
  2049. },
  2050. banlist: function() {
  2051. Alert(GetActiveChat(), SettingsList.BanList());
  2052. },
  2053. kickadd: function() {
  2054. if (arguments[0] === "") {
  2055. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2056. } else {
  2057. if (CheckUserName(arguments[0])) {
  2058. CTS.KickList.push(arguments[0].toUpperCase());
  2059. Save("KickList", JSON.stringify(CTS.KickList));
  2060. Alert(GetActiveChat(), "🗹Command Accepted!");
  2061. var check = UsernameToHandle(arguments[0].toUpperCase());
  2062. if (check != -1 && CTS.Me.mod) Send("kick", check);
  2063. } else {
  2064. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2065. }
  2066. }
  2067. },
  2068. kickremove: function() {
  2069. if (arguments[0] === "" || isNaN(arguments[0])) {
  2070. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2071. } else {
  2072. if (CTS.KickList[arguments[0]] !== undefined) {
  2073. CTS.KickList.splice(arguments[0], 1);
  2074. Save("KickList", JSON.stringify(CTS.KickList));
  2075. Alert(GetActiveChat(), "🗹Command Accepted!");
  2076. } else {
  2077. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2078. }
  2079. }
  2080. },
  2081. kicklistclear: function() {
  2082. CTS.KickList = [];
  2083. Save("KickList", JSON.stringify(CTS.KickList));
  2084. Alert(GetActiveChat(), "🗹Command Accepted!");
  2085. },
  2086. kicklist: function() {
  2087. Alert(GetActiveChat(), SettingsList.KickList());
  2088. },
  2089. bankeywordadd: function() {
  2090. if (arguments[0] === "") {
  2091. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2092. } else {
  2093. CTS.BanKeywordList.push(arguments[0]);
  2094. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2095. Alert(GetActiveChat(), "🗹Command Accepted!");
  2096. }
  2097. },
  2098. bankeywordremove: function() {
  2099. if (arguments[0] === "" || isNaN(arguments[0])) {
  2100. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2101. } else {
  2102. if (CTS.BanKeywordList[arguments[0]] !== undefined) {
  2103. CTS.BanKeywordList.splice(arguments[0], 1);
  2104. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2105. Alert(GetActiveChat(), "🗹Command Accepted!");
  2106. } else {
  2107. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2108. }
  2109. }
  2110. },
  2111. bankeywordlistclear: function() {
  2112. CTS.BanKeywordList = [];
  2113. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2114. Alert(GetActiveChat(), "🗹Command Accepted!");
  2115. },
  2116. bankeywordlist: function() {
  2117. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  2118. },
  2119. kickkeywordadd: function() {
  2120. if (arguments[0] === "") {
  2121. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2122. } else {
  2123. CTS.KickKeywordList.push(arguments[0]);
  2124. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2125. Alert(GetActiveChat(), "🗹Command Accepted!");
  2126. }
  2127. },
  2128. kickkeywordremove: function() {
  2129. if (arguments[0] === "" || isNaN(arguments[0])) {
  2130. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2131. } else {
  2132. if (CTS.KickKeywordList[arguments[0]] !== undefined) {
  2133. CTS.KickKeywordList.splice(arguments[0], 1);
  2134. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2135. Alert(GetActiveChat(), "🗹Command Accepted!");
  2136. } else {
  2137. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2138. }
  2139. }
  2140. },
  2141. kickkeywordlistclear: function() {
  2142. CTS.KickKeywordList = [];
  2143. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2144. Alert(GetActiveChat(), "🗹Command Accepted!");
  2145. },
  2146. kickkeywordlist: function() {
  2147. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  2148. },
  2149. greetadd: function() {
  2150. if (arguments[0] === "") {
  2151. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2152. } else {
  2153. if (CheckUserName(arguments[0])) {
  2154. CTS.GreetList.push(arguments[0].toUpperCase());
  2155. Save("GreetList", JSON.stringify(CTS.GreetList));
  2156. Alert(GetActiveChat(), "🗹Command Accepted!");
  2157. } else {
  2158. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2159. }
  2160. }
  2161. },
  2162. greetremove: function() {
  2163. if (arguments[0] === "" || isNaN(arguments[0])) {
  2164. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2165. } else {
  2166. if (CTS.GreetList[arguments[0]] !== undefined) {
  2167. CTS.GreetList.splice(arguments[0], 1);
  2168. Save("GreetList", JSON.stringify(CTS.GreetList));
  2169. Alert(GetActiveChat(), "🗹Command Accepted!");
  2170. } else {
  2171. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2172. }
  2173. }
  2174. },
  2175. greetlistclear: function() {
  2176. CTS.GreetList = [];
  2177. Save("GreetList", JSON.stringify(CTS.GreetList));
  2178. Alert(GetActiveChat(), "🗹Command Accepted!");
  2179. },
  2180. greetlist: function() {
  2181. Alert(GetActiveChat(), SettingsList.GreetList());
  2182. },
  2183. highlightadd: function() {
  2184. if (arguments[0] === "") {
  2185. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2186. } else {
  2187. if (CheckUserName(arguments[0])) {
  2188. CTS.HighlightList.push(arguments[0].toUpperCase());
  2189. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2190. Alert(GetActiveChat(), "🗹Command Accepted!");
  2191. } else {
  2192. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2193. }
  2194. }
  2195. },
  2196. highlightremove: function() {
  2197. if (arguments[0] === "" || isNaN(arguments[0])) {
  2198. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2199. } else {
  2200. if (CTS.HighlightList[arguments[0]] !== undefined) {
  2201. CTS.HighlightList.splice(arguments[0], 1);
  2202. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2203. Alert(GetActiveChat(), "🗹Command Accepted!");
  2204. } else {
  2205. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2206. }
  2207. }
  2208. },
  2209. highlightlistclear: function() {
  2210. CTS.HighlightList = [];
  2211. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2212. Alert(GetActiveChat(), "🗹Command Accepted!");
  2213. },
  2214. highlightlist: function() {
  2215. Alert(GetActiveChat(), SettingsList.HighlightList());
  2216. },
  2217. opadd: function() {
  2218. if (arguments[0] === "") {
  2219. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2220. } else {
  2221. if (CheckUserName(arguments[0])) {
  2222. CTS.BotOPList.push(arguments[0].toUpperCase());
  2223. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2224. Alert(GetActiveChat(), "🗹Command Accepted!");
  2225. } else {
  2226. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2227. }
  2228. }
  2229. },
  2230. opremove: function() {
  2231. if (arguments[0] === "" || isNaN(arguments[0])) {
  2232. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2233. } else {
  2234. if (CTS.BotOPList[arguments[0]] !== undefined) {
  2235. CTS.BotOPList.splice(arguments[0], 1);
  2236. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2237. Alert(GetActiveChat(), "🗹Command Accepted!");
  2238. } else {
  2239. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2240. }
  2241. }
  2242. },
  2243. oplistclear: function() {
  2244. CTS.BotOPList = [];
  2245. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2246. Alert(GetActiveChat(), "🗹Command Accepted!");
  2247. },
  2248. oplist: function() {
  2249. Alert(GetActiveChat(), SettingsList.BotOPList());
  2250. },
  2251. modadd: function() {
  2252. if (arguments[0] === "") {
  2253. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2254. } else {
  2255. if (CheckUserNameStrict(arguments[0])) {
  2256. CTS.BotModList.push(arguments[0].toUpperCase());
  2257. Save("BotModList", JSON.stringify(CTS.BotModList));
  2258. Alert(GetActiveChat(), "🗹Command Accepted!");
  2259. } else {
  2260. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2261. }
  2262. }
  2263. },
  2264. modremove: function() {
  2265. if (arguments[0] === "" || isNaN(arguments[0])) {
  2266. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2267. } else {
  2268. if (CTS.BotModList[arguments[0]] !== undefined) {
  2269. CTS.BotModList.splice(arguments[0], 1);
  2270. Save("BotModList", JSON.stringify(CTS.BotModList));
  2271. Alert(GetActiveChat(), "🗹Command Accepted!");
  2272. } else {
  2273. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2274. }
  2275. }
  2276. },
  2277. modlistclear: function() {
  2278. CTS.BotModList = [];
  2279. Save("BotModList", JSON.stringify(CTS.BotModList));
  2280. Alert(GetActiveChat(), "🗹Command Accepted!");
  2281. },
  2282. modlist: function() {
  2283. Alert(GetActiveChat(), SettingsList.BotModList());
  2284. },
  2285. ttsadd: function() {
  2286. if (arguments[0] === "") {
  2287. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2288. } else {
  2289. if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  2290. CTS.TTSList.push(arguments[0].toUpperCase());
  2291. Save("TTSList", JSON.stringify(CTS.TTSList));
  2292. Alert(GetActiveChat(), "🗹Command Accepted!");
  2293. } else {
  2294. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2295. }
  2296. }
  2297. },
  2298. ttsremove: function() {
  2299. if (arguments[0] === "" || isNaN(arguments[0])) {
  2300. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2301. } else {
  2302. if (CTS.TTSList[arguments[0]] !== undefined) {
  2303. CTS.TTSList.splice(arguments[0], 1);
  2304. Save("TTSList", JSON.stringify(CTS.TTSList));
  2305. Alert(GetActiveChat(), "🗹Command Accepted!");
  2306. } else {
  2307. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2308. }
  2309. }
  2310. },
  2311. ttslistclear: function() {
  2312. CTS.TTSList = [];
  2313. Save("TTSList", JSON.stringify(CTS.TTSList));
  2314. Alert(GetActiveChat(), "🗹Command Accepted!");
  2315. },
  2316. ttslist: function() {
  2317. Alert(GetActiveChat(), SettingsList.TTSList());
  2318. },
  2319. reminderadd: function() {
  2320. if (arguments[0] === "") {
  2321. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2322. } else {
  2323. var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9])\s?(?:[AaPp][Mm]))\s(.*)/);
  2324. if (reminder === null) {
  2325. Alert(GetActiveChat(), "🗷Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  2326. } else {
  2327. CTS.ReminderList.push([reminder[1], reminder[2]]);
  2328. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2329. Alert(GetActiveChat(), "🗹Command Accepted!");
  2330. Reminder();
  2331. }
  2332. }
  2333. },
  2334. reminderremove: function() {
  2335. if (arguments[0] === "" || isNaN(arguments[0])) {
  2336. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2337. } else {
  2338. if (CTS.ReminderList[arguments[0]] !== undefined) {
  2339. CTS.ReminderList.splice(arguments[0], 1);
  2340. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2341. Reminder();
  2342. Alert(GetActiveChat(), "🗹Command Accepted!");
  2343. } else {
  2344. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2345. }
  2346. }
  2347. },
  2348. reminderlistclear: function() {
  2349. CTS.ReminderList = [];
  2350. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2351. Alert(GetActiveChat(), "🗹Command Accepted!");
  2352. },
  2353. reminderlist: function() {
  2354. Alert(GetActiveChat(), SettingsList.ReminderList());
  2355. },
  2356. remindertoggle: function() {
  2357. CTS.Reminder = !CTS.Reminder;
  2358. Save("Reminder", JSON.stringify(CTS.Reminder));
  2359. Reminder();
  2360. Settings();
  2361. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  2362. },
  2363. safelistadd: function() {
  2364. if (arguments[0] === "" || arguments[0].toUpperCase() === "guest") { // Can't protect guests;
  2365. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2366. } else {
  2367. if (CheckUserName(arguments[0])) {
  2368. CTS.SafeList.push(arguments[0].toUpperCase());
  2369. Save("AKB", JSON.stringify(CTS.SafeList));
  2370. Alert(GetActiveChat(), "🗹Command Accepted!\nBE SURE IT'S CORRECT!!!\n!safelist");
  2371. } else {
  2372. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2373. }
  2374. }
  2375. },
  2376. safelistremove: function() {
  2377. if (arguments[0] === "" || isNaN(arguments[0])) {
  2378. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2379. } else {
  2380. if (CTS.SafeList[arguments[0]] !== undefined) {
  2381. CTS.SafeList.splice(arguments[0], 1);
  2382. Save("AKB", JSON.stringify(CTS.SafeList));
  2383. Alert(GetActiveChat(), "🗹Command Accepted!");
  2384. } else {
  2385. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2386. }
  2387. }
  2388. },
  2389. safelistclear: function() {
  2390. CTS.SafeList = [];
  2391. Save("AKB", JSON.stringify(CTS.SafeList));
  2392. Alert(GetActiveChat(), "🗹Command Accepted!");
  2393. },
  2394. safelist: function() {
  2395. Alert(GetActiveChat(), SettingsList.SafeList());
  2396. },
  2397. optoggle: function() {
  2398. CTS.UserYT = !CTS.UserYT;
  2399. Save("UserYT", JSON.stringify(CTS.UserYT));
  2400. Settings();
  2401. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  2402. },
  2403. avatartoggle: function() {
  2404. CTS.Avatar = !CTS.Avatar;
  2405. Save("Avatar", JSON.stringify(CTS.Avatar));
  2406. Settings();
  2407. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  2408. },
  2409. popuptoggle: function() {
  2410. CTS.Popups = !CTS.Popups;
  2411. Save("Popups", JSON.stringify(CTS.Popups));
  2412. Settings();
  2413. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  2414. },
  2415. notificationtoggle: function() {
  2416. CTS.Notification = !CTS.Notification;
  2417. Save("Notification", JSON.stringify(CTS.Notification));
  2418. NotificationDisplay();
  2419. Alert(GetActiveChat(), "🗹Command Accepted!");
  2420. },
  2421. greetmode: function() {
  2422. CTS.GreetMode = !CTS.GreetMode;
  2423. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  2424. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  2425. },
  2426. imgurtoggle: function() {
  2427. CTS.imgur = !CTS.imgur;
  2428. Save("imgur", JSON.stringify(CTS.imgur));
  2429. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  2430. },
  2431. clr: function() {
  2432. CTS.MessageCallback = [];
  2433. CTS.Message = [];
  2434. CTS.Message[0] = [];
  2435. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  2436. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  2437. },
  2438. autokick: function() {
  2439. if (arguments[1] === false && CTS.Me.mod) {
  2440. CTS.AutoKick = !CTS.AutoKick;
  2441. CTS.AutoBan = false;
  2442. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  2443. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  2444. }
  2445. },
  2446. autoban: function() {
  2447. if (arguments[1] === false && CTS.Me.mod) {
  2448. CTS.AutoBan = !CTS.AutoBan;
  2449. CTS.AutoKick = false;
  2450. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  2451. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  2452. }
  2453. },
  2454. camsweep: function() {
  2455. if (CTS.Me.mod && CTS.Host === CTS.Me.handle) {
  2456. CTS.Camera.SweepTimer = arguments[0] === "" || isNaN(arguments[0]) ? 5 : (arguments[0] > 30) ? 30 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  2457. CTS.Camera.Sweep = !CTS.Camera.Sweep;
  2458. clearTimeout(CTS.Camera.clearRandom);
  2459. Settings();
  2460. 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!"));
  2461. }
  2462. },
  2463. bottoggle: function() {
  2464. CTS.Bot = !CTS.Bot;
  2465. Save("Bot", JSON.stringify(CTS.Bot));
  2466. Settings();
  2467. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  2468. },
  2469. advicetoggle: function() {
  2470. CTS.Advice.toggle = !CTS.Advice.toggle;
  2471. AutoAdvice();
  2472. Save("Advice", JSON.stringify(CTS.Advice.toggle));
  2473. Settings();
  2474. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Advice.toggle) ? "You'll now spew facts every ten minutes!" : "You'll stop with all the non-sense!."));
  2475. },
  2476. votetoggle: function() {
  2477. if (CTS.Me.mod) {
  2478. CTS.VoteSystem = !CTS.VoteSystem;
  2479. CTS.WaitToVoteList = [];
  2480. var len = CTS.UserList.length;
  2481. if (len > 0) {
  2482. for (var i = 0; i < len; i++) CTS.UserList[i].vote = 0;
  2483. }
  2484. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.VoteSystem) ? "VOTING IS NOW ON!" : "VOTING IS NOW OFF!"));
  2485. }
  2486. },
  2487. bot: function() {
  2488. if (arguments[1] === false && CTS.Me.mod) Alert(0, "🗹Command Accepted!\nBot bypass was called!");
  2489. },
  2490. share: function() {
  2491. 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/gtz2JE7";
  2492. if (GetActiveChat() !== 0) {
  2493. Send("pvtmsg", msg, GetActiveChat());
  2494. PushPM(GetActiveChat(), msg);
  2495. } else {
  2496. Send("msg", msg);
  2497. }
  2498. },
  2499. gameview: function() {
  2500. CTS.CanSeeGames = !CTS.CanSeeGames;
  2501. Save("CanSeeGames", JSON.stringify(CTS.CanSeeGames));
  2502. Settings();
  2503. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
  2504. },
  2505. gamehost: function() {
  2506. CTS.CanHostGames = !CTS.CanHostGames;
  2507. Save("CanHostGames", JSON.stringify(CTS.CanHostGames));
  2508. Fish.reset(true, true);
  2509. Settings();
  2510. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanHostGames) ? "GAME HOSTING IS NOW ON!" : "GAME HOSTING IS NOW OFF!"));
  2511. },
  2512. version: function() {
  2513. if (!CTS.Me.owner) {
  2514. var msg = "I am using " + CTS.Project.Name + "v" + CTS.Project.Version;
  2515. if (GetActiveChat() !== 0) {
  2516. Send("pvtmsg", msg, GetActiveChat());
  2517. PushPM(GetActiveChat(), msg);
  2518. } else {
  2519. Send("msg", msg);
  2520. }
  2521. }
  2522. },
  2523. roll: function() {
  2524. var dice,
  2525. msg = "";
  2526. dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
  2527. for (var i = 0; i < dice; i++) msg += Dice();
  2528. if (GetActiveChat() !== 0) {
  2529. Send("pvtmsg", msg, GetActiveChat());
  2530. PushPM(GetActiveChat(), msg);
  2531. } else {
  2532. Send("msg", msg);
  2533. }
  2534. },
  2535. coin: function() {
  2536. if (CTS.Host == 0 || GetActiveChat() !== 0) {
  2537. var msg = "The coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!";
  2538. if (GetActiveChat() !== 0) {
  2539. Send("pvtmsg", msg, GetActiveChat());
  2540. } else {
  2541. Send("msg", msg);
  2542. }
  2543. }
  2544. },
  2545. settings: function() {
  2546. Settings();
  2547. },
  2548. lists: function() {
  2549. Alert(GetActiveChat(), SettingsList.BanList() + SettingsList.BanKeywordList() + SettingsList.KickList() + SettingsList.KickKeywordList() + SettingsList.BotOPList() + SettingsList.BotModList() + SettingsList.MentionList() + SettingsList.IgnoreList() + SettingsList.GreetList() + SettingsList.TTSList() + SettingsList.HighlightList() + SettingsList.ReminderList());
  2550. },
  2551. listsclear: function() {
  2552. CTS.MentionList = [];
  2553. CTS.IgnoreList = [];
  2554. CTS.BanList = [];
  2555. CTS.KickList = [];
  2556. CTS.BanKeywordList = [];
  2557. CTS.KickKeywordList = [];
  2558. CTS.GreetList = [];
  2559. CTS.HighlightList = [];
  2560. CTS.ReminderList = [];
  2561. CTS.TTSList = [];
  2562. CTS.BotOPList = [];
  2563. CTS.BotModList = [];
  2564. Save("MentionList", JSON.stringify(CTS.MentionList));
  2565. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2566. Save("BanList", JSON.stringify(CTS.BanList));
  2567. Save("KickList", JSON.stringify(CTS.KickList));
  2568. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2569. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2570. Save("GreetList", JSON.stringify(CTS.GreetList));
  2571. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2572. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2573. Save("TTSList", JSON.stringify(CTS.TTSList));
  2574. Save("BotModList", JSON.stringify(CTS.BotModList));
  2575. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2576. Alert(GetActiveChat(), "🗹Command Accepted!");
  2577. },
  2578. ytqueue: function() {},
  2579. ytclear: function() {},
  2580. ytskip: function() {},
  2581. yt: function() {},
  2582. ytbypass: function() {}
  2583. };
  2584. var SettingsList = {
  2585. BanList: function() {
  2586. var index,
  2587. msg,
  2588. len = CTS.BanList.length;
  2589. msg = "<b style=\"color:#ee3636;\"><u>Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2590. for (index = 0; index < len; index++) msg += index + " : " + CTS.BanList[index] + "\n";
  2591. return msg;
  2592. },
  2593. BanKeywordList: function() {
  2594. var index,
  2595. msg,
  2596. len = CTS.BanKeywordList.length;
  2597. msg = "<b style=\"color:#ee3636;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2598. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  2599. return msg;
  2600. },
  2601. KickList: function() {
  2602. var index,
  2603. msg,
  2604. len = CTS.KickList.length;
  2605. msg = "<b style=\"color:#ee3636;\"><u>Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2606. for (index = 0; index < len; index++) msg += index + " : " + CTS.KickList[index] + "\n";
  2607. return msg;
  2608. },
  2609. KickKeywordList: function() {
  2610. var index,
  2611. msg,
  2612. len = CTS.KickKeywordList.length;
  2613. msg = "<b style=\"color:#ee3636;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2614. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  2615. return msg;
  2616. },
  2617. BotOPList: function() {
  2618. var index,
  2619. msg,
  2620. len = CTS.BotOPList.length;
  2621. msg = "<b style=\"color:#ee3636;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2622. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  2623. return msg;
  2624. },
  2625. BotModList: function() {
  2626. var index,
  2627. msg,
  2628. len = CTS.BotModList.length;
  2629. msg = "<b style=\"color:#ee3636;\"><u>Bot Mod list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2630. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotModList[index] + "\n";
  2631. return msg;
  2632. },
  2633. MentionList: function() {
  2634. var index,
  2635. msg,
  2636. len = CTS.MentionList.length;
  2637. msg = "<b style=\"color:#ee3636;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2638. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  2639. return msg;
  2640. },
  2641. IgnoreList: function() {
  2642. var index,
  2643. msg,
  2644. len = CTS.IgnoreList.length;
  2645. msg = "<b style=\"color:#ee3636;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2646. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  2647. return msg;
  2648. },
  2649. GreetList: function() {
  2650. var index,
  2651. msg,
  2652. len = CTS.GreetList.length;
  2653. msg = "<b style=\"color:#ee3636;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2654. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  2655. return msg;
  2656. },
  2657. TTSList: function() {
  2658. var index,
  2659. msg,
  2660. len = CTS.TTSList.length;
  2661. msg = "<b style=\"color:#ee3636;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2662. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  2663. return msg;
  2664. },
  2665. HighlightList: function() {
  2666. var index,
  2667. msg,
  2668. len = CTS.HighlightList.length;
  2669. msg = "<b style=\"color:#ee3636;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2670. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  2671. return msg;
  2672. },
  2673. ReminderList: function() {
  2674. var index,
  2675. msg,
  2676. len = CTS.ReminderList.length;
  2677. msg = "<b style=\"color:#ee3636;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2678. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  2679. return msg;
  2680. },
  2681. SafeList: function() {
  2682. var index,
  2683. msg,
  2684. len = CTS.SafeList.length;
  2685. msg = "<b style=\"color:#ee3636;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2686. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  2687. return msg;
  2688. }
  2689. };
  2690. var MessageQueueList = {
  2691. add: function() {
  2692. CTS.SendQueue.push(arguments[0]);
  2693. MessageQueueList.run();
  2694. },
  2695. run: function() {
  2696. var SendInterval = setInterval(function() {
  2697. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  2698. var temp = new Date();
  2699. var OffsetTime = temp - CTS.LastMessage;
  2700. if (OffsetTime >= 1500) {
  2701. CTS.LastMessage = new Date();
  2702. CTS.SocketTarget.send(CTS.SendQueue[0]);
  2703. CTS.SendQueue.shift();
  2704. }
  2705. } else {
  2706. clearInterval(SendInterval);
  2707. }
  2708. }, 1600, CTS.LastMessage);
  2709. }
  2710. };
  2711. var ServerSendList = {
  2712. msg: function() {
  2713. var obj = {
  2714. "tc": arguments[0]
  2715. };
  2716. if (arguments[2] !== undefined) {
  2717. obj.handle = arguments[1];
  2718. CTS.SocketTarget.send(JSON.stringify(obj));
  2719. } else {
  2720. if (arguments[1] !== undefined) {
  2721. obj.text = arguments[1];
  2722. MessageQueueList.add(JSON.stringify(obj));
  2723. } else {
  2724. CTS.SocketTarget.send(JSON.stringify(obj));
  2725. }
  2726. }
  2727. },
  2728. pvtmsg: function() {
  2729. var obj = {
  2730. "tc": arguments[0],
  2731. "text": arguments[1],
  2732. "handle": Number(arguments[2])
  2733. };
  2734. MessageQueueList.add(JSON.stringify(obj));
  2735. },
  2736. kick: function() {
  2737. ServerSendList.msg(arguments[0], arguments[1], "kick");
  2738. },
  2739. ban: function() {
  2740. ServerSendList.msg(arguments[0], arguments[1], "ban");
  2741. },
  2742. stream_moder_close: function() {
  2743. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_close");
  2744. },
  2745. yut_playlist_add: function() {
  2746. var obj = {
  2747. "tc": arguments[0],
  2748. "item": {
  2749. "id": arguments[1][0],
  2750. "duration": arguments[1][1],
  2751. "title": arguments[1][2],
  2752. "image": arguments[1][3]
  2753. }
  2754. };
  2755. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  2756. CTS.SocketTarget.send(JSON.stringify(obj));
  2757. },
  2758. yut_playlist_remove: function() {
  2759. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  2760. },
  2761. yut_stop: function() {
  2762. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  2763. },
  2764. yut_play: function() {
  2765. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  2766. },
  2767. yut_playlist: function() {
  2768. ServerSendList.msg("yut_playlist");
  2769. },
  2770. yut_playlist_clear: function() {
  2771. ServerSendList.msg("yut_playlist_clear");
  2772. }
  2773. };
  2774. var ServerInList = {
  2775. joined: function() {
  2776. debug();
  2777. CTS.Me = {
  2778. "handle": arguments[0].self.handle,
  2779. "username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
  2780. "nick": arguments[0].self.nick,
  2781. "owner": arguments[0].self.owner,
  2782. "mod": arguments[0].self.mod,
  2783. "namecolor": NameColor[Rand(0, NameColor.length - 1)],
  2784. "avatar": arguments[0].self.avatar
  2785. };
  2786. CTS.Room = {
  2787. "Avatar": arguments[0].room.avatar,
  2788. "Bio": arguments[0].room.biography,
  2789. "Name": arguments[0].room.name,
  2790. "PTT": arguments[0].room.pushtotalk,
  2791. "Website": arguments[0].room.website,
  2792. "YT_ON": arguments[0].room.youtube_enabled
  2793. };
  2794. CTS.SocketConnected = true;
  2795. var modcall = setInterval(function() {
  2796. if (CTS.ScriptInit === true) {
  2797. if (CTS.Me.mod) {
  2798. if (CTS.Bot) CheckHost();
  2799. if (CTS.Room.YT_ON) {
  2800. VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  2801. //VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
  2802. }
  2803. }
  2804. clearInterval(modcall);
  2805. }
  2806. }, 200);
  2807. Reminder();
  2808. },
  2809. userlist: function() {
  2810. var len = arguments[0].users.length;
  2811. for (var user = 0; user < len; user++) {
  2812. AISB(arguments[0].users[user]);
  2813. CheckUserAbuse(arguments[0].users[user].handle, (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase(), arguments[0].users[user].nick.toUpperCase());
  2814. CTS.UserList.push({
  2815. "handle": arguments[0].users[user].handle,
  2816. "username": (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase(),
  2817. "nick": arguments[0].users[user].nick,
  2818. "owner": arguments[0].users[user].owner,
  2819. "mod": arguments[0].users[user].mod,
  2820. "namecolor": NameColor[Rand(0, NameColor.length - 1)],
  2821. "avatar": arguments[0].users[user].avatar,
  2822. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
  2823. "broadcasting": false,
  2824. "vote": 0,
  2825. });
  2826. }
  2827. RoomUsers();
  2828. },
  2829. join: function() {
  2830. AISB(arguments[0]);
  2831. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  2832. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick.toUpperCase());
  2833. if (CTS.HighlightList.includes(user) || CTS.HighlightList.includes(arguments[0].nick.toUpperCase())) {
  2834. if (CTS.enableSound === true) CTS.Sound.HIGHLIGHT.play();
  2835. }
  2836. if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
  2837. CTS.hasGreetedWC = true;
  2838. CTS.Sound.C.play();
  2839. Send("msg", UnicodeConversionList.convert("HI! " + arguments[0].nick.toUpperCase()) + "!");
  2840. } else if (arguments[0].owner === true && !CTS.hasGreetedOwner) {
  2841. CTS.hasGreetedOwner = true;
  2842. Send("msg", UnicodeConversionList.convert((CTS.Welcomes[Rand(0, CTS.Welcomes.length - 1)] + arguments[0].nick.toUpperCase())) + "!");
  2843. } else {
  2844. if ((CTS.GreetList.includes(user) || CTS.GreetList.includes(arguments[0].nick.toUpperCase()) || (CTS.Me.mod && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  2845. Send("msg", UnicodeConversionList.convert(((CTS.Welcomes[Rand(0, CTS.Welcomes.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!") : "!"))));
  2846. if (CTS.enableSound === true) CTS.Sound.GREET.play();
  2847. }
  2848. }
  2849. CTS.NoGreet = false;
  2850. AddUser(arguments[0].handle, arguments[0].mod, NameColor[Rand(0, NameColor.length - 1)], (arguments[0].avatar === "") ? "https://i.imgur.com/4Q4Lgzf.png" : arguments[0].avatar, arguments[0].nick, user, ((user !== "GUEST") ? true : false), arguments[0].owner);
  2851. RoomUsers();
  2852. },
  2853. sysmsg: function() {
  2854. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  2855. },
  2856. nick: function() {
  2857. var user = User(arguments[0].handle);
  2858. if (user != -1) {
  2859. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  2860. CTS.UserList[user].nick = arguments[0].nick;
  2861. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  2862. }
  2863. },
  2864. stream_connected: function() {
  2865. debug();
  2866. },
  2867. stream_closed: function() {
  2868. debug();
  2869. },
  2870. ping: function() {
  2871. debug();
  2872. if (CTS.ScriptInit) {
  2873. var verify;
  2874. if (CTS.WatchList.length > 0) {
  2875. verify = new Date() - CTS.WatchList[0][2];
  2876. debug("WATCHLIST::LIST", CTS.WatchList);
  2877. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/600000");
  2878. if (verify > 600000) {
  2879. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/600000");
  2880. CTS.SafeList.push(CTS.WatchList[0][0]);
  2881. CTS.WatchList.shift();
  2882. }
  2883. }
  2884. if (CTS.WaitToVoteList.length > 0) {
  2885. verify = new Date() - CTS.WaitToVoteList[0][1];
  2886. debug("VOTE::LIST", CTS.WaitToVoteList);
  2887. debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  2888. if (verify > 300000) {
  2889. debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  2890. CTS.WaitToVoteList.shift();
  2891. }
  2892. }
  2893. }
  2894. },
  2895. quit: function() {
  2896. if (CTS.ScriptInit) {
  2897. if (CTS.WatchList.length > 0) {
  2898. var len = CTS.WatchList.length;
  2899. for (var i = 0; i < len; i++) {
  2900. if (CTS.WatchList[i][1] == arguments[0].handle) {
  2901. CTS.WatchList.splice(i, 1);
  2902. break;
  2903. }
  2904. }
  2905. }
  2906. RemoveUserCamera(arguments[0].handle);
  2907. var user = User(arguments[0].handle);
  2908. if (user != -1) {
  2909. if (CTS.Me.handle === CTS.Host) {
  2910. if (Fish.getPlayer(arguments[0].handle, true, false)) {
  2911. Send("msg", CTS.Game.Fish.UserQuitLast + ", has slipped off the boat; I don't think we should look back.");
  2912. }
  2913. }
  2914. //SEND THEM OUT
  2915. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  2916. CTS.UserList.splice(user, 1);
  2917. }
  2918. RoomUsers();
  2919. if (CTS.Host == arguments[0].handle) {
  2920. CTS.Host = 0;
  2921. CTS.Camera.Sweep = false;
  2922. if (CTS.Me.mod && CTS.Bot) {
  2923. setTimeout(function(handle) {
  2924. if (CTS.Host == 0) SetBot(false);
  2925. }, (Rand(10, 30) * 1000), arguments[0].handle);
  2926. }
  2927. }
  2928. }
  2929. },
  2930. msg: function() {
  2931. if (CTS.ScriptInit) {
  2932. var user = User(arguments[0].handle);
  2933. if (user != -1) {
  2934. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
  2935. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  2936. var text = HTMLtoTXT(arguments[0].text);
  2937. OwnerCommand(user, arguments[0].text);
  2938. BotCheck(user, text, arguments[0]);
  2939. if (CTS.Me.mod) {
  2940. if (CTS.Host == CTS.Me.handle) {
  2941. BotCommandCheck(user, text);
  2942. }
  2943. CheckUserKeywordAbuse(arguments[0].handle, arguments[0].text);
  2944. }
  2945. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  2946. //PUSH MESSAGE
  2947. CTS.Message[0].push({
  2948. "time": Time(),
  2949. "namecolor": CTS.UserList[user].namecolor,
  2950. "avatar": CTS.UserList[user].avatar,
  2951. "username": CTS.UserList[user].username,
  2952. "nick": CTS.UserList[user].nick,
  2953. "msg": CheckImgur(text)
  2954. });
  2955. if (GetActiveChat() === 0) {
  2956. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  2957. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, 0);
  2958. }
  2959. if (CTS.Me.handle !== arguments[0].handle) {
  2960. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  2961. Alert(GetActiveChat(), "🗹AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  2962. CTS.AutoKick = false;
  2963. CTS.AutoBan = false;
  2964. }
  2965. if (CTS.enableSound === true) {
  2966. CTS.Sound.MSG.play();
  2967. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username) || CTS.TTSList.includes(CTS.UserList[user].nick.toUpperCase()) || CTS.TTSList.includes("-ALL"))) TTS(CTS.UserList[user].nick + ((!text.match(/(?:^\!)|(?:https?|www|\uD83C\uDFB5)/gim)) ? " said, " + text : "is box banging!"));
  2968. }
  2969. var len = CTS.MentionList.length;
  2970. for (var i = 0; i < len; i++) {
  2971. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  2972. if (CTS.enableSound === true) {
  2973. CTS.Sound.MENTION.play();
  2974. }
  2975. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  2976. }
  2977. }
  2978. }
  2979. MessagePopUp(user, text, true, false);
  2980. }
  2981. }
  2982. } else {
  2983. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  2984. }
  2985. }
  2986. }
  2987. },
  2988. pvtmsg: function() {
  2989. if (CTS.ScriptInit) {
  2990. if (CTS.enablePMs === true) {
  2991. if (arguments[0].handle != CTS.Me.handle) {
  2992. var user = User(arguments[0].handle);
  2993. if (user != -1) {
  2994. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
  2995. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  2996. var text = arguments[0].text;
  2997. if (CTS.Me.mod) CheckUserKeywordAbuse(arguments[0].handle, arguments[0].text);
  2998. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  2999. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  3000. PushPM(arguments[0].handle, text, user);
  3001. if (CTS.enableSound === true) {
  3002. CTS.Sound.PVTMSG.play();
  3003. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username) || CTS.TTSList.includes(CTS.UserList[user].nick.toUpperCase()) || CTS.TTSList.includes("-ALL"))) TTS(CTS.UserList[user].nick + ((!text.match(/(?:^\!)|(?:https?|www)/gim)) ? " said, " + text : "is box banging!"));
  3004. }
  3005. MessagePopUp(user, CheckImgur(HTMLtoTXT(text)), false, false);
  3006. }
  3007. }
  3008. } else {
  3009. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  3010. }
  3011. }
  3012.  
  3013. }
  3014. }
  3015. }
  3016. },
  3017. yut_playlist_add: function() {
  3018. if (CTS.ScriptInit) {
  3019. if (!CTS.YouTube.Playing) {
  3020. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  3021. if (CTS.Host != CTS.Me.handle) {
  3022. Send("msg", "!play");
  3023. } else {
  3024. YouTubePlayList();
  3025. }
  3026. }
  3027. }
  3028. },
  3029. yut_playlist: function() {
  3030. if (CTS.ScriptInit) {
  3031. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  3032. if (CTS.YouTube.Clear === true) {
  3033. if (arguments[0].items !== null) Send("yut_playlist_clear");
  3034. CTS.YouTube.MessageQueueList = [];
  3035. Send("msg", "🎵YouTube cleared!🎵");
  3036. CTS.YouTube.Clear = false;
  3037. } else {
  3038. if (arguments[0].items === null) {
  3039. CTS.PlayListStart = true;
  3040. } else {
  3041. CTS.YouTube.PlayListCount = arguments[0].items.length;
  3042. CTS.PlayListStart = false;
  3043. if (CTS.YouTube.ShowQueue === true) {
  3044. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  3045. for (var i = 0; i < 3; i++) {
  3046. if (arguments[0].items[i] === undefined) break;
  3047. 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]";
  3048. }
  3049. Send("msg", msg);
  3050. }
  3051. }
  3052. 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);
  3053. }
  3054. CTS.YouTube.ShowQueue = false;
  3055. }
  3056. }
  3057. },
  3058. yut_play: function() {
  3059. if (CTS.ScriptInit) {
  3060. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  3061. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  3062. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  3063. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  3064. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  3065. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  3066. }
  3067. CTS.YouTube.Playing = true;
  3068. YouTubePlayList();
  3069. }
  3070. },
  3071. yut_stop: function() {
  3072. if (CTS.ScriptInit) {
  3073. CTS.YouTube.CurrentTrack.ID = undefined;
  3074. CTS.YouTube.CurrentTrack.duration = undefined;
  3075. CTS.YouTube.CurrentTrack.title = undefined;
  3076. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  3077. CTS.YouTube.Playing = false;
  3078. YouTubePlayList();
  3079. }
  3080. },
  3081. publish: function() {
  3082. CheckUserStream(arguments[0].handle, true);
  3083. },
  3084. unpublish: function() {
  3085. CheckUserStream(arguments[0].handle, false);
  3086. }
  3087. };
  3088. var ServerOutList = {
  3089. pvtmsg: function() {
  3090. if (CTS.ScriptInit) {
  3091. Command(arguments[0].text, true);
  3092. var text = arguments[0].text;
  3093. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  3094. PushPM(arguments[0].handle, text);
  3095. }
  3096. },
  3097. msg: function() {
  3098. if (CTS.ScriptInit) {
  3099. CTS.LastMessage = new Date();
  3100. Command(arguments[0].text, false);
  3101. }
  3102. },
  3103. };
  3104. // XMLHttpRequest
  3105. CTS.YouTube.XHR.onload = function() {
  3106. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  3107. if (response.error) {
  3108. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  3109. } else {
  3110. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  3111. CTS.YouTube.ListBuilt = true;
  3112. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  3113. CTS.YouTube.DataReady = true;
  3114. CTS.YouTube.Busy = false;
  3115. YouTubeTrackAdd();
  3116. }
  3117. CTS.YouTube.DataReady = false;
  3118. if (response.items[0]) {
  3119. CTS.YouTube.Busy = true;
  3120. if (response.items[0].id) {
  3121. if (response.kind == "youtube#playlistItemListResponse") {
  3122. YouTubePlayListItems(response.items);
  3123. } else {
  3124. CTS.YouTube.VideoID = response.items[0].id.videoId;
  3125. 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);
  3126. CTS.YouTube.XHR.send();
  3127. }
  3128. } else if (response.items[0].contentDetails.duration) {
  3129. CTS.YouTube.DataReady = true;
  3130. }
  3131. if (CTS.YouTube.DataReady === false) {
  3132. CTS.YouTube.Busy = false;
  3133. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  3134. if (response.kind == "youtube#playlistItemListResponse") {
  3135. if (response.nextPageToken !== undefined) {
  3136. CTS.YouTube.ListBuilt = false;
  3137. CheckYouTube("https://www.youtube.com/playlist?list=" + CTS.YouTube.XHR.playlistid, false, response.nextPageToken);
  3138. CTS.YouTube.Busy = true;
  3139. } else {
  3140. CTS.YouTube.ListBuilt = true;
  3141. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  3142. CTS.YouTube.Busy = false;
  3143. }
  3144. }
  3145. } else {
  3146. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  3147. if (CTS.YouTube.Playing === true) {
  3148. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  3149. 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]);
  3150. CTS.YouTube.Busy = false;
  3151. } else {
  3152. if (response.items[0].snippet.title !== undefined) {
  3153. 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]);
  3154. 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]);
  3155. CTS.YouTube.Playing = true;
  3156. }
  3157. CTS.YouTube.Busy = false;
  3158. }
  3159. }
  3160. }
  3161. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  3162. var title = "";
  3163. CTS.YouTube.SearchReturn = false;
  3164. CTS.YouTube.VideoReturn = false;
  3165. if (response.items[0] !== undefined) {
  3166. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  3167. }
  3168. if (response.items !== undefined) {
  3169. if (response.items.length > 0) title = response.items[0].snippet.title;
  3170. }
  3171. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  3172. }
  3173. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  3174. }
  3175. };
  3176. // Chuck Norris Jokes API (https://api.chucknorris.io/)
  3177. CTS.Chuck.XHR.onload = function() {
  3178. var resp = JSON.parse(CTS.Chuck.XHR.responseText),
  3179. msg = "[CHUCK NORRIS]\n" + resp.value;
  3180. if (resp !== null) Send("msg", msg.substr(0, 499));
  3181. };
  3182. // https://api.Urb.com/
  3183. CTS.Urb.XHR.onload = function() {
  3184. var resp = JSON.parse(CTS.Urb.XHR.responseText),
  3185. msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
  3186. if (resp !== null) Send("msg", msg.substr(0, 499));
  3187. };
  3188. // icanhazdadjoke API (https://icanhazdadjoke.com/)
  3189. CTS.Dad.XHR.onload = function() {
  3190. var resp = JSON.parse(CTS.Dad.XHR.responseText),
  3191. msg = "[DAD JOKE]\n" + resp.joke;
  3192. if (resp !== null) Send("msg", msg.substr(0, 499));
  3193. };
  3194. // adviceslip API (https://api.adviceslip.com/advice)
  3195. CTS.Advice.XHR.onload = function() {
  3196. var resp = JSON.parse(CTS.Advice.XHR.responseText),
  3197. msg = "[ADVICE]\n" + resp.slip.advice;
  3198. if (resp !== null) Send("msg", msg.substr(0, 499));
  3199. };
  3200. // Game List Function
  3201. var Fish = {
  3202. //INIT
  3203. init: function() {
  3204. if (CTS.Me.handle == CTS.Host && CTS.CanHostGames === true) {
  3205. Send("msg", "[FISH]\n!fish at any time and upgrade your way up!\n\n!gameview to show/hide game.\n\nRemember there's a five second delay for all commands, don't spam!\nFor commands type !fishhelp!");
  3206. CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
  3207. g.cast();
  3208. }, 5000, this);
  3209. }
  3210. },
  3211. //PLAYERS
  3212. addPlayer: function(handle, username, nickname) {
  3213. if (!this.getPlayer(handle, false, false) && CTS.CanHostGames === true) {
  3214. if (CTS.SafeList.includes(username)) {
  3215. CTS.Game.Fish.Player.push({
  3216. Handle: handle,
  3217. Username: username,
  3218. Nickname: nickname,
  3219. LastCheck: new Date() - 5000,
  3220. Points: 5000,
  3221. Upgrades: {
  3222. Net: 1,
  3223. Store: 1,
  3224. Radar: 1,
  3225. Insurance: false
  3226. },
  3227. });
  3228. Send("msg", "[FISHING BOAT]\n" + nickname.substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  3229. if (this.getPlayer() == 0) this.init();
  3230. }
  3231. }
  3232. },
  3233.  
  3234. getPlayer: function(handle, del, exists) {
  3235. var len = CTS.Game.Fish.Player.length;
  3236. if (handle !== undefined) {
  3237. for (var player = 0; player < len; player++) {
  3238. if (CTS.Game.Fish.Player[player].Handle == handle) {
  3239. if (exists) return CTS.Game.Fish.Player[player];
  3240. if (del) {
  3241. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  3242. CTS.Game.Fish.Player.splice(player, 1);
  3243. }
  3244. if (!exists) return true;
  3245. }
  3246. }
  3247. if (!exists) {
  3248. return false;
  3249. } else {
  3250. return -1;
  3251. }
  3252. } else {
  3253. return len - 1;
  3254. }
  3255. },
  3256.  
  3257. listPlayers: function() {
  3258. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
  3259. place = 0;
  3260. for (var u = arguments[0]; u >= 0; u--) {
  3261. place++;
  3262. if (u < 5) {
  3263. msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
  3264. }
  3265. CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
  3266. CTS.Game.Fish.Player[u].Points += 10000;
  3267. }
  3268. Send("msg", msg);
  3269. },
  3270.  
  3271. winner: function() {
  3272. CTS.Game.Fish.Player.sort(function(a, b) {
  3273. return a.Points - b.Points;
  3274. });
  3275. if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
  3276. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
  3277. CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
  3278. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  3279. }
  3280. var len = CTS.Game.Fish.Player.length - 1;
  3281. 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!");
  3282. this.listPlayers(len);
  3283. CTS.Game.Fish.RestockTimeout = setTimeout(function(g) {
  3284. g.reset(false, true);
  3285. }, 30000, this);
  3286. },
  3287. //PRICELIST
  3288. pricelist: function(playerExist, item) {
  3289. if (item == 0) { // net
  3290. return (1000 * playerExist.Upgrades.Net * playerExist.Upgrades.Net * playerExist.Upgrades.Net);
  3291. } else if (item == 1) { // radar
  3292. return (1000 * playerExist.Upgrades.Radar * 2) + 3500;
  3293. } else if (item == 2) { // shop
  3294. return (playerExist.Upgrades.Store * playerExist.Upgrades.Store * 25000);
  3295. } else if (item == 3) { // insurance
  3296. return (20000);
  3297. } else if (item == 4) { // rob
  3298. return (10000);
  3299. } else if (item == 5) { // slap
  3300. return (50000);
  3301. } else if (item == 6) { // split (min$) / gamble
  3302. return (1000);
  3303. }
  3304. },
  3305. //GAMEPLAY
  3306. cast: function() {
  3307. clearTimeout(CTS.Game.Fish.StartTimeout);
  3308. if (CTS.Host === CTS.Me.handle) {
  3309. if (this.getPlayer() >= 0) {
  3310. if (CTS.Game.Fish.Round < 10) {
  3311. CTS.Game.Fish.Round++;
  3312. var playerlen,
  3313. fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
  3314. id,
  3315. type,
  3316. handle,
  3317. eliminate = false,
  3318. msgeliminate,
  3319. value,
  3320. msg = "[FISHING BOAT]\n";
  3321. for (var cast = 0; cast <= 2; cast++) {
  3322. playerlen = this.getPlayer();
  3323. id = Rand(0, playerlen);
  3324. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  3325. if (Rand(0, 100) <= Rand(10, 70)) {
  3326. var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
  3327. value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
  3328. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  3329. CTS.Game.Fish.Player[id].Points += value;
  3330. 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");
  3331. } else {
  3332. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  3333. CTS.Game.Fish.Player[id].Points -= value;
  3334. msg += (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "..." + ((CTS.Game.Fish.Player[id].Points < 0) ? "[broke]" : "[$" + CTS.Game.Fish.Player[id].Points + "]") + ":\n🗷" + CTS.Game.Fish.TypesOfFish[type][0] + " -$" + value + "\n");
  3335. } else {
  3336. 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");
  3337. }
  3338. }
  3339. } else {
  3340. cast--;
  3341. }
  3342. if (this.getPlayer() == -1) break;
  3343. if (CTS.Game.Fish.Player[id].Points < 0) {
  3344. eliminate = true;
  3345. handle = CTS.Game.Fish.Player[id].Handle;
  3346. msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
  3347. CTS.Game.Fish.Player.splice(id, 1);
  3348. break;
  3349. }
  3350. }
  3351. if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
  3352. if (eliminate) {
  3353. eliminate = false;
  3354. Send("msg", msgeliminate);
  3355. }
  3356. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
  3357. g.cast();
  3358. }, Rand(45000, 120000), this);
  3359. } else {
  3360. this.winner();
  3361. }
  3362. } else {
  3363. //RESTART
  3364. CTS.Game.Fish.GameStart = false;
  3365. Fish.stop();
  3366. }
  3367. }
  3368. },
  3369. //STOPPERS
  3370. reset: function(stop, bypass) {
  3371. var get = this.getPlayer();
  3372. if (get !== undefined) {
  3373. if (get >= 0 && !CTS.Game.NoReset || bypass !== undefined) {
  3374. CTS.Game.Fish.Round = 0;
  3375. clearTimeout(CTS.Game.Fish.StartTimeout);
  3376. clearTimeout(CTS.Game.Fish.RestockTimeout);
  3377. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  3378. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  3379. if (!stop) {
  3380. this.init();
  3381. } else {
  3382. if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  3383. CTS.Game.Fish.Player = [];
  3384. }
  3385. }
  3386. }
  3387. },
  3388.  
  3389. stop: function() {
  3390. CTS.Game.NoReset = false;
  3391. this.reset(true, true);
  3392. }
  3393. };
  3394.  
  3395. var FishList = {
  3396. fish: function(playerExist, user) {
  3397. Fish.addPlayer(user.handle, user.username, user.nick);
  3398. },
  3399.  
  3400. fishbank: function(playerExist) {
  3401. if (playerExist !== -1 && FishTimerCheck(playerExist)) Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname.substr(0, 16) + ", you have $" + playerExist.Points + ".");
  3402. },
  3403.  
  3404. fishrob: function(playerExist, target) {
  3405. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3406. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  3407. FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 4), Rand(5000, 20000), true);
  3408. }
  3409. },
  3410. fishgamble: function(playerExist) {
  3411. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3412. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 6))) {
  3413. var winnings;
  3414. if (Rand(1, 10) === 7) { // 10% chance
  3415. winnings = Rand(1000, 25000);
  3416. playerExist.Points += winnings;
  3417. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
  3418. } else {
  3419. if (Rand(1, 7) === 4) { // 15%
  3420. winnings = Rand(1000, 5000);
  3421. playerExist.Points += winnings;
  3422. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
  3423. } else {
  3424. if (Rand(1, 3) === 3) { // 33.33%
  3425. winnings = Rand(1, 1000);
  3426. playerExist.Points += winnings;
  3427. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
  3428. } else {
  3429. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " tough luck, you lost $1000!");
  3430. }
  3431. }
  3432. }
  3433. }
  3434. }
  3435. },
  3436. fishslap: function(playerExist, target) {
  3437. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3438. var user = UsernameToUser(target.toUpperCase());
  3439. if (user !== -1) {
  3440. if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle) {
  3441. if (CTS.Me.owner || !CTS.UserList[user].mod) {
  3442. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 5))) {
  3443. Send("stream_moder_close", CTS.UserList[user].handle);
  3444. Send("msg", playerExist.Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
  3445. }
  3446. } else {
  3447. Send("msg", "Cannot close moderator!");
  3448. }
  3449. } else {
  3450. Send("msg", "Cannot close user!");
  3451. }
  3452. }
  3453. }
  3454. },
  3455.  
  3456. fishsplit: function(playerExist, target) {
  3457. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3458. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  3459. FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 6), Math.round(playerExist.Points / 2), false);
  3460. }
  3461. },
  3462.  
  3463. fishupgrade: function(playerExist) {
  3464. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 0);
  3465. },
  3466.  
  3467. fishhelp: function(playerExist) {
  3468. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 6);
  3469. },
  3470.  
  3471. fishupgradenet: function(playerExist) {
  3472. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3473. if (playerExist.Upgrades.Net >= 10) {
  3474. Send("msg", playerExist.Nickname + ", you own all upgrades.");
  3475. } else {
  3476. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 0))) {
  3477. playerExist.Upgrades.Net += 1;
  3478. FishUpgradeStatus(playerExist, 1);
  3479. }
  3480. }
  3481. }
  3482. },
  3483.  
  3484. fishupgradeshop: function(playerExist) {
  3485. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3486. if (playerExist.Upgrades.Store >= 6) {
  3487. Send("msg", playerExist.Nickname + ", you own them all already!");
  3488. } else {
  3489. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 2))) {
  3490. playerExist.Upgrades.Store += 1;
  3491. FishUpgradeStatus(playerExist, 4);
  3492. }
  3493. }
  3494. }
  3495. },
  3496.  
  3497. fishupgraderadar: function(playerExist) {
  3498. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3499. if (playerExist.Upgrades.Radar >= 20) {
  3500. Send("msg", playerExist.Nickname + ", you own all upgrades.");
  3501. } else {
  3502. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 1))) {
  3503. playerExist.Upgrades.Radar += 5;
  3504. FishUpgradeStatus(playerExist, 2);
  3505. }
  3506. }
  3507. }
  3508. },
  3509.  
  3510. fishupgradeinsurance: function(playerExist) {
  3511. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3512. if (playerExist.Upgrades.Insurance === true) {
  3513. Send("msg", playerExist.Nickname + ", you already have insurance!");
  3514. } else {
  3515. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 3))) {
  3516. playerExist.Upgrades.Insurance = true;
  3517. FishUpgradeStatus(playerExist, 3);
  3518. }
  3519. }
  3520. }
  3521. }
  3522. };
  3523. // Misc Functions
  3524. function debug() {
  3525. if (window.DebugClear === false) {
  3526. if (arguments[0] !== undefined) {
  3527. var msg = "CTS::" + arguments[0];
  3528. if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
  3529. console.log(msg);
  3530. }
  3531. } else {
  3532. console.clear();
  3533. console.log(" ( \n ( * ))\ ) \n )\ \` ) /(()/( \n (((_) ( )(_)/(_)) \n )\___(_(_()(_)) \n((/ __|_ _/ __| \n | (__ | | \__ \ /\n \___| |_| |___/ \nCosmosisT's TinyChat Script\nCREATOR: COSMOSIST\nVERSION: " + CTS.Project.Version + "\nCONSOLE DEBUG: FALSE\n\nJoin the discord today!\nhttps://discord.gg/gtz2JE7");
  3534. }
  3535. }
  3536.  
  3537. function Remove() {
  3538. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  3539. }
  3540. })();