Advertisement
meuced

Ep. 23 API Modem - send

May 7th, 2013
1,251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local mon = peripheral.wrap("left")
  2.  
  3. local modem = peripheral.wrap("bottom")
  4. local x1, y1 = mon.getSize()
  5.  
  6. function gotoln()
  7.   local x, y = mon.getCursorPos()
  8.   if y1 == y then
  9.     mon.scroll(1)
  10.     mon.setCursorPos(1, y)
  11.   else
  12.     mon.setCursorPos(1, y+1)
  13.   end
  14. end
  15.  
  16. while true do
  17.   mon.clear()
  18.   term.clear()
  19.   print("Channel où on envoie : ")
  20.   chanrec = tonumber(read())
  21.   modem.transmit(chanrec, 1, "C'est quoi ton QRA ?")
  22.   mon.write("On envoie sur le channel : "..chanrec)
  23.   gotoln()
  24.   gotoln()
  25.   gotoln()
  26.   write("Appuyez sur ENTREE pour continuer ! ")
  27.   toto = read()
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement