Advertisement
Guest User

desktopclient

a guest
Nov 25th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1.  
  2. print("Initialisation...")
  3. local port = 0
  4. print("Client Wi-Fi - Tomorrowland Edition")
  5. print("Version 0.1a - Maxence/Amiami51")
  6. print("Choisir un port 1-65535")
  7. write("> ")
  8. local input_port = read()
  9. print("Connexion en cours...")
  10. local modem_client = peripheral.wrap("right")
  11. modem_client.open(tonumber(input_port))
  12. print("Client connecte !")
  13. print("En attente d'un affichage")
  14.  
  15. while modem_client.isOpen(tonumber(input_port)) == true do
  16. local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  17. print("----------------------")
  18. print("De : "..senderChannel)
  19. print("Message : "..message)
  20. print("transmission sur l'ecran en cours")
  21. local m = peripheral.wrap("back")
  22. local w,h = m.getSize()
  23.  
  24. m.clear()
  25. print("Width : "..w)
  26. print("Height : "..h)
  27. m.setCursorPos(math.floor(w/2-message:len()/2+.5), math.floor(h/2+.5))
  28. m.setTextColor(colors.white)
  29. m.setBackgroundColor(colors.cyan)
  30. m.setTextScale(4)
  31. m.write(message)
  32. print("Transmis avec success")
  33. print("-----------------")
  34.  
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement