Advertisement
DOGGYWOOF

Untitled

Sep 25th, 2024 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. -- Initialize Rednet
  2. rednet.open("left") -- You can change "back" to the side your modem is on
  3.  
  4. -- Function to generate a random message and number
  5. local function generateRandomMessage()
  6. local characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
  7. local message = ""
  8.  
  9. -- Generate a random string of 10 characters
  10. for i = 1, 10 do
  11. local index = math.random(1, #characters)
  12. message = message .. characters:sub(index, index)
  13. end
  14.  
  15. -- Generate a random number between 1 and 10000
  16. local randomNumber = math.random(1, 10000)
  17.  
  18. return message, randomNumber
  19. end
  20.  
  21. -- Main loop to spam broadcast random messages and numbers rapidly
  22. while true do
  23. local message, randomNumber = generateRandomMessage()
  24.  
  25. -- Broadcast random message and number, no sleep to jam the network
  26. rednet.broadcast("Message: " .. message .. " | Number: " .. randomNumber)
  27. end
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement