How to use attendre method in SeleniumBase

Best Python code snippet using SeleniumBase

script.py

Source:script.py Github

copy

Full Screen

...327 asser.goTo(Point(-820.,660.))328 #début leur totem sud329 asser.gestionTourner(0)330 action.deplacer(130)331 asser.attendre(0.5)332 asser.gestionAvancer(200,instruction = "auStopNeRienFaire")333 action.deplacer(120)334 asser.attendre(0.5)335 asser.gestionTourner(0,instruction = "auStopNeRienFaire")336 asser.gestionAvancer(200,instruction = "auStopNeRienFaire")337 action.deplacer(110)338 asser.attendre(0.5)339 action.deplacer(120)340 asser.attendre(0.5)341 asser.gestionTourner(0,instruction = "auStopNeRienFaire")342 asser.gestionAvancer(200,instruction = "auStopNeRienFaire")343 344 #mettre dans la cale345 asser.gestionAvancer(100,instruction = "auStopNeRienFaire")346 asser.gestionTourner(-math.pi/4,instruction = "auStopNeRienFaire")347 asser.gestionAvancer(300,instruction = "auStopNeRienFaire")348 asser.gestionTourner(0,instruction = "auStopNeRienFaire")349 asser.gestionAvancer(700,instruction = "auStopNeRienFaire")350 asser.gestionTourner(math.pi/4, instruction = "auStopNeRienFaire")351 asser.gestionAvancer(400,instruction = "auStopNeRienFaire")352 asser.gestionTourner(0,instruction = "auStopNeRienFaire")353 asser.gestionAvancer(300,instruction = "auStopNeRienFaire")354 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")355 action.deplacer(130)356 asser.attendre(0.2)357 action.deplacer(110)358 asser.attendre(0.2)359 action.deplacer(130)360 asser.changerVitesse("translation", 3)361 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")362 asser.changerVitesse("translation", 2)363 asser.gestionAvancer(-300,instruction = "auStopNeRienFaire")364 action.deplacer(0)365 asser.gestionTourner(math.pi/2,instruction = "auStopNeRienFaire")366 def test1(self,asser, action):367 xd = raw_input("x départ? ")368 yd = raw_input("y départ? ")369 asser.setPosition(Point(float(xd),float(yd)))370 asser.setOrientation(0)371 xa = raw_input("x arrivée? ")372 ya = raw_input("y arrivée? ")373 asser.goTo(Point(float(xa),float(ya)))374 375 def test2(self,asser,action):376 asser.setPosition(Point(812,872))377 asser.setOrientation(math.pi/2)378 asser.goTo(Point(float(850),float(1600)))379 380 def test3(self,asser,action):381 xa = raw_input("x robot adverse? ")382 ya = raw_input("y robot adverse? ")383 __builtin__.instance.ajouterRobotAdverse(Point(float(xa),float(ya)))384 385 def test4(self,asser,action):386 xd = raw_input("x départ? ")387 yd = raw_input("y départ? ")388 asser.setPosition(Point(float(xd),float(yd)))389 asser.setOrientation(0)390 xa = raw_input("x arrivée? ")391 ya = raw_input("y arrivée? ")392 asser.goTo(Point(float(xa),float(ya)))393 394 def test5(self,asser,action):395 action.deplacer(150)396 397 def test6(self,asser,action):398 action.deplacer(0)399 400 def allerRetour(self, asser,action):401 while 42:402 asser.gestionAvancer(400)403 asser.gestionTourner(0)404 asser.gestionAvancer(400)405 asser.gestionTourner(math.pi)406 407 def test_goto1(self, asser, action):408 print "OBJECTIF TOTEM SUD : (0,660)"409 asser.goTo(Point(0,660))410 411 def test_goto2(self, asser, action) :412 print "OBJECTIF TOTEM NORD : (0,1330)"413 asser.goTo(Point(0, 1330))414 def test_goto3(self, asser, action) :415 print "OBJECTIF _1 : (-800,1700)"416 asser.goTo(Point(-800,1700))417 def test_goto4(self, asser, action):418 print "OBJECTIF _2 : (800,1700)"419 asser.goTo(Point(800,1700))420 421 def testTourdeTable(self, asser,action):422 #position initiale du robot423 asser.setPosition(Point(0,400))424 while True:425 try:426 asser.goToSegment(Point(710,680))427 asser.goToSegment(Point(710,1290))428 asser.goToSegment(Point(-710,1290))429 asser.goToSegment(Point(-710,680))430 except:431 print "ca chie"432 433 def testGoTo(self):434 asser.setPosition(Point(0,400))435 asser.setOrientation(1.57)436 437 asser.goTo(Point(1002,703))438 asser.goTo(Point(0,400))439 440####################################################################################################################441#################################### Scripts de décision (marquent des points) ##########################442####################################################################################################################443 #----------------------#444 # TOTEMS #445 #----------------------#446 447 def degager(self,asser,action):448 asser.gestionAvancer(600)449 asser.gestionTourner(2)450 asser.gestionAvancer(250)451 452 def totem00(self,asser,action):453 454 asser.gestionTourner(3.1)455 asser.gestionAvancer(1020)456 asser.gestionTourner(2.0)457 asser.gestionAvancer(415)458 #asser.goTo(Point(0.,663.))459 460 #début notre totem sud461 asser.gestionTourner(0)462 action.deplacer(130)463 time.sleep(0.5)464 asser.gestionAvancer(200,instruction = "finir")465 asser.gestionTourner(0,instruction = "finir")466 action.deplacer(120)467 time.sleep(0.3)468 action.deplacer(130)469 time.sleep(0.3)470 asser.gestionTourner(0,instruction = "finir")471 asser.gestionAvancer(200,instruction = "finir")472 action.deplacer(100)473 time.sleep(0.3)474 action.deplacer(120)475 time.sleep(0.3)476 asser.gestionTourner(0,instruction = "finir")477 asser.gestionAvancer(200,instruction = "finir")478 479 #mettre dans la cale480 asser.gestionAvancer(100,instruction = "auStopNeRienFaire")481 asser.gestionTourner(math.pi/4,instruction = "auStopNeRienFaire")482 asser.gestionAvancer(320,instruction = "auStopNeRienFaire")483 asser.gestionTourner(0,instruction = "auStopNeRienFaire")484 asser.gestionAvancer(280,instruction = "auStopNeRienFaire")485 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")486 action.deplacer(130)487 time.sleep(0.3)488 action.deplacer(110)489 time.sleep(0.3)490 action.deplacer(130)491 time.sleep(0.3)492 action.deplacer(110)493 time.sleep(0.3)494 495 action.deplacer(130)496 asser.changerVitesse("translation", 3)497 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")498 asser.changerVitesse("translation", 2)499 asser.gestionAvancer(-220,instruction = "auStopNeRienFaire")500 action.deplacer(0)501 502 def totem00_v2(self,asser,action):503 504 asser.goTo(Point(0, 660.))505 #asser.goTo(Point(0.,660.))506 507 #début notre totem sud508 asser.gestionTourner(0)509 action.deplacer(130)510 time.sleep(0.5)511 asser.gestionAvancer(200,instruction = "finir")512 asser.gestionTourner(0,instruction = "finir")513 action.deplacer(120)514 time.sleep(0.3)515 action.deplacer(130)516 time.sleep(0.3)517 asser.gestionTourner(0,instruction = "finir")518 asser.gestionAvancer(200,instruction = "finir")519 action.deplacer(100)520 time.sleep(0.3)521 action.deplacer(120)522 time.sleep(0.3)523 asser.gestionTourner(0,instruction = "finir")524 asser.gestionAvancer(200,instruction = "finir")525 526 #mettre dans la cale527 asser.gestionAvancer(100,instruction = "auStopNeRienFaire")528 asser.gestionTourner(math.pi/4,instruction = "auStopNeRienFaire")529 asser.gestionAvancer(320,instruction = "auStopNeRienFaire")530 asser.gestionTourner(0,instruction = "auStopNeRienFaire")531 asser.gestionAvancer(280,instruction = "auStopNeRienFaire")532 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")533 action.deplacer(130)534 time.sleep(0.3)535 action.deplacer(110)536 time.sleep(0.3)537 action.deplacer(130)538 time.sleep(0.3)539 action.deplacer(110)540 time.sleep(0.3)541 542 action.deplacer(130)543 asser.changerVitesse("translation", 3)544 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")545 asser.changerVitesse("translation", 2)546 asser.gestionAvancer(-220,instruction = "auStopNeRienFaire")547 action.deplacer(0)548 549 def totem00_v3(self,asser,action):550 551 asser.gestionTourner(3.1)552 asser.gestionAvancer(1020)553 asser.gestionTourner(2.0)554 asser.gestionAvancer(415)555 #asser.goTo(Point(0.,660.))556 557 #début notre totem sud558 asser.gestionTourner(0)559 action.deplacer(130)560 time.sleep(0.5)561 asser.gestionAvancer(200,instruction = "finir")562 asser.gestionTourner(0,instruction = "finir")563 action.deplacer(120)564 time.sleep(0.3)565 action.deplacer(130)566 time.sleep(0.3)567 asser.gestionTourner(0,instruction = "finir")568 asser.gestionAvancer(200,instruction = "finir")569 action.deplacer(100)570 time.sleep(0.3)571 action.deplacer(120)572 time.sleep(0.3)573 asser.gestionTourner(0,instruction = "finir")574 asser.gestionAvancer(200,instruction = "finir")575 576 #mettre dans la cale577 asser.gestionAvancer(100,instruction = "auStopNeRienFaire")578 asser.gestionTourner(math.pi/4,instruction = "auStopNeRienFaire")579 asser.gestionAvancer(320,instruction = "auStopNeRienFaire")580 asser.gestionTourner(0,instruction = "auStopNeRienFaire")581 asser.gestionAvancer(280,instruction = "auStopNeRienFaire")582 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")583 action.deplacer(130)584 time.sleep(0.3)585 action.deplacer(110)586 time.sleep(0.3)587 action.deplacer(130)588 time.sleep(0.3)589 action.deplacer(110)590 time.sleep(0.3)591 592 action.deplacer(130)593 asser.changerVitesse("translation", 3)594 asser.gestionAvancer(-50,instruction = "auStopNeRienFaire")595 asser.changerVitesse("translation", 2)596 asser.gestionAvancer(-220,instruction = "auStopNeRienFaire")597 action.deplacer(0)598 599 def poussoir1(self,asser,action):600 asser.gestionTourner(math.pi/2,instruction = "finir")601 asser.gestionAvancer(400,instruction = "auStopNeRienFaire")602 asser.gestionTourner(math.pi/2)603 action.deplacer(120, "bd")604 asser.attendre(0.3)605 asser.gestionAvancer(200,instruction = "auStopNeRienFaire")606 asser.gestionTourner(-math.pi)607 asser.gestionTourner(-math.pi/2)608 #asser.changerVitesse("translation", 3)609 asser.gestionAvancer(-1000, "auStopNeRienFaire")610 #asser.changerVitesse("translation", 2)611 asser.gestionAvancer(200,instruction = "auStopNeRienFaire")612 asser.gestionTourner(-math.pi/2)613 action.deplacer(0)614 asser.gestionAvancer(260)615 log.logger.debug("Enfonçage du poussoir à nous fini")616 617 def poussoir2(self,asser,action):618 log.logger.debug("Début d'enfonçage du poussoir 2")619 asser.gestionTourner(math.pi,instruction = "finir")620 action.deplacer(130,["bd","bg"])621 asser.gestionAvancer(1248,instruction = "auStopNeRienFaire")622 action.deplacer(50, ["bg", "bd"])623 asser.gestionTourner(-math.pi/2)624 asser.gestionAvancer(-200.0)625 #asser.changerVitesse("translation", 3)626 asser.gestionAvancer(-10000, "auStopNeRienFaire")627 #asser.changerVitesse("translation", 2)628 asser.gestionTourner(-math.pi/2)629 asser.gestionAvancer(300)630 log.logger.debug("Enfonçage du poussoir éloigné fini")631 632 def totem01(self, asser, action) :633 action.deplacer(50)634 asser.goTo(Point(0, 1500))635 asser.gestionTourner(1.712)636 asser.gestionAvancer(226.0)637 ##début notre totem nord638 asser.gestionTourner(0)639 action.deplacer(130)640 asser.attendre(0.5)641 asser.gestionAvancer(250,instruction = "auStopNeRienFaire")642 action.deplacer(120)643 asser.attendre(0.5)644 asser.gestionTourner(0,instruction = "auStopNeRienFaire")645 asser.gestionAvancer(200,instruction = "auStopNeRienFaire")646 action.deplacer(110)647 asser.attendre(0.5)648 action.deplacer(150)649 asser.attendre(0.5)650 asser.gestionTourner(0,instruction = "auStopNeRienFaire")651 asser.gestionAvancer(350,instruction = "auStopNeRienFaire")652 653 ## Rotation : vers le bas :654 action.deplacer(130)655 asser.attendre(0.5)656 asser.gestionTourner(-math.pi/3, instruction="auStopNeRienFaire")657 asser.gestionAvancer(340, instruction="auStopNeRienFaire")658 asser.gestionTourner(0, instruction="auStopNeRienFaire")659 asser.gestionAvancer(250)660 action.deplacer(160)661 asser.gestionAvancer(-50)662 action.deplacer(130)663 asser.gestionAvancer(-50)664 action.deplacer(150)665 asser.gestionAvancer(-50)666 action.deplacer(110)667 asser.gestionAvancer(-150)668 #_________________________________________________________________________________________________669 #_________________________________________________________________________________________________670 671 # Rafflage de notre totem côté sud (y petits)672 def rafflerTotem00(self,asser,action) :673 log.logger.debug("Rafflage de totem 0 0")674 action.deplacer(0)675 asser.goTo(Point(-90,655))676 677 #début notre totem sud678 asser.gestionTourner(0)679 action.deplacer(140)680 asser.attendre(0.1)681 682 asser.gestionAvancer(50)683 action.deplacer(90, "bg")684 asser.attendre(0.2)685 action.deplacer(130, "bg")686 #asser.attendre(0.1)687 688 #asser.gestionAvancer(200,instruction = "finir")689 #action.deplacer(130)690 ##asser.attendre(0.2)691 #asser.gestionTourner(0,instruction = "finir")692 #asser.gestionAvancer(200,instruction = "finir")693 #action.deplacer(110)694 #asser.attendre(0.1)695 #action.deplacer(130)696 #asser.attendre(0.1)697 #asser.gestionTourner(0,instruction = "finir")698 #asser.gestionAvancer(200,instruction = "finir")699 ##mettre dans la cale700 701 asser.gestionAvancer(400, instruction="finir")702 asser.gestionTourner(0)703 asser.gestionAvancer(300)704 705 #asser.gestionAvancer(100,instruction = "finir")706 asser.gestionTourner(math.pi/4)707 asser.gestionAvancer(300)708 asser.gestionTourner(0)709 asser.gestionAvancer(300, "auStopNeRienFaire")710 asser.gestionAvancer(-50)711 action.deplacer(130)712 asser.attendre(0.1)713 action.deplacer(110)714 asser.attendre(0.1)715 action.deplacer(150)716 asser.changerVitesse("translation", 3)717 asser.gestionAvancer(-50)718 asser.changerVitesse("translation", 2)719 asser.gestionAvancer(-250)720 action.deplacer(0)721 #asser.gestionTourner(math.pi/2)722 #asser.goTo(Point(850.,1600.))723 724 # Rafflage de notre totem côté nord (y grands)725 def rafflerTotem01(self,asser,action) :726 log.logger.debug("Rafflage de totem 0 1 en cours")727 action.deplacer(0)728 asser.goTo(Point(-80,1380))729 ##début notre totem nord730 action.deplacer(90, ["bd", "hd"])731 asser.attendre(0.1)732 action.deplacer(0, ["bd", "hd"])733 asser.attendre(0.1)734 asser.gestionTourner(0)735 #action.deplacer(120)736 ##début notre totem nord737 #action.deplacer(90, ["bd", "hd"])738 #asser.attendre(0.1)739 #asser.gestionTourner(0)740 action.deplacer(130)741 asser.attendre(0.2)742 743 asser.gestionAvancer(50)744 asser.gestionTourner(0,instruction = "finir")745 action.deplacer(70, "bd")746 asser.attendre(0.2)747 action.deplacer(120, "bd")748 asser.gestionAvancer(230,"finir")749 action.deplacer(110)750 #asser.attendre(0.1)751 asser.gestionTourner(0,instruction = "finir")752 asser.gestionAvancer(200,instruction = "finir")753 #action.deplacer(120)754 #asser.attendre(0.1)755 #action.deplacer(110)756 #asser.attendre(0.1)757 asser.gestionTourner(0,instruction = "finir")758 asser.gestionAvancer(300,instruction = "finir")759 760 ## Rotation : vers le bas :761 action.deplacer(110)762 #asser.attendre(0.2)763 asser.gestionTourner(-math.pi/2)764 asser.gestionAvancer(350)765 asser.gestionTourner(0)766 asser.gestionAvancer(400, "auStopNeRienFaire")767 action.deplacer(160)768 asser.gestionAvancer(-50)769 action.deplacer(130)770 asser.gestionAvancer(-50)771 action.deplacer(150)772 asser.gestionAvancer(-50)773 action.deplacer(110)774 asser.gestionAvancer(-150)775 action.deplacer(0)776 777 # Rafflage du totem ennemi côté sud (y petits)778 def rafflerTotem10(self,asser,action) :779 log.logger.debug("Rafflage de totem 1 0 en cours")780 action.deplacer(0)781 asser.goTo(Point(-920+ 70, 440+180))782 asser.gestionTourner(0)783 action.deplacer(150)784 asser.attendre(0.2)785 asser.gestionAvancer(100, "finir")786 action.deplacer(30, "bg")787 asser.attendre(0.2)788 action.deplacer(150, "bg")789 asser.attendre(0.2)790 asser.gestionAvancer(100, "finir")791 action.deplacer(130)792 asser.gestionAvancer(100, "finir")793 asser.gestionTourner(0)794 action.deplacer(110)795 asser.attendre(0.1)796 action.deplacer(120)797 asser.attendre(0.1)798 asser.gestionTourner(0)799 asser.gestionAvancer(200, "finir")800 asser.gestionTourner(0)801 action.deplacer(90)802 asser.attendre(0.3)803 804 #asser.gestionAvancer(200)805 #action.deplacer(40, "bg")806 807 #action.deplacer(0, ["hd", "hg"])808 #asser.gestionTourner(-1)809 #asser.gestionAvancer(300)810 #asser.gestionTourner(0)811 #asser.gestionAvancer(600)812 #asser.gestionTourner(1)813 #asser.gestionAvancer(500)814 #asser.gestionTourner(0)815 #asser.gestionAvancer(300, "auStopNeRienFaire")816 #asser.gestionAvancer(-300)817 818 asser.gestionAvancer(500, "finir")819 asser.gestionTourner(0)820 asser.gestionAvancer(400)821 822 # Rafflage du totem ennemi, côté Nord.823 def rafflerTotem11(self,asser,action) :824 action.deplacer(0)825 log.logger.debug("Rafflage de totem 1 1 en cours")826 asser.goTo(Point(-920+70, 1390))827 828 asser.gestionTourner(0)829 action.deplacer(130)830 asser.attendre(0.2)831 832 asser.gestionAvancer(20)833 action.deplacer(70, "bd")834 asser.attendre(0.2)835 action.deplacer(130, "bd")836 asser.gestionAvancer(230,"finir")837 action.deplacer(120)838 asser.attendre(0.2)839 asser.gestionTourner(0,instruction = "finir")840 asser.gestionAvancer(200,instruction = "finir")841 action.deplacer(110)842 asser.attendre(0.2)843 action.deplacer(150)844 asser.attendre(0.2)845 asser.gestionTourner(0,instruction = "finir")846 asser.gestionAvancer(350,instruction = "finir")847 848 asser.gestionTourner(-math.pi/4)849 asser.gestionAvancer(300)850 asser.gestionTourner(0)851 asser.gestionAvancer(300, "auStopNeRienFaire")852 asser.gestionAvancer(-50)853 action.deplacer(130)854 asser.attendre(0.1)855 action.deplacer(110)856 asser.attendre(0.1)857 action.deplacer(150)858 asser.changerVitesse("translation", 3)859 asser.gestionAvancer(-50)860 asser.changerVitesse("translation", 2)861 asser.gestionAvancer(-250)862 action.deplacer(0)863 asser.gestionTourner(math.pi/2)864 865 866 #----------------------#867 # BOUTONS POUSSOIR #868 #----------------------#869 870 # Poussoir côté chez nous.871 def enfoncerPoussoir0(self,asser,action) :872 action.deplacer(0)873 log.logger.debug("Enfonçage du poussoir côté nous en cours")874 asser.goTo(Point(860,1490))875 asser.gestionTourner(math.pi/2)876 action.deplacer(120, "bd")877 #asser.attendre(0.2)878 asser.gestionAvancer(20)879 asser.gestionTourner(math.pi)880 asser.gestionTourner(-math.pi/2)881 882 asser.gestionAvancer(-3000, "auStopNeRienFaire")883 asser.gestionTourner(-math.pi/2)884 asser.gestionAvancer(200)885 asser.gestionAvancer(200,"finir")886 asser.gestionTourner(-math.pi/2)887 #asser.gestionAvancer(-100)888 action.deplacer(0)889 log.logger.debug("Enfonçage du poussoir à nous fini")890 891 # Poussoir côté ennemi.892 def enfoncerPoussoir1(self,asser,action) :893 action.deplacer(0)894 log.logger.debug("Enfonçage du poussoir côté ennemi en cours")895 asser.goTo(Point(-390, 1510.)) 896 asser.gestionTourner(math.pi/2)897 action.deplacer(150, "bd")898 asser.attendre(0.2)899 #asser.gestionAvancer(220)900 asser.gestionTourner(-math.pi)901 asser.gestionTourner(-math.pi/2)902 903 action.deplacer(20, "bd")904 905 asser.gestionAvancer(-3000, "auStopNeRienFaire")906 asser.gestionAvancer(200)907 asser.gestionAvancer(200)908 asser.gestionTourner(-math.pi/2)909 asser.gestionAvancer(-100)910 action.deplacer(0)911 log.logger.debug("Enfonçage du poussoir ennemi fini")912 913 914 #----------------------#915 # ANNEXES #916 #----------------------#917 def faireChierEnnemi(self,asser,action) :918 """919 On fait un tour de table bras fermés920 """921 log.logger.debug("C'est parti, on farme l'ennemi !")922 action.deplacer(0)923 asser.goTo(Point(-1500+960-70, 2000-260+160))924 asser.gestionTourner(-math.pi)925 action.deplacer(150, "bd")926 asser.attendre(0.5)927 asser.gestionAvancer(220)928 asser.gestionTourner(-math.pi/2)929 asser.gestionTourner(0)930 action.deplacer(0)931 asser.gestionAvancer(-3000, "auStopNeRienFaire")932 asser.gestionAvancer(130)933 asser.gestionTourner(-math.pi/2-0.02)934 asser.attendre(.5)935 asser.gestionAvancer(500)936 937 """938 asser.gestionTourner(-3*math.pi/4)939 asser.gestionAvancer(250)940 action.deplacer(150, "bg")941 asser.attendre(0.5)942 asser.gestionTourner(-math.pi/4)943 asser.gestionAvancer(350)944 """945 946 asser.gestionAvancer(150)947 asser.gestionTourner(-math.pi)948 asser.gestionAvancer(250)949 action.deplacer(160)950 asser.attendre(0.2)951 asser.changerVitesse("rotation", 3)952 asser.gestionTourner(-math.pi/2)953 asser.gestionTourner(math.pi)954 asser.gestionTourner(math.pi/2)955 asser.gestionTourner(math.pi)956 asser.changerVitesse("rotation", 2)957 asser.gestionAvancer(-300)958 action.deplacer(0)959 960 def debutRapide(self, asser, action) :961 asser.gestionTourner(2.9)962 asser.gestionAvancer(1000, "auStopNeRienFaire")963 asser.changerVitesse("translation", 2)964 965 def viderCaleEnnemi(self, asser, action) :966 log.logger.debug("Farmage d'ennemi")967 asser.goTo(Point(-690, 600))968 asser.gestionTourner(2.15)969 asser.gestionAvancer(239.0)970 action.deplacer(160, ["bg", "bd"])971 asser.attendre(.2)972 asser.gestionTourner(math.pi)973 asser.gestionAvancer(280.0)974 asser.changerVitesse("rotation", 3)975 asser.gestionTourner(-math.pi/2)976 asser.changerVitesse("rotation", 2)977 asser.gestionTourner(math.pi)978 asser.changerVitesse("rotation", 3)979 asser.gestionTourner(math.pi/2)980 asser.changerVitesse("rotation", 2)981 asser.gestionTourner(0)982 action.deplacer(20, ["bg", "bd"])983 asser.gestionAvancer(-270)984 asser.goTo(Point(779, 974))985 asser.gestionTourner(0)986 action.deplacer(160, ["bd", "bg"])987 asser.attendre(0.2)988 asser.gestionAvancer(270, "auStopNeRienFaire")989 asser.gestionAvancer(-270)990 action.deplacer(0)991 992 def viderCaleEnnemi2(self, asser, action) :993 log.logger.debug("On vide la cale de l'autre !")994 action.deplacer(0)995 asser.goTo(Point(-950, 1436))996 asser.gestionTourner(-math.pi/2-0.1)997 998 action.deplacer(180, "bd")999 asser.attendre(0.1)1000 asser.gestionAvancer(200, "auStopNeRienFaire")1001 action.deplacer(70, "bd")1002 asser.attendre(0.2)1003 action.deplacer(180, "bd")1004 asser.attendre(0.2)1005 asser.gestionAvancer(200)1006 action.deplacer(70, "bd")1007 asser.attendre(0.2)1008 action.deplacer(180, "bd")1009 asser.attendre(0.2)1010 asser.gestionAvancer(200)1011 action.gestionTourner(20)1012 asser.gestionTourner(0)1013 1014 asser.goTo(Point(779, 974))1015 asser.gestionTourner(0)1016 action.deplacer(160, ["bd", "bg"])1017 asser.attendre(0.2)1018 asser.gestionAvancer(270, "auStopNeRienFaire")1019 asser.gestionAvancer(-270)1020 action.deplacer(0)1021 1022 1023 # Tour de table avec les bras fermés.1024 def tourDeTable0(self,asser,action) :1025 """1026 Tenter de passer à des pts clés pour ramasser des éventuels CDs perdus1027 ET faire chier n'ennemi1028 """1029 asser.goTo(Point(0,1490))1030 raw_input()1031 asser.goTo(Point(590,290))1032 asser.goTo(Point(-990,630))1033 asser.goTo(Point(0,1490))1034 # Tour de table avec les bras ouverts1035 def tourDeTable1(self,asser,action) :1036 """1037 Tenter de passer à des pts clés pour ramasser des éventuels CDs perdus1038 """1039 log.logger.debug("Tour de table")1040 action.deplacer(120) # On ouvre les bras1041 asser.goTo(Point(860, 650)) # On va se placer à un de départ près de notre base1042 asser.goTo(Point(395, 505))1043 asser.goTo(Point(10, 580))1044 asser.goTo(Point(-425, 480))1045 asser.goTo(Point(-900, 970))1046 asser.goTo(Point(410, 1480))1047 asser.goTo(Point(0, 1400))1048 asser.goTo(Point(405, 1480))1049 asser.goTo(Point(900, 1000))1050 asser.goTo(Point(890, 755))1051 action.deplacer(80) # On ferme les bras avant de gestionTourner1052 asser.gestionTourner(0.755)1053 action.deplacer(120) # On ouvre les bras pour déposer1054 asser.gestionAvancer(340) # On va dans la calle1055 asser.gestionAvancer(-450) # On fait marche arrière pour se dégager1056 action.deplacer(100)1057 1058 def defendreBase(self,asser,action):1059 """1060 Si l'ennemi est très bon, il faudra penser à défendre la base1061 """1062 action.deplacer(0)1063 log.logger.debug("Défense de la base")1064 asser.goTo(Point(960, 1260))1065 asser.gestionTourner(math.pi/2)1066 asser.gestionAvancer(1300)1067 asser.gestionAvancer(-1300)1068 log.logger.debug("Fin défense de la base")1069 1070 def bourrerCale(self, asser, action) :1071 #action.deplacer(0)1072 asser.goTo(Point(900, 1000))1073 asser.gestionTourner(0)1074 action.deplacer(0, "bd")1075 asser.gestionTourner(-math.pi/2)1076 asser.gestionTourner(-math.pi)1077 action.deplacer(150)1078 asser.attendre(0.2)1079 asser.gestionAvancer(200, "auStopNeRienFaire")1080 action.deplacer(30)1081 asser.attendre(0.2)1082 asser.gestionAvancer(-100)1083 asser.gestionTourner(0)1084 action.deplacer(150)1085 asser.attendre(0.2)1086 asser.gestionAvancer(300, "auStopNeRienFaire")1087 asser.gestionAvancer(-230)1088 action.deplacer(0)1089 asser.gestionTourner(math.pi/2)1090 1091 1092####################################################################################################################1093########################### P R É --- A C T I O N S ##########################1094####################################################################################################################1095 def preAction_1_2(self, asser, action) :1096 action.deplacer(0)1097 asser.goTo(Point(800, 700))1098 asser.gestionTourner(math.pi/2)1099 action.deplacer(110)1100 asser.attendre(0.2)1101 asser.gestionTourner(math.pi/2)1102 asser.deplacer(700)1103 1104 def preAction_2_3(self, asser, action) :1105 action.deplacer(0)1106 asser.goTo(Point(430, 1585))1107 action.deplacer(130)1108 asser.attendre(0.2)1109 asser.gestionTourner(path.pi)1110 asser.gestionAvancer(400)1111 1112 1113####################################################################################################################1114########################### SCRIPT GÉNÉRIQUES ##########################1115####################################################################################################################1116 # Lance un script en fonction d'un tableau d'actions1117 '''1118 Syntaxe des actions : 1119 ["avancer", mm, option]1120 ["tourner", rad, option]1121 ["actionneur", angle]1122 ["goTo", point]...

Full Screen

Full Screen

scenes.py

Source:scenes.py Github

copy

Full Screen

1"""2########################3Chaque morceau (ou "scene") est défini comme suit:4def haiduk(subscene, send, get):5 # ici le code du morceau6########################7subscene: valeur transmise en osc à l'adresse /subscene8########################9send(adresse, argument_1, argument_2, etc): fonction d'envoi des commandes à sooperlooper10Exemple :11 send('/sl/0/hit', 'record') # armer la boucle 012 send('/sl/-1/set', 'mute_on') # muter toutes les pisbouclestes13 send('/sl/[0,1]/set', 'record') # armer les boucles 0 et 114 send('server', '/stop')15 send('ardour', '/sl/-1/set', 'sync', 1)16Par défaut, send envoie à Sooperlooper, mais on peut préciser en 1er argument une destination différente:17 - 'server' (serveur python)18 - 'ardour' (3819)19 - un port osc arbitraire20Exemple : muter une piste dans ardour21 send('ardour', '/strip/mute', 1, 1) # muter la 1ere piste22 send('ardour', '/strip/mute', 1, 0) # demuter la 1ere piste23 send('ardour', '/master/mute', 1) # muter le master24 send('ardour', '/master/mute', 0) # demuter le master25########################26get(adresse, nom_parametre): fonction de récupération d'une valeur de sooperlooper27Exemple : muter la boucle 0 à la fin de la prochaine iteration28 # on récupère la position actuelle29 position = get('/sl/0/get', 'loop_pos')30 # on la compare à la position actuelle31 while get('/sl/0/get', 'loop_pos') >= position:32 pass # on recommence tant que la condition n'est pas vraie33 # on mute la boucle une fois la condition vraie34 send('/sl/0/hit', 'mute')35def attendre_debut(get, ):36 position = get('/sl/0/get', 'loop_pos')37 while get('/sl/0/get', 'loop_pos') >= position:38 pass39########################40Penser à déclarer les variables globales (boucle active, état de la scène, etc)41SCENE_STATE = 042ACTIVE_LOOP = 043def haiduk(subscene, send, get):44 global SCENE_STATE, ACTIVE_LOOP45 # etc46########################47"""48SCENE_STATE = 049ACTIVE_LOOP = 050def attendre_debut(get, boucle=0):51 print('ATTENTE')52 position = get('/sl/' + str(boucle) + '/get', 'loop_pos')53 next = position54 while next >= position:55 next = get('/sl/' + str(boucle) + '/get', 'loop_pos')56 pass57def reset(subscene, send, get):58 global SCENE_STATE, ACTIVE_LOOP59 SCENE_STATE = 060 ACTIVE_LOOP = 061 send('/sl/-1/hit', 'pause')62 send('/sl/-1/hit', 'undo_all')63 send('/sl/-1/hit', 'mute_off')64 send('/set', 'sync_source', 0)65 send('/sl/-1/set', 'sync', 0)66 send('/sl/-1/set', 'quantize', 0)67 send('/sl/-1/set', 'rec_thresh', 0)68 send('ardour', '/strip/mute', 1, 1) # muter la 1ere piste69 send('ardour', '/strip/mute', 2, 1)70 send('ardour', '/strip/mute', 3, 1)71 send('ardour', '/strip/mute', 4, 1)72 send('ardour', '/strip/mute', 5, 1)73 send('ardour', '/strip/mute', 6, 1)74 send('ardour', '/strip/mute', 7, 1)75 send('ardour', '/strip/mute', 8, 1)76 send('ardour', '/strip/mute', 9, 1)77 send('ardour', '/strip/mute', 10, 1)78 send('ardour', '/strip/mute', 11, 1)79 send('ardour', '/strip/mute', 12, 1)80 send('ardour', '/strip/mute', 13, 1)81def boutons_fixes(subscene, send, get):82 global SCENE_STATE, ACTIVE_LOOP83 if subscene == 2:84 pass85 elif subscene == 3:86 pass87def haiduk(subscene, send, get):88 global SCENE_STATE, ACTIVE_LOOP89 if subscene == 'INIT':90 reset(subscene, send, get)91 print('Scene haiduk started')92 return93 elif subscene == 1: # CC1 = NEXT94 SCENE_STATE += 195 print('Scene haiduk on subscene %s' % SCENE_STATE)96 # CONDUITE LINEAIRE97 if SCENE_STATE == 1:98 send('ardour', '/strip/mute', 1, 0)99 send('ardour', '/strip/mute', 7, 0)100 send('ardour', '/strip/mute', 9, 0)101 send('/sl/0/set', 'rec_thresh', '0.5')102 send('/sl/5/set', 'rec_thresh', '0.5')103 send('/sl/[0,5]/hit', 'record')104 ACTIVE_LOOP = 0105 elif SCENE_STATE == 2:106 send('/sl/[0,5]/hit', 'record')107 send('/set', 'sync_source', 1)108 send('/set', 'overdub_quantized', 1)109 send('/sl/-1/set', 'sync', 1)110 send('/sl/-1/set', 'playback_sync', 1)111 send('/sl/-1/set', 'quantize', 3)112 send('ardour', '/strip/mute', 1, 1)113 send('ardour', '/strip/mute', 7, 1)114 send('ardour', '/strip/mute', 9, 1)115 send('ardour', '/strip/mute', 8, 0)116 elif SCENE_STATE == 3:117 #rec basse A1118 send('/sl/1/hit', 'record')119 send('ardour', '/strip/mute', 2, 0)120 ACTIVE_LOOP = 1121 elif SCENE_STATE == 4:122 #fin rec basse A1, prépa rec basse A2123 send('/sl/1/hit', 'record')124 send('/sl/2/hit', 'record')125 attendre_debut(get, 0)126 send('/sl/1/hit', 'mute_on')127 ACTIVE_LOOP = 2128 elif SCENE_STATE == 5:129 send('/sl/2/hit', 'record')130 attendre_debut(get, 0)131 send('ardour', '/strip/mute', 2, 1)132 elif SCENE_STATE == 6:133 #rec melo A1, mute A2, demute A1134 send('/sl/3/hit', 'record')135 ACTIVE_LOOP = 3136 attendre_debut(get, 0)137 send('/sl/2/hit', 'mute_on')138 send('/sl/1/hit', 'mute_off')139 send('ardour', '/strip/mute', 3, 0)140 elif SCENE_STATE == 7:141 #fin rec melo A1, rec melo A2, mute A1, demute A2142 send('/sl/3/hit', 'record')143 ACTIVE_LOOP = 4144 attendre_debut(get, 0)145 send('/sl/4/hit', 'record')146 send('/sl/1/hit', 'mute_on')147 send('/sl/2/hit', 'mute_off')148 send('/sl/4/hit', 'mute_on')149 elif SCENE_STATE == 8:150 send('/sl/4/hit', 'record')151 send('ardour', '/strip/mute', 3, 1)152 elif SCENE_STATE == 9:153 #play A1, suppr voix154 #position = get('/sl/0/get', 'loop_pos')155 attendre_debut(get, 0)156 send('/sl/1/hit', 'mute_on')157 send('/sl/2/hit', 'mute_off')158 send('/sl/3/hit', 'mute_on')159 send('/sl/4/hit', 'mute_off')160 send('/sl/5/hit', 'undo')161#---------------------------------------162 elif SCENE_STATE == 10:163 #play A2164 position = get('/sl/0/get', 'loop_pos')165 attendre_debut(get, 0)166 send('/sl/1/hit', 'mute_off')167 send('/sl/2/hit', 'mute_on')168 send('/sl/3/hit', 'mute_off')169 send('/sl/4/hit', 'mute_on')170 elif SCENE_STATE == 11:171 #play A1172 position = get('/sl/0/get', 'loop_pos')173 attendre_debut(get, 0)174 send('/sl/1/hit', 'mute_on')175 send('/sl/2/hit', 'mute_off')176 send('/sl/3/hit', 'mute_on')177 send('/sl/4/hit', 'mute_off')178 elif SCENE_STATE == 12:179 #mute A1&A2, rec caval180 position = get('/sl/0/get', 'loop_pos')181 attendre_debut(get, 0)182 send('/sl/2/hit', 'mute_on')183 send('/sl/4/hit', 'mute_on')184 send('/sl/5/hit', 'record')185 ACTIVE_LOOP = 5186 elif SCENE_STATE == 13:187 send('/sl/5/hit', 'record')188 elif SCENE_STATE == 14:189 #rec basse B1190 send('/sl/6/hit', 'record')191 ACTIVE_LOOP = 6192 elif SCENE_STATE == 15:193 send('/sl/6/hit', 'record')194 elif SCENE_STATE == 16:195 #mute caval & B1, rec basse B2196 send('/sl/6/hit', 'record')197 send('/sl/7/hit', 'record')198 ACTIVE_LOOP = 7199 position = get('/sl/0/get', 'loop_pos')200 attendre_debut(get, 0)201 send('/sl/5/hit', 'mute_on')202 send('/sl/6/hit', 'mute_on')203 elif SCENE_STATE == 17:204 send('/sl/7/hit', 'record')205 elif SCENE_STATE == 18:206 #play B1 pendant que je prends le mélo207 position = get('/sl/0/get', 'loop_pos')208 attendre_debut(get, 0)209 send('/sl/5/hit', 'mute_off')210 send('/sl/6/hit', 'mute_off')211 send('/sl/7/hit', 'mute_on')212 elif SCENE_STATE == 19:213 #rec mélo B2214 send('/sl/9/hit', 'record')215 ACTIVE_LOOP = 9216 position = get('/sl/0/get', 'loop_pos')217 attendre_debut(get, 0)218 send('/sl/5/hit', 'mute_on')219 send('/sl/6/hit', 'mute_on')220 send('/sl/7/hit', 'mute_off')221 elif SCENE_STATE == 20:222 send('/sl/9/hit', 'record')223 elif SCENE_STATE == 21:224 #rec violon B1225 send('/sl/8/hit', 'record')226 ACTIVE_LOOP = 8227 position = get('/sl/0/get', 'loop_pos')228 attendre_debut(get, 0)229 send('/sl/5/hit', 'mute_off')230 send('/sl/6/hit', 'mute_off')231 send('/sl/7/hit', 'mute_on')232 send('/sl/9/hit', 'mute_on')233 elif SCENE_STATE == 22:234 send('/sl/8/hit', 'record')235 elif SCENE_STATE == 23:236 #play B2 sur chant237 position = get('/sl/0/get', 'loop_pos')238 attendre_debut(get, 0)239 send('/sl/5/hit', 'mute_on')240 send('/sl/6/hit', 'mute_on')241 send('/sl/7/hit', 'mute_off')242 send('/sl/8/hit', 'mute_on')243 send('/sl/9/hit', 'mute_off')244 elif SCENE_STATE == 24:245 #play B1246 position = get('/sl/0/get', 'loop_pos')247 attendre_debut(get, 0)248 send('/sl/5/hit', 'mute_off')249 send('/sl/6/hit', 'mute_off')250 send('/sl/7/hit', 'mute_on')251 send('/sl/8/hit', 'mute_off')252 send('/sl/9/hit', 'mute_on')253 elif SCENE_STATE == 25:254 #play B2 sur chant255 position = get('/sl/0/get', 'loop_pos')256 attendre_debut(get, 0)257 send('/sl/5/hit', 'mute_on')258 send('/sl/6/hit', 'mute_on')259 send('/sl/7/hit', 'mute_off')260 send('/sl/8/hit', 'mute_on')261 send('/sl/9/hit', 'mute_off')262 elif SCENE_STATE == 26:263 #play B1264 position = get('/sl/0/get', 'loop_pos')265 attendre_debut(get, 0)266 send('/sl/5/hit', 'mute_off')267 send('/sl/6/hit', 'mute_off')268 send('/sl/7/hit', 'mute_on')269 send('/sl/8/hit', 'mute_off')270 send('/sl/9/hit', 'mute_on')271 elif SCENE_STATE == 27:272 #mute all B, play A1 sans la basse sur un tour273 position = get('/sl/0/get', 'loop_pos')274 attendre_debut(get, 0)275 send('/sl/[5,6,7,8,9]/hit', 'mute_on')276 send('/sl/3/hit', 'mute_off')277 position = get('/sl/0/get', 'loop_pos')278 attendre_debut(get, 0)279 send('/sl/1/hit', 'mute_off')280 elif SCENE_STATE == 28:281 #mute A1, play A2282 position = get('/sl/0/get', 'loop_pos')283 attendre_debut(get, 0)284 send('/sl/1/hit', 'mute_off')285 send('/sl/2/hit', 'mute_on')286 send('/sl/3/hit', 'mute_off')287 send('/sl/4/hit', 'mute_on')288 elif SCENE_STATE == 29:289 #play A1290 position = get('/sl/0/get', 'loop_pos')291 attendre_debut(get, 0)292 send('/sl/1/hit', 'mute_on')293 send('/sl/2/hit', 'mute_off')294 send('/sl/3/hit', 'mute_on')295 send('/sl/4/hit', 'mute_off')296 elif SCENE_STATE == 30:297 #dernier tour298 position = get('/sl/0/get', 'loop_pos')299 attendre_debut(get, 0)300 send('/sl/[0,2,4]/hit', 'mute_on')301 else:302 boutons_fixes(subscene, send, get)303def capra(subscene, send, get):304 global SCENE_STATE, ACTIVE_LOOP305 if subscene == 'INIT':306 # INIT307 reset(subscene, send, get)308 print('Scene capra started')309 return310 elif subscene == 1: # CC1 = NEXT311 SCENE_STATE += 1312 print('Scene capra on subscene %s' % SCENE_STATE)313 # CONDUITE LINEAIRE314 if SCENE_STATE == 1:315 #rec kick et méloA316 send('ardour', '/strip/mute', 12, 0)317 send('ardour', '/strip/mute', 1, 0)318 send('ardour', '/strip/mute', 3, 0)319 send('/sl/[0,1]/set', 'rec_thresh', 0.02)320 send('/sl/[0,1]/hit', 'record')321 ACTIVE_LOOP = 0322 elif SCENE_STATE == 2:323 #fin rec méloA, rec méloB324 #fin record kick meloA, synchro kick, rec meloB325 send('/sl/[0,1]/hit', 'record')326 send('ardour', '/strip/mute', 1, 1)327 send('/set', 'sync_source', 1)328 send('/set', 'overdub_quantized', 1)329 send('/sl/-1/set', 'sync', 1)330 send('/sl/-1/set', 'playback_sync', 1)331 send('/sl/-1/set', 'quantize', 3)332 import time333 time.sleep(4)334 send('/sl/2/hit', 'record')335 attendre_debut(get, 0)336 send('/sl/1/hit', 'mute_on')337 import time338 time.sleep(4)339 send('/sl/2/hit', 'record')340 attendre_debut(get, 0)341 send('ardour', '/strip/mute', 3, 1)342 send('ardour', '/strip/mute', 12, 1)343 send('ardour', '/strip/mute', 8, 0)344 send('/sl/[1,2]/hit', 'mute')345 elif SCENE_STATE == 3:346 #mute mélo B, play mélo A, chant347 send('ardour', '/strip/mute', 3, 0) #!!!! à effacer348 send('ardour', '/strip/mute', 7, 0)349 attendre_debut(get, 0)350 import time351 time.sleep(4)352 attendre_debut(get, 0)353 send('/sl/1/hit', 'mute_on')354 send('/sl/2/hit', 'mute_off')355 elif SCENE_STATE == 4:356 #rec caval357 send('/sl/6/hit', 'record')358 send('ardour', '/strip/mute', 5, 0)359 attendre_debut(get, 0)360 send('/sl/[1,2]/hit', 'mute')361 import time362 time.sleep(4)363 send('/sl/6/hit', 'record')364 attendre_debut(get, 0)365 send('ardour', '/strip/mute', 5, 1)366 elif SCENE_STATE == 5:367 #rec bassA&B, play A&B et caval368 send('/sl/3/hit', 'record')369 send('ardour', '/strip/mute', 2, 0)370 send('ardour', '/strip/mute', 8, 1)371 send('ardour', '/strip/mute', 13, 0)372 attendre_debut(get, 0)373 send('/sl/6/hit', 'mute_on')374 import time375 time.sleep(4)376 send('/sl/[3,4]/hit', 'record')377 attendre_debut(get, 0)378 send('/sl/[1,2,3]/hit', 'mute')379 import time380 time.sleep(4)381 send('/sl/4/hit', 'record')382 attendre_debut(get, 0)383 send('/sl/[1,2,3,4]/hit', 'mute')384 send('ardour', '/strip/mute', 2, 1)385 send('ardour', '/strip/mute', 8, 0)386 send('ardour', '/strip/mute', 13, 1)387 import time388 time.sleep(4)389 attendre_debut(get, 0)390 send('/sl/[1,2,3,4]/hit', 'mute')391 import time392 time.sleep(4)393 attendre_debut(get, 0)394 send('/sl/[1,2,3,4]/hit', 'mute')395 send('/sl/6/hit', 'mute')396 elif SCENE_STATE == 6:397 #play violon AA BB AA, bascule sur A vocal398 send('ardour', '/strip/mute', 4, 0)399 send('/sl/6/hit', 'mute')400 attendre_debut(get, 0)401 #1er A402 import time403 time.sleep(4)404 attendre_debut(get, 0)405 #2e A406 import time407 time.sleep(4)408 attendre_debut(get, 0)409 #1er B410 send('/sl/[1,2,3,4]/hit', 'mute')411 import time412 time.sleep(4)413 attendre_debut(get, 0)414 #2e B415 import time416 time.sleep(4)417 attendre_debut(get, 0)418 #1er A419 send('/sl/[1,2,3,4]/hit', 'mute')420 import time421 time.sleep(4)422 attendre_debut(get, 0)423 #2e A424 import time425 time.sleep(4)426 attendre_debut(get, 0)427 #A vocal428 send('ardour', '/strip/mute', 4, 1)429 elif SCENE_STATE == 7:430 #break caval mélo vers couplet AB AB puis solo clar méloA seul431 attendre_debut(get, 0)432 send('/sl/[0,2,3,4]/hit', 'mute_on')433 send('/sl/[1,6]/hit', 'mute_off')434 import time435 time.sleep(4)436 attendre_debut(get, 0)437 #A438 send('/sl/6/hit', 'mute_on')439 send('/sl/[0,1,3]/hit', 'mute_off')440 import time441 time.sleep(4)442 attendre_debut(get, 0)443 #B444 send('/sl/[1,2,3,4]/hit', 'mute')445 import time446 time.sleep(4)447 attendre_debut(get, 0)448 #A449 send('/sl/[1,2,3,4]/hit', 'mute')450 import time451 time.sleep(4)452 attendre_debut(get, 0)453 #B454 send('/sl/[1,2,3,4]/hit', 'mute')455 import time456 time.sleep(4)457 attendre_debut(get, 0)458 #solo méloA seul459 send('ardour', '/strip/mute', 6, 0)460 send('/sl/-1/hit', 'mute_on')461 send('/sl/1/hit', 'mute_off')462 elif SCENE_STATE == 8:463 #solo arrivée kick et basse464 attendre_debut(get, 0)465 send('/sl/[0,3]/hit', 'mute_off')466 elif SCENE_STATE == 9:467 #fin solo, pont caval468 attendre_debut(get, 0)469 send('ardour', '/strip/mute', 6, 1)470 send('/sl/[0,3,6]/hit', 'mute')471 elif SCENE_STATE == 10:472 #violon AA BB AA473 send('ardour', '/strip/mute', 4, 0)474 attendre_debut(get, 0)475 #A mélo seul476 import time477 time.sleep(4)478 attendre_debut(get, 0)479 #A tutti480 send('/sl/[0,3]/hit', 'mute')481 import time482 time.sleep(4)483 attendre_debut(get, 0)484 #B 1485 send('/sl/[1,2,3,4]/hit', 'mute')486 import time487 time.sleep(4)488 attendre_debut(get, 0)489 #B 2490 import time491 time.sleep(4)492 attendre_debut(get, 0)493 # A 1494 send('/sl/[1,2,3,4]/hit', 'mute')495 import time496 time.sleep(4)497 attendre_debut(get, 0)498 # A 2499 import time500 time.sleep(4)501 attendre_debut(get, 0)502 send('/sl/-1/hit', 'mute_on')503 else:504 boutons_fixes(subscene, send, get)505def kamav(subscene, send, get):506 global SCENE_STATE, ACTIVE_LOOP507 if subscene == 'INIT':508 # INIT509 reset(subscene, send, get)510 print('Scene kamav started')511 return512 elif subscene == 1: # CC1 = NEXT513 SCENE_STATE += 1514 print('Scene kamav on subscene %s' % SCENE_STATE)515 # CONDUITE LINEAIRE516 if SCENE_STATE == 1:517 #rec percus518 send('ardour', '/strip/mute', 4, 0)519 send('ardour', '/strip/mute', 8, 0)520 send('ardour', '/strip/mute', 1, 0)521 send('/sl/0/set', 'rec_thresh', 0.05)522 send('/sl/0/hit', 'record')523 ACTIVE_LOOP = 0524 elif SCENE_STATE == 2:525 send('/sl/0/hit', 'record')526 send('/set', 'sync_source', 1)527 send('/set', 'overdub_quantized', 1)528 send('/sl/-1/set', 'sync', 1)529 send('/sl/-1/set', 'playback_sync', 1)530 send('/sl/-1/set', 'quantize', 3)531 send('ardour', '/strip/mute', 1, 1)532 ACTIVE_LOOP = 1533 elif SCENE_STATE == 3:534 #rec violon intro, ABB & C, play C ad lib535 send('/sl/1/hit', 'record')536 attendre_debut(get, 0)537 import time538 time.sleep(4)539 send('/sl/1/hit', 'record')540 send('/sl/2/hit', 'record')541 attendre_debut(get, 0)542 send('/sl/1/hit', 'mute_on')543 import time544 time.sleep(4)545 attendre_debut(get, 0)546 import time547 time.sleep(4)548 send('/sl/3/hit', 'record')549 attendre_debut(get, 0)550 import time551 time.sleep(4)552 send('/sl/2/hit', 'record')553 send('/sl/3/hit', 'record')554 attendre_debut(get, 0)555 send('/sl/2/hit', 'pause')556 send('/sl/3/hit', 'pause')557 send('/sl/1/hit', 'mute_off')558 send('/sl/0/hit', 'mute_on')559 send('ardour', '/strip/mute', 7, 0)560 send('ardour', '/strip/mute', 3, 0) # à supprimer !!!!!!!!!!!561 elif SCENE_STATE == 4:562 #play violonABB et percus + violonC x 2563 send('/sl/2/hit', 'trigger')564 attendre_debut(get, 0)565 send('/sl/1/hit', 'mute_on')566 send('/sl/0/hit', 'mute_off')567 import time568 time.sleep(12)569 send('/sl/3/hit', 'trigger')570 attendre_debut(get, 2)571 send('/sl/2/hit', 'pause')572 elif SCENE_STATE == 5:573 #rec voxA sur A, B et C574 send('/sl/4/hit', 'record')575 ACTIVE_LOOP = 4576 attendre_debut(get, 0)577 send('ardour', '/strip/mute', 4, 1)578 send('/sl/2/hit', 'trigger')579 send('/sl/3/hit', 'mute_on')580 import time581 time.sleep(12)582 send('/sl/4/hit', 'record')583 send('/sl/6/hit', 'record')584 attendre_debut(get, 2)585 send('/sl/2/hit', 'pause')586 send('/sl/3/hit', 'mute_off')587 send('/sl/4/hit', 'pause')588 import time589 time.sleep(3)590 attendre_debut(get, 0)591 import time592 time.sleep(3)593 send('/sl/6/hit', 'record')594 elif SCENE_STATE == 6:595 #enchaîne sur ABB596 attendre_debut(get, 0)597 send('/sl/[2,4]/hit', 'trigger')598 send('/sl/[3,6]/hit', 'pause')599 import time600 time.sleep(12)601 attendre_debut(get, 2)602 send('/sl/[2,4]/hit', 'pause')603 send('/sl/[3,6]/hit', 'trigger')604 elif SCENE_STATE == 7:605 #odub voxC606 send('/set', 'overdub_quantized', 1)607 send('/sl/6/hit', 'overdub')608 attendre_debut(get, 0)609 elif SCENE_STATE == 8:610 #fin odub voxC611 send('/sl/6/hit', 'overdub')612 elif SCENE_STATE == 9:613 #mute tout sauf voxC614 attendre_debut(get, 6)615 send('/sl/[0,1,3]/hit', 'mute_on')616 elif SCENE_STATE == 10:617 #dernier tour618 position = get('/sl/6/get', 'loop_pos')619 attendre_debut(get, 6)620 send('/sl/[0,3,6]/hit', 'pause')621 elif SCENE_STATE == 11:622 #encore623 send('/sl/[0,3,6]/hit', 'trigger')624 elif SCENE_STATE == 12:625 attendre_debut(get, 6)626 send('/sl/[0,3]/hit', 'pause')627 attendre_debut(get, 6)628 send('/sl/6/hit', 'pause')629 else:630 boutons_fixes(subscene, send, get)631def laika(subscene, send, get):632 global SCENE_STATE, ACTIVE_LOOP633 if subscene == 'INIT':634 reset(subscene, send, get)635 print('Scene laika started')636 return637 elif subscene == 1: # CC1 = NEXT638 SCENE_STATE += 1639 print('Scene laika on subscene %s' % SCENE_STATE)640 # CONDUITE LINEAIRE641 if SCENE_STATE == 1:642 #rec mélo bourdon643 send('ardour', '/strip/mute', 3, 0)644 send('ardour', '/strip/mute', 8, 0)645 send('/sl/0/set', 'rec_thresh', 0)646 send('/sl/0/hit', 'record')647 elif SCENE_STATE == 2:648 send('/sl/0/hit', 'record')649 send('/sl/0/hit', 'overdub')650 elif SCENE_STATE == 3:651 send('/sl/0/hit', 'overdub')652 send('ardour', '/strip/mute', 3, 1)653 send('ardour', '/strip/mute', 6, 0)654 elif SCENE_STATE == 4:655 #rec kick et clar656 send('ardour', '/strip/mute', 8, 1)657 send('ardour', '/strip/mute', 11, 0)658 send('/sl/1/set', 'rec_thresh', 0.1)659 send('/sl/1/hit', 'record')660 send('/sl/6/set', 'rec_thresh', 0.02)661 send('/sl/6/hit', 'record')662 send('ardour', '/strip/mute', 1, 0)663 ACTIVE_LOOP = 1664 elif SCENE_STATE == 5:665 #fin rec kick + clar, défini comme synchro (sauf mélodica)666 send('/sl/1/hit', 'record')667 send('/sl/6/hit', 'record')668 ACTIVE_LOOP = 1669 send('ardour', '/strip/mute', 8, 0)670 send('ardour', '/strip/mute', 11, 1)671 send('ardour', '/strip/mute', 1, 1)672 send('/set', 'sync_source', 2)673 send('/set', 'overdub_quantized', 1)674 send('/sl/-1/set', 'sync', 1)675 send('/sl/0/set', 'sync', 0)676 send('/sl/-1/set', 'playback_sync', 1)677 send('/sl/0/set', 'playback_sync', 0)678 send('/sl/-1/set', 'quantize', 3)679 elif SCENE_STATE == 6:680 #rec bassA et bassB681 send('ardour', '/strip/mute', 2, 0)682 send('/sl/2/hit', 'record')683 attendre_debut(get, 1)684 send('/sl/2/hit', 'record')685 import time686 time.sleep(5)687 send('/sl/3/hit', 'record')688 attendre_debut(get, 1)689 send('/sl/2/hit', 'mute_on')690 send('/sl/6/hit', 'mute_on')691 send('/sl/3/hit', 'record')692 import time693 time.sleep(5)694 attendre_debut(get, 1)695 send('ardour', '/strip/mute', 2, 1)696 elif SCENE_STATE == 7:697 #rec violonA et violonB698 send('ardour', '/strip/mute', 4, 0)699 send('/sl/4/hit', 'record')700 attendre_debut(get, 1)701 send('/sl/2/hit', 'mute_off')702 send('/sl/3/hit', 'mute_on')703 send('/sl/0/hit', 'mute_on')704 import time705 time.sleep(5)706 send('/sl/4/hit', 'record')707 attendre_debut(get, 1)708 send('/sl/5/hit', 'record')709 send('/sl/[2,4]/hit', 'mute_on')710 send('/sl/3/hit', 'mute_off')711 import time712 time.sleep(5)713 send('/sl/5/hit', 'record')714 attendre_debut(get, 1)715 #repasse sur A tutti716 send('/sl/[2,4]/hit', 'mute_off')717 send('/sl/[3,5]/hit', 'mute_on')718 send('ardour', '/strip/mute', 4, 1)719 send('ardour', '/strip/mute', 5, 0)720 send('ardour', '/strip/mute', 7, 0)721 send('ardour', '/strip/mute', 3, 0) # à supprimer !!!!!!!!!!!!!!!722 elif SCENE_STATE == 8:723 #un tour ABBA depuis le A - oppa caval style724 attendre_debut(get, 1)725 send('/sl/[2,4]/hit', 'mute_on')726 send('/sl/[3,5]/hit', 'mute_off')727 import time728 time.sleep(7)729 attendre_debut(get, 1)730 import time731 time.sleep(7)732 attendre_debut(get, 1)733 send('/sl/[2,4]/hit', 'mute_off')734 send('/sl/[3,5]/hit', 'mute_on')735 import time736 time.sleep(7)737 attendre_debut(get, 1)738 send('/sl/[2,4]/hit', 'mute_off')739 send('/sl/[3,5]/hit', 'mute_on')740 elif SCENE_STATE == 9:741 #couplet chanté depuis le A742 #press = on va passer B, puis A ad lib743 attendre_debut(get, 1)744 send('/sl/[2,4]/hit', 'mute_on')745 send('/sl/[3,5]/hit', 'mute_off')746 import time747 time.sleep(1)748 attendre_debut(get, 1)749 send('/sl/[2,4]/hit', 'mute_off')750 send('/sl/[3,5]/hit', 'mute_on')751 elif SCENE_STATE == 10:752 #encore couplet chanté depuis le A753 #press = on va passer B, puis A ad lib754 attendre_debut(get, 1)755 send('/sl/[2,4]/hit', 'mute_on')756 send('/sl/[3,5]/hit', 'mute_off')757 import time758 time.sleep(1)759 attendre_debut(get, 1)760 send('/sl/[2,4]/hit', 'mute_off')761 send('/sl/[3,5]/hit', 'mute_on')762 elif SCENE_STATE == 11:763 #caval style. Press = on va passer au B du ABBA puis fin764 attendre_debut(get, 1)765 send('/sl/[2,4]/hit', 'mute_on')766 send('/sl/[3,5]/hit', 'mute_off')767 import time768 time.sleep(7)769 attendre_debut(get, 1)770 import time771 time.sleep(7)772 attendre_debut(get, 1)773 send('/sl/[2,4]/hit', 'mute_off')774 send('/sl/[3,5]/hit', 'mute_on')775 import time776 time.sleep(7)777 attendre_debut(get, 1)778 send('/sl/-1/hit', 'mute_on')779 else:780 boutons_fixes(subscene, send, get)781def bani(subscene, send, get):782 global SCENE_STATE, ACTIVE_LOOP783 if subscene == 'INIT':784 reset(subscene, send, get)785 print('Scene bani started')786 return787 elif subscene == 1: # CC1 = NEXT788 SCENE_STATE += 1789 print('Scene bani on subscene %s' % SCENE_STATE)790 # CONDUITE LINEAIRE791 if SCENE_STATE == 1:792 #rec kick et meloA793 send('ardour', '/strip/mute', 3, 0)794 send('ardour', '/strip/mute', 1, 0)795 send('ardour', '/strip/mute', 12, 0)796 send('/sl/[0,1]/set', 'rec_thresh', 0.02)797 send('/sl/[0,1]/hit', 'record')798 elif SCENE_STATE == 2:799 #fin record kick meloA, synchro kick, rec meloB800 send('/sl/[0,1]/hit', 'record')801 send('ardour', '/strip/mute', 1, 1)802 send('/set', 'sync_source', 1)803 send('/set', 'overdub_quantized', 1)804 send('/sl/-1/set', 'sync', 1)805 send('/sl/-1/set', 'playback_sync', 1)806 send('/sl/-1/set', 'quantize', 3)807 import time808 time.sleep(4)809 send('/sl/2/hit', 'record')810 attendre_debut(get, 0)811 send('/sl/1/hit', 'mute_on')812 import time813 time.sleep(4)814 send('/sl/2/hit', 'record')815 attendre_debut(get, 0)816 send('ardour', '/strip/mute', 3, 1)817 send('ardour', '/strip/mute', 12, 1)818 send('ardour', '/strip/mute', 8, 0)819 send('/sl/[1,2]/hit', 'mute')820 elif SCENE_STATE == 3:821 #rec bassA et bassB, puis repasse au A822 send('ardour', '/strip/mute', 2, 0)823 send('/sl/3/hit', 'record')824 attendre_debut(get, 0)825 import time826 time.sleep(4)827 send('/sl/[3,4]/hit', 'record')828 attendre_debut(get, 0)829 send('/sl/[1,3]/hit', 'mute_on')830 send('/sl/2/hit', 'mute_off')831 import time832 time.sleep(4)833 send('/sl/4/hit', 'record')834 attendre_debut(get, 0)835 send('/sl/[1,3]/hit', 'mute_off')836 send('/sl/[2,4]/hit', 'mute_on')837 send('ardour', '/strip/mute', 2, 1)838 send('ardour', '/strip/mute', 4, 0)839 elif SCENE_STATE == 4:840 #play violon ABBAB BBBB, puis A ad lib841 attendre_debut(get, 0)842 import time843 time.sleep(4)844 attendre_debut(get, 0)845 #1er B846 send('/sl/[1,2,3,4]/hit', 'mute')847 import time848 time.sleep(4)849 attendre_debut(get, 0)850 #2e B851 import time852 time.sleep(4)853 attendre_debut(get, 0)854 # A855 send('/sl/[1,2,3,4]/hit', 'mute')856 import time857 time.sleep(4)858 attendre_debut(get, 0)859 # B1860 send('/sl/[1,2,3,4]/hit', 'mute')861 import time862 time.sleep(4)863 attendre_debut(get, 0)864 #2865 import time866 time.sleep(4)867 attendre_debut(get, 0)868 #3869 import time870 time.sleep(4)871 attendre_debut(get, 0)872 #4873 import time874 time.sleep(4)875 attendre_debut(get, 0)876 #5877 import time878 time.sleep(4)879 attendre_debut(get, 0)880 send('/sl/[1,2,3,4]/hit', 'mute')881 send('ardour', '/strip/mute', 3, 0) # à supprimer !!!!!!882 send('ardour', '/strip/mute', 7, 0)883 elif SCENE_STATE == 5:884 # couplet voix déclenche B, aussi pour 2x violon, puis A885 attendre_debut(get, 0)886 send('/sl/[1,2,3,4]/hit', 'mute')887 import time888 time.sleep(4)889 attendre_debut(get, 0)890 import time891 time.sleep(4)892 attendre_debut(get, 0)893 import time894 time.sleep(4)895 attendre_debut(get, 0)896 send('/sl/[1,2,3,4]/hit', 'mute')897 elif SCENE_STATE == 6:898 # couplet voix déclenche B, 2x violon, puis ABBB, A ad lib899 attendre_debut(get, 0)900 send('/sl/[1,2,3,4]/hit', 'mute')901 import time902 time.sleep(4)903 attendre_debut(get, 0)904 import time905 time.sleep(4)906 attendre_debut(get, 0)907 import time908 time.sleep(4)909 attendre_debut(get, 0)910 send('/sl/[1,2,3,4]/hit', 'mute')911 import time912 time.sleep(4)913 attendre_debut(get, 0)914 send('/sl/[1,2,3,4]/hit', 'mute')915 import time916 time.sleep(4)917 attendre_debut(get, 0)918 import time919 time.sleep(4)920 attendre_debut(get, 0)921 import time922 time.sleep(4)923 attendre_debut(get, 0)924 import time925 time.sleep(4)926 attendre_debut(get, 0)927 send('/sl/[1,2,3,4]/hit', 'mute')928 elif SCENE_STATE == 7:929 # déclenche ABBAB BBBB, puis mute930 attendre_debut(get, 0)931 send('/sl/[0,3]/hit', 'mute_on')932 import time933 time.sleep(4)934 attendre_debut(get, 0)935 #1er B936 send('/sl/[0,3]/hit', 'mute_off')937 send('/sl/[1,2,3,4]/hit', 'mute')938 import time939 time.sleep(4)940 attendre_debut(get, 0)941 #2e B942 import time943 time.sleep(4)944 attendre_debut(get, 0)945 # A946 send('/sl/[1,2,3,4]/hit', 'mute')947 import time948 time.sleep(4)949 attendre_debut(get, 0)950 # B1951 send('/sl/[1,2,3,4]/hit', 'mute')952 import time953 time.sleep(4)954 attendre_debut(get, 0)955 #2956 import time957 time.sleep(4)958 attendre_debut(get, 0)959 #3960 import time961 time.sleep(4)962 attendre_debut(get, 0)963 #4964 import time965 time.sleep(4)966 attendre_debut(get, 0)967 #5968 import time969 time.sleep(4)970 attendre_debut(get, 0)971 send('/sl/-1/hit', 'mute_on')972 send('ardour', '/strip/mute', 4, 1)973 else:...

Full Screen

Full Screen

test.py

Source:test.py Github

copy

Full Screen

1import random2import os3class oie:4 def __init__(self):5 self.pos = 06 self.img = 07 self.timer = 08 self.attendre = 09def des():10 des1 = random.randrange(1,7)11 des2 = random.randrange(1,7)12 if prem_tour == 0:13 if des1 == 6:14 if des2 ==3:15 print('Case 26')16 return 2617 if des1 == 3:18 if des2 == 6:19 print('Case 26')20 return 2621 if des1 == 5:22 if des2 ==4:23 print('Case 52')24 return 5225 if des1 == 4:26 if des2 == 5:27 print('Case 52')28 return 5229 add = des1 + des230 return add31tour = 032p1 = oie()33p2 = oie()34p3 = oie()35p4 = oie()36p5 = oie()37p6 = oie()38continuer = 039os.system('cls')40prem_tour = 041tour_jeux = 042input('Lancez les des\n')43while continuer == 0:44 avance = des()45 print('Avancez de ' + str(avance))46 if tour == 0:47 if p1.attendre == 0:48 if p1.timer == 0:49 p1.pos += avance50 if p1.pos % 9 == 0:51 print('Et c\'est partit les copains')52 p1.pos += avance53 if p1.pos == 31:54 print('En prison')55 p1.attendre = 156 if p1.pos == 52:57 print('En prison aussi')58 p1.attendre = 159 if p1.pos == 42:60 print('Et bah non')61 p1.pos = 3062 if p1.pos == 58:63 print('Retour a la case départ')64 p1.pos = 165 if p1.pos == 6:66 print('Pont a 12')67 p1.pos = 1268 if p1.pos == 19:69 print('Bienvenue a l\'hotel ibis')70 p1.timer = 271 if p1.pos == 63:72 continuer = 173 print('P1 Win')74 if p1.pos > 63:75 recule = p1.pos - 6376 p1.pos = 63 - recule77 if p1.pos % 9 == 0:78 p1.pos-=recule79 if p1.pos == p2.pos:80 p2.pos -= avance81 if p1.pos == p3.pos:82 p3.pos -= avance83 if p1.pos == p4.pos:84 p4.pos -= avance85 if p1.pos == p5.pos:86 p5.pos -= avance87 if p1.pos == p6.pos:88 p6.pos -= avance89 print(str(p1.pos) + ' P1')90 else:91 print('Vous avez oubliez de payez, la Stonks Industries vous charge de dormir et de payer une nuit supplementaire')92 p1.timer -=193 if p1.attendre == 1 and (p2.pos >= p1.pos or p3.pos >= p1.pos or p4.pos >= p1.pos or p5.pos >= p1.pos or p6.pos >= p1.pos):94 p1.attendre = 095 elif p1.attendre == 1:96 print('Prisonnier reste la')97 p1.attendre = 198 tour += 1 99 elif tour == 1: 100 if p2.attendre == 0:101 if p2.timer == 0:102 p2.pos += avance103 if p2.pos % 9 == 0:104 print('Et c\'est partit les copains')105 p2.pos += avance106 if p2.pos == 31:107 print('En prison')108 p2.attendre = 1109 if p2.pos == 52:110 print('En prison aussi')111 p2.attendre = 1112 if p2.pos == 42:113 print('Et bah non')114 p2.pos = 30115 if p2.pos == 58:116 print('Retour a la case départ')117 p2.pos = 1118 if p2.pos == 6:119 print('Pont a 12')120 p2.pos = 12121 if p2.pos == 19:122 print('Bienvenue a l\'hotel ibis')123 p2.timer = 2124 if p2.pos == 63:125 continuer = 1126 print('P2 Win')127 if p2.pos > 63:128 recule = p2.pos - 63129 p2.pos = 63 - recule130 if p2.pos % 9 == 0:131 p2.pos-=recule132 if p2.pos == p1.pos:133 p1.pos -= avance134 if p2.pos == p3.pos:135 p3.pos -= avance136 if p2.pos == p4.pos:137 p4.pos -= avance138 if p2.pos == p5.pos:139 p5.pos -= avance140 if p2.pos == p6.pos:141 p6.pos -= avance142 print(str(p2.pos) + ' P2')143 else:144 print('Vous avez oubliez de payez, la Stonks Industries vous charge de dormir et de payer une nuit supplementaire')145 p2.timer -=1146 if p2.attendre == 1 and (p1.pos >= p2.pos or p3.pos >= p2.pos or p4.pos >= p2.pos or p5.pos >= p2.pos or p6.pos >= p2.pos):147 p2.attendre = 0148 elif p2.attendre == 1:149 print('Prisonnier reste la')150 p2.attendre = 1151 tour += 1 152 elif tour == 2:153 if p3.attendre == 0:154 if p3.timer == 0:155 p3.pos += avance156 if p3.pos % 9 == 0:157 print('Et c\'est partit les copains')158 p3.pos += avance159 if p3.pos == 31:160 print('En prison')161 p3.attendre = 1162 if p3.pos == 52:163 print('En prison aussi')164 p3.attendre = 1165 if p3.pos == 42:166 print('Et bah non')167 p3.pos = 30168 if p3.pos == 58:169 print('Retour a la case départ')170 p3.pos = 1171 if p3.pos == 6:172 print('Pont a 12')173 p3.pos = 12174 if p3.pos == 19:175 print('Bienvenue a l\'hotel ibis')176 p3.timer = 2177 if p3.pos == 63:178 continuer = 1179 print('P3 Win')180 if p3.pos > 63:181 recule = p3.pos - 63182 p3.pos = 63 - recule183 if p3.pos % 9 == 0:184 p3.pos-=recule185 if p3.pos == p2.pos:186 p2.pos -= avance187 if p3.pos == p1.pos:188 p1.pos -= avance189 if p3.pos == p4.pos:190 p4.pos -= avance191 if p3.pos == p5.pos:192 p5.pos -= avance193 if p3.pos == p6.pos:194 p6.pos -= avance195 print(str(p3.pos) + ' P3')196 else:197 print('Vous avez oubliez de payez, la Stonks Industries vous charge de dormir et de payer une nuit supplementaire')198 p3.timer -=1199 if p3.attendre == 1 and (p2.pos >= p3.pos or p1.pos >= p3.pos or p4.pos >= p3.pos or p5.pos >= p3.pos or p6.pos >= p3.pos):200 p3.attendre = 0201 elif p3.attendre == 1:202 print('Prisonnier reste la')203 p3.attendre = 1204 tour += 1205 elif tour == 3:206 if p4.attendre == 0:207 if p4.timer == 0:208 p4.pos += avance209 if p4.pos % 9 == 0:210 print('Et c\'est partit les copains')211 p4.pos += avance212 if p4.pos == 31:213 print('En prison')214 p4.attendre = 1215 if p4.pos == 52:216 print('En prison aussi')217 p4.attendre = 1218 if p4.pos == 42:219 print('Et bah non')220 p4.pos = 30221 if p4.pos == 58:222 print('Retour a la case départ')223 p4.pos = 1224 if p4.pos == 6:225 print('Pont a 12')226 p4.pos = 12227 if p4.pos == 19:228 print('Bienvenue a l\'hotel ibis')229 p4.timer = 2230 if p4.pos == 63:231 continuer = 1232 print('P4 Win')233 if p4.pos > 63:234 recule = p4.pos - 63235 p4.pos = 63 - recule236 if p4.pos % 9 == 0:237 p4.pos-=recule238 if p4.pos == p2.pos:239 p2.pos -= avance240 if p4.pos == p3.pos:241 p3.pos -= avance242 if p4.pos == p5.pos:243 p5.pos -= avance244 if p4.pos == p1.pos:245 p1.pos -= avance246 if p4.pos == p6.pos:247 p6.pos -= avance248 print(str(p4.pos) + ' P4')249 else:250 print('Vous avez oubliez de payez, la Stonks Industries vous charge de dormir et de payer une nuit supplementaire')251 p4.timer -=1252 if p4.attendre == 1 and (p2.pos >= p4.pos or p3.pos >= p4.pos or p1.pos >= p4.pos or p5.pos >= p4.pos or p6.pos >= p4.pos):253 p4.attendre = 0254 elif p4.attendre == 1:255 print('Prisonnier reste la')256 p4.attendre = 1257 tour += 1258 elif tour == 4:259 if p5.attendre == 0:260 if p5.timer == 0:261 p5.pos += avance262 if p5.pos % 9 == 0:263 print('Et c\'est partit les copains')264 p5.pos += avance265 if p5.pos == 31:266 print('En prison')267 p5.attendre = 1268 if p5.pos == 52:269 print('En prison aussi')270 p5.attendre = 1271 if p5.pos == 42:272 print('Et bah non')273 p5.pos = 30274 if p5.pos == 58:275 print('Retour a la case départ')276 p5.pos = 1277 if p5.pos == 6:278 print('Pont a 12')279 p5.pos = 12280 if p5.pos == 19:281 print('Bienvenue a l\'hotel ibis')282 p5.timer = 2283 if p5.pos == 63:284 continuer = 1285 print('P5 Win')286 if p5.pos > 63:287 recule = p5.pos - 63288 p5.pos = 63 - recule289 if p5.pos % 9 == 0:290 p5.pos-=recule291 if p5.pos == p2.pos:292 p2.pos -= avance293 if p5.pos == p3.pos:294 p3.pos -= avance295 if p5.pos == p4.pos:296 p4.pos -= avance297 if p5.pos == p1.pos:298 p1.pos -= avance299 if p5.pos == p6.pos:300 p6.pos -= avance301 print(str(p5.pos) + ' P5')302 else:303 print('Vous avez oubliez de payez, la Stonks Industries vous charge de dormir et de payer une nuit supplementaire')304 p5.timer -=1305 if p5.attendre == 1 and (p2.pos >= p5.pos or p3.pos >= p5.pos or p4.pos >= p5.pos or p1.pos >= p5.pos or p6.pos >= p5.pos):306 p5.attendre = 0307 elif p5.attendre == 1:308 print('Prisonnier reste la')309 p5.attendre = 1310 tour += 1311 elif tour == 5:312 if p6.attendre == 0:313 if p6.timer == 0:314 p6.pos += avance315 if p6.pos % 9 == 0:316 print('Et c\'est partit les copains')317 p6.pos += avance318 if p6.pos == 31:319 print('En prison')320 p6.attendre = 1321 if p6.pos == 52:322 print('En prison aussi')323 p6.attendre = 1324 if p6.pos == 42:325 print('Et bah non')326 p6.pos = 30327 if p6.pos == 58:328 print('Retour a la case départ')329 p6.pos = 1330 if p6.pos == 6:331 print('Pont a 12')332 p6.pos = 12333 if p6.pos == 19:334 print('Bienvenue a l\'hotel ibis')335 p6.timer = 2336 if p6.pos == 63:337 continuer = 1338 print('P6 Win')339 if p6.pos > 63:340 recule = p6.pos - 63341 p6.pos = 63 - recule342 if p6.pos % 9 == 0:343 p6.pos-=recule344 if p6.pos == p2.pos:345 p2.pos -= avance346 if p6.pos == p3.pos:347 p3.pos -= avance348 if p6.pos == p4.pos:349 p4.pos -= avance350 if p6.pos == p5.pos:351 p5.pos -= avance352 if p6.pos == p1.pos:353 p1.pos -= avance354 print(str(p6.pos) + ' P6')355 else:356 print('Vous avez oubliez de payez, la Stonks Industries vous charge de dormir et de payer une nuit supplementaire')357 p6.timer -=1358 if p6.attendre == 1 and (p2.pos >= p6.pos or p3.pos >= p6.pos or p4.pos >= p6.pos or p5.pos >= p6.pos or p1.pos >= p6.pos):359 p6.attendre = 0360 elif p6.attendre == 1:361 print('Prisonnier reste la')362 p6.attendre = 1363 tour = 0364 prem_tour = 1365 tour_jeux +=1...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful