Advertisement
No_Zen

CarpetTransmitter

May 12th, 2024 (edited)
569
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. local modem = peripheral.wrap("back")  -- Wrap the modem on the back side
  2.  
  3. term.clear()
  4. term.setCursorPos(1, 1)
  5. print("Enter command (say, refuel, dig, mine, w, a, s, d, up, down, slot, sety, goy, bomb, carpet, update):")
  6.  
  7. while true do
  8.     local input = read()
  9.     if input == "update" then
  10.         -- Replace 'yourPasteIdHere' with your actual Pastebin ID
  11.         local url = "https".."://".."pastebin"..".com".."/raw/FJJCENLN"
  12.         local response = http.get(url)
  13.        
  14.         if response then
  15.             local scriptContent = response.readAll()
  16.             response.close()
  17.  
  18.             modem.transmit(25813, 25813, "update " .. scriptContent)
  19.             print("Update sent.")
  20.         else
  21.             print("Failed to download the script from Pastebin.")
  22.         end
  23.     else
  24.         -- Transmit other commands as usual
  25.         modem.transmit(25813, 25813, input)
  26.         print("Command sent: " .. input)
  27.     end
  28. end
  29.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement