Advertisement
TheYoutuber_Pro

Untitled

Aug 2nd, 2022
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.67 KB | None | 0 0
  1. -- Compiled with roblox-ts v1.2.3
  2. -- Bloated comradio v2 client //
  3. local ms = game:GetService("MessagingService")
  4. local text = game:GetService("TextService")
  5. local players = game:GetService("Players")
  6. local http = game:GetService("HttpService")
  7. local char = owner.Character
  8. local head = char:FindFirstChild("Head")
  9. local channel = ""
  10. local funnynames = {
  11. "Donalod ttrumpdqdqjidqudhqiudq",
  12. "Gather free robux at amongus.com!",
  13. "amogus",
  14. "amongus!",
  15. "Hhahahahahahadsiddhqdqiuhqdiqsqodj",
  16. owner.Name.." is a idiot!",
  17. "Man, i hope no one eats my caik"
  18. }
  19. local currentauthorID = owner.UserId
  20. local NAME_COLORS = { Color3.new(), Color3.new(1 / 255, 162 / 255, 255 / 255), Color3.new(2 / 255, 184 / 255, 87 / 255), BrickColor.new("Bright violet").Color, BrickColor.new("Bright orange").Color, BrickColor.new("Bright yellow").Color, BrickColor.new("Light reddish violet").Color, BrickColor.new("Brick yellow").Color }
  21. local function encode(input)
  22. local encoded = {}
  23. do
  24. local i = 1
  25. local _shouldIncrement = false
  26. while true do
  27. if _shouldIncrement then
  28. i += 1
  29. else
  30. _shouldIncrement = true
  31. end
  32. if not (i <= #input) then
  33. break
  34. end
  35. local _i = i
  36. local _i_1 = i
  37. local c = string.sub(input, _i, _i_1)
  38. local _arg0 = (string.byte(c))
  39. -- ▼ Array.push ▼
  40. encoded[#encoded + 1] = _arg0
  41. -- ▲ Array.push ▲
  42. end
  43. end
  44. return encoded
  45. end
  46. local function xorEncrypt(input, password)
  47. local _arg0 = function(byte, index)
  48. return bit32.bxor(byte, password[index % #password + 1])
  49. end
  50. -- ▼ ReadonlyArray.map ▼
  51. local _newValue = table.create(#input)
  52. for _k, _v in ipairs(input) do
  53. _newValue[_k] = _arg0(_v, _k - 1, input)
  54. end
  55. -- ▲ ReadonlyArray.map ▲
  56. local encryptedArray = _newValue
  57. -- ▼ ReadonlyArray.join ▼
  58. local _arg0_1 = " "
  59. if _arg0_1 == nil then
  60. _arg0_1 = ", "
  61. end
  62. -- ▲ ReadonlyArray.join ▲
  63. return table.concat(encryptedArray, _arg0_1)
  64. end
  65. local function xorDecrypt(input, password)
  66. local decrypted = ""
  67. local _exp = string.split(input, ";")
  68. local _arg0 = function(byte, index)
  69. local dec = tonumber(byte)
  70. local unlocked = bit32.bxor(dec, password[index % #password + 1])
  71. decrypted ..= string.char(unlocked)
  72. end
  73. -- ▼ ReadonlyArray.forEach ▼
  74. for _k, _v in ipairs(_exp) do
  75. _arg0(_v, _k - 1, _exp)
  76. end
  77. -- ▲ ReadonlyArray.forEach ▲
  78. return decrypted
  79. end
  80. local function GetNameValue(pName)
  81. local value = 0
  82. do
  83. local index = 1
  84. local _shouldIncrement = false
  85. while true do
  86. if _shouldIncrement then
  87. index += 1
  88. else
  89. _shouldIncrement = true
  90. end
  91. if not (index < #pName) then
  92. break
  93. end
  94. local cValue = { string.byte(string.sub(pName, index, index)) }
  95. local reverseIndex = #pName - index + 1
  96. if #pName % 2 == 1 then
  97. reverseIndex = reverseIndex - 1
  98. end
  99. if reverseIndex % 4 >= 2 then
  100. cValue[1] = -cValue[1]
  101. end
  102. value += cValue[1]
  103. end
  104. end
  105. return value
  106. end
  107. local function ComputeNameColor(pName)
  108. return NAME_COLORS[GetNameValue(pName) % #NAME_COLORS + 1]
  109. end
  110. local function ExtractRGB(color)
  111. local r = math.floor(color.R * 255)
  112. local g = math.floor(color.G * 255)
  113. local b = math.floor(color.B * 255)
  114. return { r, g, b }
  115. end
  116. local function Format(text, color)
  117. local rgb = ExtractRGB(color)
  118. return '<font color="rgb(' .. tostring(rgb[1]) .. ", " .. tostring(rgb[2]) .. ", " .. tostring(rgb[3]) .. ')">' .. text .. "</font>"
  119. end
  120. local function Tags(name)
  121. local tag = Format("[" .. name .. "]: ", ComputeNameColor(name))
  122. return tag
  123. end
  124. local screen = Instance.new("Part", script)
  125. screen.Material = Enum.Material.Glass
  126. screen.BrickColor = BrickColor.new("Black")
  127. screen.Transparency = 0.6
  128. screen.Reflectance = 0.2
  129. screen.Size = Vector3.new(0, 0, 0)
  130. local _cFrame = head.CFrame
  131. local _vector3 = Vector3.new(0, 0, -5)
  132. screen.CFrame = _cFrame + _vector3
  133. screen.CanTouch = false
  134. screen.Anchored = true
  135. screen.CanCollide = false
  136. game:GetService("TweenService"):Create(screen,TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{Size = Vector3.new(10, 7, 0.001)}):Play()
  137. local gui = Instance.new("SurfaceGui", screen)
  138. gui.Face = Enum.NormalId.Back
  139. local scroller = Instance.new("ScrollingFrame", gui)
  140. scroller.BackgroundTransparency = 1
  141. scroller.Size = UDim2.fromScale(1, 1)
  142. scroller.CanvasSize = UDim2.fromScale(1, 6)
  143. local layout = Instance.new("UIListLayout", scroller)
  144. layout.HorizontalAlignment = Enum.HorizontalAlignment.Left
  145. layout.VerticalAlignment = Enum.VerticalAlignment.Top
  146. layout.SortOrder = Enum.SortOrder.Name
  147.  
  148. local function output(text)
  149. local box = Instance.new("TextBox", scroller)
  150. box.BackgroundTransparency = 1
  151. box.TextColor3 = Color3.new(1, 1, 1)
  152. box.Text = text
  153. box.Font = Enum.Font.SourceSans
  154. box.TextSize = 25
  155. box.RichText = true
  156. box.TextWrapped = true
  157. box.AutomaticSize = Enum.AutomaticSize.XY
  158. box.TextXAlignment = Enum.TextXAlignment.Left
  159. box.TextYAlignment = Enum.TextYAlignment.Top
  160. box.Name = tostring(os.clock())
  161. box.ClipsDescendants = false
  162. if #scroller:GetChildren() > 25 then
  163. local oldest
  164. local _exp = scroller:GetChildren()
  165. local _arg0 = function(element)
  166. if element:IsA("TextBox") then
  167. if not oldest then
  168. oldest = element
  169. elseif tonumber(oldest.Name) > tonumber(element.Name) then
  170. oldest = element
  171. end
  172. end
  173. end
  174. -- ▼ ReadonlyArray.forEach ▼
  175. for _k, _v in ipairs(_exp) do
  176. _arg0(_v, _k - 1, _exp)
  177. end
  178. -- ▲ ReadonlyArray.forEach ▲
  179. oldest:Destroy()
  180. end
  181. return box
  182. end
  183. local function send(message, messagetype, author, comment)
  184. print("sending message as " .. tostring(author))
  185. local request = {
  186. Author = author,
  187. Content = message,
  188. Type = messagetype,
  189. Comment = comment,
  190. }
  191. ms:PublishAsync("comradio:" .. channel, http:JSONEncode(request))
  192. end
  193. local keys = {}
  194. local exchanges = {}
  195. local privateKey = math.random(1000000, 9999999)
  196. local subscription
  197. local function subscribe(name)
  198. local _result = subscription
  199. if _result ~= nil then
  200. _result:Disconnect()
  201. end
  202. subscription = ms:SubscribeAsync("comradio:" .. name, function(message)
  203. local request = http:JSONDecode(message.Data)
  204. print("received message from " .. tostring(request.Author))
  205. print("type: " .. request.Type)
  206. local author = game:GetService("Players"):GetNameFromUserIdAsync(request.Author)
  207. local messagetype = request.Type
  208. local tag = Tags(author)
  209. print(tag)
  210. if messagetype == "text" then
  211. local content = text:FilterStringAsync(request.Content, owner.UserId):GetChatForUserAsync(owner.UserId)
  212. local box = output(tag .. content)
  213. elseif messagetype == "welcome" then
  214. local box = output("Welcome, " .. author .. '! Say "/rchelp" in the chat for a list of commands.')
  215. elseif messagetype == "status" then
  216. local comment = text:FilterStringAsync(request.Comment, owner.UserId):GetChatForUserAsync(owner.UserId)
  217. local box = output(author .. "s new status is " .. comment)
  218. elseif messagetype == "diffieHellmanExchange" then
  219. local comment = request.Comment
  220. local box = output(tag)
  221. local target = tonumber(string.split(comment, ";")[2])
  222. print(comment, request.Content)
  223. if target == owner.UserId then
  224. local _exp = string.split(comment, ";")[1]
  225. repeat
  226. if _exp == ("1a") then
  227. exchanges[request.Author] = {}
  228. exchanges[request.Author].p = tonumber(string.split(request.Content, ";")[1])
  229. exchanges[request.Author].g = tonumber(string.split(request.Content, ";")[2])
  230. box:Destroy()
  231. local B = (bit32.bxor(exchanges[request.Author].g, privateKey)) % exchanges[request.Author].p
  232. send(request.Content .. ";" .. tostring(B), "diffieHellmanExchange", owner.UserId, "1b;" .. tostring(request.Author))
  233. break
  234. end
  235. if _exp == ("1b") then
  236. exchanges[request.Author] = {}
  237. exchanges[request.Author].p = tonumber(string.split(request.Content, ";")[1])
  238. exchanges[request.Author].g = tonumber(string.split(request.Content, ";")[2])
  239. exchanges[request.Author].B = tonumber(string.split(request.Content, ";")[3])
  240. box:Destroy()
  241. local A = (bit32.bxor(exchanges[request.Author].g, privateKey)) % exchanges[request.Author].p
  242. send(tostring(A), "diffieHellmanExchange", owner.UserId, "2a;" .. tostring(request.Author))
  243. break
  244. end
  245. if _exp == ("2a") then
  246. exchanges[request.Author].A = tonumber(request.Content)
  247. exchanges[request.Author].s = (bit32.bxor(exchanges[request.Author].A, privateKey)) % exchanges[request.Author].p
  248. send("confirmed", "diffieHellmanExchange", owner.UserId, "3;" .. tostring(request.Author))
  249. box:Destroy()
  250. break
  251. end
  252. if _exp == ("2b") then
  253. exchanges[request.Author].s = (bit32.bxor(exchanges[request.Author].B, privateKey)) % exchanges[request.Author].p
  254. send("confirmed", "diffieHellmanExchange", owner.UserId, "3;" .. tostring(request.Author))
  255. box:Destroy()
  256. break
  257. end
  258. if _exp == ("3") then
  259. box.Text ..= "[KEYS CONFIFRMED] You can now send encrypted messages to " .. author
  260. keys[request.Author] = exchanges[request.Author].s
  261. break
  262. end
  263. until true
  264. else
  265. box:Destroy()
  266. end
  267. else
  268. local comment = text:FilterStringAsync(request.Comment, owner.UserId):GetChatForUserAsync(owner.UserId)
  269. local box = output(tag .. comment)
  270. repeat
  271. if messagetype == ("image") then
  272. print("image: " .. request.Content)
  273. local image = Instance.new("ImageLabel")
  274. image.Size = UDim2.fromOffset(300, 300)
  275. image.Position = UDim2.new(0, 5, 0, 25)
  276. image.BackgroundTransparency = 1
  277. image.Image = request.Content
  278. image.ScaleType = Enum.ScaleType.Fit
  279. image.Image = request.Content
  280. image.Parent = box
  281. break
  282. end
  283. if messagetype == ("sound") then
  284. print("sound: " .. request.Content)
  285. local button = Instance.new("TextButton")
  286. button.Size = UDim2.fromOffset(50, 50)
  287. button.Position = UDim2.new(0, 5, 0, 25)
  288. button.TextScaled = true
  289. button.BackgroundColor3 = Color3.new(0.1, 0.51, 0.98)
  290. button.Text = "▶"
  291. button.Parent = box
  292. local sound = Instance.new("Sound")
  293. sound.SoundId = request.Content
  294. sound.Volume = 1
  295. sound.Looped = true
  296. sound.Parent = box
  297. local playing = false
  298. button.MouseButton1Click:Connect(function()
  299. playing = not playing
  300. if playing then
  301. sound:Play()
  302. button.Text = "⏸"
  303. else
  304. sound:Pause()
  305. button.Text = "▶"
  306. end
  307. end)
  308. break
  309. end
  310. if messagetype == ("ping") then
  311. local pingTarget = players:GetPlayerByUserId(tonumber(request.Content))
  312. if pingTarget then
  313. box.BackgroundTransparency = 0.8
  314. box.BackgroundColor3 = Color3.new(1, 0.8, 0.13)
  315. box.Text ..= " @" .. pingTarget.Name
  316. end
  317. break
  318. end
  319. if messagetype == ("encrypted") then
  320. local messageTarget = tonumber(request.Content)
  321. if messageTarget == owner.UserId then
  322. -- eslint-disable-next-line roblox-ts/lua-truthiness
  323. local _value = keys[request.Author]
  324. if _value ~= 0 and _value == _value and _value then
  325. box.Text = tag .. "[ENCRYPTED] " .. xorDecrypt(comment, encode(tostring(keys[request.Author])))
  326. else
  327. box.Text = "[ERROR]: Received private message from " .. author .. ", but no keys are available to decrypt."
  328. end
  329. end
  330. break
  331. end
  332. box.Text ..= "[UNKNOWN MESSAGE TYPE]"
  333. until true
  334. end
  335. end)
  336. end
  337. subscribe("")
  338. send("", "welcome", owner.UserId, "")
  339. output("Using rorc v6 compliant with comradio Protocol v2")
  340. local _exp = players:GetPlayers()
  341. local _arg0 = function(player)
  342. player.Chatted:Connect(function(command)
  343. if string.sub(command, 1, 6) == "/send " then
  344. send(string.sub(command, 7, -1), "text", currentauthorID, "")
  345. elseif string.sub(command, 1, 9) == "/e /send " then
  346. send(string.sub(command, 10, -1), "text", currentauthorID, "")
  347. elseif string.sub(command, 1, 7) == "/image " then
  348. local split = string.split(string.sub(command, 8, -1), " ")
  349. local id = split[1]
  350. table.remove(split, 1)
  351. -- ▼ ReadonlyArray.join ▼
  352. local _arg0_1 = " "
  353. if _arg0_1 == nil then
  354. _arg0_1 = ", "
  355. end
  356. -- ▲ ReadonlyArray.join ▲
  357. local comment = table.concat(split, _arg0_1)
  358. send(id, "image", currentauthorID, comment)
  359. elseif command:sub(1,8) == "/author " then
  360. currentauthorID = command:sub(9,99999)
  361. output("Author ID changed to "..currentauthorID)
  362. print("author id changed to "..currentauthorID)
  363. elseif string.sub(command, 1, 7) == "/sound " then
  364. local split = string.split(string.sub(command, 8, -1), " ")
  365. local id = split[1]
  366. table.remove(split, 1)
  367. -- ▼ ReadonlyArray.join ▼
  368. local _arg0_1 = " "
  369. if _arg0_1 == nil then
  370. _arg0_1 = ", "
  371. end
  372. -- ▲ ReadonlyArray.join ▲
  373. local comment = table.concat(split, _arg0_1)
  374. send(id, "sound", player.UserId, comment)
  375. elseif string.sub(command, 1, 7) == "/rchelp" then
  376. output("--------------------- help ------------------------")
  377. output("/send [message] - send a text message")
  378. output("/image rbxassetid://[id] [comment] - send an image")
  379. output("/sound rbxassetid://[id] [comment] - send a sound")
  380. output("/status [status] - change your status")
  381. output("/ping [name] [comment] - ping someone")
  382. output("/list - see known channels")
  383. output("/switch [name] - switch to another channel")
  384. output("/keys [name] - confirm keys with someone")
  385. output("/private [name] [msg] - send a private message to someone [requires keys]")
  386. output("/systemsend [message] - testing fake system messages [DEPRECATED DUE TO DECREASING PERFORMANCE]")
  387. output("/e /send [message] - silent sending messages (no chat flood)")
  388. output("/author [USERID] - Changes your author's userid (can be used for impersonation)")
  389. output("--------------------- funny information ------------------------")
  390. output("the source of this is https://raw.githubusercontent.com/hmm1x/roblox-hos-scripts/gh-pages/rorc%20edit")
  391. output("comsurg made the only AND ORIGINAL console")
  392. output("hmm1x edited this")
  393. output("comsurg is cool 😁")
  394. elseif string.sub(command, 1, 8) == "/switch " then
  395. channel = string.sub(command, 9, -1)
  396. output("switching to " .. channel)
  397. subscribe(channel)
  398. send("", "welcome", owner.UserId, "")
  399. elseif string.sub(command, 1, 8) == "/status " then
  400. local status = string.sub(command, 9, -1)
  401. send("", "status", player.UserId, status)
  402. elseif string.sub(command, 1, 6) == "/ping " then
  403. local split = string.split(string.sub(command, 7, -1), " ")
  404. local name = split[1]
  405. table.remove(split, 1)
  406. -- ▼ ReadonlyArray.join ▼
  407. local _arg0_1 = " "
  408. if _arg0_1 == nil then
  409. _arg0_1 = ", "
  410. end
  411. -- ▲ ReadonlyArray.join ▲
  412. local comment = table.concat(split, _arg0_1)
  413. local id = players:GetUserIdFromNameAsync(name)
  414. send(tostring(id), "ping", player.UserId, comment)
  415. elseif string.sub(command, 1, 5) == "/list" then
  416. output("------- list -------")
  417. output("default")
  418. output("coop")
  419. output("memes")
  420. output("scripting")
  421. output("feedback")
  422. output("questions")
  423. output("townhall")
  424. output("news")
  425. output("general")
  426. output("--------------------")
  427. elseif string.sub(command, 1, 6) == "/keys " then
  428. local split = string.split(string.sub(command, 7, -1), " ")
  429. local name = split[1]
  430. table.remove(split, 1)
  431. -- ▼ ReadonlyArray.join ▼
  432. local _arg0_1 = ";"
  433. if _arg0_1 == nil then
  434. _arg0_1 = ", "
  435. end
  436. -- ▲ ReadonlyArray.join ▲
  437. local comment = table.concat(split, _arg0_1)
  438. local id = players:GetUserIdFromNameAsync(name)
  439. send(comment, "diffieHellmanExchange", player.UserId, "1a;" .. tostring(id))
  440. elseif string.sub(command, 1, 9) == "/private " then
  441. local split = string.split(string.sub(command, 10, -1), " ")
  442. local name = split[1]
  443. table.remove(split, 1)
  444. -- ▼ ReadonlyArray.join ▼
  445. local _arg0_1 = " "
  446. if _arg0_1 == nil then
  447. _arg0_1 = ", "
  448. end
  449. -- ▲ ReadonlyArray.join ▲
  450. local comment = table.concat(split, _arg0_1)
  451. local id = players:GetUserIdFromNameAsync(name)
  452. -- eslint-disable-next-line roblox-ts/lua-truthiness
  453. local _value = keys[id]
  454. if _value ~= 0 and _value == _value and _value then
  455. local encrypted = xorEncrypt(encode(comment), encode(tostring(keys[id])))
  456. send(tostring(id), "encrypted", player.UserId, encrypted)
  457. else
  458. output("[ERROR]: Attempt to send private message to someone without encryption key")
  459. end
  460. end
  461. end)
  462. end
  463. output("hmm1x edited this")
  464. -- ▼ ReadonlyArray.forEach ▼
  465. for _k, _v in ipairs(_exp) do
  466. _arg0(_v, _k - 1, _exp)
  467. end
  468. -- ▲ ReadonlyArray.forEach ▲
  469. return nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement