Пример #1
0
    def getskills(self, intent, text, tok):

        if intent == 'clock':
            clock.start(tok)
        elif intent == 'camera':
            camera.start(tok)
        elif intent == 'smarthome':
            smarthome.start(tok)
        elif intent == 'weather':
            weather.start(tok)
        elif intent == 'music':
            music.start(tok)
        elif intent == 'mail':
            mail.start(tok)
        elif intent == 'joke':
            joke.start(tok)
        elif intent == 'news':
            news.start(tok)
        elif intent == 'tuling':
            tuling.start(text, tok)
        elif intent == 'snowboytrain':
            snowboytrain.start(tok)
        elif intent == 'raspberrypi-gpio':
            raspberrypigpio.start(tok)
        elif intent == 'respeaker':
            speaker.speak()
        elif intent == 'no':
            sconvenstation()
        elif intent == 'reintent':
            intent = nlp.do_intent(text, tok)
            s.getskills(intent, text, tok)
Пример #2
0
 def alarm_clock(self, future_month, future_day, future_hour,
                 future_minute):
     while (self.CurrentMonth !=
            future_month) or (self.CurrentDay != future_day) or (
                self.CurrentHour != future_hour) or (self.CurrentMinute !=
                                                     future_minute):
         timer = datetime.datetime.now()
         self.CurrentMonth = timer.month
         self.CurrentDay = timer.day
         self.CurrentHour = timer.hour
         self.CurrentMinute = timer.minute
     music.start()
Пример #3
0
def main():
    os.environ['SDL_VIDEO_CENTERED'] = '1'
    
    pygame.display.init()
    pygame.mixer.init(44100)
    #pygame.mouse.set_visible(False)
    pygame.display.set_caption("Opencraft")
    pygame.display.set_icon(read.read_exe_icon("files\\starcraft.exe"))
    image = read.read_pcx("glue\\title\\title.pcx")
    music.start("music\\title.wav")
    ui.init()
    display_image(image)
    
    import Config
    
    if not Config.config.introduction_played:
        play_introduction()
        Config.config.introduction_played = True
    
    def campaign_editor(): print "campaign editor"
    def credits(): print "credits"
    
    
    ui.GlxMenu.GlxMenu("rez\\glumain.bin", "glue\\palmm\\backgnd.pcx", {
        3: lambda: ui.GlxMenu.GlxMenu("rez\\gluexpcmpgn.bin", "glue\\palcs\\backgnd.pcx", {
            5: lambda: 0, # save
            6: lambda: 0, # protoss
            7: lambda: 0, # terran
            8: lambda: 0, # zerg
            10: lambda: ui.GlxMenu.GlxMenu("rez\\glucreat.bin", "glue\\palcs\\backgnd.pcx", {
                12: lambda: credits(),
            }).execute(),
        }).execute(),
        4: lambda: ui.GlxMenu.GlxMenu("rez\\gluconn.bin", "glue\\palnl\\backgnd.pcx", {
            321312: "a",
        }).execute(),
        5: campaign_editor,
        8: play_introduction,
        9: lambda: ui.GlxMenu.GlxMenu("rez\\credits.bin", "glue\\palmm\\backgnd.pcx", {}).execute(),
    }).execute()
Пример #4
0
def play_introduction():
    music.fadeout()
    ui.Video.Video("smk\\blizzard.smk")
    ui.Video.Video("smk\\starxintr.smk")
    music.start("music\\title.wav")
Пример #5
0
    def music(self, tok):

        music.start(tok)
Пример #6
0
def main():
    os.environ['SDL_VIDEO_CENTERED'] = '1'

    pygame.display.init()
    pygame.mixer.init(44100)
    #pygame.mouse.set_visible(False)
    pygame.display.set_caption("Opencraft")
    pygame.display.set_icon(read.read_exe_icon("files\\starcraft.exe"))
    image = read.read_pcx("glue\\title\\title.pcx")
    music.start("music\\title.wav")
    ui.init()
    display_image(image)

    import Config

    if not Config.config.introduction_played:
        play_introduction()
        Config.config.introduction_played = True

    def campaign_editor():
        print "campaign editor"

    def credits():
        print "credits"

    ui.GlxMenu.GlxMenu(
        "rez\\glumain.bin",
        "glue\\palmm\\backgnd.pcx",
        {
            3:
            lambda: ui.GlxMenu.GlxMenu(
                "rez\\gluexpcmpgn.bin",
                "glue\\palcs\\backgnd.pcx",
                {
                    5:
                    lambda: 0,  # save
                    6:
                    lambda: 0,  # protoss
                    7:
                    lambda: 0,  # terran
                    8:
                    lambda: 0,  # zerg
                    10:
                    lambda: ui.GlxMenu.GlxMenu("rez\\glucreat.bin",
                                               "glue\\palcs\\backgnd.pcx", {
                                                   12: lambda: credits(),
                                               }).execute(),
                }).execute(),
            4:
            lambda: ui.GlxMenu.GlxMenu("rez\\gluconn.bin",
                                       "glue\\palnl\\backgnd.pcx", {
                                           321312: "a",
                                       }).execute(),
            5:
            campaign_editor,
            8:
            play_introduction,
            9:
            lambda: ui.GlxMenu.GlxMenu(
                "rez\\credits.bin", "glue\\palmm\\backgnd.pcx", {}).execute(),
        }).execute()
Пример #7
0
def play_introduction():
    music.fadeout()
    ui.Video.Video("smk\\blizzard.smk")
    ui.Video.Video("smk\\starxintr.smk")
    music.start("music\\title.wav")
Пример #8
0
def start_music():
    music.start()
    return 'Success'