Advertisement
Guest User

startup

a guest
Dec 24th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. while true do
  2.  term.clear()
  3.  term.setCursorPos(1, 1)
  4.  local colors =  {"yellow","lightBlue","lime", "magenta", "orange", "white", "black"}
  5.  print("Tape ton texte a affiche")
  6.  local input = read()
  7.  monitor = peripheral.wrap("top")
  8.  if input == "0001" then
  9.   term.clear()
  10.   term.setCursorPos(1, 1)
  11.   print("Deconnexion en cours")
  12.   sleep("5")
  13.   shell.exit()
  14.   print("OK")
  15.  else
  16.   term.clear()
  17.   term.setCursorPos(1, 1)
  18.   local rand = math.random(0, 7)
  19.   local colors1 = colors[rand]
  20.   print("Couleur choisi: " .. colors1)
  21.   print("Affichage du message " .. input)
  22.   monitor.clear()
  23.   monitor.setCursorPos(1, 1)
  24.   monitor.setBackgroundColor(colors.lime)
  25.   monitor.write(input)
  26.   sleep(5)
  27.  end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement