samuri51 / chillybot

a turntable bot created by a moderator of straight_chillin11
12 stars 12 forks source link

new bot rules #22

Closed JimmyRehberg closed 11 years ago

JimmyRehberg commented 11 years ago

from what i'm reading from the new faq the bot can only dj if there are already two dj's spinning...also the bot has to receive the awesome command from 3 separate users before it can awesome..can we get a fix for these changes?

samuri51 commented 11 years ago

as for the bot djing when 2 people on stage or more set whenToGetOnStage in the setup to 2 and whenToGetOffStage to something higher than 2 but less than or equal to 5 since 5 is max dj's and the bot counts as a dj

samuri51 commented 11 years ago

this is for bop command

add this part at the top of script where the other global variables are

var djAwesomeCounter = 0; //make this global
global.djCheckCounter = []; //used to make sure bot callers are unique

put this somewhere in the newsong event

djAwesomeCounter = 0; //reset counter each song
djCheckCounter = [];

put this inside of your bop command

//should be data.senderid if to be used in pm
//checks to see that user has not already used /bop this song
if(djCheckCounter.indexOf(data.userid) === -1)
{
    ++djAwesomeCounter; //bop command has been execute so add one 

    if(djAwesomeCounter >= 3) //if bop command is over 3 uses then bop
    {
        bot.bop(); //gets the bot to bop
       //any additional messages go here
    }

    djCheckCounter.unshift(data.userid); //put them in array so you can know that they already voted
}
else
{
    bot.speak('sorry ' + data.name + ', one /bop per person!'); //for chatbox
    bot.pm('sorry, one /bop per person!', data.userid); //for pm
}
JimmyRehberg commented 11 years ago

im a little confused on the last one...you said enter it in my bop command..need a little help here..:)

samuri51 commented 11 years ago

find your equivalent of the /awesome command, also read through my comments since i added some extra stuff in there

it replaces your /bop code, its not an addition to it, although if you have any sayings that you want they would go after the bot.bop() and the speaking part after the else{ } is what gets displayed when someone tries to use the command more than one time per song since you said all the command users had to be unique. it stops one person from typing /bop three times and fulfilling the three bops requirement

else if (text.match('/awesome'))
{
       //code goes here
}
JimmyRehberg commented 11 years ago

no luck for me tonight...may i send you my file and get you to look it over?

samuri51 commented 11 years ago

sure, cm.larosa@gmail.com

samuri51 commented 11 years ago

two questions though

  1. what do you want the bot to say when it finally bops
  2. what do you want the bot to say when someone tries to use the /bop command more than one time during a song, and do it want it to say it in the chat or pm it to them?
JimmyRehberg commented 11 years ago

it could say..my god...this is friggin ridiculous...when he finally bops...joking aside..i guess the bot needs to acknowledge each request...first /bop it could say thank you whomever (1st request) need two more..and so on...and on the third and final request it could say (I like this song too!! I hit the :thumbsup: button...I'm flexible..you can make it more cool I'm sure..i guess do all this in chat so everyone knows the count to an awesome..

JimmyRehberg commented 11 years ago

the file is to big for email...can we do team viewer?

samuri51 commented 11 years ago

yeah

samuri51 commented 11 years ago

i'm in ur turntable.fm room so we can talk faster

samuri51 commented 11 years ago

i got your message on turntable, yeah your right about the or less thing, i forgot.

if you look around line 682 this is what you need to replace the autodj code with

this will put the bot on stage if the number of dj's on stage is the same number or higher than what you specified, but less than the number your specified for it to get off stage minus one

example: whenToGetOnStage = 2 whenToGetOffStage = 5

the bot would get on stage when 2-3 dj's on stage, and since the bot counts as one dj there would now be 3-4 dj's on stage. and once a 5th person gets on, at the start of the next song the bot will get off stage. i made it current < (whenToGetOffStage - 1) instead of current < whenToGetOffStage because if there was 4 people on stage and the number to get off stage was 5 then the bot would constantly be getting on and off stage as that condition kept switching between being true and false

//puts bot on stage if there is one dj on stage, and removes them when there is 5 dj's on stage.
    current = data.room.metadata.djcount;
    var isBotDj = currentDjs.indexOf(USERID);
    if (current >= whenToGetOnStage && current < (whenToGetOffStage - 1) && queueList.length === 0)
    {
        if (getonstage === true && vipList.length === 0 && isBotDj === -1)
        {
            bot.addDj();
        }
    }
    else if (current >= whenToGetOffStage && getonstage === true && isBotDj !== -1)
    {
        bot.remDj();
    }
JimmyRehberg commented 11 years ago

and just saying to those that want a good bot....look no further...great bot and great guy that made it..:)