Giter VIP home page Giter VIP logo

mrannouncerbot's Introduction

MrAnnouncerBot

A Twitch bot written in C#

Overview

This bot runs during the live twitch.tv/CodeRushed stream and its primary function is to allow people in the chat room to control Mark's electronic co-host, during the show.

Phrases Mr. Announcer Bot Can Say

Mr. Announcer Bot has a vocabulary of over 100 phrases that include pre-rendered animations synched up to the words. To get Mr. Announcer Bot to say something, simply type the "!" symbol into the chat room followed by the shortcut command for the phrase.

For example, to get Mr. Announcer Bot to say "Excellent!", send the text "!ex" to the chat window.

Levels

For the purposes of determining what you can say, Mr. Announcer Bot tracks viewer "levels". Levels are determined by past contributions, total time spent in the chat room (across all the episodes), and whether you are following/subscribing to the channel or not. It's a lot like one of those dungeon adventuring games. A level-72 wizard can smite you with a side-eye glance, while a level-0 wizard may be stuck fumbling with the spell casting book just to cast magic missiles.

Here is more about level qualifications and what you can say based on your level:

Level 0

Anyone in the chat room who is not yet following the CodeRushed channel is a Level 0 botcaster. Level 0 botcasters can say any of these phrases:

Shortcut Scene Category
cr CodeRush!* Branding
dx DevExpress! Branding
ex Excellent! Good
mark Mark->* Alert

Level 1

Want to jump-start your levels in the chat room? Follow us on Twitch at:

http://twitch.tv/CodeRushed

This will instantly take you to Level 1 and you gain these botcasting skills:

Shortcut Scene Category
awe Awesome! Good
aweCon Awesome Contribution! Chat
b2code Back to the Code! Transition
bfi Brute Force and Ignorance! Gung Ho
bug That's a BUG! Debug
bugsCode Bugs in My Code! Debug
close1 That was a close one! Good
coding Coding! Gung Ho
compShip It compiles - let's ship it! Good
constants Constants! Code
constructors Constructors! Code
debugger Debugger! Debug
debugIt Debug It! Debug
fixed Fixed! Good
fixIt Fix It! Debug
getClose Getting Closer! Good
goodDesign Good Design Good
goodQ Good Question! Chat
greatQ Great Question! Chat
greatSug Great Suggestion! Chat
handlers Event Handlers! Code
heAwe He's Awesome! Chat
inspect Inspect It! Debug
js Javascript! Code
letsDoThis Let's Do This! Good
niceClassName Nice Class Name! Code
niceFunc That's a nice function! Good
niceVarName Nice Variable Name! Good
phew Phew - That was close! Good
sadP Sad Panda! Sad
setBreak Set Breakpoint Debug
sheAwe She's Awesome! Chat
theyAwe They're Awesome! Chat
worked That Worked! Good

Level 2

Shortcut Scene Category
askChat Ask the chat room! Chat
bro Cool Story Bro! Bad
codeDance Let's make this code dance! Gung Ho
forgot Forgot Something! Bad
knowWhatHappen Does Anybody Know What's Happening? Mystery
nfn Nice Function Name! Code

Level 3

Shortcut Scene Category
airbags Check your airbags! Gung Ho
funny That was funny! Good
hack Hacked! Bad
notPretty Won't be pretty! Bad
whatHappen What happened? Mystery
wow Wow. Just Wow. Bad

Level 4

Shortcut Scene Category
exactly Exactly! Good
mop Mother of Pearl! Swear
noSense this doesn't make any sense Mystery
offRails Going Off Rails! Gung Ho
toobad Too Bad! Sad
unb Unbelievable! Mystery

Level 5

Shortcut Scene Category
aye Aye Aye Aye Yikesters! Swear
evenWork Does This Even Work? Mystery
noo Nooooo! Bad
ugly Getting Ugly! Bad
wheelsOff The Training Wheels Are Off! Gung Ho

Level 6

Shortcut Scene Category
buttercup Buckle Up Buttercup! Gung Ho
danceBattle Dance Battle! Crazy
face Excuse your face sir! Swear
sickBurn Sick Burn! Bad
stinks This Stinks! Bad

Level 7

Shortcut Scene Category
chatRoomOnFire Chat Room On Fire Good
fail Fail! Bad
frogs FrogsInCars Good
marksick Mark is sick! Bad
mdkwhd Disclaimer - Mark doesn't know what he's doing! Disclaimer
noJack Disclaimer - Mark doesn't know Jack! Disclaimer
party DH.Party1 Good
party2 DH.Party2 Good
players Players System
rory Rory System

Level 10

Shortcut Scene Category
party3 DH.Party3 Good
ufo UFO Crash Good

Level 11

Shortcut Scene Category
sprinkles DH.Sprinkles Good

Level 12

Shortcut Scene Category
party4 DH.Party4 Good

Level 14

Shortcut Scene Category
party5 DH.Party5 Good

Level 15

Shortcut Scene Category
droneFail Drone Failure Bad
oops Oops! Sorry
sorry Sorry-ish Sorry
urWelcome you're welcome! Conversation

Level 16

Shortcut Scene Category
party6 DH.Party6 Good

Level 18

Shortcut Scene Category
party7 DH.Party7 Good

Level 20

Shortcut Scene Category
party8 DH.Party8 Good

Level 22

Shortcut Scene Category
party9 DH.Party9 Good

Level 24

Shortcut Scene Category
party10 DH.Party10 Good

Level 26

Shortcut Scene Category
party11 DH.Party11 Good

Level 30

Shortcut Scene Category
party12 DH.Party12 Good

mrannouncerbot's People

Contributors

bsimser avatar code-ru-sh avatar influencer avatar legendairymoo avatar millermark avatar rorybecker avatar surlydev avatar wilbennett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mrannouncerbot's Issues

Bug in Emitter

There is a bug on line 113 of Emitter.ts... should be calling super.preUpdate() not super.update()..... sorry :(

LINQ

Mark,

Here is an example of what I was mentioning yesterday (HandleQuestionCommand event handler):

List<string> accessibleScenes = scenes
   .Where(m => m.Level <= userLevel)
   .Select(m =>
    {
       if (m.ChatShortcut.IndexOf(' ') >= 0)
           return $"\"{m.ChatShortcut}\"";
       else
           return m.ChatShortcut;
    })
   .ToList();

I'm not a big fan of putting blocks of code in LINQ. I think it obscures the code. LINQ is supposed to make code simple, readable and maintainable.

Here's an alternate version:

List<string> accessibleScenes = scenes
   .Where(m => m.Level <= userLevel)
   .Select(m => m.ChatShortcut.IndexOf(' ') >= 0 ? $"\"{m.ChatShortcut}\"" : m.ChatShortcut)
   .ToList();

Of course, you cannot always use the ternary and readability is still not the best. To do a general purpose solution, pull the block out into a function:

string QuotedIfSpace(string text)
{
    return text.IndexOf(' ') >= 0
       ? $"\"{text}\""
       : text;
}

Now you can do:

List<string> accessibleScenes = scenes
   .Where(m => m.Level <= userLevel)
   .Select(m => QuotedIfSpace(m.ChatShortcut))
   .ToList();

Or:

List<string> accessibleScenes = scenes
   .Where(m => m.Level <= userLevel)
   .Select(m => m.ChatShortcut)
   .Select(QuotedIfSpace)
   .ToList();

Your LINQ is much cleaner and you now have a utility function that you will probably find uses for elsewhere. If not, you can always make it a nested function in the current method.

Personally, I think all LINQ code should be like this. Single line per function call when using many and simple checks or method calls per function. Makes it really easy to see the flow and to rearrange, add, remove, comment out individual pieces, etc...

You like?

Alternative image for day-night cycle

Hello there!
I watched the last stream and scribbled along the alternative non-licensed(aka free for use) version of the cog day-night cycle image. I saved it as a png but can reexport it into different layers or even make an svg-overhaul if needed. The picture is made in procreate and as such a psd is available too.
Should I create a pull request or is it ok as it is(it should be a transparent png, but i dunno if github actually messes with it)?
Best regards,
Oste

cogdaytime

IncludeIf

Mark,

Here is an example of what I was suggesting a few streams ago. To be clear, I'm not saying it's "better". Just the way I usually do it because "I" think it's easier to read and maintain. Let me know what you think.

Wil

Original:

static WeaponProperties GetWeaponProperties(WeaponDto weaponDto)
{
    WeaponProperties result = WeaponProperties.None;
    if (MathUtils.IsChecked(weaponDto.Ammo))
        result |= WeaponProperties.Ammunition;
    if (MathUtils.IsChecked(weaponDto.Finesse))
        result |= WeaponProperties.Finesse;
    if (MathUtils.IsChecked(weaponDto.Heavy))
        result |= WeaponProperties.Heavy;
    if (MathUtils.IsChecked(weaponDto.Light))
        result |= WeaponProperties.Light;
    if (MathUtils.IsChecked(weaponDto.Martial))
        result |= WeaponProperties.Martial;
    if (MathUtils.IsChecked(weaponDto.Melee))
        result |= WeaponProperties.Melee;
    if (MathUtils.IsChecked(weaponDto.Ranged))
        result |= WeaponProperties.Ranged;
    if (MathUtils.IsChecked(weaponDto.Reach))
        result |= WeaponProperties.Reach;
    if (MathUtils.IsChecked(weaponDto.Special))
        result |= WeaponProperties.Special;
    if (MathUtils.IsChecked(weaponDto.Thrown))
        result |= WeaponProperties.Thrown;
    if (MathUtils.IsChecked(weaponDto.TwoHanded))
        result |= WeaponProperties.TwoHanded;
    if (MathUtils.IsChecked(weaponDto.Versatile))
        result |= WeaponProperties.Versatile;

    return result;
}

Alternate:

static WeaponProperties GetWeaponProperties3(WeaponDto weaponDto)
{
    WeaponProperties result = WeaponProperties.None;
    IncludeIf(weaponDto.Ammo, WeaponProperties.Ammunition);
    IncludeIf(weaponDto.Finesse, WeaponProperties.Finesse);
    IncludeIf(weaponDto.Heavy, WeaponProperties.Heavy);
    IncludeIf(weaponDto.Light, WeaponProperties.Light);
    IncludeIf(weaponDto.Martial, WeaponProperties.Martial);
    IncludeIf(weaponDto.Melee, WeaponProperties.Melee);
    IncludeIf(weaponDto.Ranged, WeaponProperties.Ranged);
    IncludeIf(weaponDto.Reach, WeaponProperties.Reach);
    IncludeIf(weaponDto.Special, WeaponProperties.Special);
    IncludeIf(weaponDto.Thrown, WeaponProperties.Thrown);
    IncludeIf(weaponDto.TwoHanded, WeaponProperties.TwoHanded);
    IncludeIf(weaponDto.Versatile, WeaponProperties.Versatile);

    return result;

    void IncludeIf(string propertyValue, WeaponProperties value)
    {
        if (MathUtils.IsChecked(propertyValue)) result |= value;
    }
}

More Generic:

static WeaponProperties GetWeaponProperties(WeaponDto weaponDto)
{
    WeaponProperties result = WeaponProperties.None;
    IncludeIf(MathUtils.IsChecked(weaponDto.Ammo), WeaponProperties.Ammunition);
    IncludeIf(MathUtils.IsChecked(weaponDto.Finesse), WeaponProperties.Finesse);
    IncludeIf(MathUtils.IsChecked(weaponDto.Heavy), WeaponProperties.Heavy);
    IncludeIf(MathUtils.IsChecked(weaponDto.Light), WeaponProperties.Light);
    IncludeIf(MathUtils.IsChecked(weaponDto.Martial), WeaponProperties.Martial);
    IncludeIf(MathUtils.IsChecked(weaponDto.Melee), WeaponProperties.Melee);
    IncludeIf(MathUtils.IsChecked(weaponDto.Ranged), WeaponProperties.Ranged);
    IncludeIf(MathUtils.IsChecked(weaponDto.Reach), WeaponProperties.Reach);
    IncludeIf(MathUtils.IsChecked(weaponDto.Special), WeaponProperties.Special);
    IncludeIf(MathUtils.IsChecked(weaponDto.Thrown), WeaponProperties.Thrown);
    IncludeIf(MathUtils.IsChecked(weaponDto.TwoHanded), WeaponProperties.TwoHanded);
    IncludeIf(MathUtils.IsChecked(weaponDto.Versatile), WeaponProperties.Versatile);

    return result;

    void IncludeIf(bool cond, WeaponProperties value)
    {
        if (cond) result |= value;
    }
}

You could make the IncludeIf method global and generic as well. There would need to be a modification since you have to "change" the enum to a number to "or" it in a generic method. I don't think the global approach is worth the expense though (you have to box/unbox or something similar - like use IConvertible).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.