Want more features on Pastebin? Sign Up, it's FREE!
Guest

startup

By: a guest on Dec 24th, 2012  |  syntax: Lua  |  size: 0.70 KB  |  views: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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
clone this paste RAW Paste Data