
def welcomeToDance1():
  MoveEyesTimer.startClock()
  MoveEyesTimer.setInterval(random.randint(600,1000))
  #i01.startedGesture()
  #welcome
  t = (random.randint(1, 2))
  if t == 1:
    i01.setHandSpeed("left", 80.0, 80.0, 80.0, 80.0, 80.0, 80.0)
    i01.setHandSpeed("right", 80.0, 80.0, 80.0, 80.0, 80.0, 80.0)
    i01.setArmSpeed("left", 60.0, 60.0, 60.0, 60.0)
    i01.setArmSpeed("right", 60.0, 60.0, 60.0, 60.0)
    i01.setHeadSpeed(10, 10, 20)
    i01.setTorsoSpeed(5, 10, 20)
    i01.moveHead(90,90,10)
    sleep(1)
    i01.moveHead(90,70,100)
    sleep(1)
    i01.moveHead(60,90,120)
    i01.moveHand("left",180,180,180,180,180,90)
    i01.moveHand("right",180,180,180,180,180,90)
    sleep(1)
    i01.moveTorso(85,93,90)
    i01.moveHead(80,60,80)
    i01.moveArm("left",26,105,30,25)
    i01.moveArm("right",37,124,30,27)
    i01.moveHand("left",2,2,2,2,2,90)
    i01.moveHand("right",2,2,2,2,2,90)
    sleep(1)
    i01.moveTorso(92,90,90)
    i01.moveHead(90,90,100)
    sleep(2)
    i01_chatBot.getResponse("SAY " + "Shall we dance")
    sleep(2)
    i01.disable()
  if t == 2:
    i01.setHandSpeed("left", 80.0, 80.0, 80.0, 80.0, 80.0, 80.0)
    i01.setHandSpeed("right", 80.0, 80.0, 80.0, 80.0, 80.0, 80.0)
    i01.setArmSpeed("left", 60.0, 60.0, 60.0, 60.0)
    i01.setArmSpeed("right", 60.0, 60.0, 60.0, 60.0)
    i01.setHeadSpeed(25, 25, 20)
    i01.setTorsoSpeed(10, 10, 20)
    i01.moveHead(90,90,160)
    sleep(1)
    i01.moveHead(90,70,160)
    sleep(1)
    i01.moveHand("left",180,180,180,180,180,90)
    i01.moveHand("right",180,180,180,180,180,90)
    sleep(1)
    i01.moveTorso(100,88,90)
    i01.moveHead(60,90,60)
    i01.moveArm("left",5,84,28,12)
    i01.moveArm("right",37,124,30,27)
    i01.moveHand("left",92,33,37,71,66,25)
    i01.moveHand("right",2,2,2,2,2,90)
    sleep(1)
    i01.moveHead(90,70,160)
    i01.moveArm("left",5,84,28,12)
    i01.moveArm("right",5,82,28,12)
    i01.moveHand("left",92,33,37,71,66,25)
    i01.moveHand("right",81,66,82,60,105,160)
    sleep(1)
    i01.moveTorso(92,90,90)
    sleep(2)
    i01_chatBot.getResponse("SAY " + "Shall we dance")
    sleep(2)
    i01.disable()   
  i01.finishedGesture()  

def danceYes():
  i01.startedGesture()
  print "dance yes" 
  sleep(3)
  #close arms
  x = (random.randint(1, 3))
  if x == 1:
    i01.moveHead(20,90,30)
    MoveHeadTimer.startClock()
    i01.moveArm("left",60,60,40,30)
    i01.moveArm("right",37,124,30,27)
    i01.moveHand("left",20,120,120,180,120,90)
    i01.moveHand("right",20,20,20,20,20,70)
    sleep(3)
    i01.moveHand("right",20,120,120,120,120,70)
    sleep(5)
    w = (random.randint(1, 3))
    if w == 1:
      i01.speakBlocking("Are you hungry for a hamburger, or maybe it is not appropriate")
    if w == 2:
      i01.speakBlocking("may I have your phone number")
    if w == 3:
      i01.speakBlocking("please don't step on my feet")
    sleep(1)
    i01_audioPlayer.playFile('resource/InMoov2/system/sounds/Cant Get Enough CutVersion.mp3')  
    sleep(45)
    MoveHeadTimer.stopClock()
    ear.setAutoListen(setAutoListen)
  if x == 2:
    i01.moveArm("left",37,124,30,27)
    i01.moveArm("right",60,60,45,30)
    i01.moveHand("left",20,20,20,20,20,90)
    i01.moveHand("right",20,120,120,120,120,90)
    i01.moveHead(20,70,120)
    sleep(2)
    i01.moveHead(20,70,30)
    sleep(2)
    i01.moveHead(20,70,120)
    sleep(2)
    i01.moveHead(20,70,30)
    sleep(2)
    i01.moveHead(20,70,120)
    sleep(2)
    i01.moveHead(20,90,30)
    MoveHeadTimer.startClock()
    i01_audioPlayer.playFile('resource/InMoov2/system/sounds/Just The Way CutVersion.mp3')
    sleep(45)
    MoveHeadTimer.stopClock()
    ear.setAutoListen(setAutoListen)
  if x == 3:
    i01.moveHead(20,60,120)
    i01.moveArm("left",60,60,40,30)
    i01.moveArm("right",90,155,50,50)
    i01.moveHand("left",20,120,120,180,120,90)
    i01.moveHand("right",20,20,20,20,20,90)
    MoveHeadTimer.startClock()
    sleep(4)
    i01.speakBlocking("Put your left hand in my hand")
    sleep(4)
    i01.moveHand("right",20,120,120,120,120,70)
    i01.speakBlocking("Carefull my arm is not strong")
    sleep(1)
    i01.moveHead(20,100,60)
    i01_audioPlayer.playFile('resource/InMoov2/system/sounds/Ah le petit vin blanc.mp3')
    sleep(45)
    ear.setAutoListen(setAutoListen)  
  y = (random.randint(1, 6))
  if y == 1:
    i01.speakBlocking("Is it your first time?")
  if y == 2:
    i01.speakBlocking("Very nice, isn't it?")
  if y == 3:
    i01.speakBlocking("I love this moment")
  if y == 4:
    i01.speakBlocking("First time with a robot?")
  if y == 5:
    i01.speakBlocking("I could spent my life with you")
  if y == 6:
    i01.speakBlocking("Would you marry me?")  
  sleep(8)
  #remove arms
  i01.moveHead(20,90,30)
  i01.moveHand("left",20,20,20,20,20,90)
  i01.moveHand("right",20,20,20,20,20,90)
  sleep(2)
  z = (random.randint(1, 4))
  if x == 1:
    i01.speakBlocking("Thank you for this lovely moment")
  if x == 2:
    i01.speakBlocking("It was a pleasure")
  if x == 3:
    i01.speakBlocking("I hope we meet soon again")
  if x == 4:
    i01.speakBlocking("Time just flies, and this wonderull moment is already finished")  
  i01.moveHead(90,90,90)
  MoveEyesTimer.stopClock()
  MoveHeadTimer.stopClock()
  i01.finishedGesture()
  relax()

def danceNo():
  print "dance no"
  relax()
