local ecran=peripheral.wrap("right")

while true do
	if turtle.getItemCount(1)==0 then
		ecran.setBackgroundColor(colors.red)
		ecran.clear()
		event, sid, xPos, yPos = os.pullEvent("monitor_touch")
	elseif turtle.getItemCount(2)==0 then
		ecran.setBackgroundColor(colors.red)
		ecran.clear()
		event, sid, xPos, yPos = os.pullEvent("monitor_touch")
	elseif turtle.getItemCount(3)==0 then
		ecran.setBackgroundColor(colors.red)
		ecran.clear()
		event, sid, xPos, yPos = os.pullEvent("monitor_touch")
	else
		ecran.setBackgroundColor(colors.green)
		ecran.clear()
		
		event, sid, xPos, yPos = os.pullEvent("monitor_touch")
		
		
		
		ecran.setBackgroundColor(colors.yellow)
		ecran.clear()
	
		turtle.select(1)
		turtle.drop(1)
		turtle.select(2)
		turtle.drop(1)
		turtle.select(3)
		turtle.drop(1)
		
		local event = os.pullEvent("redstone")
		
	end
end