CosmosisT's TinyChat Script (CTS V1.5.3)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.5.3)
  3. // @version 1.5.3
  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.  
  22. (function() {
  23. "use strict";
  24. //CTS
  25. var CTS = {
  26. DebugClear: false,
  27. Project:{
  28. Version:"1.5.3",
  29. Name:"CTS",
  30. Storage: "CTS_"
  31. },
  32. Me: [],
  33. Room: "",
  34. ScriptInit: false,
  35. MainBackground: undefined,
  36. MainBackgroundColorCounter: 0,
  37. FontSize: 20,
  38. ChatStyleCounter: 0,
  39. ChatHeight: 30,
  40. ChatWidth: 0,
  41. ChatDisplay: true,
  42. UserListDisplay: true,
  43. ChatStyles: undefined,
  44. NameColors: undefined,
  45. MainBackgroundCounter: 0,
  46. ChatCSS: [],
  47. ChatLimit: 500,
  48. NotificationLimit: 100,
  49. ChatScroll: true,
  50. NotificationScroll: true,
  51. NoGreet: false,
  52. Featured: true,
  53. Bot: true,
  54. AutoKick: false,
  55. AutoBan: false,
  56. GreetMode: false,
  57. CanTTS: false,
  58. Popups: true,
  59. Avatar: true,
  60. Reminder: true,
  61. CanSeeGames: true,
  62. imgur: true,
  63. Notification: true,
  64. UserYT: true,
  65. AutoMicrophone: false,
  66. Game: {
  67. NoReset: false,
  68. Fish: {
  69. HighScore: ["CosmosisT", 133337],
  70. StartTimeout:undefined,
  71. RestockTimeout:undefined,
  72. ReCastTimeout:undefined,
  73. NotEnoughTimeout:undefined,
  74. Round:0,
  75. Player:[],
  76. TypesOfFish:[
  77. ["frog", 30, true],
  78. ["sunfish", 35, true],
  79. ["goldfish", 40, true],
  80. ["fish swollowed hook", 20, false],
  81. ["family of sardine", 20, true],
  82. ["catfish", 45, true],
  83. ["spotted bass", 50, true],
  84. ["largemouth bass", 35, true],
  85. ["family of shrimp", 40, true],
  86. ["cleaned garbage from the lake", 70, true],
  87. ["cisco", 45, true],
  88. ["seaweed, still edible", 50, true],
  89. ["snagged a tire and lost rod", 50, false],
  90. ["snagged a tire and lost hook", 30, false],
  91. ["lost their rod to a shark", 50, false],
  92. ["rainbow trout", 50, true],
  93. ["It's your turn for dinner", 80, false],
  94. ["parrot fish", 65, true],
  95. ["snagged a plastic bag,\n their hook is gone", 30, false],
  96. ["walleye", 55, true],
  97. ["Round Whitefish", 60, true],
  98. ["family of clams", 220, true],
  99. ["family of oyster", 200, true],
  100. ["Round blackfish", 70, true],
  101. ["dolphin", 120, true],
  102. ["seagull,\n not a fish but will do", 120, true],
  103. //MEDIUM GRADE CATCH
  104. ["pufferfish", 100, true],
  105. ["red snapper", 110, true],
  106. ["lobster", 100, true],
  107. ["tuna", 150, true],
  108. ["electric eel", 200, true],
  109. ["Eel electricuted you,\nrod is toast", 100, false],
  110. ["swordfish", 200, true],
  111. ["had bills at home to pay", 100, false],
  112. ["slipped and lost equipment", 150, false],
  113. ["bike, still good too", 250, true],
  114. ["great white", 300, true],
  115. ["octopus", 350, true],
  116. ["serpeant", 375, true],
  117. ["sea turtle", 425, true],
  118. ["it pays to not drink,\ncrazy night however!", 400, false],
  119. ["fined for capturing,\n a female whale", 500, false],
  120. //SUPERB CATCH
  121. ["male whale", 400, true],
  122. ["barracuda", 450, true],
  123. ["pike", 500, true],
  124. ["lochiness monster", 700, true],
  125. ["anglerfish", 1000, true],
  126. ["small treasure chest", 1000, true],
  127. ["golden tuna", 2000, true],
  128. ["family of beautiful rims", 2000, true],
  129. ["fined for smuggling\nmore than fish", 2500, false],
  130. ["jaws", 5000, true],
  131. ["mermaid", 7500, true],
  132. ["holy grail,\nhow'd that get there?", 10000, true],
  133. ["secret formula", 20000, true]
  134. ]
  135. }
  136. },
  137. 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"]]},
  138. 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."],
  139. TTS: {synth: undefined,voices: undefined},
  140. Host: 0,
  141. HostAttempt: 0,
  142. HostWaiting: false,
  143. YouTube: {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},},
  144. UserList: [],
  145. MentionList: [],
  146. TempIgnoreList: [],
  147. IgnoreList: [],
  148. BanList: [],
  149. KickList: [],
  150. BotOPList: [],
  151. TTSList: [],
  152. BanKeywordList: [],
  153. KickKeywordList: [],
  154. HighlightList: [],
  155. GreetList: [],
  156. ReminderList: [],
  157. ReminderServerInList: [],
  158. Favorited: [],
  159. SafeList: [],
  160. KBQueue:[],
  161. WatchList: [],
  162. MessageCallback: [],
  163. Message: [[]],
  164. LastMessage: new Date(),
  165. SendQueue: [],
  166. MissedMsg: 0,
  167. ActiveMessage: 0,
  168. NotificationTimeOut: [],
  169. Sound: {highlight: 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")},
  170. Welcomes: ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "]
  171. },
  172. MainElement, ChatLogElement, VideoListElement, SideMenuElement, TitleElement, UserListElement, ModerationListElement, ChatListElement, UserContextElement, MicrophoneElement;
  173. window.RADIO_STATIONS = CTS.Radio.station;
  174. //CTS SETTINGS
  175. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore",JSON.stringify(["CosmosisT", 133337])));
  176. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", 0));
  177. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  178. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  179. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/RC3bKe7.jpg)");
  180. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  181. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  182. CTS.Notification = JSON.parse(Load("Notification", JSON.stringify(true)));
  183. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  184. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  185. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  186. CTS.Favorited = JSON.parse(Load("Favorited", JSON.stringify([["stonercircle", "https://avatars.tinychat.com/da/838b96/5f/medium/phpKXAdEn.jpeg"], null, null, null, null])));
  187. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  188. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  189. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  190. CTS.FontSize = JSON.parse(Load("FontSize", 20));
  191. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  192. CTS.KickList = JSON.parse(Load("KickList", JSON.stringify([])));
  193. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  194. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  195. CTS.BanList = JSON.parse(Load("BanList", JSON.stringify([])));
  196. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  197. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  198. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  199. CTS.imgur = JSON.parse(Load("imgur", JSON.stringify(true)));
  200. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  201. //ROOM CSS
  202. var NameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  203. var Colors = ["#CD5C5C", "#F08080", "#FA8072", "#E9967A", "#DC143C", "#FF0000", "#B22222", "#8B0000", "#000000", "#FFFFFF", "#FFC0CB", "#FFB6C1", "#FF69B4", "#FF1493", "#C71585", "#DB7093", "#000000", "#FFFFFF", "#FFA07A", "#FF7F50", "#FF6347", "#FF4500", "#FF8C00", "#FFA500", "#000000", "#FFFFFF", "#FFD700", "#FFFF00", "#FFFFE0", "#FFFACD", "#FAFAD2", "#FFEFD5", "#FFE4B5", "#FFDAB9", "#EEE8AA", "#F0E68C", "#BDB76B", "#000000", "#FFFFFF", "#E6E6FA", "#D8BFD8", "#DDA0DD", "#EE82EE", "#DA70D6", "#FF00FF", "#BA55D3", "#9370DB", "#9966CC", "#8A2BE2", "#9400D3", "#9932CC", "#8B008B", "#800080", "#4B0082", "#6A5ACD", "#483D8B", "#7B68EE", "#000000", "#FFFFFF", "#ADFF2F", "#7FFF00", "#7CFC00", "#00FF00", "#32CD32", "#98FB98", "#90EE90", "#00FA9A", "#00FF7F", "#3CB371", "#2E8B57", "#228B22", "#008000", "#006400", "#9ACD32", "#6B8E23", "#808000", "#556B2F", "#66CDAA", "#8FBC8F", "#20B2AA", "#008B8B", "#008080", "#000000", "#FFFFFF", "#00FFFF", "#E0FFFF", "#AFEEEE", "#7FFFD4", "#40E0D0", "#48D1CC", "#00CED1", "#5F9EA0", "#4682B4", "#B0C4DE", "#B0E0E6", "#ADD8E6", "#87CEEB", "#87CEFA", "#00BFFF", "#1E90FF", "#6495ED", "#4169E1", "#0000FF", "#0000CD", "#00008B", "#000080", "#191970", "#000000", "#FFFFFF", "#FFF8DC", "#FFEBCD", "#FFE4C4", "#FFDEAD", "#F5DEB3", "#DEB887", "#D2B48C", "#BC8F8F", "#F4A460", "#DAA520", "#B8860B", "#CD853F", "#D2691E", "#8B4513", "#A0522D", "#A52A2A", "#800000", "#000000", "#FFFFFF", "#FFFFFF", "#FFFAFA", "#F0FFF0", "#F5FFFA", "#F0FFFF", "#F0F8FF", "#F8F8FF", "#F5F5F5", "#FFF5EE", "#F5F5DC", "#FDF5E6", "#FFFAF0", "#FFFFF0", "#FAEBD7", "#FAF0E6", "#FFF0F5", "#FFE4E1", "#000000", "#FFFFFF", "#DCDCDC", "#D3D3D3", "#C0C0C0", "#A9A9A9", "#808080", "#696969", "#778899", "#708090", "#2F4F4F", "#000000", "#FFFFFF"];
  204. var Images = ["","https://i.imgur.com/8M0NPCv.png", "https://i.imgur.com/6IAL4aM.png", "https://i.imgur.com/QdOTqIR.jpg", "https://i.imgur.com/qqFsein.jpg", "https://i.imgur.com/vVD5pUb.jpg", "https://i.imgur.com/Sux2Age.jpg", "https://i.imgur.com/cIKznlf.jpg", "https://i.imgur.com/iEMP5I6.jpg", "https://i.imgur.com/rEGy1tK.jpg", "https://i.imgur.com/JR6Ped5.jpg", "https://i.imgur.com/m3dX7yn.jpg", "https://i.imgur.com/2cJqV1K.jpg", "https://i.imgur.com/QL1M4yG.jpg", "https://i.imgur.com/Syy1mUU.jpg", "https://i.imgur.com/sRpDOp3.jpg", "https://i.imgur.com/Im7dWdM.jpg", "https://i.imgur.com/9uCdYyq.png", "https://i.imgur.com/X9Kp6ka.jpg", "https://i.imgur.com/TOZTx1M.jpg", "https://i.imgur.com/wcjxVjk.png", "https://i.imgur.com/UZfmih9.png", "https://i.imgur.com/mkauZUT.jpg", "https://i.imgur.com/GfPqv7d.jpg", "https://i.imgur.com/R7AOtjV.jpg", "https://i.imgur.com/Qso6n8k.jpg", "https://i.imgur.com/vVfj23z.jpg", "https://i.imgur.com/BYPsShX.jpg", "https://i.imgur.com/1EWYBQw.jpg", "https://i.imgur.com/Oaq0eip.jpg", "https://i.imgur.com/HVHaJ1r.jpg", "https://i.imgur.com/SImcSc2.png", "https://i.imgur.com/CgRDCdy.jpg", "https://i.imgur.com/VMtXsES.png", "https://i.imgur.com/oxHz9un.jpg", "https://i.imgur.com/VN6x9QA.jpg", "https://i.imgur.com/9KhjWvW.jpg", "https://i.imgur.com/fu0eiv4.jpg", "https://i.imgur.com/QgcvxZf.jpg", "https://i.imgur.com/2kz8Roz.jpg", "https://i.imgur.com/A2AdQd8.jpg", "https://i.imgur.com/zuNUJ4J.jpg", "https://i.imgur.com/CW4mVWE.jpg", "https://i.imgur.com/0NGecGX.jpg", "https://i.imgur.com/4IEcVlr.jpg", "https://i.imgur.com/JDnQzF4.jpg", "https://i.imgur.com/Ye6iIrw.jpg", "https://i.imgur.com/DVlwQFN.jpg", "https://i.imgur.com/G6Oa9s6.jpg", "https://i.imgur.com/cXpEHvX.jpg", "https://i.imgur.com/ANXRz54.jpg", "https://i.imgur.com/i7KvpAf.jpg", "https://i.imgur.com/kJ44IQQ.jpg", "https://i.imgur.com/5ONal5c.jpg", "https://i.imgur.com/nWuC5FK.jpg", "https://i.imgur.com/ZYNsEN6.jpg", "https://i.imgur.com/C3aVnBq.jpg", "https://i.imgur.com/8Kts9t7.jpg", "https://i.imgur.com/QiaDx3C.jpg", "https://i.imgur.com/wrt6zBN.jpg", "https://i.imgur.com/3YgGoV0.jpg", "https://i.imgur.com/HPsbhiF.jpg", "https://i.imgur.com/X4wSs8f.jpg", "https://i.imgur.com/cqeMox0.jpg", "https://i.imgur.com/apNgmSO.jpg", "https://i.imgur.com/YjYcyCn.jpg", "https://i.imgur.com/2hUFTDv.png", "https://i.imgur.com/7lDQKff.jpg", "https://i.imgur.com/yuQTkOy.png", "https://i.imgur.com/7zvCOpV.jpg", "https://i.imgur.com/L5v6bcs.jpg", "https://i.imgur.com/5h3N2HY.jpg", "https://i.imgur.com/AvhrIcv.jpg", "https://i.imgur.com/DsAMAG1.jpg", "https://i.imgur.com/dDvOwXi.jpg", "https://i.imgur.com/ii00Lnl.jpg",
  205. "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",
  206. "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",
  207. "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",
  208. "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",
  209. "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",
  210. "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",
  211. ];
  212.  
  213. var FeaturedCSS = "#videos.column>.videos-items{background:#0000003b;height:20%}#videos.column>.videos-items+.videos-items{background:none;height:80%}#videos.row>.videos-items{background:#0000003b;width:20%}#videos.row>.videos-items+.videos-items{background:none;width:80%}#videos.row.featured-2>.videos-items{width:20%}#videos.row.featured-2>.videos-items+.videos-items{width:80%}#videos.column.featured-2>.videos-items{height:20%}#videos.column.featured-2>.videos-items+.videos-items{height:80%}#videos.row.featured-3>.videos-items{width:20%}#videos.row.featured-3>.videos-items+.videos-items{width:80%}#videos.column.featured-3>.videos-items{height:20%}#videos.column.featured-3>.videos-items+.videos-items{height:80%}";
  214. var VideoCSS = ".tcsettings:hover{background:#008cda;}.tcsettings{border-radius: 12px 0 0 0;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:4px;right:4px;z-index:2;min-width: 46px;}.ctsdrop-content{border-radius: 12px;position:absolute;top:28px;right:0;background:#181d1e;min-width:46px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{border-radius: 12px;width:100%;height:28px;line-height:16px;z-index: 2;cursor: pointer;top: 4px;background: #0000008f;border: none;color: white;padding: 4px 8px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px}#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{border-radius: 12px;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{border-radius:12px 0 0 0;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:0 0 0 12px;z-index: 1;padding: unset!important;white-space: pre}#videos-footer-broadcast-wrapper{z-index: 1;visibility: visible;height: 50px;min-height: 50px;width: 400px;padding: unset;right: 0;left: unset;position: fixed;top: calc(30% + 34px)}span[title=\"Settings\"]>svg{padding:4px;height:24px;width:24px}#seek-duration{pointer-events: none;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 600 20px sans-serif}#videos{bottom: 0;left: 0;right: 0;top: 0}:host,#videolist{background:unset;}.video:after{content: unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header{border-radius: 12px 0 0 0;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;}";
  215. var SideMenuCSS = "#sidemenu-wider{display:none;}#sidemenu-content::-webkit-scrollbar{width:0;background:transparent;}#sidemenu{border-radius: 12px 0 0 12px;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!important;max-width:400px!important;}#sidemenu-content{scrollbar-width:none;padding-top:unset;min-height:calc(100% - 50px)!important;max-height:calc(100% - 50px)!important;}";
  216. var MainCSS = "body{background:" + CTS.MainBackground + " no-repeat center;background-size:cover;overflow:hidden;}#content{width:calc(100% - 400px);padding:0!important;}#nav-static-wrapper, #nav-fixed-wrapper{display:none;}";
  217. var RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{background:unset!important;}";
  218. var TitleCSS = "#room-header{border-radius: 12px 0 0 12px;border:unset;z-index:1;min-height:36px!important;max-height:36px!important;min-width:400px!important;max-width:400px!important;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{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;}#room-header-info>span{right: 8px;position: absolute;top:7px;margin-top:0!important;}";
  219. var ContextMenuCSS = ".context:after{content:unset;}.context>span{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:800 14px sans-serif;color:#FFFFFF;display:inline-block;padding:1px 1%;line-height:17px;height:17px;}.context{background:#20262870;position:unset;padding:0;}";
  220. var ModeratorCSS = ".video{min-width: 114px;max-width: 114px;}#moderatorlist:after{right:5px;color:#FFFFFF;background:#53b6ef;}#moderatorlist>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist>#header>span>button{top:-2px;background: #20262870;}#moderatorlist.show>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist{max-height:60px;}#moderatorlist>#header{height:60px;font-size:16px;font-weight:600;font-family:sans-serif;color:#FFFFFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}#moderatorlist.show[data-videos-count=\"1\"], #moderatorlist.show[data-videos-count=\"2\"] {max-height:205px;}#moderatorlist.show[data-videos-count=\"3\"], #moderatorlist.show[data-videos-count=\"4\"] {max-height:290px;}#moderatorlist.show[data-videos-count=\"5\"], #moderatorlist.show[data-videos-count=\"6\"] {max-height:400px;}#moderatorlist.show[data-videos-count=\"7\"], #moderatorlist.show[data-videos-count=\"8\"] {max-height:460px;}#moderatorlist.show[data-videos-count=\"9\"], #moderatorlist.show[data-videos-count=\"10\"] {max-height:545px;}#moderatorlist.show[data-videos-count=\"11\"], #moderatorlist.show[data-videos-count=\"12\"] {max-height:630px;}";
  221. var UserListCSS = ".list-item>span>span[data-cam=\"1\"]:after{height:15px;width:15px;background-image:url(https://i.imgur.com/QKSbq8d.png);}.list-item>span>span[data-moderator=\"1\"]:before{margin-right:3px;width:15px;height:15px;background-image:url(https://i.imgur.com/CEA9aro.png);}.list-item>span>span{background:transparent;box-shadow:none;}.list-item>span>span>.send-gift{top:4px;}.list-item>span>img{top:6px;}#button-banlist{color:#53b6ef;transition:none;top:calc(30% + 89px);right:3px;position:fixed;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#userlist>div{height:22px;}#userlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#userlist>#header{height:40px;top:10px;}#contextmenu {top:calc(100% - 45px)!important;right:5px!important;left:5px!important;}";
  222. var ChatListCSS = ".list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background:transparent;visibility:hidden;}.list-item>span>span{top:-4px;background:transparent;box-shadow:none;}.list-item>span>span[data-messages]:before{background:#53b6ef;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#chatlist>#header>.list-item>span.active{background:#53b6ef;}#chatlist>#header{height:60px;top:30px}#chatlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#chatlist>div{height:22px;line-height:22px;}";
  223. var NotificationCSS = ".PMTime{display:inline-block;padding:0 6px 0 0;margin:0 8px 0 0;border-right:4px groove #797979;}.PMName{display:inline-block;}#popup div{user-select: text;-webkit-user-select: text;-moz-user-select: text;color:#FFFFFF;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font-weight: 300;font-size: 18px;font-family: sans-serif;z-index:1;}.PMOverlay{height: calc(100% - 92px);overflow: hidden;pointer-events:none;position:absolute;padding-top:12px;top:0;bottom:0;left:0;right:0;visibility:visible;}.PMPopup{pointer-events:all;margin:5px auto;width:50%;position:relative;}.PMPopup a, .PMPopup a:visited, .PMPopup a:hover, .PMPopup a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.PMPopup a:hover{color:#FFFFFF;text-decoration:underline;}.PMPopup h2{border-radius:5px 5px 0 0;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0 0 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
  224. var ChatboxCSS = "#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #181d1e94;}#input-user:checked ~ #user-menu{display:inline-block;}#user-menu > a:hover #user-menu > span > a:hover{color: #FFFFFF}#user-menu > a, #user-menu > span > a {font-weight: 600;position: relative;display: inline-block;width:calc(100% - 30px);padding: 6px;box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;}#user-menu {position: absolute;display: none;bottom: 50px;right: 0;border: 1px solid rgba(0, 0, 0, .06);box-sizing: border-box;border-radius: 3px;color: #FFFFFF;background: #181d1e;line-height: 1;box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .09);z-index: 1;}#user-menu > span {display: inline-block;width: 100%;padding: 12px;box-sizing: border-box;font-size: 16px;font-weight: 500;white-space: nowrap;text-overflow: ellipsis;cursor: default;overflow: hidden;}#label-user > img {position: absolute;height: 100%;left: -8px;vertical-align: top;}#label-user{position: relative;display: inline-block;height: 48px;width: 48px;border-radius: 100%;overflow: hidden;cursor: pointer;}#header-user{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;position: absolute;top: 10px;right: 0;}#chat-wrapper.full-screen #chat-instant, #chatf-wrapper.full-screen #chat-instant>.avatar>.status-icon,#chat-wrapper.full-screen #chat-content>.message>.avatar>.status-icon {background:unset;}.cts-message-unread{display:block;border-radius:6px;padding:1px 6px 1px 6px;background:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font:bold 16px sans-serif;cursor:pointer}.ctstime{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;position:absolute;right:3px;top:3px;background: #181d1e;border: 1px solid black;border-radius: 6px;padding: 1px 6px;}#chat-instant>.avatar>div>img,#cts-chat-content>.message>.avatar>div>img{position:relative;height:100%;left:-7px}.message{color:#FFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-family:sans-serif;font-weight:300;font-size:20px;white-space:pre-line;word-wrap:break-word}.message a, .message a:visited, .message a:hover, .message a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.message a:hover{color:#FFFFFF;text-decoration:underline;}#chat{will-change: transform;min-height:unset;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:3px 3px;background:#181d1ea8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#3b7494;-webkit-box-shadow: 0 0 20px #ffffff;box-shadow: inset 0 0 20px 0 #ffffff;}#cts-chat-content>.message.common{padding:3px 3px 3px 50px;box-sizing:border-box;text-align:left}#chat-instant>.avatar,#cts-chat-content>.message>.avatar{position:absolute;height:40px;width:40px;top:3px;left:3px;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}#chat-instant>.avatar>div,#cts-chat-content>.message>.avatar>div{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden}#notification-content .nickname{border-radius:6px;padding:1px 6px 1px 6px}.notification{padding:1px 0 1px 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black}.time{position:absolute;right:5px}.notifbtn:hover{background:linear-gradient(0deg,rgb(0, 135, 186)0%,rgba(0, 49, 64, 0.94)75%,rgba(0, 172, 255, 0.6)100%);}.notifbtn{cursor: pointer;border-radius: 0 0 12px 12px;outline: none;background: linear-gradient(0deg,rgba(0, 0, 0, 0)0%,rgba(37, 37, 37, 0.94)75%,rgba(0, 172, 255, 0.6)100%);border: none;color: white;width: 100%;}#notification-content.large{height:100%;}#notification-content{will-change: transform;top:0;position:relative;scrollbar-width:none;background:#181d1e;border-radius:12px 12px 0 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height:80px;font:bold 16px sans-serif;color:#FFF;overflow-y:scroll;overflow-wrap:break-word;padding:0 6px 0 6px}#notification-content::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#chat-instant>.avatar>.status-icon,#cts-chat-content>.message>.avatar>.status-icon{left:0!important}#chat-instant>.nickname{color:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-size: 20px;font-weight: 800;}#chat-position>#chat-instant>a{display:none;}#chat-instant{padding-left:50px;background:transparent!important;}#chat-instant::after{background:none;}.on-white-scroll{scrollbar-width: none;}.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-radius: 12px 0 0 12px;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;}";
  225. //CHATSTYLES
  226. CTS.ChatCSS.push([
  227. //STYLE #0
  228. ["#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%);}"],
  229. ["#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;}"],
  230. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  231. ],[ //STYLE #1
  232. ["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%);}"],
  233. ["#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;}"],
  234. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
  235. ],[ //STYLE #2
  236. ["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)}"],
  237. ["#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;}"],
  238. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
  239. ],[ //STYLE #3
  240. ["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%);}"],
  241. ["#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;}"],
  242. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
  243. ],[ //STYLE #4
  244. ["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%);}"],
  245. ["#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;}"],
  246. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
  247. ],[ //STYLE #5
  248. ["#chat-wrapper{background:linear-gradient(0deg,rgb(225,0,211)0%,rgb(44,15,45)calc(100% - 62px),rgb(208,0,176)100%);}"]
  249. ["#videos-footer-broadcast-wrapper>.waiting{background:#bc01a0;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#bc01a0!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#5a004d!important;}#videos-footer-push-to-talk{background:#bc01a0}#videos-footer-push-to-talk:hover{background:#5a004d}#videos-footer-broadcast:hover{background:#5a004d}#videos-footer-broadcast{background:#bc01a0;}"],
  250. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,14)8px,rgb(188,1,160)100%);}"]
  251. ],[ //STYLE #6
  252. ["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%);}"],
  253. ["#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;}"],
  254. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
  255. ],[ //STYLE #7
  256. ["#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%);}"],
  257. ["#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;}"],
  258. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
  259. ],[ //STYLE #8
  260. ["#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%);}"],
  261. ["#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;}"],
  262. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
  263. ],[ //STYLE #9
  264. ["#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%);}"],
  265. ["#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;}"],
  266. ["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
  267. ],[ //STYLE #10
  268. ["#chat-wrapper{background: linear-gradient(0deg,rgba(255, 125, 0, 1)0%,rgba(255, 125, 0, 0.82)calc(100% - 62px),rgba(255, 125, 0, 1)100%);}"],
  269. ["#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;}"],
  270. ["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
  271. ],[ //STYLE #11
  272. ["#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)"],
  273. ["#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;}"],
  274. ["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px)}"]
  275. ]);
  276. //GLOBAL DECLARE
  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. }
  337. }, 500);
  338. }
  339.  
  340. function CTSHomeInject() {
  341. var HomeCSS = '#modalfree-wrapper{display: none;}.tile-header > img {transition:unset;}.tile-favroom-opt{cursor:pointer;position: absolute;right: 0;top: 0;padding: 12px;background:#181d1e94;}.tile-favroom-opt:hover{background:#ff00008c;}#content{padding-bottom:unset;}.tile-content{height:180px;}.cts-footer-contents .tile-info{height:20px}.cts-footer-contents .tile-header>img{cursor:pointer;height: 220px;}.tile-header>img{height: 230px;width: 100%;max-width: 100%;}.cts-footer:hover .cts-footer-contents .tile{font-size: 18px;font-weight: 800;width:20%;display:inline-block;}.cts-footer-contents .tile {background: #00a2ff;text-align: center;border:unset;height:unset;display:none;margin: unset;}.cts-footer {background:#181d1e94;width: 100%;position: fixed;bottom: 0;left: 0;}#catalog > div {display: inline-block;padding: 5px;box-sizing: border-box;}.tile[data-status="pro"], .tile[data-status="extreme"], .tile[data-status="gold"] {margin-top: 12px;}.tile-header {border-radius: 12px 12px 0 0;}#promoted .tile-header > img{width:100%;}#navigation > label{border-radius:12px;}#welcome>div{padding-top:0}.tile-statistic{padding-top:0;padding-bottom:4px;background: #000000a6;}.tile-name{padding-top:unset;}#promote-button{border-radius: 12px 12px 0 0;}tile-name{padding-top:unset;}.tile-info{bottom:unset;top:0;height:28px;}.cts-footer > h2, #promoted-wrapper > h2, #trended-wrapper > h2, #header-for-all{text-align: center;font-size: 30px;font-weight: 800;}body{background:' + CTS.MainBackground + ' no-repeat center;background-size:cover;background-attachment: fixed;}.tile-content-info-icon > img {display:none;}.tile-content-info{font-size: 14px;font-weight: 600;}#promoted .tile-content-info-text{word-break: break-word;max-height:95px;}.tile{border:2px solid #fff;margin-top: 13px;height:425px;}#loadmore-no-more {background:#181d1e;}.tile-content > img{display:none;}#welcome-wrapper{background: #181d1e94;border-bottom:unset;}#loadmore{background: #00a2ff;font-weight: 600;}#user-menu{background: #181d1e;}#nav-static-wrapper {-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background:#181d1e;}#up-button:hover > #up-button-content {background: #181d1e59;}#nav-fixed{border-bottom:unset;}#nav-fixed-wrapper{-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background: #181d1e;}#nav-static {border-bottom:unset;}#welcome{padding:12px 30px 24px;}.tile{border-radius: 12px;background: #181d1eb3;}div, span, a, h1, h2, h3, h4, h5, h6, p {text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color: #FFFFFF!important;}#promoted-wrapper > div, #trended-wrapper > div {background: #00a2ff;border-radius: 12px;}.tile-content-info-text {word-break: break-word;width:100%;}.tile-content-info.with-icon {display: contents;}#navigation > label:not([for="input-catalog-navigation"]) {font-weight:600;background: #000000;}';
  342. //INSERT HTML/CSS
  343. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  344. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  345. //INSERT SCRIPT
  346. var script = document.createElement("script"),
  347. elem = document.getElementsByTagName("script")[0];
  348. 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}';
  349. elem.parentNode.insertBefore(script, elem);
  350. var len = CTS.Favorited.length;
  351. for (var i = 0; i < len; i++) document.body.querySelector(".cts-footer-contents").insertAdjacentHTML("beforeend", CTS.Favorited[i] !== null ? '<div class="tile" data-room-name="' + CTS.Favorited[i][0] + '">Favorite #' + (i + 1) + ' <div class="tile-header"><img id="tile-header-image" src="' + (CTS.Favorited[i][1] ? CTS.Favorited[i][1] : "https://i.imgur.com/VnVFEv7.png") + '" onload="MasonryTails.Refresh();" onclick="locationTo(\'/room/' + CTS.Favorited[i][0] + '\');"><div class="tile-info"><div class="tile-favroom-opt" onclick="RemoveFavorite(this,' + i + ')">X</div><div class="tile-name">' + CTS.Favorited[i][0] + '</div><div class="tile-statistic"><svg width="18" height="14" viewBox="0 0 18 14" xmlns="https://www.w3.org/2000/svg"><path d="M9.333 5.667c0-.367-.3-.667-.666-.667h-8C.3 5 0 5.3 0 5.667v6.666C0 12.7.3 13 .667 13h8c.366 0 .666-.3.666-.667V10L12 12.667V5.333L9.333 8V5.667z" transform="translate(3 -3)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span><svg width="20" height="16" viewBox="0 0 20 16" xmlns="https://www.w3.org/2000/svg"><path d="M57 4c-3.182 0-5.9 2.073-7 5 1.1 2.927 3.818 5 7 5s5.9-2.073 7-5c-1.1-2.927-3.818-5-7-5zm0 8.495c1.93 0 3.495-1.565 3.495-3.495 0-1.93-1.565-3.495-3.495-3.495-1.93 0-3.495 1.565-3.495 3.495 0 1.93 1.565 3.495 3.495 3.495zm0-1.51c1.096 0 1.985-.89 1.985-1.985 0-1.096-.89-1.985-1.985-1.985-1.096 0-1.985.89-1.985 1.985 0 1.096.89 1.985 1.985 1.985z" transform="translate(-47 -2)" fill="#fff" fill-rule="evenodd"></path></svg><span>0</span></div></div></div></div>' : '<div class="tile">Favorite #' + (i + 1) + "</div>");
  352. //SCRIPT INIT -> PREPARE()
  353. clearInterval(CTS.ScriptLoading);
  354. CTS.ScriptInit = true;
  355. CTSHomePrepare();
  356. }
  357.  
  358. function CTSHomePrepare() {
  359. //FUNCTION BYPASS
  360. window.ModalFreeTrialPro = function() {};
  361. //REMOVE
  362. Remove(document, "#footer");
  363. Remove(document, ".nav-logo");
  364. }
  365.  
  366. function CTSRoomInject() {
  367. //INSERT SCRIPT
  368. var script = document.createElement("script"),
  369. elem = document.getElementsByTagName("script")[0];
  370. 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}';
  371. elem.parentNode.insertBefore(script, elem);
  372. //LOCALSETTINGS
  373. CTS.enablePMs = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enablePMs : true;
  374. CTS.enableSound = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enableSound : true;
  375. //TTS
  376. if (CTS.enableSound === true && "speechSynthesis" in window) {
  377. CTS.TTS.synth = window.speechSynthesis;
  378. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  379. }
  380. //ELEMENT DEFINE
  381. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  382. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  383. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  384. MicrophoneElement = document.createEvent("MouseEvent");
  385. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  386. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  387. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  388. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  389. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  390. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  391. //INSERTHTML/CSS
  392. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  393. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  394. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  395. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", '<style id="' + CTS.ChatStyleCounter + '">' + CTS.ChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  396. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  397. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  398. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  399. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  400. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  401. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  402. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  403. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  404. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  405. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  406. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  407. 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">vol</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>');
  408. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  409. VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin","<button class=\"tcsettings\">⯇</button>");
  410. VideoListElement.querySelector("#videos-header").appendChild(TitleElement.querySelector('span[title="Settings"]'));
  411. VideoListElement.querySelector("#videolist").appendChild(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"));
  412. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  413. VideoListElement.querySelector("#videolist").insertAdjacentHTML("afterbegin", '<div class="ctsdrop"><button class="ctsoptions" title="CTS Options">⚙</button><div class="ctsdrop-content"><button id="BackgroundUpdateRight" class="ctsoptions" title="Background">+</button><button id="BackgroundUpdateColor" class="ctsoptions" title="Background Color">BG</button><button id="BackgroundUpdateLeft" class="ctsoptions" title="Background">-</button><div style="height:6px;background:#624482;"></div><button id="FontSizeUpdate" class="ctsoptions" title="Font Size">🗚</button><div style="height:6px;background:#624482;"></div><button id="ChatColor" class="ctsoptions" title="Chat Style">🖉</button><button id="FeaturedToggled" class="ctsoptions" title="YouTube/Featured Resize">⛶</button><button id="ChatWidthToggled" class="ctsoptions" title="Chat Resize">↹</button><button id="ChatHeightToggled" class="ctsoptions" title="Chat Resize">≡</button></div></div>');
  414. ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div><button class="notifbtn">▼</button>');
  415. ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
  416. ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
  417. //SCRIPT INIT -> PREPARE()
  418. clearInterval(CTS.ScriptLoading);
  419. CTS.ScriptInit = true;
  420. CTSRoomPrepare();
  421. }
  422.  
  423. function CTSRoomPrepare() {
  424. var TCApp = window.TinychatApp;
  425. //FUNCTION BYPASS
  426. TCApp.BLL.SoundPlayer.playMessage = function() {};
  427. TCApp.BLL.SoundPlayer.playGift = function() {};
  428. TCApp.BLL.User.isSubscription = function() {return true;};
  429. TCApp.BLL.User.canUseFilters = function() {return true;};
  430. TCApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  431. var b = this,
  432. d = this.settings.getSettings();
  433. if (d.video === null) {
  434. return void this.app.MediaSettings(() => {
  435. this.BroadcastStart();
  436. });
  437. }
  438. this.videolist.AddingVideoSelf(this.self_handle);
  439. var e = {};
  440. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  441. e.audio = true;
  442. e.video = {width: {min: 320, max: 4096}, height: {min: 240,max: 2160}, frameRate: {min: 15, ideal:30, max: 60}};
  443. } else {
  444. navigator.mediaDevices.enumerateDevices().then(g => {
  445. var h = false;
  446. var len = g.length;
  447. for (var c = 0; c < len; c++) {
  448. if (g[c].kind === "videoinput") {
  449. if (e.video === void 0) e.video = {width: {min: 320, max: 4096}, height: {min: 240,max: 2160}, frameRate: {min: 15, ideal:30, max: 60}};
  450. if (h) {
  451. d.video = g[c];
  452. h = false;
  453. this.settings.saveSettings(d);
  454. } else if (d.video === null) {
  455. d.video = g[c];
  456. this.settings.saveSettings(d);
  457. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  458. e.video.deviceId = {exact: d.video.deviceId};
  459. } else if (d.video.deviceId === a) {
  460. h = true;
  461. }
  462. }
  463. if (g[c].kind === "audioinput") {
  464. if (e.audio === void 0) e.audio = {};
  465. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) e.audio.deviceId = {exact: d.audio.deviceId};
  466. }
  467. }
  468. if(e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
  469. if (!(e.audio || e.video)) {
  470. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  471. } else if ("https:" === location.protocol || this.app.isDebug()) {
  472. debug("BROADCAST", "Initiating Media...");
  473. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  474. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  475. b.mediaLastConstraints = e;
  476. navigator.mediaDevices.getUserMedia(e).then(m => {
  477. b.onMediaSuccessCallback(m);
  478. });
  479. }
  480. }).catch(er => {
  481. debug("CAMERA::ERROR", er);
  482. });
  483. }
  484. };
  485. TCApp.BLL.Userlist.prototype.ignore = function(a) {
  486. var b = a.isUsername ? a.username : a.nickname;
  487. if (this.isIgnored(a) || this.ignored.push(b)) {
  488. let c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  489. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
  490. this.app.showToast(b + " ignored successfully till they leave or you refresh!");
  491. CTS.TempIgnoreList.push(b.toUpperCase());
  492. }
  493. };
  494. TCApp.BLL.Userlist.prototype.unignore = function(a) {
  495. let b = a.isUsername ? a.username : a.nickname,
  496. len = this.ignored.length;
  497. for (var TI = 0; TI<len; TI++) {
  498. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  499. this.ignored.splice(TI, 1);
  500. break;
  501. }
  502. }
  503. len = CTS.TempIgnoreList.length;
  504. for (TI = 0; TI<len; TI++) {
  505. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  506. CTS.TempIgnoreList.splice(TI, 1);
  507. break;
  508. }
  509. }
  510. let e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  511. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
  512. this.app.showToast(a.username + " unignored");
  513. };
  514.  
  515.  
  516. //REMOVE
  517. Remove(ChatLogElement, 'span[id="input-unread"]');
  518. Remove(ChatLogElement, "#chat-content");
  519. Remove(ChatLogElement, "#chat-wider");
  520. Remove(ChatLogElement, "#chatlog-button");
  521. Remove(SideMenuElement, "#top-buttons-wrapper");
  522. Remove(SideMenuElement, "#user-info");
  523. Remove(SideMenuElement, "#close-users");
  524. Remove(TitleElement, "#room-header-avatar");
  525. Remove(TitleElement, "#room-header-gifts");
  526. Remove(TitleElement, "#room-header-info-text");
  527. Remove(TitleElement, "#room-header-info-details");
  528. Remove(TitleElement, "#room-header-mobile-button");
  529. Remove(TitleElement, 'span[title="Follow"]');
  530. Remove(TitleElement, 'span[title="Share room"]');
  531. Remove(VideoListElement, "#youtube-overlay");
  532. Remove(VideoListElement, "#videos-header-volume");
  533. Remove(document, "#menu-icon");
  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. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  544. if (!CTS.ChatDisplay) {
  545. CTS.ChatWidth += 5;
  546. CTS.ChatDisplay = true;
  547. }
  548. CTS.ChatHeight -= 5;
  549. CTS.UserListDisplay = true;
  550. if (CTS.ChatHeight == 20) {
  551. CTS.ChatHeight = 45;
  552. CTS.UserListDisplay = false;
  553. }
  554. 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;" : "top:36px;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
  555. 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);" : "0;");
  556. 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;bottom:0;");
  557. VideoListElement.querySelector("#videos-header").style.cssText = "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + (CTS.UserListDisplay ? CTS.ChatHeight + "%;" : "unset;bottom:50px;");
  558. 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;";
  559. UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  560. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  561. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "36px;") + "right:-70px;display:block;";
  562. UpdateScroll(1, true);
  563. Resize();
  564. }, {
  565. passive: true
  566. });
  567. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  568. CTS.ChatWidth += 5;
  569. CTS.ChatDisplay = true;
  570. if (CTS.ChatWidth == 25) {
  571. CTS.ChatWidth = -5;
  572. CTS.ChatDisplay = false;
  573. }
  574. 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;" : "top:36px;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
  575. 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);" : "0;");
  576. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 34px);" : "unset;bottom:0;");
  577. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + ((CTS.UserListDisplay) ? CTS.ChatHeight + "%;" : "unset;bottom:50px;");
  578. 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;";
  579. UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  580. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  581. if (CTS.Me.mod) VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "36px;") + "right:-70px;display:block;";
  582. UpdateScroll(1, true);
  583. Resize();
  584. }, {
  585. passive: true
  586. });
  587. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  588. CTS.Featured = !CTS.Featured;
  589. if (CTS.Featured === true) {
  590. Remove(VideoListElement, "#SmallFTYT");
  591. } else {
  592. var node = document.createElement("style");
  593. node.appendChild(document.createTextNode(FeaturedCSS));
  594. node.setAttribute("id", "SmallFTYT");
  595. VideoListElement.appendChild(node);
  596. }
  597. Resize();
  598. }, {
  599. passive: true
  600. });
  601. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  602. CTS.ChatStyleCounter++;
  603. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  604. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  605. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  606. var len = CTS.ChatCSS.length - 1;
  607. if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
  608. ChatLogElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][0] + "</style>");
  609. VideoListElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][1] + "</style>");
  610. SideMenuElement.querySelector("style").insertAdjacentHTML("afterend", "<style id=\"" + CTS.ChatStyleCounter + "\">" + CTS.ChatCSS[CTS.ChatStyleCounter][2] + "</style>");
  611. Save("ChatStyle", CTS.ChatStyleCounter);
  612. }, {
  613. passive: true
  614. });
  615. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  616. UpdateScroll(1, true);
  617. CheckUnreadMessage();
  618. }, {
  619. passive: true
  620. });
  621. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  622. var element = event.target;
  623. if (Math.floor(element.scrollTop + 25) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage();
  624. }, {
  625. passive: true
  626. });
  627. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  628. var element = event.target;
  629. if (Math.floor(element.scrollTop + 25) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  630. }, {
  631. passive: true
  632. });
  633. if (CTS.Notification) {
  634. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {passive: true});
  635. }
  636. VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
  637. var arg;
  638. if (this.innerText === "⯈") {
  639. this.innerText = "⯇";
  640. arg = "block";
  641. } else {
  642. this.innerText = "⯈";
  643. arg = "none";
  644. }
  645. VideoListElement.querySelector("#videos-header-sound").style.display = arg;
  646. if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
  647. //VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
  648. VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
  649. VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
  650. }, {
  651. passive: true
  652. });
  653. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  654. CTS.MainBackgroundCounter++;
  655. if (CTS.MainBackgroundCounter === Images.length) CTS.MainBackgroundCounter = 0;
  656. document.body.style.background = "#000000 url(" + Images[CTS.MainBackgroundCounter] + ") no-repeat center";
  657. document.body.style.backgroundSize = "cover";
  658. Save("MainBackground", "url(" + Images[CTS.MainBackgroundCounter] + ")");
  659. }, {
  660. passive: true
  661. });
  662. VideoListElement.querySelector("button[id=\"BackgroundUpdateColor\"]").addEventListener("click", function() {
  663. CTS.MainBackgroundColorCounter++;
  664. if (CTS.MainBackgroundColorCounter === Colors.length) CTS.MainBackgroundColorCounter = 0;
  665. document.body.style.background = Colors[CTS.MainBackgroundColorCounter];
  666. Save("MainBackground", Colors[CTS.MainBackgroundColorCounter]);
  667. }, {
  668. passive: true
  669. });
  670. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  671. CTS.MainBackgroundCounter--;
  672. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = Images.length - 1;
  673. document.body.style.background = "#000000 url(" + Images[CTS.MainBackgroundCounter] + ") no-repeat center";
  674. document.body.style.backgroundSize = "cover";
  675. Save("MainBackground", "url(" + Images[CTS.MainBackgroundCounter] + ")");
  676. }, {
  677. passive: true
  678. });
  679. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  680. CTS.FontSize += 5;
  681. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  682. Save("FontSize", CTS.FontSize);
  683. ChatLogElement.querySelector("#textarea").style.fontSize = (CTS.FontSize - 4) + "px";
  684. }, {
  685. passive: true
  686. });
  687. //MUTATION OBSERVERS
  688. new MutationObserver(function() {
  689. LoadMessage();
  690. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  691. attributes: true,
  692. attributeFilter: ["class"],
  693. childList: false,
  694. characterData: false
  695. });
  696. new MutationObserver(function() {
  697. Cameras();
  698. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  699. childList: true
  700. });
  701. new MutationObserver(function() {
  702. Cameras();
  703. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  704. childList: true
  705. });
  706. new MutationObserver(function() {
  707. if (CTS.AutoMicrophone) {
  708. OpenMicrophone();
  709. }
  710. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  711. attributes: true,
  712. attributeFilter: ["class"]
  713. });
  714. //REFRESH VIEW
  715. NotificationDisplay();
  716. Cameras();
  717. }
  718.  
  719. //YOUTUBE FUNCTIONS
  720. function CheckHost() {
  721. if (CTS.Host === 0) {
  722. Send("msg", "!whoisbot");
  723. CTS.HostAttempt = 0;
  724. CTS.HostWaiting = true;
  725. }
  726. }
  727.  
  728. function SetBot(stillbot) {
  729. if (stillbot) {
  730. CTS.Game.NoReset = true;
  731. }
  732. Send("msg", "!bot");
  733. CTS.HostWaiting = false;
  734. }
  735.  
  736. function CheckYouTube() {
  737. if (arguments[3] === undefined) arguments[3] = true;
  738. CTS.YouTube.XHR.type = arguments[1];
  739. 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);
  740. if (videoid !== null) {
  741. videoid = videoid[1].replace(/v\=/g, "");
  742. if (videoid.match(/list\=/i)) {
  743. if (arguments[3]) {
  744. videoid = videoid.replace(/list\=/, "");
  745. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  746. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/playlistItems?playlistId=" + videoid + "&part=snippet&maxResults=50" + ((arguments[2] !== undefined) ? "&pageToken=" + arguments[2] : "") + "&type=video&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  747. CTS.YouTube.XHR.playlistid = videoid;
  748. CTS.YouTube.XHR.send();
  749. }
  750. } else {
  751. CTS.YouTube.XHR.videoid = videoid;
  752. CTS.YouTube.VideoReturn = true;
  753. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.XHR.videoid + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  754. CTS.YouTube.XHR.send();
  755. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  756. }
  757. } else {
  758. if (CTS.YouTube.MessageQueueList.length <= 0) {
  759. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  760. CTS.YouTube.SearchReturn = true;
  761. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/search?key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg&maxResults=1&q=" + encodeURI(arguments[0]) + "&type=video&part=snippet");
  762. CTS.YouTube.XHR.send();
  763. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  764. }
  765. }
  766. }
  767.  
  768. function YouTubePlayList() {
  769. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  770. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  771. }
  772.  
  773. function YouTubeTrackAdd() {
  774. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  775. if (CTS.YouTube.Busy === false) {
  776. if (CTS.YouTube.MessageQueueList.length > 0) {
  777. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  778. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  779. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  780. CTS.YouTube.XHR.send();
  781. CTS.YouTube.MessageQueueList.shift();
  782. }
  783. }
  784. }
  785. }
  786.  
  787. function YouTubePlayListItems() {
  788. var len = arguments[0].length;
  789. for (var i = 0; i < len; i++) {
  790. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  791. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  792. }
  793. }
  794. }
  795.  
  796. function YouTubePlayListRemove() {
  797. var len = arguments[0].length;
  798. for (var i = 0; i < len; i++) {
  799. setTimeout(Send("yut_playlist_remove", [arguments[0][i].id, arguments[0][i].duration, arguments[0][i].title, arguments[0][i].image]), (i * 5), arguments[0]);
  800. }
  801. }
  802.  
  803. function YouTubeTimeConvert() {
  804. var a = arguments[0].match(/\d+/g);
  805. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  806. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  807. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  808. var len = a.length;
  809. arguments[0] = 0;
  810. if (len == 3) {
  811. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  812. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  813. arguments[0] = arguments[0] + parseInt(a[2]);
  814. }
  815. if (len == 2) {
  816. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  817. arguments[0] = arguments[0] + parseInt(a[1]);
  818. }
  819. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  820. return arguments[0];
  821. }
  822.  
  823. function BotCommandCheck(){
  824. // text:user
  825. if (arguments[1].match(/^!play$/i)) YouTubePlayList();
  826. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  827. if (arguments[1].match(/^!yt\s/i)) BotCommand(1, arguments[0], arguments[1]);
  828. if (arguments[1].match(/^!ytbypass\s/i)) BotCommand(6, arguments[0], arguments[1]);
  829. if (arguments[1].match(/^!ytclear$/i)) BotCommand(2, arguments[0]);
  830. if (arguments[1].match(/^!ytskip$/i)) BotCommand(3, arguments[0]);
  831. if (arguments[1].match(/^!ytqueue$/i)) BotCommand(4, arguments[0]);
  832. //Fun
  833. if (arguments[1].match(/^!8ball\s.*\?/i)) Send("msg", CTS.EightBall[Rand(0, CTS.EightBall.length - 1)]);
  834. if (arguments[1].match(/^!coin$/i)) Send("msg", "The coin landed on "+((Rand(0, 1)==1)?"heads":"tails")+"!");
  835. //Can Game Check
  836. if(CTS.UserList[arguments[0]].canGame) {
  837. //Fish
  838. FishCommandCheck(arguments[0], arguments[1]);
  839. }
  840. }
  841.  
  842. function BotCheck() {
  843. if (CTS.UserList[arguments[0]].mod) {
  844. //CHECK YOUTUBE HOST
  845. if (CTS.Host == CTS.Me.handle) {
  846. if(arguments[1].match(/^!startboat$/i) && !CTS.Game.Fish.GameStart) {
  847. CTS.Game.Fish.GameStart = true;
  848. Fish.init();
  849. }
  850. if(arguments[1].match(/^!stopboat$/i)) {
  851. CTS.Game.Fish.GameStart = false;
  852. Fish.stop();
  853. }
  854. }
  855. if (CTS.Room.YT_ON===true) {
  856. if(arguments[1].match(/^!bot$/i)) {
  857. //SET HOST&CONTINUE YT
  858. CTS.Host = arguments[2].handle;
  859. CTS.HostWaiting = false;
  860. //RESET GAMES
  861. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  862. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  863. if (CTS.Me.handle !== arguments[2].handle) {
  864. CTS.Game.Fish.GameStart = false;
  865. CTS.Game.NoReset = false;
  866. Fish.reset(true);
  867. }
  868. }
  869. if (CTS.Me.handle == arguments[2].handle) {
  870. YouTubePlayList();
  871. }
  872. } else if (CTS.HostWaiting === true) {
  873. CTS.HostAttempt++;
  874. if (CTS.HostAttempt == 1) {
  875. setTimeout(function() {
  876. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  877. }, 6000);
  878. }
  879. if (CTS.HostAttempt == 10) SetBot(false);
  880. }
  881. }
  882. }
  883. }
  884.  
  885. CTS.YouTube.XHR.onload = function() {
  886. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  887. if (response.error) {
  888. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  889. } else {
  890. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  891. CTS.YouTube.ListBuilt = true;
  892. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  893. CTS.YouTube.DataReady = true;
  894. CTS.YouTube.Busy = false;
  895. YouTubeTrackAdd();
  896. }
  897. CTS.YouTube.DataReady = false;
  898. if (response.items[0]) {
  899. CTS.YouTube.Busy = true;
  900. if (response.items[0].id) {
  901. if (response.kind == "youtube#playlistItemListResponse") {
  902. YouTubePlayListItems(response.items);
  903. } else {
  904. CTS.YouTube.VideoID = response.items[0].id.videoId;
  905. CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.VideoID + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg");
  906. CTS.YouTube.XHR.send();
  907. }
  908. } else if (response.items[0].contentDetails.duration) {
  909. CTS.YouTube.DataReady = true;
  910. }
  911. if (CTS.YouTube.DataReady === false) {
  912. CTS.YouTube.Busy = false;
  913. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  914. if (response.kind == "youtube#playlistItemListResponse") {
  915. if (response.nextPageToken !== undefined) {
  916. CTS.YouTube.ListBuilt = false;
  917. CheckYouTube("https://www.youtube.com/playlist?list=" + CTS.YouTube.XHR.playlistid, false, response.nextPageToken);
  918. CTS.YouTube.Busy = true;
  919. } else {
  920. CTS.YouTube.ListBuilt = true;
  921. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  922. CTS.YouTube.Busy = false;
  923. }
  924. }
  925. } else {
  926. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  927. if (CTS.YouTube.Playing === true) {
  928. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  929. 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]);
  930. CTS.YouTube.Busy = false;
  931. } else {
  932. if (response.items[0].snippet.title !== undefined) {
  933. 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]);
  934. 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]);
  935. CTS.YouTube.Playing = true;
  936. }
  937. CTS.YouTube.Busy = false;
  938. }
  939. }
  940. }
  941. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  942. var title = "";
  943. CTS.YouTube.SearchReturn = false;
  944. CTS.YouTube.VideoReturn = false;
  945. if (response.items[0] !== undefined) {
  946. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  947. }
  948. if (response.items !== undefined) {
  949. if (response.items.length > 0) title = response.items[0].snippet.title;
  950. }
  951. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  952. }
  953. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  954. }
  955. };
  956. // Message Functions
  957. function CreateMessage() {
  958. CheckUnreadMessage();
  959. 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>");
  960. var Chat = ChatLogElement.querySelectorAll("#cts-chat-content>.message");
  961. var len = Chat.length;
  962. if (len > CTS.ChatLimit + 50) {
  963. CTS.ChatScroll = true;
  964. len = Chat.length - CTS.ChatLimit;
  965. var ChatIndex = 0;
  966. for (ChatIndex; ChatIndex < len; ChatIndex++) {
  967. Chat[ChatIndex].parentNode.removeChild(Chat[ChatIndex]);
  968. CTS.Message[arguments[6]].shift();
  969. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  970. }
  971. }
  972. UpdateScroll(1, false);
  973. }
  974.  
  975. function AKB() {
  976. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  977. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  978. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  979. } else {
  980. if (CTS.Me.mod) {
  981. if (CTS.AutoKick === true) {
  982. CTS.NoGreet = true;
  983. Send("kick", arguments[1]);
  984. } else if (CTS.AutoBan === true) {
  985. CTS.NoGreet = true;
  986. Send("ban", arguments[1]);
  987. }
  988. }
  989. }
  990. }
  991.  
  992. function AISB() {
  993. if (arguments[0].username !== "") {
  994. if (!CTS.SafeList.includes(arguments[0].username.toUpperCase())) {
  995. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  996. if (CTS.SafeList.length < 1000) {
  997. CTS.SafeList.push(arguments[0].username.toUpperCase());
  998. Save("AKB", JSON.stringify(CTS.SafeList));
  999. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1000. }
  1001. } else {
  1002. if (arguments[0].lurker === false) {
  1003. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1004. } else {
  1005. AKB(false, arguments[0].handle);
  1006. }
  1007. }
  1008. }
  1009. } else {
  1010. AKB(false, arguments[0].handle);
  1011. }
  1012. }
  1013.  
  1014. function LoadMessage() {
  1015. var ChatIndex, index, Chat = ChatLogElement.querySelector("#cts-chat-content");
  1016. CTS.ChatScroll = true;
  1017. if (!CTS.MessageCallback[CTS.ActiveMessage]) CTS.MessageCallback[CTS.ActiveMessage] = [];
  1018. CTS.MessageCallback[CTS.ActiveMessage].html = Chat.innerHTML;
  1019. CTS.MessageCallback[CTS.ActiveMessage].len = (Chat.innerHTML === "") ? 0 : CTS.Message[CTS.ActiveMessage].length;
  1020. Chat.innerHTML = "";
  1021. CheckUnreadMessage();
  1022. CTS.ActiveMessage = GetActiveChat();
  1023. if (CTS.Message[CTS.ActiveMessage]) {
  1024. index = (CTS.MessageCallback[CTS.ActiveMessage]) ? CTS.MessageCallback[CTS.ActiveMessage].len : 0;
  1025. if (index > 0) Chat.innerHTML = CTS.MessageCallback[CTS.ActiveMessage].html;
  1026. var len = CTS.Message[CTS.ActiveMessage].length;
  1027. 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>");
  1028. } else {
  1029. CTS.Message[CTS.ActiveMessage] = [];
  1030. }
  1031. UpdateScroll(1, false);
  1032. }
  1033.  
  1034. function CheckUnreadMessage() {
  1035. if (Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) {
  1036. CTS.MissedMsg = 0;
  1037. CTS.ChatScroll = true;
  1038. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1039. } else {
  1040. CTS.MissedMsg++;
  1041. CTS.ChatScroll = false;
  1042. if (ChatLogElement.querySelector(".cts-message-unread").style.display == "none") {
  1043. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1044. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1045. }
  1046. }
  1047. }
  1048.  
  1049. function GetActiveChat() {
  1050. var elem = ChatListElement.querySelector(".active");
  1051. if (elem) return elem.getAttribute("data-chat-id");
  1052. return 0;
  1053. }
  1054.  
  1055. function CheckImgur() {
  1056. if (CTS.imgur) {
  1057. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpg|gif|png|mp4)/);
  1058. if (i !== null) {
  1059. arguments[0] = (i[1] == "mp4") ? "<center>(Video Below)\n<video onclick=\"if (this.paused) {this.play();}else{this.pause();}\" oncontextmenu=\"return false;\" width=\"320px\" height=\"240px\"><source src=\"" + i[0] + "\" type=\"video/mp4\" /><source src=\"https://i.imgur.com/qLOIgom.mp4\" type=\"video/mp4\" /></video>\n<a href=\"" + i[0] + "\" target=\"_blank\">Direct Link</a></center>" : "<center><img src=\"" + i[0] + "\" width=\"320px\" height=\"240px\" />\n<a href=\"" + i[0] + "\" target=\"_blank\">Direct Link</a></center>";
  1060. }
  1061. }
  1062. return arguments[0];
  1063. }
  1064.  
  1065. function TTS() {
  1066. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1067. utter.voice = CTS.TTS.voices[0];
  1068. utter.rate = 1.0;
  1069. utter.pitch = 0.5;
  1070. CTS.TTS.synth.speak(utter);
  1071. }
  1072.  
  1073. function RoomUsers() {
  1074. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  1075. }
  1076.  
  1077. function SpamPrevention() {
  1078. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  1079. if (LineBreaks >= 14 && arguments[1] === false) return true;
  1080. return false;
  1081. }
  1082.  
  1083. function GamePrevention () {
  1084. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(?:FISHING\sBOAT)\]/i)) return false;
  1085. return true;
  1086. }
  1087.  
  1088. function UpdateScroll() {
  1089. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  1090. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true)) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  1091. }
  1092.  
  1093. function DecodeTXT() {
  1094. var txt = document.createElement("textarea");
  1095. txt.innerHTML = arguments[0];
  1096. return txt.value;
  1097. }
  1098.  
  1099. function HTMLtoTXT() {
  1100. var p = document.createElement("p");
  1101. p.appendChild(document.createTextNode(arguments[0]));
  1102. 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>");
  1103. }
  1104.  
  1105. function TimeToDate() {
  1106. if (arguments[1] === undefined) arguments[1] = new Date();
  1107. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((am|AM|aM|Am)|(pm|PM|pM|Pm))/);
  1108. var t = {
  1109. hours: parseInt(match[1]),
  1110. minutes: parseInt(match[2]),
  1111. period: match[3].toLowerCase()
  1112. };
  1113. if (t.hours === 12) {
  1114. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  1115. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  1116. } else {
  1117. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  1118. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  1119. }
  1120. return arguments[1];
  1121. }
  1122.  
  1123. function PushPM() {
  1124. var list = (arguments[2] !== undefined) ? CTS.UserList[arguments[2]] : CTS.Me;
  1125.  
  1126. CTS.Message[arguments[0]].push({
  1127. "time": Time(),
  1128. "namecolor": list.namecolor,
  1129. "avatar": list.avatar,
  1130. "username": list.username,
  1131. "nick": list.nick,
  1132. "msg": CheckImgur(HTMLtoTXT(arguments[1]))
  1133. });
  1134.  
  1135. if (arguments[0] == GetActiveChat()) {
  1136. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1137. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, arguments[0]);
  1138. UpdateScroll(1, false);
  1139. }
  1140. }
  1141.  
  1142. function Time() {
  1143. return (new Date().toLocaleString("en-US", {
  1144. hour: "numeric",
  1145. minute: "numeric",
  1146. second: "numeric",
  1147. hour12: true
  1148. }));
  1149. }
  1150. // Features
  1151. function MessagePopUp() {
  1152. if (CTS.Popups) {
  1153. var push = false;
  1154. if (arguments[0] != -1) {
  1155. if (ChatListElement.querySelector(".list-item .active")) {
  1156. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  1157. if (arguments[2]) push = true;
  1158. } else {
  1159. push = true;
  1160. }
  1161. } else if (!arguments[2]) {
  1162. push = true;
  1163. }
  1164. }
  1165. if (arguments[3]) push = true;
  1166. if (push) {
  1167. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  1168. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1169. clearTimeout(CTS.NotificationTimeOut[0]);
  1170. CTS.NotificationTimeOut.shift();
  1171. }
  1172. 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>");
  1173. CTS.NotificationTimeOut.push(setTimeout(function() {
  1174. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  1175. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1176. CTS.NotificationTimeOut.shift();
  1177. }
  1178. }, 11100));
  1179. }
  1180. }
  1181. }
  1182.  
  1183. function Reminder() {
  1184. var temp,
  1185. i,
  1186. len = CTS.ReminderServerInList.length;
  1187. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  1188. CTS.ReminderServerInList = [];
  1189. if (CTS.Reminder === true) {
  1190. len = CTS.ReminderList.length;
  1191. for (i = 0; i < len; i++) {
  1192. temp = TimeToDate(CTS.ReminderList[i][0]);
  1193. CTS.RecentTime = new Date();
  1194. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  1195. var OffsetTime = temp - CTS.RecentTime;
  1196. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, arguments[0], CTS.ReminderList[i][1], i));
  1197. }
  1198. }
  1199. }
  1200.  
  1201. function AddReminder() {
  1202. Send("msg", "🕬 " + arguments[1]);
  1203. setTimeout(Reminder, 5000, arguments[0]);
  1204. }
  1205.  
  1206. function NotificationDisplay() {
  1207. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.Notification) ? "block" : "none") + ";";
  1208. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.Notification) ? "block" : "none") + ";";
  1209. if (CTS.Notification) {
  1210. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {passive: true});
  1211. } else {
  1212. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {passive: true});
  1213. }
  1214. }
  1215.  
  1216. function NotificationResize() {
  1217. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  1218. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  1219. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  1220. ChatLogElement.querySelector("#chat").style.height="0%";
  1221. ChatLogElement.querySelector("#input").style.display="none";
  1222. } else {
  1223. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  1224. ChatLogElement.querySelector("#chat").style.height="100%";
  1225. ChatLogElement.querySelector("#input").style.display="block";
  1226. }
  1227. }
  1228.  
  1229. function Dice() {
  1230. return String.fromCharCode("0x268" + Rand(0, 5));
  1231. }
  1232.  
  1233. function Rand() {
  1234. arguments[0] = Math.ceil(arguments[0]);
  1235. arguments[1] = Math.floor(arguments[1]);
  1236. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  1237. }
  1238.  
  1239. function OpenMicrophone() {
  1240. MicrophoneElement.initMouseEvent("mousedown");
  1241. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  1242. }
  1243.  
  1244. function Cameras() {
  1245. var Camera = VideoListElement.querySelectorAll(".videos-items:first-child>.js-video");
  1246. for (var featured = 1; featured < Camera.length; featured++) {
  1247. if (!Camera[featured].querySelector("tc-video-item").shadowRoot.querySelector(".video #fixed")) {
  1248. 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>");
  1249. }
  1250. }
  1251. Camera = VideoListElement.querySelectorAll(".videos-items:last-child>.js-video");
  1252. for (var normal = 0; normal < Camera.length; normal++) {
  1253. if (!Camera[normal].querySelector("tc-video-item").shadowRoot.querySelector(".video #fixed")) {
  1254. 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>");
  1255. }
  1256. }
  1257. Resize();
  1258. }
  1259.  
  1260. function Resize() {
  1261. window.dispatchEvent(new Event("resize"));
  1262. }
  1263.  
  1264. function OwnerCommand(){
  1265. if (CTS.UserList[arguments[0]].owner && !CTS.Me.owner) {
  1266. //PROCEED WITH CAUTION
  1267. if (arguments[1].match(/^!raid\s/i)) {
  1268. var raid = arguments[1].match(/^(?:\!raid\s)(https?:\/\/tinychat.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?(?:[a-z0-9_]){1,32})/i);
  1269. if (raid !== undefined) window.location.replace(raid[1]);
  1270. }
  1271. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using "+CTS.Project.Name+"v"+CTS.Project.Version, CTS.UserList[arguments[0]].handle);
  1272.  
  1273. }
  1274. }
  1275.  
  1276. function Command() {
  1277. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?:\s?)(.*)/i);
  1278. if (UserCommand) {
  1279. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  1280. //debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1]+":"+UserCommand[2]);
  1281. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  1282. }
  1283. }
  1284. }
  1285. // Alert Functions
  1286. function Settings() {
  1287. Alert(GetActiveChat(), ((arguments[0] !== undefined) ? arguments[0] : "") + "<center>CTS BOT CONFIGURATION:\nBot Mode: " + ((CTS.Bot) ? "AUTO" : "OFF") + "\nOperator Mode: " + ((CTS.UserYT) ? "ON" : "OFF") + "\nReminder Mode: " + ((CTS.Reminder) ? "ON" : "OFF") + "\nGame View: " + ((CTS.CanSeeGames) ? "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>");
  1288. }
  1289.  
  1290. function Alert() {
  1291. CTS.Message[arguments[0]].push({
  1292. "time": Time(),
  1293. "namecolor": "#3f69c0",
  1294. "avatar": "https://i.imgur.com/S09irS7.png",
  1295. "username": "",
  1296. "nick": ("CTS Version: " + CTS.Project.Version),
  1297. "msg": arguments[1]
  1298. });
  1299. var len = CTS.Message[arguments[0]].length - 1;
  1300. arguments[1] = CTS.Message[arguments[0]][len];
  1301. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[0]);
  1302. }
  1303.  
  1304. function AddUserNotification() {
  1305. if (CTS.ScriptInit) {
  1306. var chat = ChatLogElement.querySelector("#notification-content"),
  1307. Notification;
  1308. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  1309. if (arguments[0] == 1) {
  1310. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  1311. } else if (arguments[0] == 2) {
  1312. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left");
  1313. } else if (arguments[0] == 3) {
  1314. Notification = arguments[2] + "has mentioned you!";
  1315. 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>");
  1316. UpdateScroll(2, true);
  1317. } else if (arguments[0] == 4) {
  1318. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  1319. }
  1320. 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>");
  1321. 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);
  1322. UpdateScroll(2, false);
  1323. var Notifications = ChatLogElement.querySelectorAll(".notification");
  1324. if (Notifications.length > CTS.NotificationLimit + 10) {
  1325. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  1326. }
  1327. }
  1328. }
  1329.  
  1330. function AddSystemNotification() {
  1331. if (CTS.ScriptInit) {
  1332. 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>");
  1333. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  1334. UpdateScroll(2, false);
  1335. }
  1336. }
  1337. // User Functions
  1338. function AddUser() {
  1339. CTS.UserList.push({
  1340. "handle": arguments[0],
  1341. "username": arguments[5],
  1342. "nick": arguments[4],
  1343. "owner":arguments[7],
  1344. "mod": arguments[1],
  1345. "namecolor": arguments[2],
  1346. "avatar": arguments[3],
  1347. "canGame": arguments[6],
  1348. });
  1349. AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  1350. }
  1351.  
  1352. function User() {
  1353. for (var user = 0; user < CTS.UserList.length; user++) {
  1354. if (CTS.UserList[user].handle == arguments[0]) return user;
  1355. }
  1356. return -1;
  1357. }
  1358.  
  1359. function UsernameToHandle() {
  1360. for (var user = 0; user < CTS.UserList.length; user++) {
  1361. if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  1362. }
  1363. return -1;
  1364. }
  1365.  
  1366. function CheckUserListSafe() {
  1367. var len = CTS.UserList.length;
  1368. for (var user = 0; user < len; user++) {
  1369. if (!CTS.SafeList.includes(CTS.UserList[user].username)) {
  1370. CTS.KBQueue.push(CTS.UserList[user].handle);
  1371. }
  1372. }
  1373. len = CTS.KBQueue.length;
  1374. for (var kb = 0; kb < len; kb++) {
  1375. Send(arguments[0], CTS.KBQueue[kb]);
  1376. }
  1377. CTS.KBQueue = [];
  1378. }
  1379.  
  1380. function CheckUserTempIgnore() {
  1381. if (CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1382. return false;
  1383. }
  1384.  
  1385. function CheckUserIgnore() {
  1386. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.IgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1387. return false;
  1388. }
  1389.  
  1390. function CheckUserAbuse() {
  1391. if (CTS.Me.mod) {
  1392. if ((CTS.KickList.includes(arguments[1]) || CTS.KickList.includes(arguments[2]))) {
  1393. CTS.NoGreet = true;
  1394. Send("kick", arguments[0]);
  1395. }
  1396. if ((CTS.BanList.includes(arguments[1]) || CTS.BanList.includes(arguments[2]))) {
  1397. CTS.NoGreet = true;
  1398. Send("ban", arguments[0]);
  1399. }
  1400. }
  1401. }
  1402.  
  1403. function CheckUserKeywordAbuse() {
  1404. if (arguments[0] != CTS.Me.handle) {
  1405. var len = CTS.KickKeywordList.length;
  1406. for (var i = 0; i < len; i++) {
  1407. if (arguments[1].includes(CTS.KickKeywordList[i])) Send("kick", arguments[0]);
  1408. }
  1409. len = CTS.BanKeywordList.length;
  1410. for (i = 0; i < len; i++) {
  1411. if (arguments[1].includes(CTS.BanKeywordList[i])) Send("ban", arguments[0]);
  1412. }
  1413. }
  1414. }
  1415.  
  1416. function CheckUserStream() {
  1417. var user = User(arguments[0]);
  1418. if (user != -1) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  1419. }
  1420.  
  1421. function CheckUserName() {
  1422. return arguments[0].match(/^(-all|[a-z0-9_]){1,32}$/i);
  1423. }
  1424. // Load/Save Function
  1425. function Load() {
  1426. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  1427. if (null === val && "undefined" != typeof arguments[1]) {
  1428. Save(arguments[0], arguments[1]);
  1429. return arguments[1];
  1430. }
  1431. return val;
  1432. }
  1433.  
  1434. function Save() {
  1435. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  1436. }
  1437. // Socket functions
  1438. function CTSWebSocket() {
  1439. if (window.Proxy === undefined) return;
  1440. var handler = {
  1441. set: function(Target, prop, value) {
  1442. if (prop == "onmessage") {
  1443. var oldMessage = value;
  1444. value = function(event) {
  1445. var parse = JSON.parse(event.data);
  1446. ServerMsg(parse, Target);
  1447. oldMessage(event);
  1448. };
  1449. }
  1450. return (Target[prop] = value);
  1451. },
  1452. get: function(Target, prop) {
  1453. var value = Target[prop];
  1454. if (prop == "send") {
  1455. value = function(event) {
  1456. var parse = JSON.parse(event);
  1457. ClientMsg(parse, Target);
  1458. Target.send(event);
  1459. };
  1460. }
  1461. return value;
  1462. }
  1463. };
  1464. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  1465. construct: function(Target, args) {
  1466. CTS.SocketTarget = new Target(args[0]);
  1467. debug("SOCKET::CONNECTING", args[0]);
  1468. return new window.Proxy(CTS.SocketTarget, handler);
  1469. }
  1470. });
  1471. window.WebSocket = WebSocketProxy;
  1472. }
  1473.  
  1474. function BotCommand() {
  1475. var len = CTS.YouTube.MessageQueueList.length;
  1476. if (len <= 0) {
  1477. // Moderator Control
  1478. if (CTS.UserList[arguments[1]].mod) {
  1479. if (arguments[0] == 2) {
  1480. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1481. CTS.YouTube.Clear = true;
  1482. YouTubePlayList();
  1483. }
  1484. }
  1485. if (arguments[0] == 5) SetBot(true);
  1486. }
  1487. // User and Moderator Control
  1488. if ((CTS.UserYT && (CTS.BotOPList.includes(CTS.UserList[arguments[1]].username) || CTS.BotOPList.includes("-ALL"))) || CTS.UserList[arguments[1]].mod) {
  1489. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  1490. if (arguments[0] == 4) YouTubePlayList(true);
  1491. if (arguments[0] == 6) {
  1492. if (CTS.UserList[arguments[1]].mod) {
  1493. 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);
  1494. if (videoid !== null) {
  1495. CTS.SocketTarget.send(JSON.stringify({
  1496. "tc": "yut_play",
  1497. "item": {
  1498. "id": videoid[1],
  1499. "duration": 7200,
  1500. "offset": 0,
  1501. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1502. }
  1503. }));
  1504. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1505. }
  1506. } else {
  1507. Send("msg", "Ask a moderator to play your request.");
  1508. }
  1509. }
  1510. if (arguments[0] == 3) {
  1511. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1512. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  1513. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  1514. }
  1515. }
  1516. }
  1517. } else {
  1518. if (CTS.YouTube.ListBuilt === false) {
  1519. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  1520. } else {
  1521. Send("msg", "🎵 Playlist items are being added, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  1522. }
  1523. }
  1524. }
  1525.  
  1526. function ServerMsg() {
  1527. if (typeof ServerInList[arguments[0].tc] == "function") {
  1528. //debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  1529. ServerInList[arguments[0].tc](arguments[0]);
  1530. }
  1531. }
  1532.  
  1533. function ClientMsg() {
  1534. if (typeof ServerOutList[arguments[0].tc] == "function") {
  1535. //debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  1536. ServerOutList[arguments[0].tc](arguments[0]);
  1537. }
  1538. }
  1539.  
  1540. function Send() {
  1541. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  1542. if (arguments[1] === undefined) arguments[1] = "Open Request";
  1543. //debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  1544. }
  1545. // Game Functions
  1546. // Fishing Boat
  1547. function FishUpgradeStatus(playerExist, type) {
  1548. var msg = "[FISHING BOAT]\nCommand Delay:30s\n";
  1549. if (type != 7) msg += playerExist.Nickname+":\n";
  1550. if (type == 0 || type == 1 ) msg += "[NET]Lv. "+playerExist.Upgrades.Net+"\n"+((playerExist.Upgrades.Net>= 10)?"[MAXED]":"[$"+(1000 * playerExist.Upgrades.Net * 5)+" to UPGRADE]\n\n");
  1551. if (type == 0 || type == 2 ) msg += "[RADAR]Lv. "+playerExist.Upgrades.Radar+"\n"+((playerExist.Upgrades.Radar >= 38)?"[MAXED]":"[$"+((3500*playerExist.Upgrades.Radar*2)+3500)+" to UPGRADE]")+"\n\n";
  1552. if (type == 0 || type == 3 ) msg += "[INSURANCE]\n"+((playerExist.Upgrades.Insurance)?"[OWNED]":"[$20000 to BUY]")+"\n\n";
  1553. if (type == 0 || type == 4 ) msg += "[SHOP]Lv. "+playerExist.Upgrades.Store+"\n"+((playerExist.Upgrades.Store>=6)?"[MAXED]":"[$"+(playerExist.Upgrades.Store*playerExist.Upgrades.Store*25000)+" to UPGRADE]")+"\n\n";
  1554. if (type == 0 || type == 5 ) msg += "[FACTORY]Lv. "+playerExist.Upgrades.Factory+"\n"+((playerExist.Upgrades.Factory >= 5)?"[maxed]":"[$"+((50000*playerExist.Upgrades.Factory*playerExist.Upgrades.Factory)+50000)+" to UPGRADE]")+"\n\n";
  1555. if (type == 6) msg += "HELP:\n!fish\n!fishbank\n!fishsplit user|nick\n!fishrob user|nick\n[$100000]\n!fishslap user|nick\n[$1000000]\n!fishupgrade\n!fishupgrade\n[Rod|Net|Radar|Insurance|Shop|Factory]\n\n";
  1556. Send("msg", msg);
  1557. }
  1558.  
  1559. function FishTimerCheck(playerExist) {
  1560. if (new Date() - playerExist.LastCheck >= 30000) {
  1561. playerExist.LastCheck = new Date();
  1562. return true;
  1563. }
  1564. return false;
  1565. }
  1566.  
  1567. function FishCommandCheck() {
  1568. var command,
  1569. playerExist = Fish.getPlayer(CTS.UserList[arguments[0]].handle, false, true),
  1570. FishCommand = arguments[1].match(/^\!(fish(?:rob|slap|split|help|upgrade)?)\s?(?:([a-z0-9_]*)|rod|net|factory|shop|radar|insurance)?$/i);
  1571.  
  1572. if (FishCommand) {
  1573. if (FishCommand[1]==="fishslap"||FishCommand[1]==="fishrob"||FishCommand[1]==="fishsplit") {
  1574. if (FishCommand[2] !== undefined) {
  1575. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") {
  1576. console.log("user to user attack");
  1577. FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  1578. }
  1579. }
  1580. } else {
  1581. command = ((FishCommand[2] !== undefined)?FishCommand[1]+FishCommand[2]:FishCommand[1]);
  1582. console.log(command);
  1583. if (typeof FishList[command.toLowerCase()] == "function") {
  1584. console.log("non user to user attack");
  1585. FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  1586. }
  1587. }
  1588. }
  1589. }
  1590.  
  1591. function FishTransfer(playerExist, target, cost, deduct, rob) {
  1592. if (target!==undefined&&target!==-1) {
  1593. if (playerExist.Points > cost) {
  1594. if (rob) {
  1595. playerExist.Points -= cost;
  1596. target.Points -= deduct;
  1597. playerExist.Points += deduct;
  1598. Send("msg", "[FISHING BOAT]\n"+playerExist.Nickname+ " robbed "+ target.Nickname+" for $"+deduct+"!");
  1599. } else {
  1600. playerExist.Points = deduct;
  1601. target.Points += deduct;
  1602. Send("msg", "[FISHING BOAT]\n"+playerExist.Nickname+ " split their money with "+ target.Nickname+"!");
  1603. }
  1604. } else {
  1605. Send("msg", "[FISHING BOAT]\n"+playerExist.Nickname+" are you kidding me?\nTalk to me when you have money!");
  1606. }
  1607. }
  1608. }
  1609.  
  1610. function FishTransaction(playerExist, cost, status) {
  1611. if (playerExist.Points > cost) {
  1612. playerExist.Points -= cost;
  1613. return true;
  1614. } else {
  1615. Send("msg", "[FISHING BOAT]\n"+playerExist.Nickname+", are you kidding me?\nTalk to me when you have money!");
  1616. return false;
  1617. }
  1618. }
  1619.  
  1620. // Server / Client List Functions
  1621. var UnicodeConversionList = {
  1622. convert: function() {
  1623. return this.numerical(arguments[0]).replace(/[A-Za-z]/g, this.alphabet);
  1624. },
  1625. alphabet: function() {
  1626. return String.fromCodePoint(arguments[0].codePointAt(0) + ((/[A-Z]/.test(arguments[0])) ? "𝗔".codePointAt(0) - "A".codePointAt(0) : "𝗮".codePointAt(0) - "a".codePointAt(0)));
  1627. },
  1628. numerical: function() {
  1629. return arguments[0].replace(/\d/g, function(c) {
  1630. return String.fromCodePoint(0x1D79E + c.charCodeAt(0));
  1631. });
  1632. }
  1633. };
  1634. var CommandList = {
  1635. cts: function() {
  1636. Alert(GetActiveChat(), "<b style=\"color:#ee3636;\">Owner Commands:</b>\n!raid <b style=\"color:#ffff00;\">tc link</b>\n!version\n\n<b style=\"color:#ee3636;\">Moderator Commands:</b>\n!whoisbot\n!bot\n!bottoggle\n!autokick (be careful!)\n!autoban (be careful!)\n\n!ytbypass <b style=\"color:#ffff00;\">link (no playlists)</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytclear\n\n!banlist\n!banlistclear\n!banadd <b style=\"color:#ffff00;\">user | nick</b>\n!banremove <b style=\"color:#ffff00;\">#</b>\n\n!bankeywordlist\n!bankeywordlistclear\n!bankeywordadd <b style=\"color:#ffff00;\">keyword</b>\n!bankeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!kicklist\n!kicklistclear\n!kickadd <b style=\"color:#ffff00;\">user | nick</b>\n!kickremove <b style=\"color:#ffff00;\">#</b>\n\n!kickkeywordlist\n!kickkeywordlistclear\n!kickkeywordadd <b style=\"color:#ffff00;\">keyword</b>\n!kickkeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!oplist\n!oplistclear\n!opadd <b style=\"color:#ffff00;\">user | nick | -all</b>\n!opremove <b style=\"color:#ffff00;\">#</b>\n!optoggle\n\n<b style=\"color:#ee3636;\">User Commands:</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytskip\n!ytqueue\n\n!mentionlist\n!mentionlistclear\n!mentionadd <b style=\"color:#ffff00;\">keyword</b>\n!mentionremove <b style=\"color:#ffff00;\">#</b>\n\n!ignorelist\n!ignorelistclear\n!ignoreadd <b style=\"color:#ffff00;\">user | nick</b>\n!ignoreremove <b style=\"color:#ffff00;\">#</b>\n\n!greetlist\n!greetlistclear\n!greetadd <b style=\"color:#ffff00;\">user | nick | -all</b>\n!greetremove <b style=\"color:#ffff00;\">#</b>\n\n!ttslist\n!ttslistclear\n!ttsadd <b style=\"color:#ffff00;\">user | nick | -all | -event</b>\n!ttsremove <b style=\"color:#ffff00;\">#</b>\n\n!highlightlist\n!highlightlistclear\n!highlightadd <b style=\"color:#ffff00;\">user | nick</b>\n!highlightremove <b style=\"color:#ffff00;\">#</b>\n\n!reminderlist\n!reminderlistclear\n!reminderadd <b style=\"color:#ffff00;\">user | nick</b>\n!reminderremove <b style=\"color:#ffff00;\">#</b>\n!remindertoggle\n\n!safelist\n!safelistclear\n!safelistremove <b style=\"color:#ffff00;\">#</b>\n\n!lists\n!listsclear\n\n!greetmode\n!imgurtoggle\n!avatartoggle\n!notificationtoggle\n!popuptoggle\n\n!coin\n!8ball <b style=\"color:#ffff00;\">question</b>\n!roll <b style=\"color:#ffff00;\">#</b>\n\n!clr\n!settings\n!share\n\n<b style=\"color:#ee3636;\">Game Commands:</b>\n!gameview\n!fish");
  1637. },
  1638. mentionadd: function() {
  1639. if (arguments[0] === "") {
  1640. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1641. } else {
  1642. if (CheckUserName(arguments[0])) {
  1643. CTS.MentionList.push(arguments[0].toUpperCase());
  1644. Save("MentionList", JSON.stringify(CTS.MentionList));
  1645. Alert(GetActiveChat(), "🗹Command Accepted!");
  1646. }
  1647. }
  1648. },
  1649. mentionremove: function() {
  1650. if (arguments[0] === "" || isNaN(arguments[0])) {
  1651. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1652. } else {
  1653. if (CTS.MentionList[arguments[0]] !== undefined) {
  1654. CTS.MentionList.splice(arguments[0], 1);
  1655. Save("MentionList", JSON.stringify(CTS.MentionList));
  1656. Alert(GetActiveChat(), "🗹Command Accepted!");
  1657. } else {
  1658. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1659. }
  1660. }
  1661. },
  1662. mentionlistclear: function() {
  1663. CTS.MentionList = [];
  1664. Save("MentionList", JSON.stringify(CTS.MentionList));
  1665. Alert(GetActiveChat(), "🗹Command Accepted!");
  1666. },
  1667. mentionlist: function() {
  1668. Alert(GetActiveChat(), SettingsList.MentionList());
  1669. },
  1670. ignoreadd: function() {
  1671. if (arguments[0] === "") {
  1672. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1673. } else {
  1674. if (CheckUserName(arguments[0])) {
  1675. CTS.IgnoreList.push(arguments[0].toUpperCase());
  1676. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1677. Alert(GetActiveChat(), "🗹Command Accepted!");
  1678. }
  1679. }
  1680. },
  1681. ignoreremove: function() {
  1682. if (arguments[0] === "" || isNaN(arguments[0])) {
  1683. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1684. } else {
  1685. if (CTS.IgnoreList[arguments[0]] !== undefined) {
  1686. CTS.IgnoreList.splice(arguments[0], 1);
  1687. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1688. Alert(GetActiveChat(), "🗹Command Accepted!");
  1689. } else {
  1690. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1691. }
  1692. }
  1693. },
  1694. ignorelistclear: function() {
  1695. CTS.IgnoreList = [];
  1696. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  1697. Alert(GetActiveChat(), "🗹Command Accepted!");
  1698. },
  1699. ignorelist: function() {
  1700. Alert(GetActiveChat(), SettingsList.IgnoreList());
  1701. },
  1702. banadd: function() {
  1703. if (arguments[0] === "") {
  1704. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1705. } else {
  1706. if (CheckUserName(arguments[0])) {
  1707. CTS.BanList.push(arguments[0].toUpperCase());
  1708. Save("BanList", JSON.stringify(CTS.BanList));
  1709. Alert(GetActiveChat(), "🗹Command Accepted!");
  1710. var check = UsernameToHandle(arguments[0].toUpperCase());
  1711. if (check != -1 && CTS.Me.mod) Send("ban", check);
  1712. }
  1713. }
  1714. },
  1715. banremove: function() {
  1716. if (arguments[0] === "" || isNaN(arguments[0])) {
  1717. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1718. } else {
  1719. if (CTS.BanList[arguments[0]] !== undefined) {
  1720. CTS.BanList.splice(arguments[0], 1);
  1721. Save("BanList", JSON.stringify(CTS.BanList));
  1722. Alert(GetActiveChat(), "🗹Command Accepted!");
  1723. } else {
  1724. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1725. }
  1726. }
  1727. },
  1728. banlistclear: function() {
  1729. CTS.BanList = [];
  1730. Save("BanList", JSON.stringify(CTS.BanList));
  1731. Alert(GetActiveChat(), "🗹Command Accepted!");
  1732. },
  1733. banlist: function() {
  1734. Alert(GetActiveChat(), SettingsList.BanList());
  1735. },
  1736. kickadd: function() {
  1737. if (arguments[0] === "") {
  1738. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1739. } else {
  1740. if (CheckUserName(arguments[0])) {
  1741. CTS.KickList.push(arguments[0].toUpperCase());
  1742. Save("KickList", JSON.stringify(CTS.KickList));
  1743. Alert(GetActiveChat(), "🗹Command Accepted!");
  1744. var check = UsernameToHandle(arguments[0].toUpperCase());
  1745. if (check != -1 && CTS.Me.mod) Send("kick", check);
  1746. }
  1747. }
  1748. },
  1749. kickremove: function() {
  1750. if (arguments[0] === "" || isNaN(arguments[0])) {
  1751. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1752. } else {
  1753. if (CTS.KickList[arguments[0]] !== undefined) {
  1754. CTS.KickList.splice(arguments[0], 1);
  1755. Save("KickList", JSON.stringify(CTS.KickList));
  1756. Alert(GetActiveChat(), "🗹Command Accepted!");
  1757. } else {
  1758. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1759. }
  1760. }
  1761. },
  1762. kicklistclear: function() {
  1763. CTS.KickList = [];
  1764. Save("KickList", JSON.stringify(CTS.KickList));
  1765. Alert(GetActiveChat(), "🗹Command Accepted!");
  1766. },
  1767. kicklist: function() {
  1768. Alert(GetActiveChat(), SettingsList.KickList());
  1769. },
  1770. bankeywordadd: function() {
  1771. if (arguments[0] === "") {
  1772. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1773. } else {
  1774. CTS.BanKeywordList.push(arguments[0]);
  1775. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  1776. Alert(GetActiveChat(), "🗹Command Accepted!");
  1777. }
  1778. },
  1779. bankeywordremove: function() {
  1780. if (arguments[0] === "" || isNaN(arguments[0])) {
  1781. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1782. } else {
  1783. if (CTS.BanKeywordList[arguments[0]] !== undefined) {
  1784. CTS.BanKeywordList.splice(arguments[0], 1);
  1785. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  1786. Alert(GetActiveChat(), "🗹Command Accepted!");
  1787. } else {
  1788. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1789. }
  1790. }
  1791. },
  1792. bankeywordlistclear: function() {
  1793. CTS.BanKeywordList = [];
  1794. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  1795. Alert(GetActiveChat(), "🗹Command Accepted!");
  1796. },
  1797. bankeywordlist: function() {
  1798. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  1799. },
  1800. kickkeywordadd: function() {
  1801. if (arguments[0] === "") {
  1802. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1803. } else {
  1804. CTS.KickKeywordList.push(arguments[0]);
  1805. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  1806. Alert(GetActiveChat(), "🗹Command Accepted!");
  1807. }
  1808. },
  1809. kickkeywordremove: function() {
  1810. if (arguments[0] === "" || isNaN(arguments[0])) {
  1811. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1812. } else {
  1813. if (CTS.KickKeywordList[arguments[0]] !== undefined) {
  1814. CTS.KickKeywordList.splice(arguments[0], 1);
  1815. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  1816. Alert(GetActiveChat(), "🗹Command Accepted!");
  1817. } else {
  1818. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1819. }
  1820. }
  1821. },
  1822. kickkeywordlistclear: function() {
  1823. CTS.KickKeywordList = [];
  1824. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  1825. Alert(GetActiveChat(), "🗹Command Accepted!");
  1826. },
  1827. kickkeywordlist: function() {
  1828. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  1829. },
  1830. greetadd: function() {
  1831. if (arguments[0] === "") {
  1832. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1833. } else {
  1834. if (CheckUserName(arguments[0])) {
  1835. CTS.GreetList.push(arguments[0].toUpperCase());
  1836. Save("GreetList", JSON.stringify(CTS.GreetList));
  1837. Alert(GetActiveChat(), "🗹Command Accepted!");
  1838. }
  1839. }
  1840. },
  1841. greetremove: function() {
  1842. if (arguments[0] === "" || isNaN(arguments[0])) {
  1843. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1844. } else {
  1845. if (CTS.GreetList[arguments[0]] !== undefined) {
  1846. CTS.GreetList.splice(arguments[0], 1);
  1847. Save("GreetList", JSON.stringify(CTS.GreetList));
  1848. Alert(GetActiveChat(), "🗹Command Accepted!");
  1849. } else {
  1850. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1851. }
  1852. }
  1853. },
  1854. greetlistclear: function() {
  1855. CTS.GreetList = [];
  1856. Save("GreetList", JSON.stringify(CTS.GreetList));
  1857. Alert(GetActiveChat(), "🗹Command Accepted!");
  1858. },
  1859. greetlist: function() {
  1860. Alert(GetActiveChat(), SettingsList.GreetList());
  1861. },
  1862. highlightadd: function() {
  1863. if (arguments[0] === "") {
  1864. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1865. } else {
  1866. if (CheckUserName(arguments[0])) {
  1867. CTS.HighlightList.push(arguments[0].toUpperCase());
  1868. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  1869. Alert(GetActiveChat(), "🗹Command Accepted!");
  1870. }
  1871. }
  1872. },
  1873. highlightremove: function() {
  1874. if (arguments[0] === "" || isNaN(arguments[0])) {
  1875. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1876. } else {
  1877. if (CTS.HighlightList[arguments[0]] !== undefined) {
  1878. CTS.HighlightList.splice(arguments[0], 1);
  1879. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  1880. Alert(GetActiveChat(), "🗹Command Accepted!");
  1881. } else {
  1882. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1883. }
  1884. }
  1885. },
  1886. highlightlistclear: function() {
  1887. CTS.HighlightList = [];
  1888. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  1889. Alert(GetActiveChat(), "🗹Command Accepted!");
  1890. },
  1891. highlightlist: function() {
  1892. Alert(GetActiveChat(), SettingsList.HighlightList());
  1893. },
  1894. opadd: function() {
  1895. if (arguments[0] === "") {
  1896. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1897. } else {
  1898. if (CheckUserName(arguments[0])) {
  1899. CTS.BotOPList.push(arguments[0].toUpperCase());
  1900. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  1901. Alert(GetActiveChat(), "🗹Command Accepted!");
  1902. }
  1903. }
  1904. },
  1905. opremove: function() {
  1906. if (arguments[0] === "" || isNaN(arguments[0])) {
  1907. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1908. } else {
  1909. if (CTS.BotOPList[arguments[0]] !== undefined) {
  1910. CTS.BotOPList.splice(arguments[0], 1);
  1911. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  1912. Alert(GetActiveChat(), "🗹Command Accepted!");
  1913. } else {
  1914. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1915. }
  1916. }
  1917. },
  1918. oplistclear: function() {
  1919. CTS.BotOPList = [];
  1920. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  1921. Alert(GetActiveChat(), "🗹Command Accepted!");
  1922. },
  1923. oplist: function() {
  1924. Alert(GetActiveChat(), SettingsList.BotOPList());
  1925. },
  1926. ttsadd: function() {
  1927. if (arguments[0] === "") {
  1928. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1929. } else {
  1930. if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  1931. CTS.TTSList.push(arguments[0].toUpperCase());
  1932. Save("TTSList", JSON.stringify(CTS.TTSList));
  1933. Alert(GetActiveChat(), "🗹Command Accepted!");
  1934. }
  1935. }
  1936. },
  1937. ttsremove: function() {
  1938. if (arguments[0] === "" || isNaN(arguments[0])) {
  1939. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1940. } else {
  1941. if (CTS.TTSList[arguments[0]] !== undefined) {
  1942. CTS.TTSList.splice(arguments[0], 1);
  1943. Save("TTSList", JSON.stringify(CTS.TTSList));
  1944. Alert(GetActiveChat(), "🗹Command Accepted!");
  1945. } else {
  1946. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1947. }
  1948. }
  1949. },
  1950. ttslistclear: function() {
  1951. CTS.TTSList = [];
  1952. Save("TTSList", JSON.stringify(CTS.TTSList));
  1953. Alert(GetActiveChat(), "🗹Command Accepted!");
  1954. },
  1955. ttslist: function() {
  1956. Alert(GetActiveChat(), SettingsList.TTSList());
  1957. },
  1958. reminderadd: function() {
  1959. if (arguments[0] === "") {
  1960. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1961. } else {
  1962. var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9])\s?(?:[AaPp][Mm]))\s(.*)/);
  1963. if (reminder === null) {
  1964. Alert(GetActiveChat(), "🗷Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  1965. } else {
  1966. CTS.ReminderList.push([reminder[1], reminder[2]]);
  1967. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  1968. Alert(GetActiveChat(), "🗹Command Accepted!");
  1969. Reminder();
  1970. }
  1971. }
  1972. },
  1973. reminderremove: function() {
  1974. if (arguments[0] === "" || isNaN(arguments[0])) {
  1975. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  1976. } else {
  1977. if (CTS.ReminderList[arguments[0]] !== undefined) {
  1978. CTS.ReminderList.splice(arguments[0], 1);
  1979. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  1980. Reminder();
  1981. Alert(GetActiveChat(), "🗹Command Accepted!");
  1982. } else {
  1983. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  1984. }
  1985. }
  1986. },
  1987. reminderlistclear: function() {
  1988. CTS.ReminderList = [];
  1989. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  1990. Alert(GetActiveChat(), "🗹Command Accepted!");
  1991. },
  1992. reminderlist: function() {
  1993. Alert(GetActiveChat(), SettingsList.ReminderList());
  1994. },
  1995. remindertoggle: function() {
  1996. CTS.Reminder = !CTS.Reminder;
  1997. Save("Reminder", JSON.stringify(CTS.Reminder));
  1998. Reminder();
  1999. Settings();
  2000. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  2001. },
  2002. safelistremove: function() {
  2003. if (arguments[0] === "" || isNaN(arguments[0])) {
  2004. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2005. } else {
  2006. if (CTS.SafeList[arguments[0]] !== undefined) {
  2007. CTS.SafeList.splice(arguments[0], 1);
  2008. Save("AKB", JSON.stringify(CTS.SafeList));
  2009. Alert(GetActiveChat(), "🗹Command Accepted!");
  2010. } else {
  2011. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2012. }
  2013. }
  2014. },
  2015. safelistclear: function() {
  2016. CTS.SafeList = [];
  2017. Save("AKB", JSON.stringify(CTS.SafeList));
  2018. Alert(GetActiveChat(), "🗹Command Accepted!");
  2019. },
  2020. safelist: function() {
  2021. Alert(GetActiveChat(), SettingsList.SafeList());
  2022. },
  2023. optoggle: function() {
  2024. CTS.UserYT = !CTS.UserYT;
  2025. Save("UserYT", JSON.stringify(CTS.UserYT));
  2026. Settings();
  2027. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  2028. },
  2029. avatartoggle: function() {
  2030. CTS.Avatar = !CTS.Avatar;
  2031. Save("Avatar", JSON.stringify(CTS.Avatar));
  2032. Settings();
  2033. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  2034. },
  2035. popuptoggle: function() {
  2036. CTS.Popups = !CTS.Popups;
  2037. Save("Popups", JSON.stringify(CTS.Popups));
  2038. Settings();
  2039. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  2040. },
  2041. notificationtoggle: function() {
  2042. CTS.Notification = !CTS.Notification;
  2043. Save("Notification", JSON.stringify(CTS.Notification));
  2044. NotificationDisplay();
  2045. Alert(GetActiveChat(), "🗹Command Accepted!");
  2046. },
  2047. greetmode: function() {
  2048. CTS.GreetMode = !CTS.GreetMode;
  2049. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  2050. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  2051. },
  2052. imgurtoggle: function() {
  2053. CTS.imgur = !CTS.imgur;
  2054. Save("imgur", JSON.stringify(CTS.imgur));
  2055. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  2056. },
  2057. clr: function() {
  2058. CTS.MessageCallback = [];
  2059. CTS.Message = [];
  2060. CTS.Message[0] = [];
  2061. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  2062. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  2063. },
  2064. autokick: function() {
  2065. if (arguments[1] === false && CTS.Me.mod) {
  2066. CTS.AutoKick = !CTS.AutoKick;
  2067. CTS.AutoBan = false;
  2068. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  2069. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  2070. }
  2071. },
  2072. autoban: function() {
  2073. if (arguments[1] === false && CTS.Me.mod) {
  2074. CTS.AutoBan = !CTS.AutoBan;
  2075. CTS.AutoKick = false;
  2076. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  2077. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  2078. }
  2079. },
  2080. bottoggle: function() {
  2081. CTS.Bot = !CTS.Bot;
  2082. Save("Bot", JSON.stringify(CTS.Bot));
  2083. Settings();
  2084. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  2085. },
  2086. bot: function() {
  2087. if (arguments[1] === false && CTS.Me.mod && CTS.Room.YT_ON===true) Alert(0, "🗹Command Accepted!\nBot bypass was called!");
  2088. },
  2089. share: function() {
  2090. var msg = "CosmosisT's TinyChat Script:\nInstall...\n1. (Tamper Monkey Link)\nhttps://www.tampermonkey.net/\n2. (CTS Link)\nhttps://greasyfork.org/en/scripts/392086";
  2091. if (GetActiveChat() !== 0) {
  2092. Send("pvtmsg", msg, GetActiveChat());
  2093. PushPM(GetActiveChat(), msg);
  2094. } else {
  2095. Send("msg", msg);
  2096. }
  2097. },
  2098. gameview: function() {
  2099. CTS.CanSeeGames = !CTS.CanSeeGames;
  2100. Settings();
  2101. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
  2102. },
  2103. version:function(){
  2104. if(!CTS.Me.owner) {
  2105. var msg = "I am using "+CTS.Project.Name+"v"+CTS.Project.Version;
  2106. if (GetActiveChat() !== 0) {
  2107. Send("pvtmsg", msg, GetActiveChat());
  2108. PushPM(GetActiveChat(), msg);
  2109. } else {
  2110. Send("msg", msg);
  2111. }
  2112. }
  2113. },
  2114. "8ball": function() {
  2115. if (!CTS.Room.YT_ON || CTS.Host == 0) {
  2116. if (arguments[0] === "") {
  2117. Alert(GetActiveChat(), "That's not a question!");
  2118. } else {
  2119. var msg = CTS.EightBall[Rand(0, CTS.EightBall.length - 1)];
  2120. if (GetActiveChat() !== 0) {
  2121. Send("pvtmsg", msg, GetActiveChat());
  2122. } else {
  2123. Send("msg", msg);
  2124. }
  2125. }
  2126. }
  2127. },
  2128. roll: function() {
  2129. var dice,
  2130. msg = "";
  2131. dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
  2132. for (var i = 0; i < dice; i++) msg += Dice();
  2133. if (GetActiveChat() !== 0) {
  2134. Send("pvtmsg", msg, GetActiveChat());
  2135. PushPM(GetActiveChat(), msg);
  2136. } else {
  2137. Send("msg", msg);
  2138. }
  2139. },
  2140. coin: function() {
  2141. if (!CTS.Room.YT_ON || CTS.Host == 0) {
  2142. var msg = "The coin landed on "+((Rand(0, 1)==1)?"heads":"tails")+"!";
  2143. if (GetActiveChat() !== 0) {
  2144. Send("pvtmsg", msg, GetActiveChat());
  2145. } else {
  2146. Send("msg", msg);
  2147. }
  2148. }
  2149. },
  2150. settings: function() {
  2151. Settings();
  2152. },
  2153. lists: function() {
  2154. Alert(GetActiveChat(), SettingsList.BanList() + SettingsList.BanKeywordList() + SettingsList.KickList() + SettingsList.KickKeywordList() + SettingsList.BotOPList() + SettingsList.MentionList() + SettingsList.IgnoreList() + SettingsList.GreetList() + SettingsList.TTSList() + SettingsList.HighlightList() + SettingsList.ReminderList());
  2155. },
  2156. listsclear: function() {
  2157. CTS.MentionList = [];
  2158. CTS.IgnoreList = [];
  2159. CTS.BanList = [];
  2160. CTS.KickList = [];
  2161. CTS.BanKeywordList = [];
  2162. CTS.KickKeywordList = [];
  2163. CTS.GreetList = [];
  2164. CTS.HighlightList = [];
  2165. CTS.ReminderList = [];
  2166. CTS.TTSList = [];
  2167. CTS.BotOPList = [];
  2168. Save("MentionList", JSON.stringify(CTS.MentionList));
  2169. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2170. Save("BanList", JSON.stringify(CTS.BanList));
  2171. Save("KickList", JSON.stringify(CTS.KickList));
  2172. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2173. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2174. Save("GreetList", JSON.stringify(CTS.GreetList));
  2175. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2176. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2177. Save("TTSList", JSON.stringify(CTS.TTSList));
  2178. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2179. Alert(GetActiveChat(), "🗹Command Accepted!");
  2180. },
  2181. ytqueue: function() {},
  2182. ytclear: function() {},
  2183. ytskip: function() {},
  2184. yt: function() {},
  2185. ytbypass: function() {}
  2186. };
  2187. var SettingsList = {
  2188. BanList: function() {
  2189. var index,
  2190. msg,
  2191. len = CTS.BanList.length;
  2192. msg = "<b style=\"color:#ee3636;\"><u>Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2193. for (index = 0; index < len; index++) msg += index + " : " + CTS.BanList[index] + "\n";
  2194. return msg;
  2195. },
  2196. BanKeywordList: function() {
  2197. var index,
  2198. msg,
  2199. len = CTS.BanKeywordList.length;
  2200. msg = "<b style=\"color:#ee3636;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2201. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  2202. return msg;
  2203. },
  2204. KickList: function() {
  2205. var index,
  2206. msg,
  2207. len = CTS.KickList.length;
  2208. msg = "<b style=\"color:#ee3636;\"><u>Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2209. for (index = 0; index < len; index++) msg += index + " : " + CTS.KickList[index] + "\n";
  2210. return msg;
  2211. },
  2212. KickKeywordList: function() {
  2213. var index,
  2214. msg,
  2215. len = CTS.KickKeywordList.length;
  2216. msg = "<b style=\"color:#ee3636;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2217. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  2218. return msg;
  2219. },
  2220. BotOPList: function() {
  2221. var index,
  2222. msg,
  2223. len = CTS.BotOPList.length;
  2224. msg = "<b style=\"color:#ee3636;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2225. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  2226. return msg;
  2227. },
  2228. MentionList: function() {
  2229. var index,
  2230. msg,
  2231. len = CTS.MentionList.length;
  2232. msg = "<b style=\"color:#ee3636;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2233. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  2234. return msg;
  2235. },
  2236. IgnoreList: function() {
  2237. var index,
  2238. msg,
  2239. len = CTS.IgnoreList.length;
  2240. msg = "<b style=\"color:#ee3636;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2241. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  2242. return msg;
  2243. },
  2244. GreetList: function() {
  2245. var index,
  2246. msg,
  2247. len = CTS.GreetList.length;
  2248. msg = "<b style=\"color:#ee3636;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2249. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  2250. return msg;
  2251. },
  2252. TTSList: function() {
  2253. var index,
  2254. msg,
  2255. len = CTS.TTSList.length;
  2256. msg = "<b style=\"color:#ee3636;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2257. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  2258. return msg;
  2259. },
  2260. HighlightList: function() {
  2261. var index,
  2262. msg,
  2263. len = CTS.HighlightList.length;
  2264. msg = "<b style=\"color:#ee3636;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2265. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  2266. return msg;
  2267. },
  2268. ReminderList: function() {
  2269. var index,
  2270. msg,
  2271. len = CTS.ReminderList.length;
  2272. msg = "<b style=\"color:#ee3636;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2273. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  2274. return msg;
  2275. },
  2276. SafeList: function() {
  2277. var index,
  2278. msg,
  2279. len = CTS.SafeList.length;
  2280. msg = "<b style=\"color:#ee3636;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2281. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  2282. return msg;
  2283. }
  2284. };
  2285. var MessageQueueList = {
  2286. add: function() {
  2287. CTS.SendQueue.push(arguments[0]);
  2288. MessageQueueList.run();
  2289. },
  2290. run: function() {
  2291. var SendInterval = setInterval(function() {
  2292. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  2293. var temp = new Date();
  2294. var OffsetTime = temp - CTS.LastMessage;
  2295. if (OffsetTime >= 1500) {
  2296. CTS.LastMessage = new Date();
  2297. CTS.SocketTarget.send(CTS.SendQueue[0]);
  2298. CTS.SendQueue.shift();
  2299. }
  2300. } else {
  2301. clearInterval(SendInterval);
  2302. }
  2303. }, 1600, CTS.LastMessage);
  2304. }
  2305. };
  2306. var ServerSendList = {
  2307. msg: function() {
  2308. var obj = {
  2309. "tc": arguments[0]
  2310. };
  2311. if (arguments[2] !== undefined) {
  2312. obj.handle = arguments[1];
  2313. CTS.SocketTarget.send(JSON.stringify(obj));
  2314. } else {
  2315. if (arguments[1] !== undefined) {
  2316. obj.text = arguments[1];
  2317. MessageQueueList.add(JSON.stringify(obj));
  2318. } else {
  2319. CTS.SocketTarget.send(JSON.stringify(obj));
  2320. }
  2321. }
  2322. },
  2323. pvtmsg: function() {
  2324. var obj = {
  2325. "tc": arguments[0],
  2326. "text": arguments[1],
  2327. "handle": Number(arguments[2])
  2328. };
  2329. MessageQueueList.add(JSON.stringify(obj));
  2330. },
  2331. kick: function() {
  2332. ServerSendList.msg(arguments[0], arguments[1], "kick");
  2333. },
  2334. ban: function() {
  2335. ServerSendList.msg(arguments[0], arguments[1], "ban");
  2336. },
  2337. yut_playlist_add: function() {
  2338. var obj = {
  2339. "tc": arguments[0],
  2340. "item": {
  2341. "id": arguments[1][0],
  2342. "duration": arguments[1][1],
  2343. "title": arguments[1][2],
  2344. "image": arguments[1][3]
  2345. }
  2346. };
  2347. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  2348. CTS.SocketTarget.send(JSON.stringify(obj));
  2349. },
  2350. yut_playlist_remove: function() {
  2351. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  2352. },
  2353. yut_stop: function() {
  2354. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  2355. },
  2356. yut_play: function() {
  2357. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  2358. },
  2359. yut_playlist: function() {
  2360. ServerSendList.msg("yut_playlist");
  2361. }
  2362. };
  2363. var ServerInList = {
  2364. joined: function() {
  2365. debug();
  2366. CTS.Me = {
  2367. "handle": arguments[0].self.handle,
  2368. "username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
  2369. "nick": arguments[0].self.nick,
  2370. "owner":arguments[0].self.owner,
  2371. "mod": arguments[0].self.mod,
  2372. "namecolor": NameColor[Rand(0, NameColor.length-1)],
  2373. "avatar": arguments[0].self.avatar
  2374. };
  2375. CTS.Room = {
  2376. "Avatar": arguments[0].room.avatar,
  2377. "Bio": arguments[0].room.biography,
  2378. "Name": arguments[0].room.name,
  2379. "PTT": arguments[0].room.pushtotalk,
  2380. "Website": arguments[0].room.website,
  2381. "YT_ON":true//arguments[0].room.youtube_enabled
  2382. };
  2383. CTS.SocketConnected = true;
  2384. var modcall = setInterval(function() {
  2385. if (CTS.ScriptInit === true) {
  2386. if (CTS.Me.mod && CTS.Room.YT_ON) {
  2387. if (CTS.Bot) CheckHost();
  2388. VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  2389. //VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
  2390. }
  2391. clearInterval(modcall);
  2392. }
  2393. }, 200);
  2394. Reminder();
  2395. },
  2396. userlist: function() {
  2397. var len = arguments[0].users.length;
  2398. for (var user = 0; user < len; user++) {
  2399. AISB(arguments[0].users[user]);
  2400. CheckUserAbuse(arguments[0].users[user].handle, (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase(), arguments[0].users[user].nick.toUpperCase());
  2401. CTS.UserList.push({
  2402. "handle": arguments[0].users[user].handle,
  2403. "username": (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase(),
  2404. "nick": arguments[0].users[user].nick,
  2405. "owner":arguments[0].users[user].owner,
  2406. "mod": arguments[0].users[user].mod,
  2407. "namecolor": NameColor[Rand(0, NameColor.length - 1)],
  2408. "avatar": arguments[0].users[user].avatar,
  2409. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false
  2410. });
  2411. }
  2412. RoomUsers();
  2413. },
  2414. join: function() {
  2415. AISB(arguments[0]);
  2416. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  2417. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick.toUpperCase());
  2418. if (CTS.HighlightList.includes(user) || CTS.HighlightList.includes(arguments[0].nick.toUpperCase())) {
  2419. if (CTS.enableSound === true) CTS.Sound.highlight.play();
  2420. }
  2421. if ((CTS.GreetList.includes(user) || CTS.GreetList.includes(arguments[0].nick.toUpperCase()) || (CTS.Me.mod && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  2422. 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!") : "!"))));
  2423. if (CTS.enableSound === true) CTS.Sound.highlight.play();
  2424. }
  2425. CTS.NoGreet = false;
  2426. 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);
  2427. RoomUsers();
  2428. },
  2429. sysmsg: function() {
  2430. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  2431. },
  2432. nick: function() {
  2433. var user = User(arguments[0].handle);
  2434. if (user != -1) {
  2435. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  2436. CTS.UserList[user].nick = arguments[0].nick;
  2437. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  2438. }
  2439. },
  2440. stream_connected: function() {
  2441. debug();
  2442. },
  2443. stream_closed: function() {
  2444. debug();
  2445. },
  2446. ping: function() {
  2447. debug();
  2448. if (CTS.ScriptInit) {
  2449. if (CTS.WatchList.length > 0) {
  2450. var verify = new Date() - CTS.WatchList[0][2];
  2451. debug("WATCHLIST::LIST", CTS.WatchList);
  2452. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/900000");
  2453. if (verify > 600000) {
  2454. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/900000");
  2455. CTS.SafeList.push(CTS.WatchList[0][0]);
  2456. CTS.WatchList.shift();
  2457. }
  2458. }
  2459. }
  2460. },
  2461. quit: function() {
  2462. if (CTS.ScriptInit) {
  2463. if (CTS.WatchList.length > 0) {
  2464. var len = CTS.WatchList.length;
  2465. for (var i = 0; i < len; i++) {
  2466. if (CTS.WatchList[i][1] == arguments[0].handle) {
  2467. CTS.WatchList.splice(i, 1);
  2468. break;
  2469. }
  2470. }
  2471. }
  2472. var user = User(arguments[0].handle);
  2473. if (user != -1) {
  2474. if (CTS.Me.handle === CTS.Host) {
  2475. if(Fish.getPlayer(arguments[0].handle, true, false)){
  2476. Send("msg", CTS.Game.Fish.UserQuitLast + ", has slipped off the boat; I don't think we should look back.");
  2477. }
  2478. }
  2479. //SEND THEM OUT
  2480. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  2481. CTS.UserList.splice(user, 1);
  2482. }
  2483. RoomUsers();
  2484. if (CTS.Host == arguments[0].handle) {
  2485. CTS.Host = 0;
  2486. if (CTS.Me.mod && CTS.Bot && CTS.Room.YT_ON===true) {
  2487. setTimeout(function(handle) {
  2488. if (handle == CTS.Host) SetBot(false);
  2489. }, (Rand(10, 30) * 1000), arguments[0].handle);
  2490. }
  2491. }
  2492. }
  2493. },
  2494. msg: function() {
  2495. if (CTS.ScriptInit) {
  2496. var user = User(arguments[0].handle);
  2497. if (user != -1) {
  2498. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
  2499. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  2500. var text = HTMLtoTXT(arguments[0].text);
  2501. OwnerCommand(user, arguments[0].text);
  2502. BotCheck(user, text, arguments[0]);
  2503. if (CTS.Me.mod) {
  2504. if (CTS.Host == CTS.Me.handle && CTS.Room.YT_ON===true) BotCommandCheck(user,text);
  2505. CheckUserKeywordAbuse(arguments[0].handle, arguments[0].text);
  2506. }
  2507. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user)) {
  2508. //PUSH MESSAGE
  2509. CTS.Message[0].push({
  2510. "time": Time(),
  2511. "namecolor": CTS.UserList[user].namecolor,
  2512. "avatar": CTS.UserList[user].avatar,
  2513. "username": CTS.UserList[user].username,
  2514. "nick": CTS.UserList[user].nick,
  2515. "msg": CheckImgur(text)
  2516. });
  2517. if (GetActiveChat() === 0) {
  2518. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  2519. CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, 0);
  2520. }
  2521. if (CTS.Me.handle !== arguments[0].handle) {
  2522. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  2523. Alert(GetActiveChat(), "🗹AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  2524. CTS.AutoKick = false;
  2525. CTS.AutoBan = false;
  2526. }
  2527. if (CTS.enableSound === true) {
  2528. CTS.Sound.MSG.play();
  2529. 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!"));
  2530. }
  2531. var len = CTS.MentionList.length;
  2532. for (var i = 0; i < len; i++) {
  2533. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  2534. if (CTS.enableSound === true) {
  2535. CTS.Sound.mention.play();
  2536. }
  2537. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  2538. }
  2539. }
  2540. }
  2541. MessagePopUp(user, text, true, false);
  2542. }
  2543. }
  2544. } else {
  2545. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  2546. }
  2547. }
  2548. }
  2549. },
  2550. pvtmsg: function() {
  2551. if (CTS.ScriptInit) {
  2552. if (CTS.enablePMs === true) {
  2553. if (arguments[0].handle != CTS.Me.handle) {
  2554. var user = User(arguments[0].handle);
  2555. if (user != -1) {
  2556. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)){
  2557. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  2558. var text = arguments[0].text;
  2559. if (CTS.Me.mod) CheckUserKeywordAbuse(arguments[0].handle, arguments[0].text);
  2560. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user)) {
  2561. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  2562. PushPM(arguments[0].handle, text, user);
  2563. if (CTS.enableSound === true) {
  2564. CTS.Sound.PVTMSG.play();
  2565. 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!"));
  2566. }
  2567. MessagePopUp(user, CheckImgur(HTMLtoTXT(text)), false, false);
  2568. }
  2569. }
  2570. } else {
  2571. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  2572. }
  2573. }
  2574.  
  2575. }
  2576. }
  2577. }
  2578. },
  2579. yut_playlist_add: function() {
  2580. if (CTS.ScriptInit) {
  2581. if (!CTS.YouTube.Playing) {
  2582. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  2583. if (CTS.Host != CTS.Me.handle) {
  2584. Send("msg", "!play");
  2585. } else {
  2586. YouTubePlayList();
  2587. }
  2588. }
  2589. }
  2590. },
  2591. yut_playlist: function() {
  2592. if (CTS.ScriptInit) {
  2593. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  2594. if (CTS.YouTube.Clear === true) {
  2595. if (arguments[0].items !== null) YouTubePlayListRemove(arguments[0].items);
  2596. CTS.YouTube.MessageQueueList = [];
  2597. Send("msg", "🎵YouTube cleared!🎵");
  2598. CTS.YouTube.Clear = false;
  2599. } else {
  2600. if (arguments[0].items === null) {
  2601. CTS.PlayListStart = true;
  2602. } else {
  2603. CTS.YouTube.PlayListCount = arguments[0].items.length;
  2604. CTS.PlayListStart = false;
  2605. if (CTS.YouTube.ShowQueue === true) {
  2606. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  2607. for (var i = 0; i < 3; i++) {
  2608. if (arguments[0].items[i] === undefined) break;
  2609. 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]";
  2610. }
  2611. Send("msg", msg);
  2612. }
  2613. }
  2614. 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);
  2615. }
  2616. CTS.YouTube.ShowQueue = false;
  2617. }
  2618. }
  2619. },
  2620. yut_play: function() {
  2621. if (CTS.ScriptInit) {
  2622. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  2623. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  2624. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  2625. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  2626. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  2627. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  2628. }
  2629. CTS.YouTube.Playing = true;
  2630. YouTubePlayList();
  2631. }
  2632. },
  2633. yut_stop: function() {
  2634. if (CTS.ScriptInit) {
  2635. CTS.YouTube.CurrentTrack.ID = undefined;
  2636. CTS.YouTube.CurrentTrack.duration = undefined;
  2637. CTS.YouTube.CurrentTrack.title = undefined;
  2638. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  2639. CTS.YouTube.Playing = false;
  2640. YouTubePlayList();
  2641. }
  2642. },
  2643. publish: function() {
  2644. if (CTS.ScriptInit) {
  2645. CheckUserStream(arguments[0].handle, true);
  2646. }
  2647. },
  2648. unpublish: function() {
  2649. if (CTS.ScriptInit) {
  2650. CheckUserStream(arguments[0].handle, false);
  2651. }
  2652. }
  2653. };
  2654. var ServerOutList = {
  2655. pvtmsg: function() {
  2656. if (CTS.ScriptInit) {
  2657. Command(arguments[0].text, true);
  2658. var text = arguments[0].text;
  2659. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  2660. PushPM(arguments[0].handle, text);
  2661. }
  2662. },
  2663. msg: function() {
  2664. if (CTS.ScriptInit) {
  2665. CTS.LastMessage = new Date();
  2666. Command(arguments[0].text, false);
  2667. }
  2668. }
  2669. };
  2670. // Game List Function
  2671. var Fish = {
  2672. init:function() {
  2673. if (CTS.Me.handle == CTS.Host) {
  2674. 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 thirty second delay for all commands, don't spam!\nFor commands type !fishhelp!");
  2675. CTS.Game.Fish.StartTimeout = setTimeout(function(g){
  2676. g.cast();
  2677. },5000,this);
  2678. }
  2679. },
  2680. addPlayer:function(handle, username, nickname){
  2681. if (!this.getPlayer(handle, false, false)) {
  2682. if (CTS.SafeList.includes(username)) {
  2683. CTS.Game.Fish.Player.push({
  2684. Handle: handle,
  2685. Username: username,
  2686. Nickname: nickname,
  2687. LastCheck: new Date()-30000,
  2688. Points: 5000,
  2689. Upgrades: {
  2690. Rod: 30,
  2691. Net: 1,
  2692. Store: 1,
  2693. Radar: 1,
  2694. Insurance: false,
  2695. Factory: 0
  2696. },
  2697. });
  2698. Send("msg", "[FISHING BOAT]\n"+nickname.substr(0,16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  2699. if (this.getPlayer()==0) this.init();
  2700. }
  2701. }
  2702. },
  2703. winner:function(){
  2704. var Winner = null;
  2705. for (const mostpoints of CTS.Game.Fish.Player) {
  2706. if (!Winner || mostpoints.Points > Winner.Points) Winner = mostpoints;
  2707. }
  2708. if (CTS.Game.Fish.HighScore[1] < Winner.Points) {
  2709. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going "+Winner.Nickname+"!");
  2710. CTS.Game.Fish.HighScore = [Winner.Nickname, Winner.Points];
  2711. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  2712. }
  2713.  
  2714. Send("msg", "[FISHING BOAT HIGH SCORE]\nHIGH SCORE:\n"+CTS.Game.Fish.HighScore[0]+" : $"+CTS.Game.Fish.HighScore[1]+"\n\nROUND WINNER:\n"+ Winner.Nickname + " : $" + Winner.Points + "!\n\nNext round will start in thirty seconds!");
  2715. // this.listPlayers();
  2716. CTS.Game.Fish.RestockTimeout = setTimeout(function(g) {
  2717. g.reset(false, true);
  2718. },30000, this);
  2719. },
  2720. listPlayers:function() {
  2721. var len = CTS.Game.Fish.Player.length;
  2722. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n";
  2723. for (var u = 1; u <= len; u++) {
  2724. msg += u+":"+CTS.Game.Fish.Player[u-1].Nickname+"[$"+CTS.Game.Fish.Player[u-1].Points+"]\n";
  2725. if (u==4) break;
  2726. }
  2727. Send("msg",msg);
  2728. },
  2729. getPlayer:function(handle, del, exists) {
  2730. var len = CTS.Game.Fish.Player.length;
  2731. if (handle !== undefined) {
  2732. for (var player = 0; player < len; player++) {
  2733. if (CTS.Game.Fish.Player[player].Handle == handle) {
  2734. if (exists) return CTS.Game.Fish.Player[player];
  2735. if (del) {
  2736. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  2737. CTS.Game.Fish.Player.splice(player, 1);
  2738. }
  2739. if (!exists) return true;
  2740. }
  2741. }
  2742. if (!exists) {
  2743. return false;
  2744. } else {
  2745. return -1;
  2746. }
  2747. } else {
  2748. return len-1;
  2749. }
  2750. },
  2751. FishBank:function(player, get) {
  2752. if (get === true)Send("msg", "[FISHING BOAT]\n"+player.Nickname.substr(0,16) + ", you have $" +player.Points + ".");
  2753. },
  2754. reset:function(stop, bypass) {
  2755. if (this.getPlayer()>=0 && !CTS.Game.NoReset || bypass !== undefined) {
  2756. CTS.Game.Fish.Round = 0;
  2757. clearTimeout(CTS.Game.Fish.StartTimeout);
  2758. clearTimeout(CTS.Game.Fish.RestockTimeout);
  2759. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  2760. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  2761. if (!stop) {
  2762. this.init();
  2763. } else {
  2764. Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  2765. CTS.Game.Fish.Player = [];
  2766. }
  2767. }
  2768. },
  2769. stop:function(){
  2770. CTS.Game.NoReset = false;
  2771. this.reset(true, true);
  2772. },
  2773. cast:function(){
  2774. clearTimeout(CTS.Game.Fish.StartTimeout);
  2775. if (CTS.Host === CTS.Me.handle) {
  2776. if (this.getPlayer()>=0) {
  2777. if (CTS.Game.Fish.Round < 20) {
  2778. CTS.Game.Fish.Round++;
  2779. var playerlen,
  2780. fishlen = CTS.Game.Fish.TypesOfFish.length-1,
  2781. id,
  2782. type,
  2783. handle,
  2784. eliminate = false,
  2785. msgeliminate,
  2786. value,
  2787. msg = "[FISHING BOAT]\n";
  2788. for (var cast = 0; cast <= 1; cast++) {
  2789. playerlen = this.getPlayer();
  2790. id = Rand(0, playerlen);
  2791. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  2792. if (Rand(0, 100) <= Rand(10, 70)) { // Room for improvements soon
  2793. value = ((CTS.Game.Fish.Player[id].Upgrades.Net * ((CTS.Game.Fish.TypesOfFish[type][1])*Rand(1,CTS.Game.Fish.Player[id].Upgrades.Store))));
  2794. if (CTS.Game.Fish.Player[id].Upgrades.Factory >0) value *= (Rand(1,CTS.Game.Fish.Player[id].Upgrades.Factory*2));
  2795. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  2796. CTS.Game.Fish.Player[id].Points += value;
  2797. msg += (CTS.Game.Fish.Player[id].Nickname.substr(0,16) + "...[$" + CTS.Game.Fish.Player[id].Points + "]:\n🗹" + CTS.Game.Fish.Player[id].Upgrades.Net + " x " + CTS.Game.Fish.TypesOfFish[type][0] + " +$" + value + "\n");
  2798. } else {
  2799. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  2800. CTS.Game.Fish.Player[id].Points -= value;
  2801. 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] + " -$" + (CTS.Game.Fish.Player[id].Upgrades.Net * ((CTS.Game.Fish.TypesOfFish[type][1]*4)*CTS.Game.Fish.Player[id].Upgrades.Store)) + "\n");
  2802. } else {
  2803. msg += (CTS.Game.Fish.Player[id].Nickname.substr(0,16) + "...[$" + CTS.Game.Fish.Player[id].Points + "]:\n🗹" + CTS.Game.Fish.Player[id].Upgrades.Net + " x " + CTS.Game.Fish.TypesOfFish[type][0] + " -$0\n");
  2804. }
  2805. }
  2806. } else {
  2807. cast--;
  2808. }
  2809. if(this.getPlayer() == -1) break;
  2810. if (CTS.Game.Fish.Player[id].Points < 0) {
  2811. eliminate = true;
  2812. handle = CTS.Game.Fish.Player[id].Handle;
  2813. msgeliminate = "[FISHING BOAT]\n"+(CTS.Game.Fish.Player[id].Nickname.substr(0,16)+"...\nCan walk the plank for costing me my moneys!");
  2814. CTS.Game.Fish.Player.splice(id, 1);
  2815. break;
  2816. }
  2817. }
  2818. if (msg !== "[FISHING BOAT]\n") {
  2819. Send("msg", msg);
  2820. }
  2821. if (eliminate) {
  2822. eliminate = false;
  2823. Send("msg", msgeliminate);
  2824. }
  2825. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g){
  2826. g.cast();
  2827. },Rand(30000, 120000),this);
  2828. } else {
  2829. this.winner();
  2830. }
  2831. } else {
  2832. //RESTART
  2833. CTS.Game.Fish.GameStart = false;
  2834. Fish.stop();
  2835. }
  2836. }
  2837. }
  2838. };
  2839. var FishList = {
  2840. fish:function(playerExist, user){
  2841. Fish.addPlayer(user.handle, user.username, user.nick);
  2842. },
  2843.  
  2844. fishbank:function(playerExist){
  2845. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2846. Fish.FishBank(playerExist, true);
  2847. }
  2848. },
  2849.  
  2850. fishrob:function(playerExist, target) {
  2851. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2852. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  2853. FishTransfer(playerExist, CanEliminate, 100000, Rand((Math.round(CanEliminate.Points/8)),Math.round((CanEliminate.Points/2))), true);
  2854. }
  2855. },
  2856.  
  2857. fishslap:function(playerExist, target) {
  2858. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2859. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  2860. FishTransfer(playerExist, CanEliminate, 1000000, Rand((Math.round(CanEliminate.Points/8)),Math.round((CanEliminate.Points))), true);
  2861. }
  2862. },
  2863.  
  2864. fishsplit:function(playerExist, target) {
  2865. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2866. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  2867. FishTransfer(playerExist, CanEliminate, 1000, Math.round(playerExist.Points/2),false);
  2868. }
  2869. },
  2870.  
  2871. fishupgrade:function(playerExist){
  2872. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 0);
  2873. },
  2874.  
  2875. fishhelp:function(playerExist){
  2876. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 6);
  2877. },
  2878.  
  2879. fishupgradenet:function(playerExist){
  2880. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2881. if (playerExist.Upgrades.Net >= 10) {
  2882. Send("msg", playerExist.Nickname+", you own all upgrades.");
  2883. } else {
  2884. if(FishTransaction(playerExist, 1000 * playerExist.Upgrades.Net * 5)) {
  2885. playerExist.Upgrades.Net +=1;
  2886. FishUpgradeStatus(playerExist, 1);
  2887. }
  2888. }
  2889. }
  2890. },
  2891.  
  2892. fishupgradefactory:function(playerExist){
  2893. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2894. if (playerExist.Upgrades.Factory >= 5) {
  2895. Send("msg", playerExist.Nickname+", you own all upgrades.");
  2896. } else {
  2897. if(FishTransaction(playerExist, (50000*playerExist.Upgrades.Factory*playerExist.Upgrades.Factory)+50000)) {
  2898. playerExist.Upgrades.Factory +=1;
  2899. FishUpgradeStatus(playerExist, 5);
  2900. }
  2901. }
  2902. }
  2903. },
  2904.  
  2905. fishupgradeshop:function(playerExist){
  2906. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2907. if (playerExist.Upgrades.Store >= 6) {
  2908. Send("msg", playerExist.Nickname+", you own them all already!");
  2909. } else {
  2910. if(FishTransaction(playerExist, (playerExist.Upgrades.Store*playerExist.Upgrades.Store*25000))) {
  2911. playerExist.Upgrades.Store +=1;
  2912. FishUpgradeStatus(playerExist, 4);
  2913. }
  2914. }
  2915. }
  2916. },
  2917.  
  2918. fishupgraderadar:function(playerExist){
  2919. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2920. if (playerExist.Upgrades.Radar >= 38) {
  2921. Send("msg", playerExist.Nickname+", you own all upgrades.");
  2922. } else {
  2923. if(FishTransaction(playerExist, (3500*playerExist.Upgrades.Radar*2)+3500)) {
  2924. playerExist.Upgrades.Radar +=8;
  2925. FishUpgradeStatus(playerExist, 2);
  2926. }
  2927. }
  2928. }
  2929. },
  2930.  
  2931. fishupgradeinsurance:function(playerExist){
  2932. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  2933. if (playerExist.Upgrades.Insurance === true) {
  2934. Send("msg", playerExist.Nickname+", you already have insurance!");
  2935. } else {
  2936. if(FishTransaction(playerExist, 20000)) {
  2937. playerExist.Upgrades.Insurance = true;
  2938. FishUpgradeStatus(playerExist, 3);
  2939. }
  2940. }
  2941. }
  2942. }
  2943. };
  2944. // Misc Functions
  2945. function debug() {
  2946. if (CTS.DebugClear === false) {
  2947. if (arguments[0] !== undefined) {
  2948. var msg = "%cCTS::" + arguments[0];
  2949. if (arguments[1]) msg = msg + "\n%c" + JSON.stringify(arguments[1]);
  2950. console.log(msg, "background: #000000; color: #53b6ef;", "color:#53b6ef;");
  2951. }
  2952. } else {
  2953. console.clear();
  2954. console.log(" ( \n ( * ))\ ) \n )\ \` ) /(()/( \n (((_) ( )(_)/(_)) \n )\___(_(_()(_)) \n((/ __|_ _/ __| \n | (__ | | \__ \ /\n \___| |_| |___/ \nCosmosisT's TinyChat Script\nCREATOR: COSMOSIST\nVERSION: " + CTS.Project.Version + "\nCONSOLE DEBUG: FALSE\n\nJoin the discord today!\nhttps://discord.gg/84xqc6r");
  2955. }
  2956. }
  2957.  
  2958. function Remove() {
  2959. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  2960. }
  2961. })();