Skip to content

Instantly share code, notes, and snippets.

@omicr0n
Forked from kjmehta01/CamsSounds.js
Created January 20, 2016 06:33
Show Gist options
  • Save omicr0n/5f207ccafc05c4b17613 to your computer and use it in GitHub Desktop.
Save omicr0n/5f207ccafc05c4b17613 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Cam's Sounds (OmicroN modified)
// @namespace http://tagpro.gg/
// @version 1.0
// @include http://tagpro-*.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @description Change the sounds of tagpro to Cam's sound pack.
// @author RonSpawnson, Cyanide, Seconskin, Cam, Acid Rap
// @reference https://www.reddit.com/r/TagPro/wiki/api
// ==/UserScript==
var customSounds = {
'drop': 'https://a.clyp.it/u4xkn4nz.mp3',
'friendlydrop': 'https://a.clyp.it/bmheasoj.mp3',
'cheering': 'https://a.clyp.it/tzf3isu4.mp3',
'sigh': 'https://a.clyp.it/l4cnwevl.mp3',
'burst': 'https://a.clyp.it/oxx1egzh.mp3',
'friendlyalert': 'https://a.clyp.it/flx4jjdf.mp3',
'alert': 'https://a.clyp.it/bi542q4c.mp3',
'pop': 'https://a.clyp.it/r45ia2oc.mp3',
'click': 'https://a.clyp.it/nlswdgoj.mp3',
'explosion': 'https://a.clyp.it/51sasefj.mp3',
'countdown': 'https://a.clyp.it/rs02xwd2.mp3',
'alertlong': 'https://a.clyp.it/dvpcs1ku.mp3',
'go': 'https://a.clyp.it/r2y3yrhs.mp3',
'degreeup': 'https://a.clyp.it/g5b0sdro.mp3',
'teleport': 'https://a.clyp.it/sghlyxz0.mp3',
'powerup': 'https://a.clyp.it/mo1ms21v.mp3'
};
tagpro.ready(function () {
for (var snd in customSounds) {
if (customSounds.hasOwnProperty(snd)) {
// Remove all audio sources for sound except the first
$('audio#' + snd).find('source:gt(0)').remove();
// Replace the first audio source with the new sound
$('audio#' + snd).find('source').attr('src', customSounds[snd]);
// Reload the sound with the new source
$('audio#' + snd)[0].load();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment