mirror of
https://github.com/reality/dbot.git
synced 2024-11-23 20:39:25 +01:00
getajob and youare use valMatch and chanceIn
This commit is contained in:
parent
908e957db1
commit
3291586d18
@ -3,8 +3,7 @@ var getAJob = function(dbot) {
|
||||
|
||||
return {
|
||||
'listener': function(data) {
|
||||
var num = Math.floor(Math.random()*101);
|
||||
if(num == 50) {
|
||||
if(Number.prototype.chanceIn(1, 50)) {
|
||||
dbot.say(data.channel, data.user + ': Get a job!');
|
||||
}
|
||||
},
|
||||
|
@ -3,10 +3,10 @@ var youAre = function(dbot) {
|
||||
|
||||
return {
|
||||
'listener': function(data) {
|
||||
var key = data.message.match(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/);
|
||||
var key = data.message.valMatch(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/, 5);
|
||||
|
||||
if(key && Number.prototype.chanceIn(1, 3)) {
|
||||
dbot.say(data.channel, data.user + ': You\'re ' + key[2]);
|
||||
if(key && key[2] != "" && Number.prototype.chanceIn(1, 3)) {
|
||||
dbot.say(data.channel, data.user + ': You\'re ' + key[2] + '.');
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user