Changes to pity system
This commit is contained in:
parent
93c7d21123
commit
0269913a93
10
bot.js
10
bot.js
|
|
@ -236,6 +236,11 @@ function onMessageHandler (channel, userstate, message, self) {
|
|||
|
||||
counter.total++;
|
||||
|
||||
if (pityTracker[channel])
|
||||
pityTracker[channel]++;
|
||||
else
|
||||
pityTracker[channel] = 1;
|
||||
|
||||
// random chance
|
||||
// TODO: find a better alternative
|
||||
var number = Math.random() * 100;
|
||||
|
|
@ -276,11 +281,6 @@ function onMessageHandler (channel, userstate, message, self) {
|
|||
});
|
||||
|
||||
client.say(channel, newMessage.trim());
|
||||
} else {
|
||||
if (pityTracker[channel])
|
||||
pityTracker[channel]++;
|
||||
else
|
||||
pityTracker[channel] = 1;
|
||||
}
|
||||
|
||||
console.log(channel + ": " + JSON.stringify(counter));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user