CosmosisT's TinyChat Script (CTS V1.6.0)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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