CosmosisT's TinyChat Script (CTS V1.5.22)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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