CosmosisT's TinyChat Script (CTS V1.5.64)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-03-21 提交的版本,查看 最新版本

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