logo bannerlogo banner
Page Navigator

Constants are the core numbers and ways we can easily define information in a readable format. Instead of always calling the blue team 1, the value, we instead can call it Team.Blue!

You don't need to use constants, but if anything changes in shell, they will be updated and your "magic numbers" might not be. Constants are super easy to understand and improve code readability, so we highly recommend them.

Constant List

The names are exactly how you'd import them. If you see the name Team, you'd use:

import { Team } from 'yolkbot/constants';
  • ChallengeSubType: object - The different subtypes of challenges. Subtypes are a mess and I recommend you really don't use them. (read more)
    • Killstreak - a challenge that requires you to get a certain number of kills
    • KillWithWeapon - a challenge that requires you to get a certain number of kills with a specific weapon
    • MovementDistance - a challenge that requires you to move a certain distance
    • Jumping - a challenge that requires you to do something while jumping
    • TimePlayed - a challenge that requires you to play for a certain amount of time
    • TimeAlive - a challenge that requires you to stay alive for a certain amount of time
    • KillWithCondition - a challenge that requires you to get a kill with a specific condition (e.g. with one shot, a player with a 5+ streak, etc)
    • TotalKills - a challenge that requires you to get a certain number of kills in total
    • SpatulaKills - a challenge that requires you to get kill related to the spatula (this is a mess)
    • Collecting - a challenge that requires you to collect a certain number of ammo/grenades
    • FromTheCoop - a challenge that requires you to do something on the coop
    • SpecialOffensive - capture a coop, capture the spatula, or hold the spatula for time. a really bad name for a really bad category
    • WinKOTC - a challenge that requires you to win KoTC games
    • KillWithSpatula - a challenge that requires you to get a # of kills with the spatula (some of this is also in SpatulaKills because subtypes are a disaster)
  • ChallengeType: object - The different types of challenges read more
    • Kill - a kill based challenge
    • Damage - a damage based challenge
    • Movement - a movement based challenge
    • Collect - a ammo/grenade based challenge
    • Time - a time based challenge
    • KOTC - a King of the Coop based challenge
    • Spatula - a spatula based challenge
  • ChatFlag: object - The various "flags" that could be in a a chat message
    • None
    • Pinned - the message is pinned in chat
    • Team - the message is team-only
    • Mod - the message is from a moderator
    • Server - the message is from the server
  • ChiknWinnerDailyLimit: number - The number of times you can play Chikn winner before it "goes to sleep"
  • CollectType: object - The different items on the ground
    • Ammo - ammo packs
    • Grenade - grenades!
  • CoopState: object - The different stages of KoTC game
    • Start - the 'waiting for players' stage
    • Score - when a team has won a specific coop (one of the 5)
    • Win - when a team has won the round
    • Capturing - when one team is sitting on the coop
    • Contested - when both teams are fighting on the coop
    • Takeover - when a team is taking over the coop
    • Abandoned - when no one is on the coop, and a team has already started capturing it
    • Unclaimed - when no one has captured the current coop yet (right after one of the 5 rounds ends)
  • FirebaseKey: string - The firebase API key used to interact with game authorization
  • FramesBetweenSyncs: number - The number of times bot.update is called between server syncs
  • GameAction: object - The different actions executed by a host
    • Reset - when the game is reset by the host
    • Pause - when the game forces everyone to pause for various reasons
  • GameMode: object - The different game modes
    • FFA - Free for all
    • Teams - Teams
    • Spatula - Captula the Spatula
    • KOTC - King of the Coop
  • GameOptionFlag: object - The different checkboxes game hosts control
    • Locked - the game being locked
    • NoTeamChange - when the players cannot change teams
    • NoTeamShuffle - when the game doesn't shuffle teams after a KoTC round
  • GunEquipTime: number - The tick time it takes to equip a gun.
  • GunList: array<Gun> - An array of all the guns in the game, ordered by the selector menu.
  • IsBrowser: boolean - A quick and easy check for if the bot is running in the browser.
  • ItemType: object - The different types of items in the game (hat, stamp, melee, etc)
    • Hat - hats
    • Stamp - stamps
    • Primary - the primary gun
    • Secondary - the secondary gun
    • Grenade - grenades
    • Melee - melees
  • Movement: object - The different ways to move. Critical for MovementDispatch.
    • Forward - moving forward
    • Backward - moving backward
    • Left - moving left
    • Right - moving right
    • Jump - jumping
  • PlayType: object - The different ways to play a game
    • JoinPublic - joining a public game
    • CreatePrivate - creating a private game
    • JoinPrivate - joining a private game/entering a game code
  • ProxiesEnabled: boolean - If proxies are usable in the current environment
  • ShellStreak: object - The different streak rewards in the game
    • HardBoiled - the health shield
    • EggBreaker - the 2x damage
    • Restock - the onetime ammo refill
    • OverHeal - the green 2x ticking health buff
    • DoubleEggs - the 2x eggs buff
    • MiniEgg - the mini egg effect
  • SocialMedia: object - The different social media platforms CCs can have
    • Facebook
    • Instagram
    • Tiktok
    • Discord
    • Youtube
    • Twitter
    • Twitch
  • SocialReward: object - The rewards claimable for clicking BWD's social media links on the homepage
    • Discord
    • Tiktok
    • Instagram
    • Steam
    • Facebook
    • Twitter
    • Twitch
  • StateBufferSize: number - the max size of the statebuffer
  • Team: object - The two teams (blue/red)
    • Blue - the blue team
    • Red - the red team
  • URLRewards: array<string> - Rewards that are put at the end of a URL that users can claim.
  • UserAgent: string - The user agent used for connecting to WebSockets and sending requests

Some of these, like Movement, are very important for the movement dispatch. Others, like GameOptionFlag, are relatively obscure and will likely never be needed by you.