Buzzzard

Computer Craft chat with monitor

Aug 11th, 2025
259
1
Never
14
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | Gaming | 1 0
  1. -- Get the username and channel
  2. write("Username: ")
  3. username = read()
  4. write("Channel: ")
  5. channel = read()
  6.  
  7. term.clear()
  8. term.setCursorPos(1,1)
  9.  
  10. -- Open any modems on the computer
  11. peripheral.find("modem", rednet.open)
  12. message = ""
  13.  
  14. -- Find and set up monitor
  15. local monitor = peripheral.find("monitor")
  16. if monitor then
  17.     monitor.setTextScale(1) -- adjust for readability
  18.     monitor.clear()
  19.     monitor.setCursorPos(1, 1)
  20. else
  21.     print("No monitor found, running in terminal only.")
  22. end
  23.  
  24. -- Keep track of where we are printing on the monitor
  25. local monX, monY = 1, 1
  26. local function monPrint(text)
  27.     if monitor then
  28.         monitor.setCursorPos(monX, monY)
  29.         monitor.write(text)
  30.         monY = monY + 1
  31.         if monY > select(2, monitor.getSize()) then
  32.             monitor.scroll(1)
  33.             monY = select(2, monitor.getSize())
  34.         end
  35.     end
  36. end
  37.  
  38. -- Receives chat messages from other clients on the same channel
  39. function receiveChat()
  40.     while true do
  41.         local id, msg, chan = rednet.receive(channel)
  42.         if msg then
  43.             print(msg)
  44.             monPrint(msg)
  45.         end
  46.     end
  47. end
  48.  
  49. -- Sends messages to other clients on the same channel
  50. function sendMsg()
  51.     while true do
  52.         write(">: ")
  53.         message = read()
  54.         if message == "exit[]" then
  55.             os.reboot()
  56.         end
  57.         term.clearLine()
  58.         local fullMsg = username .. ": " .. message
  59.         rednet.broadcast(fullMsg, channel)
  60.         monPrint(fullMsg)
  61.     end
  62. end
  63.  
  64. -- Runs the functions in parallel so you can receive and send messages at the same time
  65. parallel.waitForAny(receiveChat, sendMsg)
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Icximpa
    36 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Frokimky
    22 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • User was banned
  • Jorvegdy
    11 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=aafjqlnyjf
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment