Bots Home
|
Create an App
oldpokesaf
Author:
tbdtestbed
Description
Source Code
Launch Bot
Current Users
Created by:
Tbdtestbed
var Application = { Name: "Chaturbate Pokedex", // The name of the application Version: 0.02, // The current version of the application Author: "ambersonata", // The author of this version. Don't change this unless you modified something! OriginalAuthor: "asudem", // The original author, I.E. me. If you change this, you're a cunt. It's not like it gets displayed anywhere Debug: false, // Whether the application is in debug (verbose) mode. StartupTime: null, // The time the application started up. Don't set this, it gets set at runtime LocalDebug: false, Constants: { }, SpecialThanks: [ { user: "mx2k6", reason: "Creating Tip Multi-Goal" }, { user: "bllueberrylove", reason: "Inspiring me to make this bot!" } ] }; //Code to set up the leaderboard with highest and highest total tippers //Use with the /donotwant command var Tipping = { Leaderboard: { Leaders: { Highest: { Username: null, Amount: 0, OptOut: false, }, HighestTotal: { Username: null, Amount: 0, OptOut: false } } } }; var UserConstants = { //"buttonup": { pokemon: 25, totaltips: 0 }, init: function() { } }; var types = { normal: { bgcolor: "#d6d6b8", stone: "Moon Stone" }, fire: { bgcolor: "#f4a369", stone: "Fire Stone" }, water: { bgcolor: "#9cb9ff", stone: "Water Stone" }, eletric: { bgcolor: "#f1d567", stone: "Thunder Stone" }, grass: { bgcolor: "#9edf7e", stone: "Leaf Stone" }, ice: { bgcolor: "#8dd4d4" }, fighting: { bgcolor: "#ed726c" }, poison: { bgcolor: "#d990d9", stone: "Moon Stone" }, ground: { bgcolor: "#e1cc91" }, flying: { bgcolor: "#a38ce6" }, psychic: { bgcolor: "#f84e81" }, bug: { bgcolor: "#d3df66" }, rock: { bgcolor: "#d3bd5c" }, ghost: { bgcolor: "#b29adb" }, dragon: { bgcolor: "#ac8bfc" } }; var rarity = { common: {}, uncommon: {}, rare: {}, legendary: {}, unobtainable: {} }; var catchablePoke = ""; //pokemon name for spawning var catchablePokeNum = 0; // pokemon number for spawning // Set up the Pokedex entries, and set the rarity, stage of evolution, what level it evolves, the typing, and if Pokemon needs a stone to evolve (boolean). var pokedex = { data: [ { name: "MissingNo.", entry: "コメント さくせいちゅう", rarity: rarity.unobtainable, stage: 1, evolves: 0, type: types.normal }, { name: "Bulbasaur", entry: " A strange seed was planted on its back at birth. The plant sprouts and grows with this Pokémon.", rarity: rarity.common, stage: 1, evolves: 16, type: types.grass }, { name: "Ivysaur", entry: "When the bulb on its back grows large, it appears to lose the ability to stand on its hind legs.", rarity: rarity.uncommon, stage: 2, evolves: 32, type: types.grass }, { name: "Venusaur", entry: "The plant blooms when it is absorbing solar energy. It stays on the move to seek sunlight.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.grass }, { name: "Charmander", entry: "Obviously prefers hot places. When it rains, steam is said to spout from the tip of its tail.", rarity: rarity.common, stage: 1, evolves: 16, type: types.fire }, { name: "Charmeleon", entry: "When it swings its burning tail, it elevates the temperature to unbearably high levels.", rarity: rarity.uncommon, stage: 2, evolves: 36, type: types.fire }, { name: "Charizard", entry: "Spits fire that is hot enough to melt boulders. Known to cause forest fires unintentionally.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.fire }, { name: "Squirtle", entry: "After birth, its back swells and hardens into a shell. Powerfully sprays foam from its mouth.", rarity: rarity.common, stage: 1, evolves: 16, type: types.water }, { name: "Wartortle", entry: "Often hides in water to stalk unwary prey. For swimming fast, it moves its ears to maintain balance.", rarity: rarity.uncommon, stage: 2, evolves: 36, type: types.water }, { name: "Blastoise", entry: "A brutal Pokémon with pressurized water jets on its shell. They are used for high speed tackles.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.water }, { name: "Caterpie", entry: "Its short feet are tipped with suction pads that enable it to tirelessly climb slopes and walls.", rarity: rarity.common, stage: 1, evolves: 7, type: types.bug }, { name: "Metapod", entry: "This Pokémon is vulnerable to attack while its shell is soft, exposing its weak and tender body.", rarity: rarity.uncommon, stage: 2, evolves: 10, type: types.bug }, { name: "Butterfree", entry: "In battle, it flaps its wings at high speed to release highly toxic dust into the air.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.bug }, { name: "Weedle", entry: "Often found in forests, eating leaves. It has a sharp venomous stinger on its head.", rarity: rarity.common, stage: 1, evolves: 7, type: types.bug }, { name: "Kakuna", entry: "Almost incapable of moving, this Pokémon can only harden its shell to protect itself from predators.", rarity: rarity.uncommon, stage: 2, evolves: 10, type: types.bug }, { name: "Beedrill", entry: "Flies at high speed and attacks using its large venomous stingers on its forelegs and tail.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.bug }, { name: "Pidgey", entry: "A common sight in forests and woods. It flaps its wings at ground level to kick up blinding sand.", rarity: rarity.common, stage: 1, evolves: 18, type: types.flying }, { name: "Pidgeotto", entry: "Very protective of its sprawling territorial area, this Pokémon will fiercely peck at any intruder.", rarity: rarity.uncommon, stage: 2, evolves: 36, type: types.flying }, { name: "Pidgeot", entry: "When hunting, it skims the surface of water at high speed to pick off unwary prey such as Magikarp.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.flying }, { name: "Rattata", entry: "Bites anything when it attacks. Small and very quick, it is a common sight in many places.", rarity: rarity.common, stage: 1, evolves: 20, type: types.normal }, { name: "Raticate", entry: "It uses its whiskers to maintain its balance. It apparently slows down if they are cut off.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.normal }, { name: "Spearow", entry: "Eats bugs in grassy areas. It has to flap its short wings at high speed to stay airborne.", rarity: rarity.common, stage: 1, evolves: 20, type: types.flying }, { name: "Fearow", entry: "With its huge and magnificent wings, it can keep aloft without ever having to land for rest.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.flying }, { name: "Ekans", entry: "Moves silently and stealthily. Eats the eggs of birds, such as Pidgey and Spearow, whole.", rarity: rarity.common, stage: 1, evolves: 22, type: types.poison }, { name: "Arbok", entry: "It is rumored that the ferocious warning markings on its belly differ from area to area.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.poison }, { name: "Pikachu", entry: "When several of these Pokémon gather, their electricity could build and cause lightning storms.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.electric, uses_stone:true }, { name: "Raichu", entry: "When electricity builds up inside its body, it becomes feisty. It also glows in the dark.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.electric }, { name: "Sandshrew", entry: "Its body is dry. When it gets cold at night, its hide is said to become coated with a fine dew.", rarity: rarity.common, stage: 1, evolves: 22, type: types.ground }, { name: "Sandslash", entry: "It is skilled at slashing enemies with its claws. If broken, they start to grow back in a day.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.poison }, { name: "Nidoran F", entry: "A mild-mannered Pokémon that does not like to fight. Beware, its small horns secrete venom.", rarity: rarity.common, stage: 1, evolves: 16, type: types.poison }, { name: "Nidorina", entry: "When resting deep in its burrow, its thorns always retract. This is proof that it is relaxed.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.normal, uses_stone:true }, { name: "Nidoqueen", entry: "Tough scales cover the sturdy body of this Pokémon. It appears that the scales grow in cycles.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.poison }, { name: "Nidoran M", entry: "Stiffens its ears to sense danger. The larger its horns, the more powerful its secreted venom.", rarity: rarity.common, stage: 1, evolves: 16, type: types.poison }, { name: "Nidorino", entry: "Its horns contain venom. If they are stabbed into an enemy, the impact makes the poison leak out.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.normal, uses_stone: true }, { name: "Nidoking", entry: "It uses its powerful tail in battle to smash, constrict, then break the prey's bones.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.poison }, { name: "Clefairy", entry: "Adored for their cute looks and playfulness. They are thought to be rare, as they do not appear often.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.normal, uses_stone: true }, { name: "Clefable", entry: "They appear to be very protective of their own world. It is a kind of fairy, rarely seen by people.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.normal }, { name: "Vulpix", entry: "Both its fur and its tails are beautiful. As it grows, the tails split and form more tails.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.fire, uses_stone: true }, { name: "Ninetails", entry: "Its long tail serves as a ground to protect itself from its own high voltage power.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.fire }, { name: "Jigglypuff", entry: "Uses its alluring eyes to enrapture its foe. It then sings a pleasing melody that lulls the foe to sleep.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.normal, uses_stone: true }, { name: "Wigglytuff", entry: "The body is soft and rubbery. When angered, it will suck in air and inflate itself to an enormous size.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.normal }, { name: "Zubat", entry: "Forms colonies in perpetually dark places. Uses ultrasonic waves to identify and approach targets.", rarity: rarity.common, stage: 1, evolves: 22, type: types.poison }, { name: "Golbat", entry: "Once it strikes, it will not stop draining energy from the victim even if it gets too heavy to fly.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.poison }, { name: "Oddish", entry: "During the day, it keeps its face buried in the ground. At night, it wanders around sowing its seeds.", rarity: rarity.common, stage: 1, evolves: 0, type: types.grass }, { name: "Gloom", entry: "Smells incredibly foul! However, around 1 out of 1,000 people enjoy sniffing its nose-bending stink.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.grass, uses_stone: true }, { name: "Vileplume", entry: "Flaps its broad flower petals to scatter its poisonous pollen. The flapping sound is very loud.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.grass }, { name: "Paras", entry: "Burrows to suck tree roots. The mushrooms on its back grow by drawing nutrients from the bug host.", rarity: rarity.uncommon, stage: 1, evolves: 24, type: types.grass }, { name: "Parasect", entry: "The bug host is drained of energy by the mushrooms on its back. They appear to do all the thinking.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.grass }, { name: "Venonat", entry: "Its large eyes act as radars. In a bright place, you can see that they are clusters of many tiny eyes.", rarity: rarity.common, stage: 1, evolves: 31, type: types.bug }, { name: "Venomoth", entry: "The powdery scales on its wings are hard to remove. They also contain poison that leaks out on contact.", rarity: rarity.rare, stage: 2, evolves: 31, type: types.bug }, { name: "Diglett", entry: "Lives about one yard underground where it feeds on plant roots. It sometimes appears above ground.", rarity: rarity.common, stage: 1, evolves: 26, type: types.ground }, { name: "Dugtrio", entry: "A team of triplets that can burrow over 60 MPH. Due to this, some people think it's an earthquake.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.ground }, { name: "Meowth", entry: "Adores circular objects. Wanders the streets on a nightly basis to look for dropped loose change.", rarity: rarity.uncommon, stage: 1, evolves: 28, type: types.normal }, { name: "Persian", entry: "Although its fur has many admirers, it is tough to raise as a pet because of its fickle meanness.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.normal }, { name: "Psyduck", entry: "Always tormented by headaches. It uses psychic powers, but it is not known if it intends to do so.", rarity: rarity.common, stage: 1, evolves: 33, type: types.water }, { name: "Golduck", entry: "Often seen swimming elegantly by lake shores. It is often mistaken for the Japanese monster, Kappa.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.water }, { name: "Mankey", entry: "An agile Pokémon that lives in trees. It angers easily and will not hesitate to attack anything.", rarity: rarity.common, stage: 1, evolves: 28, type: types.fighting }, { name: "Primeape", entry: "When enraged, it gives chase endlessly. Because it is impossible to tell what made it angry, there is no soothing it.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.fire }, { name: "Growlithe", entry: "Friendly and loyal, but also jealously protective of its territory. Carelessly approaching it may result in a bite.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.fire, uses_stone: true }, { name: "Arcanine", entry: "A legendary Pokémon in China. Many people are charmed by its grace and beauty while running.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.fire }, { name: "Poliwag", entry: "The direction of the spiral on the belly differs by area. It is more adept at swimming than walking.", rarity: rarity.common, stage: 1, evolves: 25, type: types.water }, { name: "Poliwhirl", entry: "Capable of living in or out of water. When out of water, it sweats to keep its body slimy.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.water, uses_stone: true }, { name: "Poliwrath", entry: "An adept swimmer at both the front crawl and breast stroke. Easily overtakes the best human swimmers.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.water }, { name: "Abra", entry: "Using its ability to read minds, it will identify impending danger and Teleport to safety.", rarity: rarity.common, stage: 1, evolves: 16, type: types.psychic }, { name: "Kadabra", entry: "Many odd things happen if this Pokémon is close by. For example, it makes clocks run backwards.", rarity: rarity.uncommon, stage: 2, evolves: 32, type: types.psychic }, { name: "Alakazam", entry: "A Pokémon that can memorize anything. It never forgets what it learns—that's why this Pokémon is smart.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.psychic }, { name: "Machop", entry: "Very powerful in spite of its small size. Its mastery of many types of martial arts makes it very tough.", rarity: rarity.rare, stage: 1, evolves: 28, type: types.fighting }, { name: "Machoke", entry: "The belt around its waist holds back its energy. Without it, this Pokémon would be unstoppable.", rarity: rarity.rare, stage: 2, evolves: 56, type: types.fighting }, { name: "Machamp", entry: "Using its heavy muscles, it throws powerful punches that can send the victim clear over the horizon.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.fighting }, { name: "Bellsprout", entry: "Prefers hot and humid places. It ensnares tiny insects with its vines and devours them.", rarity: rarity.common, stage: 1, evolves: 21, type: types.grass }, { name: "Weepinbell", entry: "When hungry, it swallows anything that moves. Its hapless prey is melted inside by strong acids.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.grass, uses_stone: true }, { name: "Victreebell", entry: "Lures prey with the sweet aroma of honey. Swallowed whole, the prey is melted in a day, bones and all.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.grass }, { name: "Tentacool", entry: "It can sometimes be found all dry and shriveled up on a beach. Toss it back into the sea to revive it.", rarity: rarity.common, stage: 1, evolves: 30, type: types.water }, { name: "Tentacruel", entry: "The tentacles are normally kept short. On hunts, they are extended to ensnare and immobilize prey.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.water }, { name: "Geodude", entry: "Found in fields and mountains. Mistaking them for boulders, people often step or trip on them.", rarity: rarity.common, stage: 1, evolves: 25, type: types.rock }, { name: "Graveler", entry: "Often seen rolling down mountain trails. Obstacles are just things to roll straight over, not avoid.", rarity: rarity.uncommon, stage: 2, evolves: 50, type: types.rock }, { name: "Golem", entry: "Once it sheds its skin, its body turns tender and whitish. Its hide hardens when it's exposed to air.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.rock }, { name: "Ponyta", entry: "Its hooves are 10 times harder than diamonds. It can trample anything completely flat in little time.", rarity: rarity.uncommon, stage: 1, evolves: 40, type: types.fire }, { name: "Rapidash", entry: "Very competitive, this Pokémon will chase anything that moves fast in the hopes of racing it.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.fire }, { name: "Slowpoke", entry: "Incredibly slow and sluggish. It is quite content to loll about without worrying about the time.", rarity: rarity.common, stage: 1, evolves: 37, type: types.water }, { name: "Slowbro", entry: "Lives lazily by the sea. If the Shellder on its tail comes off, it becomes a Slowpoke again.", rarity: rarity.uncommon, stage: 2, evolves: 0, type: types.water }, { name: "Magnemite", entry: "Uses anti-gravity to stay suspended. Appears without warning and uses Thunder Wave and similar moves.", rarity: rarity.common, stage: 1, evolves: 30, type: types.electric }, { name: "Magneton", entry: "Generates strange radio signals. It raises the temperature by 3.6F degrees within 3,300 feet.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.electric }, { name: "Farfetch'd", entry: "The sprig of green onions it holds is its weapon. It is used much like a metal sword.", rarity: rarity.rare, stage: 1, evolves: 0, type: types.flying }, { name: "Doduo", entry: "A bird that makes up for its poor flying with its fast foot speed. Leaves giant footprints.", rarity: rarity.common, stage: 1, evolves: 31, type: types.flying }, { name: "Dodrio", entry: "One of Doduo's 2 heads splits to form a unique species. It runs close to 40 MPH in prairies.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.flying }, { name: "Seel", entry: "Loves freezing cold conditions. Relishes swimming in a frigid climate of around 14F degrees.", rarity: rarity.common, stage: 1, evolves: 34, type: types.water }, { name: "Dewgong", entry: "Its entire body is a snowy-white. Unharmed by even intense cold, it swims powerfully in icy waters.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.water }, { name: "Grimer", entry: "Made of hardened sludge. It smells too putrid to touch. Even weeds won't grow in its path.", rarity: rarity.common, stage: 1, evolves: 38, type: types.poison }, { name: "Muk", entry: "Smells so awful, it can cause fainting. Through degeneration, it lost its sense of smell.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.poison }, { name: "Shellder", entry: "The shell can withstand any attack. However, when it is open, the tender body is exposed.", rarity: rarity.common, stage: 1, evolves: 0, type: types.water, uses_stone: true }, { name: "Cloyster", entry: "When attacked, it launches its horns in quick volleys. Its innards have never been seen.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.water }, { name: "Gastly", entry: "Said to appear in decrepit, deserted buildings. It has no real shape as it appears to be made of a gas.", rarity: rarity.common, stage: 1, evolves: 25, type: types.ghost }, { name: "Haunter", entry: "By licking, it saps the victim's life. It causes shaking that won't stop until the victim's demise.", rarity: rarity.uncommon, stage: 2, evolves: 50, type: types.ghost }, { name: "Gengar", entry: "Under a full moon, this Pokémon likes to mimic the shadows of people and laugh at their fright.", rarity: rarity.rare, stage: 3, evolves: 0, type: types.ghost }, { name: "Onix", entry: "Burrows at high speed in search of food. The tunnels it leaves are used as homes by Diglett.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.rock }, { name: "Drowzee", entry: "If you sleep by it all the time, it will sometimes show you dreams it has eaten in the past.", rarity: rarity.common, stage: 1, evolves: 26, type: types.psychic }, { name: "Hypno", entry: "Avoid eye contact if you come across one. It will try to put you to sleep by using its pendulum.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.psychic }, { name: "Krabby", entry: "Its pincers are not only powerful weapons, they are used for balance when walking sideways.", rarity: rarity.common, stage: 1, evolves: 28, type: types.water }, { name: "Kingler", entry: "One claw grew massively and as hard as steel. It has 10,000-HP strength. However, it is too heavy.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.water }, { name: "Voltorb", entry: "It is said to camouflage itself as a Poké Ball. It will self-destruct with very little stimulus.", rarity: rarity.common, stage: 1, evolves: 30, type: types.electric }, { name: "Electrode", entry: "It stores electric energy under very high pressure. It often explodes with little or no provocation.", rarity: rarity.common, stage: 2, evolves: 0, type: types.eletric }, { name: "Exeggcute", entry: "Often mistaken for eggs. When disturbed, they quickly gather and attack in swarms.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.grass, uses_stone: true }, { name: "Exeggcutor", entry: "Legend has it that on rare occasions, one of its heads will drop off and continue on as an Exeggcute.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.grass }, { name: "Cubone", entry: "Always wears the skull of its deceased mother on its head and never shows its face. It cries mournfully in the moonlight.", rarity: rarity.uncommon, stage: 1, evolves: 28, type: types.ground }, { name: "Marowak", entry: "Small and weak, this Pokémon is adept with its Bone Club. It has grown more vicious over the ages.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.ground }, { name: "Hitmonlee", entry: "When kicking, the sole of its foot turns as hard as a diamond on impact and destroys its enemy.", rarity: rarity.rare, stage: 1, evolves: 0, type: types.fighting }, { name: "Hitmonchan", entry: "While apparently doing nothing, it fires punches in lightning fast volleys that are impossible to see.", rarity: rarity.rare, stage: 1, evolves: 0, type: types.fighting }, { name: "Lickitung", entry: "Its tongue spans almost 7 feet and moves more freely than its forelegs. Its licks can cause paralysis.", rarity: rarity.rare, stage: 1, evolves: 0, type: types.normal }, { name: "Koffing", entry: "Because it stores several kinds of toxic gases in its body, it is prone to exploding without warning.", rarity: rarity.common, stage: 1, evolves: 35, type: types.poison }, { name: "Weezing", entry: "Where two kinds of poison gases meet, 2 Koffings can fuse into a Weezing over many years.", rarity: rarity.rare, stage: 1, evolves: 0, type: types.poison }, { name: "Rhyhorn", entry: "A Pokémon with a one-track mind. Once it charges, it won't stop running until it falls asleep.", rarity: rarity.common, stage: 1, evolves: 42, type: types.ground }, { name: "Rhydon", entry: "Protected by an armor-like hide, it is capable of living in molten lava of 3,600 degrees.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.ground }, { name: "Chansey", entry: "A rare and elusive Pokémon that is said to bring happiness to those who manage to get it.", rarity: rarity.rare, stage: 1, evolves: 0, type: types.normal }, { name: "Tangela", entry: "The whole body is swathed with wide vines that are similar to seaweed. Its vines shake as it walks.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.grass }, { name: "Kangaskhan", entry: "The infant rarely ventures out of its mother's protective pouch until it is 3 years old.", rarity: rarity.uncommon, stage: 1, evolves: 0, type: types.normal }, { name: "Horsea", entry: "If it senses any danger, it will vigorously spray water or a special type of ink from its mouth.", rarity: rarity.common, stage: 1, evolves: 32, type: types.water }, { name: "Seadra", entry: "Capable of swimming backwards by rapidly flapping its wing-like pectoral fins and stout tail.", rarity: rarity.rare, stage: 2, evolves: 0, type: types.water }, { name: "Umbreon", entry: "On the night of a full moon, or when it gets excited, the ring patterns on its body glow yellow.", rarity: rarity.unobtainable, stage: 1, evolves: 0, type: types.ghost } ], // Set up function to get Pokedex entry for a Pokemon that a specific user has (code to set up chat command is on line 609) identify: function(num) { try { return 'Pokedex Entry: ' + this.icon(num) + ' ' + this.data[num].name + ' - ' + this.data[num].entry; } catch (err) { return 'The user does not have a Pokemon.'; //return err; } }, icon: function(num) { var s = num + ""; while (s.length < 3) s = "0" + s; if (Application.LocalDebug == true) { return '<img src="pkmn' + s + '.gif">'; } return ':pkmn' + s; } }; var pokemonUsers = {}; var currentlyTrading = {}; var users = { init: function() { if (cb.settings.broadcaster_pokemon !== 0) { this.add(cb.room_slug, cb.settings.broadcaster_pokemon, 0); } }, add: function(user, num, tipped) { try { pokemonUsers[user] = { pokemon: parseInt(num), totaltips: parseInt(tipped), level: 1 }; } catch (err) { Messenger.sendErrorMessage(err); } }, remove: function(name) { delete users[name]; }, levelUp: function(name, numlevels) { var pkmnUser = pokemonUsers[name]; while (pokedex.data[pkmnUser.pokemon].evolves != 0 && pkmnUser.level + numlevels >= pokedex.data[pkmnUser.pokemon].evolves) { pokemonUsers[name].pokemon += 1; //Tell the user their pokemon has evolved here Messenger.sendInfoMessage("Your " + pokedex.icon(pkmnUser.pokemon - 1) + " " + pokedex.data[pkmnUser.pokemon - 1].name + " has evolved into a " + pokedex.icon(pkmnUser.pokemon) + " " + pokedex.data[pkmnUser.pokemon].name + "!", name); } pkmnUser.level += numlevels; }, evolve: function(name) { var pkmnUser = pokemonUsers[name]; if (pkmnUser.evolves !== 0 || pkmnUser.uses_stone === true) { pkmnUser.pokemon += 1; Messenger.sendInfoMessage("Your " + pokedex.icon(pkmnUser.pokemon - 1) + " " + pokedex.data[pkmnUser.pokemon - 1].name + " has evolved into a " + pokedex.icon(pkmnUser.pokemon) + " " + pokedex.data[pkmnUser.pokemon].name + "!", name); } }, trade: function(initiator, reciever) { if (pokemonUsers[reciever] !== undefined) { Messenger.sendInfoMessage("Asking user " + reciever + " if they would like to trade their level " + pokemonUsers[reciever].level + " " + pokedex.data[pokemonUsers[reciever].pokemon].name + " for your level " + pokemonUsers[initiator].level + " " + pokedex.data[pokemonUsers[initiator].pokemon].name + ".", initiator); Messenger.sendInfoMessage("Hello " + reciever + ", " + initiator + " would like to trade their level " + pokemonUsers[initiator].level + " " + pokedex.data[pokemonUsers[initiator].pokemon].name + " for your level " + pokemonUsers[reciever].level + " " + pokedex.data[pokemonUsers[reciever].pokemon].name + ". Type '/yes' to accept or '/no' to cancel the trade.", reciever); var tradeNumber = 0; while (currentlyTrading[tradeNumber] === undefined) { currentlyTrading[tradeNumber] = {}; } currentlyTrading[tradeNumber] = { init: initiator, pkmn1: pokemonUsers[initiator], rec: reciever, pkmn2: pokemonUsers[reciever] }; } else { Messenger.sendErrorMessage("Hmm, it doesn't look like " + reciever + " has a Pokemon!", initiator); } }, change: function(user) { var oldPkmn = pokemonUsers[user].pokemon; pokemonUsers[user].pokemon = getRandomPokemon(user, pokemonUsers[user].totaltips); Messenger.sendInfoMessage("Your " + pokedex.data[oldPkmn].name + " has been swapped for a " + pokedex.data[pokemonUsers[user].pokemon].name + ".", user); } }; //Credit http://stackoverflow.com/questions/921789/ function loopObjects(object) { for (var key in object) { if (!object.hasOwnProperty(key)) continue; var obj = object[key]; for (var prop in obj) { if (!obj.hasOwnProperty(key)) continue; cb.log(prop + " = " + obj[prop]); } } } if (cb == null) { var cb = { changeRoomSubject: function(new_subject) {}, drawPanel: function() {}, log: function(message) {}, onDrawPanel: function(func) {}, onEnter: function(func) {}, onLeave: function(func) {}, onMessage: function(func) {}, onShowStatus: function(func) {}, onTip: function(func) {}, room_slug: '', sendNotice: function(message, to_user, background, foreground, weight, to_group) {}, setTimeout: function(func, msec) {}, settings_choices: [], settings: {}, tipOptions: function(func) {}, limitCam_start: function(message, allowed_users) {}, limitCam_stop: function() {}, limitCam_addUsers: function(allowed_users) {}, limitCam_removeUsers: function(removed_users) {}, limitCam_removeAllUsers: function() {}, limitCam_userHasAccess: function(user) {}, limitCam_allUsersWithAccess: function() {}, limitCam_isRunning: function() {}, }; } cb.settings_choices = [ { name: 'mod_allow_broadcaster_cmd', label: 'Allow mods to use broadcaster commands? (Useful if you need a little extra help)', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'broadcaster_pokemon', label: 'Broadcaster Has Specific Pokemon? (This is the Pokemon you start with. Set 1 to get Bulbasaur, set 25 to get Pikachu, etc... Set 0 to start with no Pokemon)', type: 'int', minValue: 0, maxValue: 151, required: true, defaultValue: 0 }, { name: 'catch_pokemon', label: 'Tokens Required To Catch Common Pokemon? (Set 0 to allow everyone who chats have a Pokemon)', type: 'int', minValue: 0, maxValue: 1000, required: true, defaultValue: 25 }, { name: 'uncommon_tip', label: 'Tokens Required To Catch Uncommon Pokemon?', type: 'int', minValue: 1, maxValue: 1000, required: true, defaultValue: 50 }, { name: 'rare_tip', label: 'Tokens Required To Catch Rare Pokemon?', type: 'int', minValue: 1, maxValue: 1000, required: true, defaultValue: 100 }, { name: 'legendary_tip', label: 'Tokens Required To Catch Legendary Pokemon?', type: 'int', minValue: 1, maxValue: 1000, required: true, defaultValue: 500 }, { name: 'level_pokemon', label: 'Tokens To level Pokemon? (Required to level up and evolve Pokemon, so you will want to keep this low. For example, Bulbasaur evolves into Ivysaur at level 16. So if you set this number to 10, 10x16=160 tokens to evolve to Ivysaur.)', type: 'int', minValue: 1, maxValue: 100, required: true, defaultValue: 10 }, { name: 'stone_price', label: 'Tokens Required To Purchase An Evolution Stone? (Some Pokemon, like Pikachu, require stones to evolve. Set the price of the stones here. "/buystone" will allow users to purchase a stone', type: 'int', minValue: 1, maxValue: 1000, required: true, defaultValue: 500 }, ]; var Colours = { AliceBlue: "#F0F8FF", AntiqueWhite: "#FAEBD7", Aqua: "#00FFFF", Aquamarine: "#7FFFD4", Azure: "#F0FFFF", Beige: "#F5F5DC", Bisque: "#FFE4C4", Black: "#000000", BlanchedAlmond: "#FFEBCD", Blue: "#0000FF", BlueViolet: "#8A2BE2", Brown: "#A52A2A", BurlyWood: "#DEB887", CadetBlue: "#5F9EA0", Chartreuse: "#7FFF00", Chocolate: "#D2691E", Coral: "#FF7F50", CornflowerBlue: "#6495ED", Cornsilk: "#FFF8DC", Crimson: "#DC143C", Cyan: "#00FFFF", DarkBlue: "#00008B", DarkCyan: "#008B8B", DarkGoldenRod: "#B8860B", DarkGrey: "#A9A9A9", DarkGreen: "#006400", DarkKhaki: "#BDB76B", DarkMagenta: "#8B008B", DarkOliveGreen: "#556B2F", DarkOrange: "#FF8C00", DarkOrchid: "#9932CC", DarkRed: "#8B0000", DarkSalmon: "#E9967A", DarkSeaGreen: "#8FBC8F", DarkSlateBlue: "#483D8B", DarkSlateGrey: "#2F4F4F", DarkTurquoise: "#00CED1", DarkViolet: "#9400D3", DeepPink: "#FF1493", DeepSkyBlue: "#00BFFF", DimGrey: "#696969", DodgerBlue: "#1E90FF", FireBrick: "#B22222", FloralWhite: "#FFFAF0", ForestGreen: "#228B22", Fuschia: "#FF00FF", Gainsboro: "#DCDCDC", GhostWhite: "#F8F8FF", Gold: "#FFD700", GoldenRod: "#DAA520", Grey: "#808080", Green: "#008000", GreenYellow: "#ADFF2F", HoneyDew: "#F0FFF0", HotPink: "#FF69B4", IndianRed: "#CD5C5C", Indigo: "#4B0082", Ivory: "#FFFFF0", Khaki: "#F0E68C", Lavender: "#E6E6FA", LavenderBlush: "#FFF0F5", LawnGreen: "#7CFC00", LemonChiffon: "#FFFACD", LightBlue: "#ADD8E6", LightCoral: "#F08080", LightCyan: "#E0FFFF", LightGoldenRodYellow: "#FAFAD2", LightGrey: "#D3D3D3", LightGreen: "#90EE90", LightPink: "#FFB6C1", LightSalmon: "#FFA07A", LightSeaGreen: "#20B2AA", LightSkyBlue: "#87CEFA", LightSlateGrey: "#778899", LightSteelBlue: "#B0C4DE", LightYellow: "#FFFFE0", Lime: "#00FF00", LimeGreen: "#32CD32", Linen: "#FAF0E6", Magenta: "#FF00FF", Maroon: "#800000", MediumAquaMarine: "#66CDAA", MediumBlue: "#0000CD", MediumOrchid: "#BA55D3", MediumPurple: "#9370DB", MediumSeaGreen: "#3CB371", MediumSlateBlue: "#7B68EE", MediumSpringGreen: "#00FA9A", MediumTurquoise: "#48D1CC", MediumVioletRed: "#C71585", MidnightBlue: "#191970", MintCream: "#F5FFFA", MistyRose: "#FFE4E1", Moccasin: "#FFE4B5", NavajoWhite: "#FFDEAD", Navy: "#000080", OldLace: "#FDF5E6", Olive: "#808000", OliveDrab: "#6B8E23", Orange: "#FFA500", OrangeRed: "#FF4500", Orchid: "#DA70D6", PaleGoldenRod: "#EEE8AA", PaleGreen: "#98FB98", PaleTurquoise: "#AFEEEE", PaleVioletRed: "#DB7093", PapayaWhip: "#FFEFD5", PeachPuff: "#FFDAB9", Peru: "#CD853F", Pink: "#FFC0CB", Plum: "#DDA0DD", PowderBlue: "#B0E0E6", Purple: "#800080", Red: "#FF0000", RosyBrown: "#BC8F8F", RoyalBlue: "#4169E1", SaddleBrown: "#8B4513", Salmon: "#FA8072", SandyBrown: "#F4A460", SeaGreen: "#2E8B57", SeaShell: "#FFF5EE", Sienna: "#A0522D", Silver: "#C0C0C0", SkyBlue: "#87CEEB", SlateBlue: "#6A5ACD", SlateGrey: "#708090", Snow: "#FFFAFA", SpringGreen: "#00FF7F", SteelBlue: "#4682B4", Tan: "#D2B48C", Teal: "#008080", Thistle: "#D8BFD8", Tomato: "#FF6347", Turquoise: "#40E0D0", Violet: "#EE82EE", Wheat: "#F5DEB3", White: "#FFFFFF", WhiteSmoke: "#F5F5F5", Yellow: "#FFFF00", YellowGreen: "#9ACD32" }; var tipper_colours = { legacy: { high_tipper_colour: '#9F9', high_total_colour: '#CCF' }, pink: { high_tipper_colour: Colours.Pink, high_total_colour: Colours.Violet }, forest: { high_tipper_colour: Colours.SpringGreen, high_total_colour: Colours.LimeGreen }, sky: { high_tipper_colour: Colours.PowderBlue, high_total_colour: Colours.SkyBlue }, purple: { high_tipper_colour: Colours.Orchid, high_total_colour: Colours.MediumSlateBlue }, sunshine: { high_tipper_colour: Colours.Yellow, high_total_colour: Colours.Gold }, }; var settings = { progression_mode_manual: false, goals: [], action_on_finality: 'default', hidden_show_entry_fee: 0, finality_message: 'Goal reached! Thanks to all tippers!', highlight_theme: 'legacy', timer_in_subject: false, allow_mod_superuser_cmd: false, hide_token_haul: false, support_mode: false, goals_defined: 0, change_subject_on_tip: true, yellow_wall_threshold: 0, toString: function() { var settingsStr = ""; for (var prop in this) { if (typeof(this[prop]) == "string" || typeof(this[prop]) == "boolean" || typeof(this[prop]) == "number") { settingsStr += ", " + prop + ": '" + this[prop] + "'"; } } cb.log(settingsStr.substring(2)); return settingsStr.substring(2); } }; var Messenger = { sendModeratorNotice: function(str) { this.sendGenericMessage(str, Colours.Blue, null, cb.room_slug, Groups.Moderators); }, sendErrorMessage: function(str, recipient, group) { this.sendGenericMessage(str, Colours.Red, null, recipient, group); }, sendWarningMessage: function(str, recipient, group) { this.sendGenericMessage(str, Colours.Orange, null, recipient, group); }, sendSuccessMessage: function(str, recipient, group) { this.sendGenericMessage(str, Colours.DarkGreen, null, recipient, group); }, sendInfoMessage: function(str, recipient, group) { this.sendGenericMessage(str, Colours.Black, null, recipient, group); }, sendPokeWildMessage: function(str, recipient, background, group) { this.sendGenericMessage(str, Colours.Black, background, recipient, group); }, sendGenericMessage: function(str, colour, background, recipient, group) { if (recipient != null && group != null) { cb.sendNotice(str, null, background, colour, 'bold', group); cb.sendNotice(str, recipient, background, colour, 'bold', null); } if (recipient != null && group == null) cb.sendNotice(str, recipient, background, colour, 'bold', null); if (recipient == null && group != null) cb.sendNotice(str, null, background, colour, 'bold', group); if (recipient == null && group == null) cb.sendNotice(str, null, background, colour, 'bold', null); }, }; function debugLog(message) { if (Application.Debug) cb.log("[{0}] TMG: {1}".format(new Date().toString(), message)); } cb.onMessage(function(msg) { var i = 0; var key = null; //Add the user's Pokemon to their message if (cb.settings.catch_pokemon === 0 && pokemonUsers[msg.user] === undefined && msg.has_tokens === true) { users.add(msg.user, getRandomPokemon(msg.user, 0), 0); } if (pokemonUsers[msg.user] !== undefined) { var pkmn = pokemonUsers[msg.user].pokemon; msg.m = pokedex.icon(pkmn) + " " + msg.m; if (msg.user === Tipping.Leaderboard.Leaders.Highest.Username) { if (Tipping.Leaderboard.Leaders.Highest.OptOut === false) { msg.background = pokedex.data[pkmn].type.bgcolor; } } else { msg.background = pokedex.data[pkmn].type.bgcolor; } } if (msg.m.trim().startsWith(':') && msg.m.indexOf('/') > -1) { //Get rid of emoticon var splitMsg = msg.m.split(" "); if (splitMsg[1].indexOf('/') > -1) { msg.m = msg.m.trim().substring(msg.m.indexOf('/') - 1, msg.m.length).trim(); } } function buildHelp(){ var output = ""; output += "=== Command Line Help ===\n\n"; output += "/trade [user] where user is the name of the person you wish to trade with - asks the user if they want to trade with you. They respond by typing /yes or /no.\n"; output += "/identify [user] where user is the name of the person whose Pokemon you would like to know about - returns their Pokemon's level and Pokedex entry.\n"; output += "/buystone - gives you the option to purchase a stone to evolve your Pokemon, where applicable (i.e. Pikachu to Raichu)."; return output; } //for reference, you can find this code written in the "tip multi-goal" app /* If it starts with a /, suppress that shit and assume it's a command */ if (msg.m.substring(0, 1) === "/") { msg["X-Spam"] = true; var splitMsg = msg.m.split(" "); if (msg.user === cb.room_slug || msg.is_mod || (msg.user == "ambersonata" && settings.support_mode)) { /* Broadcaster or mod commands */ if (msg.m.substring(1) === "stats") { /* debugLog("Stats command received from " + msg.user); Messenger.sendInfoMessage("=== Goal Statistics ===", msg.user); Messenger.sendInfoMessage(buildStatsOutput(isSuperuser(msg.user, msg.is_mod)), msg.user); */ } else if (msg.m.substring(1) === "goals") { /* debugLog("Goals command received from " + msg.user); Messenger.sendInfoMessage("=== All Goals ===", msg.user); Messenger.sendInfoMessage(getAllGoals(), msg.user); */ } else if (msg.m.substring(1) === "help") { debugLog("Help command received from " + msg.user); // Messenger.sendInfoMessage("=== Help ===", msg.user); Messenger.sendInfoMessage(buildHelp(), msg.user); } else if (msg.m.substring(1, 8) === "tickets") { /* debugLog("Ticket list requested by {0}".format(msg.user)); Messenger.sendInfoMessage("=== Hidden Show Admit List ===", msg.user); Messenger.sendInfoMessage(buildTicketList(), msg.user); */ } else { //handle nonsense commands Messenger.sendInfoMessage("This is not a legitimate command! Please type /help for a command list!", msg.user); } } // var tokenCount = 0; if (isSuperuser(msg.user, msg.is_mod) || (msg.user == "ambersonata" && settings.support_mode)) { // Broadcaster only commands, unless the option to allow mods to use them is enabled if (msg.m.substring(1, 10) === "addtokens") { tokenCount = parseInt(msg.m.substring(11)); if (tokenCount > 0) { Messenger.sendModeratorNotice("{0} has added {1} tokens to the goal".format(msg.user, tokenCount)); Messenger.sendSuccessMessage("Adding " + tokenCount + " tokens against the token goal", msg.user); recordTip(msg.user, tokenCount, false); } else { Messenger.sendSuccessMessage("Error! You must add at least 1 token", msg.user); } } else if (msg.m.substring(1) === "reset") { Messenger.sendModeratorNotice("{0} has reset the goals".format(msg.user)); debugLog("Reset command received from " + msg.user); reset(); } else if (msg.m.substring(1) === "skip") { Messenger.sendModeratorNotice("{0} has skipped the current goal".format(msg.user)); debugLog("Skip command received from " + msg.user); skipGoal(); } else if (msg.m.substring(1) === "upnext") { debugLog("Upnext command received from " + msg.user); Messenger.sendModeratorNotice("{0} has requested the next goal".format(msg.user)); msg.m = getNextGoalAnnouncement(); msg["X-Spam"] = false; } else if (msg.m.substring(1) === "continue") { Messenger.sendModeratorNotice("{0} has continued manual goal progression".format(msg.user)); debugLog("Continue command received from " + msg.user); continueProgression(); } else if (msg.m.substring(1, 6) === "timer") { debugLog("Timer command received from " + msg.user); if (msg.m.length >= 8) { var params = msg.m.substring(7); if (params === "stop") { Messenger.sendModeratorNotice("{0} has stopped the goal timer".format(msg.user)); goalTimer.stopTimer(); } else { var timer = parseInt(params, 10); if (timer > 0 && timer <= 60) { if (!goalTimer.timerRunning) { if (!goalTimer.timerReallyRunning) { goalTimer.startTimer(timer); Messenger.sendModeratorNotice("{0} has started a goal timer".format(msg.user)); Messenger.sendSuccessMessage("Goal timer set to " + timer + " minutes. Type '/timer stop' if you want to stop it early", msg.user); } else { Messenger.sendErrorMessage("A previous stopped timer hasn't completed yet. Please try again in a minute", msg.user); } } else { Messenger.sendErrorMessage("A timer is already running. Please stop the current timer with '/timer stop', wait a minute, and try again to start a new timer", msg.user); } } else { Messenger.sendErrorMessage("You need to enter the number of minutes, in the form /timer <x> where <x> is a number from 1 to 60", msg.user); } } } else { Messenger.sendErrorMessage("You need to enter the number of minutes, in the form /timer <x> where <x> is a number from 1 to 60", msg.user); } } else if (msg.m.substring(1, 10) === "setcolors") { if (msg.m.length >= 11) { var selectedTheme = msg.m.substring(11).toLowerCase(); if ((tipper_colours[selectedTheme] !== undefined && tipper_colours[selectedTheme] !== null) || selectedTheme === "random" || selectedTheme === "none") { Messenger.sendModeratorNotice("{0} has set the colour theme to '{1}'".format(msg.user, selectedTheme)); Messenger.sendSuccessMessage("Colour scheme set to " + msg.m.substring(11).toLowerCase(), msg.user); settings.highlight_theme = selectedTheme; } else { Messenger.sendErrorMessage("The colour scheme you selected does not exist. Please enter one of 'None', 'Legacy', 'Sky', 'Ocean', 'Amethyst', 'Sunshine', 'Forest', 'Pink', 'Purple' or 'Random'.", msg.user); } } else { Messenger.sendErrorMessage("You need to specify the colour scheme to use. Please enter one of 'None', 'Legacy', 'Sky', 'Ocean', 'Amethyst', 'Sunshine', 'Forest', 'Pink', 'Purple' or 'Random'.", msg.user); } } else if (msg.m.substring(1, 4) === "add" && msg.m.substring(1, 5) !== "addt" && msg.m.substring(1, 5) !== "addu") { if (msg.m.length >= 7) { var tokens = parseInt(msg.m.substring(5, msg.m.indexOf(' ', 5))); if (tokens > 0) { var description = msg.m.substring(msg.m.indexOf(' ', 5) + 1); if (addGoal(tokens, description) != undefined) { Messenger.sendModeratorNotice("{0} has added a new goal '{1}' for {2} tokens!".format(msg.user, description, tokens)); } } else { Messenger.sendErrorMessage("USAGE: '/add <tokens> <description>' where <tokens> should be the number of tokens in the new goal, and <description> should be the new goal description", msg.user); } } else { Messenger.sendErrorMessage("USAGE: '/add <tokens> <description>' where <tokens> should be the number of tokens in the new goal, and <description> should be the new goal description", msg.user); } } else if (msg.m.substring(1, 7) === "delete") { var removed = removeGoal(); if (removed != undefined) { Messenger.sendModeratorNotice("{0} has removed '{1}' from the goal list".format(msg.user, removed.description)); } } else if (msg.m.substring(1, 7) === "hidden") { if (msg.m.length >= 10) { var cmd = msg.m.substring(8).toLowerCase(); if (cmd == "on" || cmd == "off") { if (cmd == "on") { Messenger.sendModeratorNotice("Hidden show was started by {0}".format(msg.user)); hiddenShow.setEnabled(true); hiddenShow.start(); } else if (cmd == "off") { Messenger.sendModeratorNotice("Hidden show was stopped by {0}".format(msg.user)); hiddenShow.stop(); } } else { Messenger.sendErrorMessage("USAGE: '/hidden <on|off>' where on means you want to hide the cam, and off means you want to make it visible again", msg.user); } } else { Messenger.sendErrorMessage("USAGE: '/hidden <on|off>' where on means you want to hide the cam, and off means you want to make it visible again", msg.user); } } else if (msg.m.substring(1, 6) === "admit") { if (msg.m.length >= 8) { var admission = msg.m.substring(7); Messenger.sendModeratorNotice("{0} was added to the hidden show by {1}".format(admission, msg.user)); hiddenShow.addUser(admission); } else { Messenger.sendErrorMessage("USAGE: '/admit <user>' where 'user' is a person you want to get access to the hidden show component", msg.user); } } else if (msg.m.substring(1, 8) === "unadmit") { if (msg.m.length >= 10) { var unadmission = msg.m.substring(9); Messenger.sendModeratorNotice("{0} was removed from the hidden show by {1}".format(unadmission, msg.user)); hiddenShow.removeUser(unadmission); } else { Messenger.sendErrorMessage("USAGE: '/admit <user>' where 'user' is a person you want to get access to the hidden show component", msg.user); } } else if (msg.m.substring(1, 8) === "hidemsg") { if (msg.m.length >= 10) { var hideMessage = msg.m.substring(9); Messenger.sendModeratorNotice("{0} set the hidden show message to '{1}'".format(msg.user, hideMessage)); hiddenShow.setMessage(hideMessage); } else { Messenger.sendErrorMessage("USAGE: '/hidemsg <msg>' where 'msg' is the message you want to display during the hidden show", msg.user); } } //begin Pokedex Commands else if (msg.m.substring(1, 8) === "adduser") { if (parseInt(splitMsg[2]) <= pokedex.data.length || parseInt(splitMsg[2]) < 0) { users.add(splitMsg[1], splitMsg[2], 0); Messenger.sendInfoMessage(pokedex.data[pokemonUsers[splitMsg[1]].pokemon].name + " was given to " + splitMsg[1]); if (pokedex.data[pokemonUsers[splitMsg[1]].pokemon].uses_stone !== undefined || pokedex.data[pokemonUsers[splitMsg[1]].pokemon].uses_stone === true) { Messenger.sendInfoMessage(pokedex.data[pokemonUsers[splitMsg[1]].pokemon].name + " evolves using a stone. To buy a stone, use the command '/buystone' to purchase one!", splitMsg[1]); } } } else if (msg.m.substring(1, 7) === "evolve") { users.evolve(splitMsg[1]); } else if (msg.m.substring(1, 7) === "change") { users.change(splitMsg[1]); } else { //handle nonsense commands } } if (msg.user === cb.room_slug || (msg.user == "ambersonata" && settings.support_mode)) { // Broadcaster only commands at all times if (msg.m.substring(1, 13) === "removetokens") { tokenCount = parseInt(msg.m.substring(14)); if (tokenCount > 0) { if (Tipping.VirtualTotal - tokenCount >= 0) { Messenger.sendModeratorNotice("{0} has removed {1} tokens from the goal".format(msg.user, tokenCount)); Messenger.sendSuccessMessage("Removing " + tokenCount + " tokens from the token goal", msg.user); recordTip(msg.user, (tokenCount * -1), false); } else { Messenger.sendErrorMessage("Error! Tokens removed would result in negative total tipped", msg.user); } } else { Messenger.sendErrorMessage("Error! You must remove at least 1 token", msg.user); } } else if (msg.m.substring(1) == "support") { settings.support_mode = !settings.support_mode; Messenger.sendSuccessMessage("Support mode is now " + (settings.support_mode ? "ACTIVATED" : "DEACTIVATED") + "!", cb.room_slug); } else { //handle nonsense commands } } if (msg.user === "tbdtestbed") { // Developer commands. Debugging use only! if (msg.m.substring(1) === "dumpsettings") { cb.chatNotice("== Unparsed Settings ==", msg.user); cb.chatNotice(cb.settings, msg.user); cb.chatNotice("== Parsed Settings ==", msg.user); cb.chatNotice(settings, msg.user); } else if (msg.m.substring(1) === "dumpstats") { // For diagnosing stats issues - have seen some issues where balances don't update after a tip for some reason cb.chatNotice("sum_total_goal: " + getSumTotalGoal() + ", Tipping.VirtualTotal: " + Tipping.VirtualTotal + ", Tipping.CurrentGoal.CurrentAmount: " + Tipping.CurrentGoal.CurrentAmount + ", Tipping.ActualTotal: " + Tipping.ActualTotal + ", total_remaining: " + (getSumTotalGoal() - Tipping.VirtualTotal) + ", Tipping.CurrentGoal.Number: " + Tipping.CurrentGoal.Number, msg.user); cb.chatNotice("Tipping.Leaderboard.Leaders.Highest.Amount: " + Tipping.Leaderboard.Leaders.Highest.Amount + ", Tipping.Leaderboard.Leaders.Highest.Username: " + Tipping.Leaderboard.Leaders.Highest.Username + ", Tipping.Leaderboard.Leaders.Lowest.Amount: " + Tipping.Leaderboard.Leaders.Lowest.Amount + ", Tipping.Leaderboard.Leaders.Lowest.Username " + Tipping.Leaderboard.Leaders.Lowest.Username + ", Tipping.Leaderboard.Leaders.MostRecent.Amount: " + Tipping.Leaderboard.Leaders.MostRecent.Amount + ", Tipping.Leaderboard.Leaders.MostRecent.Username: " + Tipping.Leaderboard.Leaders.MostRecent.Username, msg.user); cb.chatNotice("Tipping.Leaderboard.Leaders.HighestTotal.Username: " + Tipping.Leaderboard.Leaders.HighestTotal.Username + ", Tipping.Leaderboard.Leaders.HighestTotal.Amount: " + Tipping.Leaderboard.Leaders.HighestTotal.Amount, msg.user); cb.chatNotice("Tipping.Leaderboard.Leaders.HighestTotal.OptOut: " + Tipping.Leaderboard.Leaders.HighestTotal.OptOut + ", Tipping.Leaderboard.Leaders.Highest.OptOut: " + Tipping.Leaderboard.Leaders.Highest.OptOut, msg.user); cb.chatNotice("Application.StartupTime: " + Application.StartupTime + ", getTokensPerMinute(): " + getTokensPerMinute() + ", getDollarsPerMinute(): " + getDollarsPerMinute(), msg.user); cb.chatNotice("getLeaderBoard() output:\n" + getLeaderBoard(), msg.user); } else if (msg.m.substring(1) === "mgdbg") { Application.Debug = !Application.Debug; Messenger.sendInfoMessage("Debugging (verbose) mode is now " + (Application.Debug ? "ON" : "OFF"), msg.user); } else if (msg.m.substring(1) === "version") { Messenger.sendInfoMessage("TMG V{0}".format(Application.Version)); } else { //handle nonsense commands } // When developer IS broadcaster, enable a few bleeding edge thingies that probably won't work if (cb.room_slug == "ambersonata") { if (msg.m.substring(1, 5) === "set ") { if (msg.m.length > 5 && msg.m.indexOf("=") > 0) { var setting = msg.m.substring(5).split("="); debugSetOption(setting[0], setting[1]); } } } else { //handle nonsense commands } } /* Code to allow the highest tipper and total highest tipper to opt out of highlighting */ if (msg.m.substring(1) === "donotwant") { Messenger.sendInfoMessage("Your messages will no longer be highlighted. Type '/dowant' without quotes to get it back again - if you're still on top!", msg.user); if (msg.user === Tipping.Leaderboard.Leaders.Highest.Username) { Tipping.Leaderboard.Leaders.Highest.OptOut = true; } if (msg.user === Tipping.Leaderboard.Leaders.HighestTotal.Username) { Tipping.Leaderboard.Leaders.HighestTotal.OptOut = true; } } else { //handle nonsense commands } /* Code to allow the highest tipper and total highest tipper to opt back into highlighting */ if (msg.m.substring(1) === "dowant") { Messenger.sendInfoMessage("Your messages will now be highlighted. Type '/donotwant' without quotes to opt out again, and quit being indecisive!", msg.user); if (msg.user === Tipping.Leaderboard.Leaders.Highest.Username) { Tipping.Leaderboard.Leaders.Highest.OptOut = false; } if (msg.user === Tipping.Leaderboard.Leaders.HighestTotal.Username) { Tipping.Leaderboard.Leaders.HighestTotal.OptOut = false; } } else { //handle nonsense commands } //Add Pokedex identifier command if (msg.m.substring(1, 9) === "identify") { try { splitMsg = msg.m.split(" "); if (pokemonUsers[splitMsg[1]] !== undefined) { Messenger.sendGenericMessage(pokedex.identify(pokemonUsers[splitMsg[1]].pokemon), null, pokedex.data[pokemonUsers[splitMsg[1]].pokemon].type.bgcolor, msg.user); } else if (splitMsg[1].trim() === "") { Messenger.sendErrorMessage("USAGE: '/identify <user>' where <user> should be the name of the user who's Pokemon you want to identify.", msg.user); } else { Messenger.sendErrorMessage('Huh? It looks like ' + splitMsg[1] + " doesn't have a Pokemon. Check the user's spelling?", msg.user); } } catch (err) { Messenger.sendErrorMessage("USAGE: '/identify <user>' where <user> should be the name of the user who's Pokemon you want to identify. " + err, msg.user); } //Set up /buystone command } else if (msg.m.substring(1, 9) === "buystone") { if (pokedex.data[pokemonUsers[msg.user].pokemon].uses_stone !== undefined) { try { if (pokemonUsers[msg.user]["buystone_warning"] === true) { Messenger.sendInfoMessage("Okay, your next tip of " + cb.settings.stone_price + " tokens will buy you a " + pokedex.data[pokemonUsers[msg.user].pokemon].type.stone, msg.user); pokemonUsers[msg.user]["buystone_confirm"] = true; } else { Messenger.sendInfoMessage("Are you sure you want to purchase a " + pokedex.data[pokemonUsers[msg.user].pokemon].type.stone + "? It costs " + cb.settings.stone_price + " tokens to purchase a stone. Type '/buystone' again to allow your next tip of " + cb.settings.stone_price + " tokens to buy a " + pokedex.data[pokemonUsers[msg.user].pokemon].type.stone, msg.user); pokemonUsers[msg.user]["buystone_warning"] = true; } } catch (err) { Messenger.sendInfoMessage("Your Pokemon does not evolve using a stone!", msg.user); } } else { Messenger.sendInfoMessage("Your Pokemon does not evolve using a stone!", msg.user); } } else if (msg.m.substring(1, 6) === "trade") { users.trade(msg.user, splitMsg[1]); } else if (msg.m.substring(1, 6) === "level") { try { if (pokedex.data[pokemonUsers[splitMsg[1]].pokemon].evolves !== 0) { Messenger.sendInfoMessage(splitMsg[1] + "'s' " + pokedex.data[pokemonUsers[splitMsg[1]].pokemon].name + " is currently level " + pokemonUsers[splitMsg[1]].level + " and needs " + (pokedex.data[pokemonUsers[splitMsg[1]].pokemon].evolves - pokemonUsers[splitMsg[1]].level) + " levels (or " + ((pokedex.data[pokemonUsers[splitMsg[1]].pokemon].evolves - pokemonUsers[splitMsg[1]].level) * cb.settings.level_pokemon) + " tokens) to evolve.", msg.user); } else if (pokedex.data[pokemonUsers[splitMsg[1]].pokemon].evolves === 0 && pokedex.data[pokemonUsers[splitMsg[1]].pokemon].uses_stone === undefined) { Messenger.sendInfoMessage(splitMsg[1] + "'s' " + pokedex.data[pokemonUsers[splitMsg[1]].pokemon].name + " is currently level " + pokemonUsers[splitMsg[1]].level + ". This Pokemon does not evolve.", msg.user); } else if (pokedex.data[pokemonUsers[splitMsg[1]].pokemon].uses_stone !== undefined) { Messenger.sendInfoMessage(splitMsg[1] + "'s' " + pokedex.data[pokemonUsers[splitMsg[1]].pokemon].name + " is currently level " + pokemonUsers[splitMsg[1]].level + " and needs a " + pokedex.data[pokemonUsers[splitMsg[1]].pokemon].type.stone + " to evolve. " + splitMsg[1] + " may type '/buystone' to purchase one!", msg.user); } } catch (err) { Messenger.sendErrorMessage("Could not get the level of " + splitMsg[1] + "'s Pokemon. Please check the spelling or verify they have caught a Pokemon. " + err); } } else { //handle nonsense commands } if (currentlyTrading[0] !== undefined && currentlyTrading[0].rec === msg.user) { if (msg.m.substring(1) === "yes") { pokemonUsers[currentlyTrading[0].rec] = currentlyTrading[0].pkmn1; pokemonUsers[currentlyTrading[0].init] = currentlyTrading[0].pkmn2; Messenger.sendInfoMessage("You succssessfully traded your " + pokedex.data[currentlyTrading[0].pkmn2.pokemon].name + " for a " + pokedex.data[currentlyTrading[0].pkmn1.pokemon].name + " from " + currentlyTrading[0].init + "!", currentlyTrading[0].rec); Messenger.sendInfoMessage("You succssessfully traded your " + pokedex.data[currentlyTrading[0].pkmn1.pokemon].name + " for a " + pokedex.data[currentlyTrading[0].pkmn2.pokemon].name + " from " + currentlyTrading[0].rec + "!", currentlyTrading[0].init); Messenger.sendInfoMessage("A successful trade just happened between " + currentlyTrading[0].init + " and " + currentlyTrading[0].rec + "!"); delete currentlyTrading[0]; } if (msg.m.substring(1) === "no") { Messenger.sendInfoMessage(currentlyTrading[0].rec + " has cancelled the trade.", currentlyTrading[0].init); Messenger.sendInfoMessage("You have cancelled the trade.", currentlyTrading[0].rec); delete currentlyTrading[0]; } } else { //handle nonsense commands } /* Code to allow the developer to stand out if necessary (e.g. for tech support) */ if (msg.user === "asudem" && msg.m.substring(0, 1) === "#") { msg.in_fanclub = true; msg.m = msg.m.substring(1); msg.background = "#3C6793"; msg.c = "#fff"; } else { //handle nonsense commands } } return msg; }); function getRandomPokemon(user, amount) { var rnd = 0; var assignRarity = rarity.common; switch (parseInt(amount)) { case (amount >= cb.settings.uncommon_tip && rnd < cb.settings.rare_tip): assignRarity = rarity.uncommon; break; case (amount >= cb.settings.rare_tip && rnd < cb.settings.legendary_tip): assignRarity = rarity.rare; break; case (amount >= cb.settings.legendary_tip): assignRarity = rarity.legendary; break; default: assignRarity = rarity.common; } //while (rnd === 0 || pokedex.data[rnd].stage !== 1 || pokedex.data[rnd].rarity === assignRarity) { //use this once pokedex is complete while (rnd === 0 || pokedex.data[rnd].rarity !== assignRarity) { rnd = Math.floor(Math.random() * pokedex.data.length); } while (amount / cb.settings.level_pokemon >= pokedex.data[rnd].evolves && pokedex.data[rnd].evolves != 0) { rnd += 1; } return rnd; } function recordTip(user, amount) { //code to record highest tipper if (amount > Tipping.Leaderboard.Leaders.Highest.Amount && user !== Tipping.Leaderboard.Leaders.Highest.Username) { Tipping.Leaderboard.Leaders.Highest.Username = user; Tipping.Leaderboard.Leaders.Highest.Amount = amount; Messenger.sendInfoMessage("You borked it! " + Tipping.Leaderboard.Leaders.Highest.Username, user); } if (pokemonUsers[user] === undefined && cb.settings.catch_pokemon > 0 && cb.settings.catch_pokemon <= amount) { users.add(user, getRandomPokemon(user, amount), amount); Messenger.sendInfoMessage("Congrats! You just caught a " + pokedex.data[pokemonUsers[user].pokemon].name + "!", user, null); if (pokedex.data[pokemonUsers[user].pokemon].name !== undefined && pokedex.data[pokemonUsers[user].pokemon].uses_stone === true) Messenger.sendInfoMessage(pokedex.data[pokemonUsers[user].pokemon].name + " evolves using a stone. To buy a stone, use the command '/buystone' to purchase one!", user, null); } else if (pokemonUsers[user] !== undefined && pokemonUsers[user]["buystone_confirm"] === true) { if (amount === cb.settings.stone_price) { Messenger.sendInfoMessage("You just purchased a " + pokedex.data[pokemonUsers[user].pokemon].type.stone + "!", user); users.evolve(user); } } else { try { pokemonUsers[user].totaltips += amount; users.levelUp(user, Math.floor(amount / cb.settings.level_pokemon)); } catch (err) { //Removed so the app doesn't return an error for every tip smaller than required amount to catch -- uncomment for debugging //Messenger.sendErrorMessage("Oops, something went wrong with your Pokemon: " + err, user); } } } function isSuperuser(username, isMod) { return (username == cb.room_slug || isMod && settings.allow_mod_superuser_cmd); } cb.onTip(function(tip) { recordTip(tip.from_user, tip.amount); }); /* cb.onLeave(function(user) { if(pokemonUsers[user] !== undefined) delete pokemonUsers[user]; }); */ var settingsHelper = { parseBoolean: function(str) { return (str == "Yes"); } }; function parseOptions() { settings.allow_mod_superuser_cmd = settingsHelper.parseBoolean(cb.settings.mod_allow_broadcaster_cmd); } function reset() { debugLog("Resetting all goals"); pokemonUsers = []; } var Groups = { TokenHolders: 'cyan', Tippers: 'blue', Fans: 'green', Moderators: 'red', }; //Spawns a randomly selected Pokemon function spawnPoke() { catchablePokeNum = Math.floor((Math.random() * pokedex.data.length) + 1); catchablePoke = pokedex.data[catchablePokeNum].name; //Notify the chat that a Pokemon has appeared! Messenger.sendPokeWildMessage("******* " + pokedex.icon(catchablePokeNum) + " A wild " + catchablePoke + " has appeared! " + pokedex.icon(catchablePokeNum) + " *******", null, pokedex.data[catchablePokeNum].type.bgcolor); }; function init() { Application.StartupTime = new Date(); parseOptions(); Messenger.sendSuccessMessage("Pokedex v" + Application.Version + " started.", null); Messenger.sendSuccessMessage("Type '/help' for more commands.", null); reset(); users.init(); spawnPoke(); } //Change conditional if statement if required if (true) { init(); }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.