Created
November 5, 2012 07:55
-
-
Save passcod/4015901 to your computer and use it in GitHub Desktop.
Proposed library functions for xbot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Proposed by passcod @ Nov 07 2012 06:47:22 | |
self.attack = function(to) { | |
var user = to || Object.keys(bot.users)[Math.floor(Object.keys(bot.users).length * Math.random())]; | |
var attack = store.attacks[Math.floor(store.attacks.length * Math.random())]; | |
return attack.replace(/\{defender\}/g, user).replace(/\{attacker\}/g, bot.caller).replace(/{year}/g, Math.round(Math.random() * 10000) + (Math.random() * 100 < 35 ? "BC" : "")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Proposed by passcod @ Nov 07 2012 07:09:19 | |
self.fish = function(n) { | |
n = typeof n == 'undefined' ? 1 : n; | |
return (n < 0) ? "<>< ".repeat(n * -1) : "><> ".repeat(n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment