コード例 #1
0
def badLanguage(bot, trigger):
    """Easter egg command that insults a random language from this list. Feel free to add lots
       more languages >:) (Possibly including C???)
    """
    langs = [ "Ruby", "Python", "C++", "PHP", "Rust", "Go", "Perl", "C#", "Java", "Scala", "Objective-C", "F#",
    "Haskell", "Clojure", "BASIC", "Visual Basic", "HTML", "CSS", "Javascript", "Actionscript", "D", "Fortran" ]
    info(bot, None, "%s is a bad language :)" % random.choice(langs))
コード例 #2
0
ファイル: handmade_faq.py プロジェクト: schme/ChronalRobot
def thanksMessage(bot, trigger):
    """Command to thank a user.
    """
    if (trigger and trigger.group(2)):
        info(bot, trigger, "Your thanking has been noted.")
    else:
        info(bot, trigger, "You're welcome <3")
コード例 #3
0
def usedCompilierInfo(bot, trigger):
    """Command to answer the many what compiler is he using
    """
    info(
        bot, trigger,
        "Casey compiles from a batch file using MSVC on windows, and has told us he uses Clang to compile on GNU/Linux, BSD, and OS X. You can get the same version of MSVC which he uses on stream completely free as part of Visual Studio 2013 Community Edition here: http://goo.gl/BzGwMC (More: !build, !batch, !unity)"
    )
コード例 #4
0
def archiveInfo(bot, trigger):
    """Info command that prints out the forum/youtube archive links.
    """
    info(
        bot, trigger,
        'Annotated Episode Guide: https://goo.gl/O5ljen   ::   YouTube Archive: http://goo.gl/u3hKKj'
    )
コード例 #5
0
def streamInfo(bot, trigger):
    """Info command that displays basic information about the stream itself.
    """
    info(
        bot, trigger,
        "In this stream, game programmer Casey Muratori is walking us through the creation of a game from scratch in C. The game is being developed for educational purposes: he will explain what he is doing every step of the way. For more information, visit http://goo.gl/fmjocD"
    )
コード例 #6
0
def gameInfo(bot, trigger):
    """Info command that displays basic information about the game being built.
    """
    info(
        bot, trigger,
        "Handmade Hero is a 2Dish top-down game inspired by classic Zelda games and modern games like The Binding of Isaac. The entire development of the game is being catalogued in these streams. (More: !art, !lang)"
    )
コード例 #7
0
def whyNoTemplatesInfo(bot, trigger):
    """Command to answer the many why Casey avoids using C++ templates where possible
	"""
    info(
        bot, trigger,
        "Casey avoids using C++ templates where not absolutely necessary, as they lead to longer compile times and make debugging harder. See also: http://mollyrocket.com/forums/molly_forum_402.html"
    )
コード例 #8
0
def thanksMessage(bot, trigger):
    """Command to thank a user.
    """
    if (trigger and trigger.group(2)):
        info(bot, trigger, "%s would like to express their gratitude." % trigger.nick)
    else:
        info(bot, trigger, "You're welcome <3")
コード例 #9
0
def siteInfo(bot, trigger):
    """Info command that prints out the site/forum links.
    """
    info(
        bot, trigger,
        'HMH Website: http://goo.gl/fmjocD  ::  HMH Forums: http://goo.gl/X5JDvT'
    )
コード例 #10
0
def milkInfo(bot, trigger):
    """Info command that prints out info about almond milk.
    """
    info(
        bot, trigger,
        "One of Casey's drinks of choice is Almond Milk, a delicious and refreshing beverage. Some common brands are Silk and Almond Breeze. Over Summer, Casey has been making his own lemonade."
    )
コード例 #11
0
def getTime(bot, trigger):
    """Info command that prints out the current time in PST. For the purposes of the handmade hero
        stream, we don't really care about other time zones.
    """
    now = arrow.now('US/Pacific')
    info(bot, trigger,
         "The current time in Seattle is %s" % (now.strftime("%I:%M %p %Z")))
コード例 #12
0
def gettingStartedLearning(bot, trigger):
    """Command for basic learning instructions for all those where to start learning questions we get during the stream
    """
    info(
        bot, trigger,
        "Programming can actually be quite simple if you start out right. For absolute beginners, try khanacademy.org or codecademy.com for garden-path tutorials and explanations, or c.learncodethehardway.org/book/ for a more self-directed introduction to C programming, LearnXinYminutes is a quick way to get a overview of a language found here http://goo.gl/ZEDxDt. See !learnC for more."
    )
コード例 #13
0
def learningC(bot, trigger):
    """Command describing how you can begin learning C, like this
    """
    info(
        bot, trigger,
        "One way to start programming in this manner is to watch the Intro to C series at https://hero.handmadedev.org/jace/guide/ to get a general feel of things. Later, read 'The C Programming Language' by Brian W. Kernighan and Dennis M. Ritchie and work through all the exercises, LearnXinYminutes can be used to see the basics of C http://goo.gl/qmluuM. The most important part is to start coding and to make lots of things in code. Good luck!"
    )
コード例 #14
0
def renderInfo(bot, trigger):
    """Command to give render information to the chat target
    """
    info(
        bot, trigger,
        "We are currently using software rendering in order to implement our own renderer. Ultimately the game will take advantage of hardware acceleration (i.e. using OpenGL, Direct3D, etc.) to maximize performance. See also !opengl."
    )
コード例 #15
0
def renderInfo(bot, trigger):
    """Command to give openGL information to the chat target
    """
    info(
        bot, trigger,
        "While Casey will rewrite the renderer using OpenGL in the future - see !render - the current OpenGL code is to allow for vsync, giving a more predictable frame time."
    )
コード例 #16
0
def buyInfo(bot, trigger):
    """Info command that prints out where you can buy the game/support the project.
    """
    info(
        bot, trigger,
        "The Handmade Hero art assets and full source code can be purchased at http://goo.gl/y20Q9C . You can also support Casey monthly at http://www.patreon.com/cmuratori"
    )
コード例 #17
0
def usedBuildBatchInfo(bot, trigger):
    """Command to answer the many why Casey builds HMH the way he does
    """
    info(
        bot, trigger,
        "On windows, Casey compiles with MSVC from a batch script, also called by Emacs for rebuilds. The program builds as a single translation unit (STU) using #include to compile all involved files in one go, which we call a unity or STU build. The script needs a change only when adding a dependency. See also: Day 011, http://goo.gl/8ATplA (More: !editor, !compiler)"
    )
コード例 #18
0
def wristInfo(bot, trigger):
    """Info command that prints out info about Casey's wrist braces
    """
    info(
        bot, trigger,
        "The wrist braces Casey wears help make typing more comfortable and prevent Repetitive Strain Injury. They were made by Medi-Active (the ones without the thumb brace) but are no longer in production."
    )
コード例 #19
0
def emacsVersion(bot, trigger):
    """Info command that provides information about the emacs version.
    """
    info(
        bot, trigger,
        "The version of emacs that Casey uses is GNU Emacs 23.4.1 (i386-mingw-nt6.1.7601), released in 2012."
    )
コード例 #20
0
def ideInfo(bot, trigger):
    """Info command that provides information about the editor (emacs) used by Casey.
    """
    info(
        bot, trigger,
        "Casey uses Emacs to edit his code because that is what he is used to. There are a lot of editors out there, however, so you should use whatever you feel most comfortable in. (See also: !emacsversion)"
    )
コード例 #21
0
def caseyInfo(bot, trigger):
    """Info command that prints out info about Casey. Could be refactored into multiple commands
        for better clarity.
    """
    info(
        bot, trigger,
        "Casey Muratori is a 38 year old software engineer living in Seattle, Washington. He started Handmade Hero to give the general public a better idea of what coding a game from scratch is like based on his experiences in the industry. For a full bio, see http://mollyrocket.com/casey/about.html"
    )
コード例 #22
0
def artCreatorInfo(bot, trigger):
    """Command to state who the art is done by
        TODO: maybe look to casey to get a link the artists profile for viewing
    """
    info(
        bot, trigger,
        "The art in Handmade Hero is created by Yangtian Li (http://www.yangtianli.com/), an artist Casey knows whom he contracted using the funds provided by purchases of the game."
    )
コード例 #23
0
def langInfo(bot, trigger):
    """Info command that provides a description of the language and style used on the stream.
        Could be split into two commands, one for simple info and one about the structural choices.
    """
    info(
        bot, trigger,
        "The language used in the stream is a subset of C++ that is very C-like with a few differences, such as the use of operator and function overloading. Since we're writing everything from scratch, we will not be using the C or C++ standard libraries wherever possible."
    )
コード例 #24
0
def nextSchedule(bot, trigger):
	"""Info command that prints out the expected time of the next stream
	"""
	nextStream = getNextStream()
	if( nextStream != None):
		info(bot, trigger, "The stream should next be live on %s PST" % nextStream.start.strftime("%a at %I:%M %p"))
	else:
		info(bot, trigger, "No more streams scheduled in the bot, Try checking www.handmadehero.org")
コード例 #25
0
ファイル: handmade_stream.py プロジェクト: schme/ChronalRobot
def timer(bot, trigger):
    """Info command that prints out the time until the next stream.
    """
    nowTime = now()
    streamTime = getNextStream(nowTime) # Make "now" the default argument?

    #TEST CODE
    #stream.scheduleStream(newTime) # sets the time of any existing stream on that day to the new time, or creates one if there is no entry
    #stream.setStreamLength(date, lengthInMinutes) # set the length of the stream (not including Q&A) on that date to the given length

    info(bot, trigger, timeToStream(streamTime, nowTime))
コード例 #26
0
def currentSchedule(bot, trigger):
	"""Info command that prints out this week's schedule
	"""
	startOfWeek = getStartOfDay()
	if (startOfWeek.weekday() <= FRIDAY):
		startOfWeek = startOfWeek.replace(days=-(startOfWeek.weekday()-MONDAY))
	else: # It's a weekend, go forward to the next week
		startOfWeek = startOfWeek.replace(days=+(SUNDAY-startOfWeek.weekday())+1)

	endOfWeek = startOfWeek.replace(days=+7)

	streams = getStreamsBetween(startOfWeek, endOfWeek)
	streamTimes = " :: ".join([stream.start.strftime("%I %p on %a").lstrip("0") for stream in streams])
	info( bot, trigger, "Schedule for week of %s: %s (times in PST)" % (startOfWeek.strftime("%m/%d"), streamTimes) )
コード例 #27
0
ファイル: handmade_stream.py プロジェクト: schme/ChronalRobot
def currentSchedule(bot, trigger):
    """Info command that prints out this week's schedule
    """
    nowDate = now()
    if (nowDate.weekday() <= FRIDAY):
        while(nowDate.weekday() > MONDAY):
            nowDate = nowDate - timedelta(days=1)
    else: # It's a weekend, go forward to the next week
        while(nowDate.weekday() > MONDAY):
            nowDate = nowDate + timedelta(days=1)

    times = []
    while(nowDate.weekday() <= FRIDAY):
        #check from 12AM for arbitrary reasons
        times.append(getNextStream(datetime.combine(nowDate, time(hour=0, tzinfo=timezone("PST8PDT")))))
        nowDate = nowDate + timedelta(days=1)
    
    info(bot, trigger, "Current schedule: %s " % " :: ".join([t.strftime("%I %p on %a").lstrip("0") for t in times]))
コード例 #28
0
def timer(bot, trigger):
	"""Info command that prints out the time until the next stream.
	"""
	now = arrow.now();
	currentStream = getStreamAt(now)

	if(currentStream == None):
		# Check if there is a stream coming up.
		nextStream = getNextStream()
		if(nextStream == None):
			return info(bot, trigger, "No more streams scheduled in the bot, Try checking www.handmadehero.org")
		else:
			return info(bot, trigger, "Next stream is in %s" % getDurationString(nextStream.start - now ))

	if( currentStream.start < now  and now < currentStream.getQaStart() ):
		return info(bot, trigger, "%s into stream (%s until Q&A) if Casey is on schedule" % (getDurationString(now - currentStream.start), getDurationString(currentStream.getQaStart() - now)))

	if( currentStream.getQaStart() < now  and now < currentStream.getEnd() ):
		return info(bot, trigger, "%s into the Q&A (%s until end) if Casey is on schedule" % (getDurationString(now - currentStream.getQaStart()), getDurationString(currentStream.getEnd() - now)))
コード例 #29
0
ファイル: handmade_bonus.py プロジェクト: schme/ChronalRobot
def hug(bot, trigger):
    """Easter egg info command that attempts to provide human warmth and empathy in times of 
        emotional trauma.
    """
    info(bot, trigger, "Were I not a transient being circling through an ether of intangible bits and bytes, I would hug you, with all the human emotional context it implies")
コード例 #30
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def rules(bot, trigger):
    info(bot, trigger, "The Handmade Hero moderator team volunteers their time in order to keep chat civil and clean during stream time. Spamming, repetitive arguments that clog up the chat, or refusal to cooperate with a reasonable request from a moderator may result in a ban from the chat at the moderators' sole discretion.")
コード例 #31
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def milkInfo(bot, trigger):
    """Info command that prints out info about almond milk.
    """
    info(bot, trigger, "One of Casey's drinks of choice is Almond Milk, a delicious and refreshing beverage. Some common brands are Silk and Almond Breeze. Over Summer, Casey has been making his own lemonade.")
コード例 #32
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def caseyInfo(bot, trigger):
    """Info command that prints out info about Casey. Could be refactored into multiple commands
        for better clarity.
    """
    info(bot, trigger, "Casey Muratori is a 38 year old software engineer living in Seattle, Washington. He started Handmade Hero to give the general public a better idea of what coding a game from scratch is like based on his experiences in the industry. For a full bio, see http://mollyrocket.com/casey/about.html")
コード例 #33
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def archiveInfo(bot, trigger):
    """Info command that prints out the forum/youtube archive links.
    """
    info(bot, trigger, 'Annotated Episode Guide: https://goo.gl/O5ljen   ::   YouTube Archive: http://goo.gl/u3hKKj')
コード例 #34
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def wristInfo(bot, trigger):
    """Info command that prints out info about Casey's wrist braces
    """
    info(bot, trigger, "The wrist braces Casey wears help make typing more comfortable and prevent Repetitive Strain Injury. They were made by Medi-Active (the ones without the thumb brace) but are no longer in production.")
コード例 #35
0
def nightNight(bot, trigger):
    info(bot, trigger, "Night night <3")
コード例 #36
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def never(bot, trigger):
    info(bot, trigger, "Programming is not really about the code. See moderator AbnerCoimbre's informal lecture on the subject here: http://y2u.be/Lzc3HcIgXis or a more extensive talk from Mike Acton here: http://y2u.be/rX0ItVEVjHc")
コード例 #37
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def ask2ask(bot, trigger):
    info(bot, trigger, "Don't ask to ask a question, simply ask your question. Many regulars use IRC, so we will see your question eventually. If you can't stay long, you may also ask your question on the !forum")
コード例 #38
0
def bestEditor(bot, trigger):
    """Easter egg command that endorses either emacs or vim. Feel free to add more editors.
    """
    editors = ["emacs", "vim", "sublime", "notepad++", "notepad2", "ed", "nano"]
    info(bot, None, "%s is the best editor :)" % random.choice(editors))
コード例 #39
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def hmhcon(bot, trigger):
    info(bot, trigger, "HandmadeCon 2015 will be held on Krampusnacht in Seattle. More specifically: Saturday, December 5th, 2015, from 10AM to 6PM PST, in the auditorium at the central branch of the Seattle Public Library. There are 275 tickets total, at $45/ticket (or $35/ticket if ordered before November 5th). Read the latest info at http://handmadecon.org")
コード例 #40
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def manifesto(bot, trigger):
    info(bot, trigger, "You can read The Handmade Manifesto here: http://handmadedev.org/manifesto/")
コード例 #41
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def design(bot, trigger):
    info(bot, trigger, "Handmade Hero is primarily a demonstration of game _programming_, and the design of the game is intended only to facilitate that by employing complex mechanics and interesting interactions, and may not necessarily innovate in any particular direction. If you'd like to see a lecture on game design from moderator GarlandoBloom, see http://y2u.be/0zVjdEhHmGo")
コード例 #42
0
ファイル: handmade_stream.py プロジェクト: schme/ChronalRobot
def nextSchedule(bot, trigger):
    """Info command that prints out the expected time of the next stream
    """
    streamTime = getNextStream(now())
    info(bot, trigger, "The stream should next be live on %s" % streamTime.strftime("%a at %I:%M %p"))
コード例 #43
0
def ExplainUGT(bot, trigger):
    info(bot, trigger, "Use UGT to greet people! It's always morning when you arrive, and always night when you leave ;) You can also use !o/ and !\o/.")
コード例 #44
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def creativeAsk(bot, trigger):
    info(bot, trigger, "Handmade Hero is being streamed in the Creative section of twitch because twitch administration asked Casey to do so. It is unclear if there is a larger reason behind the decision.")
コード例 #45
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def userlist(bot, trigger):
    info(bot, trigger, "Are you on IRC and missing a user list? Use the raw command in your IRC client (/raw or /quote usually, or just /cap) to issue the following command: CAP REQ :twitch.tv/membership For the change to take effect you will need to use /cycle (if supported) or /part and /join in that order. It is recommended to add this to your connect command.")
コード例 #46
0
def randomNumber(bot, trigger):
    """Easter egg info command that returns a randomly-selected number.
    """
    info(bot, trigger, "Your random number is %s" % (random.randint(100) if random.random() < 0.0001 else 4))
コード例 #47
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def getTime(bot, trigger):
    """Info command that prints out the current time in PST. For the purposes of the handmade hero
        stream, we don't really care about other time zones.
    """
    now = arrow.now('US/Pacific')
    info(bot, trigger, "The current time in Seattle is %s" % (now.strftime("%I:%M %p %Z")))
コード例 #48
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def siteInfo(bot, trigger):
    """Info command that prints out the site/forum links.
    """
    info(bot, trigger, 'HMH Website: http://goo.gl/fmjocD  ::  HMH Forums: http://goo.gl/X5JDvT')
コード例 #49
0
def creativeAsk(bot, trigger):
    info(
        bot, trigger,
        "Handmade Hero is being streamed in the Creative section of twitch because twitch administration asked Casey to do so. It is unclear if there is a larger reason behind the decision."
    )
コード例 #50
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def scripting(bot, trigger):
    info(bot, trigger, "We will not be creating a scripting language for Handmade Hero because we have a hot-reloading feature! We can keep all the code in one language with all the benefits that scripting languages typically try to offer.")
コード例 #51
0
ファイル: handmade_faq.py プロジェクト: Chronister/hmh_bot
def quotelist(bot, trigger):
    info(bot, trigger, "A list of all saved quotes is available here: https://goo.gl/YYT8rN.")