Ejemplo n.º 1
0
    "This function makes a random movement for Ohbot to perform, and then chooses a random wait time after the movement"
    ohbot.move(random.randint(0, 6), random.randint(0, 9),
               random.randint(1, 10))
    ohbot.wait(getRandomDecimal())


def getRandomDecimal():
    """This function creates a random decimal between 0.1 and 0.9 for the wait times between moves"""
    decimal = float(random.randrange(1, 9) / 10)
    return decimal


ohbot.reset()
ohbot.wait(1)

ohbot.setVoice("Samantha")

ohbot.say("Hi sean and mummy and daddy")
ohbot.say("i love you")
ohbot.say("do you love me yes or no ")

love = input("write your answer")

if love == "yes":
    ohbot.say("yes yes yes i want to marry you")

elif love == "no":
    ohbot.say("moo moo moo moo    no no nope")
else:
    ohbot.say("I don't understand")
Ejemplo n.º 2
0
from ohbotMac import ohbot

ohbot.setVoice("Fiona")

def warmUp(motor, movePosition, speed):
    ohbot.move(motor, movePosition, speed)
    ohbot.wait(WAITTIME)

def giveInfo(motor):
    motorList = ["neck", "eye balls", "eye lids", "top lip", "bottom lip", "eye sockets"]
    currentMotor = motorList[motor - 1]
    ohbot.say("checking" + currentMotor)

def yes():
    ohbot.move(ohbot.HEADNOD, 0, 10)
    ohbot.wait(.1)
    ohbot.move(ohbot.HEADNOD, 10, 10)
    ohbot.wait(.5)
    ohbot.move(ohbot.HEADNOD, 5, 10)
    ohbot.wait(.1)


#define constants for motors:

NECK = 1
EYEBALLS = 2
EYELIDS = 3
TOPLIP = 4
BOTTOMLIP = 5
EYESOCKETS = 6
Ejemplo n.º 3
0
    choice = random.randint(1, 2)
    print(choice)

    if choice == 1:
        showerFirst = "Michelle"
    elif choice == 2:
        showerFirst = "Sean"

    return showerFirst


ob.reset()
ob.wait(1)

ob.setVoice("Samantha")

ob.say("Ah I'm awake. Did you need me?")

listOfMoves = [i for i in range(random.randint(40, 60))]
print(len(listOfMoves))

for move in listOfMoves:
    chooseBigOrSmall()

ob.reset()
ob.wait(1)

ob.say("Hi, Sean Hi Michelle")

ob.say("Should I choose who will shower first tonight?")