Popopidoo

Untitled

Sep 23rd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function centerText(text, y, color)
  2.                mX = mon.getSize()
  3.                x =  math.floor(mX/2) - math.floor(string.len(text)/2)
  4.                mon.setCursorPos(x, y)
  5.                mon.setTextColor(color)
  6.                mon.write(text)
  7.             end
  8.            
  9. function Text(text, y, color)
  10.               mX = mon.getSize()
  11.               x = 3
  12.               mon.setCursorPos(x,y)
  13.               mon.setTextColor(color)
  14.               mon.write(text)
  15.             end    
  16.  
  17.  
  18.                    
  19.             mon = peripheral.wrap("back")
  20.             mon.setTextScale(1)
  21.             mon.setBackgroundColor(colors.gray)
  22.             mon.clear()
  23.                     centerText("Bienvenue à la boulangerie du serveur", 1,16384)
  24.                     centerText("Pour acheter un produit,", 2,2)
  25.                     centerText("clique gauche sur un coffre", 3,2)
  26.                     centerText("_________________________________________________________", 4,2)
  27.                     centerText("Item | Prix", 5,2)
  28.                     Text("        Bread         |  3 euros", 6,2)
  29.                     Text("        Log           |  1 euro", 7,2)
  30.                     Text("        Carrot        |  2 euros", 8,2)
  31.                     Text("        Baked Potato  |  5 euros", 9,2)
Advertisement
Add Comment
Please, Sign In to add comment