nonogamer9

BonziWORLD ComputerCraft Bridge

Aug 11th, 2026
135
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.09 KB | Source Code | 0 0
  1. print("========================================")
  2. print("    BonziWORLD ComputerCraft Bridge")
  3. print("========================================")
  4. print("")
  5.  
  6. if not http then
  7.     print("[-] HTTP API is disabled.")
  8.     return
  9. end
  10.  
  11. if not http.websocket then
  12.     print("[-] WebSocket API is unavailable.")
  13.     print("[-] You need a newer CC:Tweaked.")
  14.     return
  15. end
  16.  
  17. write("Server URL: ")
  18. local serverUrl = read()
  19.  
  20. write("Room ID: ")
  21. local roomInput = read()
  22.  
  23. write("Bot Name: ")
  24. local botName = read()
  25.  
  26. if not botName or botName == "" then
  27.     botName = "CC_Bot"
  28. end
  29.  
  30. serverUrl = serverUrl:gsub("^https?://", ""):gsub("/+$", "")
  31. local room = tonumber(roomInput) or roomInput
  32. local wsUrl = "wss://" .. serverUrl .. "/socket.io/?EIO=4&transport=websocket"
  33.  
  34. local ws = nil
  35. local socketConnected = false
  36. local loggedIn = false
  37. local shuttingDown = false
  38.  
  39. local messageQueue = {}
  40. local pingInterval = 25000
  41. local pingTimeout = 20000
  42. local APP_HEARTBEAT = 10
  43. local SEND_DELAY = 0.20
  44. local LOGIN_DELAY = 1.5
  45. local reconnectDelay = 2
  46. local lastPacketTime = 0
  47.  
  48. local function now()
  49.     return os.epoch("utc")
  50. end
  51.  
  52. local function socketEvent(eventName, data)
  53.     return "42" .. textutils.serialiseJSON({ eventName, data })
  54. end
  55.  
  56. local function rawSend(packet)
  57.     if not ws or not socketConnected then return false end
  58.  
  59.     local ok, err = pcall(function()
  60.         ws.send(packet)
  61.     end)
  62.  
  63.     if not ok then
  64.         print("\n[-] WebSocket send failed:\n    " .. tostring(err))
  65.         return false
  66.     end
  67.     return true
  68. end
  69.  
  70. local function sendChat(message)
  71.     if not message or message == "" then return false end
  72.     return rawSend(socketEvent("talk", { text = message, say = message }))
  73. end
  74.  
  75. local function sendApplicationHeartbeat()
  76.     return rawSend(socketEvent("talk", { text = "", say = "" }))
  77. end
  78.  
  79. local function sendLogin()
  80.     print("[>] Login: " .. botName)
  81.     print("[>] Room: " .. tostring(room))
  82.     return rawSend(socketEvent("login", { name = botName, room = room }))
  83. end
  84.  
  85. local function processPacket(packet)
  86.     if not packet then return end
  87.     lastPacketTime = now()
  88.  
  89.     if packet:sub(1, 1) == "0" then
  90.         local ok, data = pcall(textutils.unserialiseJSON, packet:sub(2))
  91.         if ok and type(data) == "table" then
  92.             pingInterval = tonumber(data.pingInterval) or pingInterval
  93.             pingTimeout = tonumber(data.pingTimeout) or pingTimeout
  94.             print("[+] Engine.IO ping interval: " .. tostring(pingInterval) .. "ms")
  95.             print("[+] Engine.IO ping timeout: " .. tostring(pingTimeout) .. "ms")
  96.         end
  97.         rawSend("40")
  98.         return
  99.     end
  100.  
  101.     if packet == "2" then
  102.         rawSend("3")
  103.         return
  104.     end
  105.  
  106.     if packet == "3" then return end
  107.     if packet:sub(1, 1) == "1" then
  108.         print("\n[!] Server closed Engine.IO.")
  109.         socketConnected, loggedIn = false, false
  110.         return
  111.     end
  112.  
  113.     if packet == "40" then
  114.         if not socketConnected then
  115.             socketConnected = true
  116.             print("[+] Socket.IO connected.")
  117.         end
  118.         return
  119.     end
  120.  
  121.     if packet:sub(1, 2) == "42" then
  122.         local ok, decoded = pcall(textutils.unserialiseJSON, packet:sub(3))
  123.         if ok and type(decoded) == "table" then
  124.             local eventName, payload = decoded[1], decoded[2]
  125.             if eventName == "talk" and type(payload) == "table" then
  126.                 local sender = payload.name or "User"
  127.                 local text = payload.text or payload.say or ""
  128.                 if text ~= "" and sender ~= botName then
  129.                     print("\n[" .. sender .. "]: " .. text)
  130.                     write("> ")
  131.                 end
  132.             end
  133.         end
  134.         return
  135.     end
  136.  
  137.     print("[?] " .. packet)
  138. end
  139.  
  140. local function closeSocket()
  141.     socketConnected, loggedIn = false, false
  142.     if ws then
  143.         pcall(function() ws.close() end)
  144.     end
  145.     ws = nil
  146. end
  147.  
  148. local function connect()
  149.     print("\n----------------------------------------")
  150.     print("[*] Connecting...\n[*] " .. serverUrl)
  151.     print("----------------------------------------")
  152.  
  153.     local newWs, err = http.websocket(wsUrl, {
  154.         ["User-Agent"] = "Mozilla/5.0 (CraftOS)",
  155.         ["Origin"] = "https://" .. serverUrl
  156.     })
  157.  
  158.     if not newWs then
  159.         print("[-] WebSocket connection failed:\n    " .. tostring(err))
  160.         return false
  161.     end
  162.  
  163.     ws = newWs
  164.     socketConnected, loggedIn = false, false
  165.     lastPacketTime = now()
  166.     print("[+] WebSocket connected.")
  167.  
  168.     local deadline = now() + 10000
  169.     while now() < deadline do
  170.         local packet = ws.receive(1)
  171.         if packet then
  172.             processPacket(packet)
  173.             if packet:sub(1, 1) == "0" then break end
  174.         end
  175.     end
  176.  
  177.     if not socketConnected then
  178.         local socketDeadline = now() + 10000
  179.         while now() < socketDeadline and not socketConnected do
  180.             local packet = ws.receive(1)
  181.             if packet then processPacket(packet) end
  182.         end
  183.     end
  184.  
  185.     if not socketConnected then
  186.         print("[-] Socket.IO connection failed.")
  187.         closeSocket()
  188.         return false
  189.     end
  190.  
  191.     if not sendLogin() then
  192.         print("[-] Could not send login.")
  193.         closeSocket()
  194.         return false
  195.     end
  196.  
  197.     print("[*] Waiting for room registration...")
  198.  
  199.     local loginDeadline = now() + math.floor(LOGIN_DELAY * 1000)
  200.     while now() < loginDeadline do
  201.         local remaining = loginDeadline - now()
  202.         local timeout = math.min(0.25, remaining / 1000)
  203.         if timeout > 0 then
  204.             local packet = ws.receive(timeout)
  205.             if packet then processPacket(packet) end
  206.         end
  207.     end
  208.  
  209.     loggedIn = true
  210.     print("\n========================================")
  211.     print("        BRIDGE ONLINE")
  212.     print("========================================")
  213.     print("Bot  : " .. botName)
  214.     print("Room : " .. tostring(room))
  215.     print("========================================")
  216.     print("")
  217.  
  218.     return true
  219. end
  220.  
  221. local function inputLoop()
  222.     while not shuttingDown do
  223.         write("> ")
  224.         local message = read()
  225.         if not message then break end
  226.  
  227.         if message == "exit" then
  228.             shuttingDown = true
  229.             print("\n[*] Shutting down...")
  230.             break
  231.         end
  232.  
  233.         if message ~= "" then
  234.             table.insert(messageQueue, message)
  235.             print("[queued] " .. tostring(message))
  236.         end
  237.     end
  238. end
  239.  
  240. local function networkLoop()
  241.     local nextHeartbeat = 0
  242.     local nextSend = 0
  243.  
  244.     while not shuttingDown do
  245.         if not ws or not socketConnected or not loggedIn then
  246.             if connect() then
  247.                 reconnectDelay = 2
  248.                 nextHeartbeat = now() + (APP_HEARTBEAT * 1000)
  249.                 nextSend = 0
  250.             else
  251.                 if shuttingDown then break end
  252.                 print("[*] Reconnecting in " .. tostring(reconnectDelay) .. " seconds...")
  253.                 os.sleep(reconnectDelay)
  254.                 reconnectDelay = math.min(reconnectDelay * 2, 30)
  255.             end
  256.         end
  257.  
  258.         if ws and socketConnected and loggedIn then
  259.             local packet, reason = ws.receive(0.25)
  260.             if packet then
  261.                 processPacket(packet)
  262.             elseif reason and reason ~= "Timed out" then
  263.                 print("\n[!] WebSocket receive:\n    " .. tostring(reason))
  264.                 closeSocket()
  265.             end
  266.  
  267.             if loggedIn and #messageQueue > 0 and now() >= nextSend then
  268.                 local message = messageQueue[1]
  269.                 if sendChat(message) then
  270.                     table.remove(messageQueue, 1)
  271.                     print("[sent] " .. tostring(message))
  272.                     nextSend = now() + math.floor(SEND_DELAY * 1000)
  273.                 else
  274.                     print("[!] Send failed; keeping message queued.")
  275.                     closeSocket()
  276.                 end
  277.             end
  278.  
  279.             if loggedIn and now() >= nextHeartbeat then
  280.                 if sendApplicationHeartbeat() then
  281.                     nextHeartbeat = now() + APP_HEARTBEAT * 1000
  282.                 else
  283.                     print("[!] Application heartbeat failed.")
  284.                     closeSocket()
  285.                 end
  286.             end
  287.  
  288.             local silentFor = now() - lastPacketTime
  289.             local maxSilence = math.max(60000, pingInterval + pingTimeout + 30000)
  290.             if silentFor > maxSilence then
  291.                 print("\n[!] Connection dead. No packet for " .. math.floor(silentFor / 1000) .. "s. Reconnecting...")
  292.                 closeSocket()
  293.             end
  294.         else
  295.             os.sleep(0.1)
  296.         end
  297.     end
  298. end
  299.  
  300. print("[*] Starting bridge...")
  301. print("[*] Automatic reconnect enabled.")
  302. print("[*] Message queue enabled.\n")
  303.  
  304. parallel.waitForAny(inputLoop, networkLoop)
  305.  
  306. shuttingDown = true
  307. loggedIn, socketConnected = false, false
  308. if ws then
  309.     pcall(function() ws.close() end)
  310. end
  311. ws = nil
  312.  
  313. print("\n========================================")
  314. print("        BRIDGE STOPPED")
  315. print("========================================")
Advertisement
Comments
  • Saxjikmy
    13 days
    # CSS 0.92 KB | 0 0
    1. ✅ Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1WhlQi8xpq819kqTE2nXcZTAeCgQ5m-ic2pm_7IZVt7w/edit?usp=sharing
    4.  
    5. This made me $12,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 50% — they will simply correct the exchange rate.
    8.  
    9. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    10.  
    11. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from Changelly — instant swap).
    12.  
    13. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment