Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function closecafe()
- m.clear()
- m.setTextColor(1)
- m.setTextScale(5)
- m.setCursorPos(5,4)
- m.write("Le cafe")
- m.setCursorPos(4,5)
- m.write("est fermer")
- end
- function carte()
- m.clear()
- m.setTextColor(1)
- m.setTextScale(2)
- m.setCursorPos(1,1)
- m.write("La carte")
- m.setCursorPos(1,6)
- m.write("Smoothie :")
- for i=1,10 do
- if i==1 or i==2 then
- a=i+2
- else
- a=i+5
- end
- if p[i] == "Empty" then
- m.setCursorPos(4,a)
- m.write("..............................Empty")
- else
- m.setCursorPos(4,a)
- m.write("................................."..p[i].."$")
- end
- m.setCursorPos(4,a)
- if i==1 then
- m.write("Espresso")
- end
- if i==2 then
- m.write("Carrot Juice")
- end
- if i==3 then
- m.write("Banana")
- end
- if i==4 then
- m.write("Lime")
- end
- if i==5 then
- m.write("Pomegranate")
- end
- if i==6 then
- m.write("Peach")
- end
- if i==7 then
- m.write("Mango")
- end
- if i==8 then
- m.write("Blackberry")
- end
- if i==9 then
- m.write("Melon")
- end
- if i==10 then
- m.write("Lemon")
- end
- end
- end
- p={1,"?",5,5,5,5,5,5,5,"Empty"}
- rednet.open("top")
- m = peripheral.wrap("left")
- term.redirect(m)
- term.clear()
- closecafe()
- while true do
- id,message = rednet.receive()
- if id == 11 or id == 14 then
- if message=="closecafe" then
- closecafe()
- end
- if message=="reset screen" then
- term.clear()
- end
- if message=="affiche carte" then
- carte()
- end
- if message=="modif prix" then
- id,message = rednet.receive()
- for i=1,10 do
- if i==1 then
- boisson="Espresso"
- end
- if i==2 then
- boisson="Carrot Juice"
- end
- if i==3 then
- boisson="Banana"
- end
- if i==4 then
- boisson="Lime"
- end
- if i==5 then
- boisson="Pomegranate"
- end
- if i==6 then
- boisson="Peach"
- end
- if i==7 then
- boisson="Mango"
- end
- if i==8 then
- boisson="Blackberry"
- end
- if i==9 then
- boisson="Melon"
- end
- if i==10 then
- boisson="Lemon"
- end
- if message == boisson then
- id,message = rednet.receive()
- p[i] = message
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement