samuri51 / chillybot

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

Want to change q commands. #20

Closed btburbank closed 11 years ago

btburbank commented 11 years ago

I'm trying to simplify the q commands a bit. I changed the q commands to /q+ and /q- the bot will not respond to /q+ of those changes. What did I miss?

mnafricano commented 11 years ago

I can't tell you unless you upload your code, sorry. Once you upload your code I can, though.

btburbank commented 11 years ago

Ok, I'll post the code I'm trying to modify.

On Tue, Apr 30, 2013 at 8:04 PM, Marcello Africano <notifications@github.com

wrote:

I can't tell you unless you upload your code, sorry. Once you upload your code I can, though.

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17261853 .

mnafricano commented 11 years ago

Okay, sounds good.

btburbank commented 11 years ago

else if (text.match(/^\/q+$/) && queue === true) { var list3 = queueList.indexOf(data.name); var list10 = currentDjs.indexOf(data.userid) var checkStageList = stageList.indexOf(data.userid); var checkManualStageList = bannedFromStage.indexOf(data.userid); if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1) { queueList.push(data.name, data.userid); queueName.push(data.name); var temp91 = 'The queue is now: '; for (var hj = 0; hj < queueName.length; hj++) { if (hj != (queueName.length - 1)) { temp91 += queueName[hj] + ', '; } else if (hj == (queueName.length - 1)) { temp91 += queueName[hj]; } } bot.speak(temp91); } }

btburbank commented 11 years ago

It's not making any sense to me. I get a pm saying that I need to be in the q to use /q-. But, using /q+ does nothing.

mnafricano commented 11 years ago

Hold on, I'm reading your code, give me a second...

mnafricano commented 11 years ago

Okay, replace this:

else if (text.match(/^\/addme$/) && queue === true)
    {
    var list3 = queueList.indexOf(data.name);
    var list10 = currentDjs.indexOf(data.userid)
    var checkStageList = stageList.indexOf(data.userid);
    var checkManualStageList = bannedFromStage.indexOf(data.userid);
    if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1)
    {
        queueList.push(data.name, data.userid);
        queueName.push(data.name);
        var temp91 = 'The queue is now: ';
        for (var hj = 0; hj < queueName.length; hj++)
        {
            if (hj != (queueName.length - 1))
            {
                temp91 += queueName[hj] + ', ';
            }
            else if (hj == (queueName.length - 1))
            {
                temp91 += queueName[hj];
            }
        }
        bot.speak(temp91);
    }
}

with this:

else if (text.match(/^\/q+$/) && queue === true)
    {
    var list3 = queueList.indexOf(data.name);
    var list10 = currentDjs.indexOf(data.userid)
    var checkStageList = stageList.indexOf(data.userid);
    var checkManualStageList = bannedFromStage.indexOf(data.userid);
    if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1)
    {
        queueList.push(data.name, data.userid);
        queueName.push(data.name);
        var temp91 = 'The queue is now: ';
        for (var hj = 0; hj < queueName.length; hj++)
        {
            if (hj != (queueName.length - 1))
            {
                temp91 += queueName[hj] + ', ';
            }
            else if (hj == (queueName.length - 1))
            {
                temp91 += queueName[hj];
            }
        }
        bot.speak(temp91);
    }
}

If that doesn't work, tell me.

btburbank commented 11 years ago

Ok, thanks for the help, lemme test it out.

On Tue, Apr 30, 2013 at 8:17 PM, Marcello Africano <notifications@github.com

wrote:

Okay, replace this:

else if (text.match(/^\/addme$/) && queue === true) { var list3 = queueList.indexOf(data.name); var list10 = currentDjs.indexOf(data.userid) var checkStageList = stageList.indexOf(data.userid); var checkManualStageList = bannedFromStage.indexOf(data.userid); if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1) { queueList.push(data.name, data.userid); queueName.push(data.name); var temp91 = 'The queue is now: '; for (var hj = 0; hj < queueName.length; hj++) { if (hj != (queueName.length - 1)) { temp91 += queueName[hj] + ', '; } else if (hj == (queueName.length - 1)) { temp91 += queueName[hj]; } } bot.speak(temp91); } }

with this:

else if (text.match(/^\/q+$/) && queue === true) { var list3 = queueList.indexOf(data.name); var list10 = currentDjs.indexOf(data.userid) var checkStageList = stageList.indexOf(data.userid); var checkManualStageList = bannedFromStage.indexOf(data.userid); if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1) { queueList.push(data.name, data.userid); queueName.push(data.name); var temp91 = 'The queue is now: '; for (var hj = 0; hj < queueName.length; hj++) { if (hj != (queueName.length - 1)) { temp91 += queueName[hj] + ', '; } else if (hj == (queueName.length - 1)) { temp91 += queueName[hj]; } } bot.speak(temp91); } }

If that doesn't work, tell me.

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17262202 .

btburbank commented 11 years ago

Nope. Still not working.

On Tue, Apr 30, 2013 at 8:18 PM, Brad Burbank btburbank@gmail.com wrote:

Ok, thanks for the help, lemme test it out.

On Tue, Apr 30, 2013 at 8:17 PM, Marcello Africano < notifications@github.com> wrote:

Okay, replace this:

else if (text.match(/^\/addme$/) && queue === true) { var list3 = queueList.indexOf(data.name); var list10 = currentDjs.indexOf(data.userid) var checkStageList = stageList.indexOf(data.userid); var checkManualStageList = bannedFromStage.indexOf(data.userid); if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1) { queueList.push(data.name, data.userid); queueName.push(data.name); var temp91 = 'The queue is now: '; for (var hj = 0; hj < queueName.length; hj++) { if (hj != (queueName.length - 1)) { temp91 += queueName[hj] + ', '; } else if (hj == (queueName.length - 1)) { temp91 += queueName[hj]; } } bot.speak(temp91); } }

with this:

else if (text.match(/^\/q+$/) && queue === true) { var list3 = queueList.indexOf(data.name); var list10 = currentDjs.indexOf(data.userid) var checkStageList = stageList.indexOf(data.userid); var checkManualStageList = bannedFromStage.indexOf(data.userid); if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1) { queueList.push(data.name, data.userid); queueName.push(data.name); var temp91 = 'The queue is now: '; for (var hj = 0; hj < queueName.length; hj++) { if (hj != (queueName.length - 1)) { temp91 += queueName[hj] + ', '; } else if (hj == (queueName.length - 1)) { temp91 += queueName[hj]; } } bot.speak(temp91); } }

If that doesn't work, tell me.

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17262202 .

btburbank commented 11 years ago

/q- is working just fine though.

On Tue, Apr 30, 2013 at 8:29 PM, Brad Burbank btburbank@gmail.com wrote:

Nope. Still not working.

On Tue, Apr 30, 2013 at 8:18 PM, Brad Burbank btburbank@gmail.com wrote:

Ok, thanks for the help, lemme test it out.

On Tue, Apr 30, 2013 at 8:17 PM, Marcello Africano < notifications@github.com> wrote:

Okay, replace this:

else if (text.match(/^\/addme$/) && queue === true) { var list3 = queueList.indexOf(data.name); var list10 = currentDjs.indexOf(data.userid) var checkStageList = stageList.indexOf(data.userid); var checkManualStageList = bannedFromStage.indexOf(data.userid); if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1) { queueList.push(data.name, data.userid); queueName.push(data.name); var temp91 = 'The queue is now: '; for (var hj = 0; hj < queueName.length; hj++) { if (hj != (queueName.length - 1)) { temp91 += queueName[hj] + ', '; } else if (hj == (queueName.length - 1)) { temp91 += queueName[hj]; } } bot.speak(temp91); } }

with this:

else if (text.match(/^\/q+$/) && queue === true) { var list3 = queueList.indexOf(data.name); var list10 = currentDjs.indexOf(data.userid) var checkStageList = stageList.indexOf(data.userid); var checkManualStageList = bannedFromStage.indexOf(data.userid); if (list3 == -1 && list10 == -1 && checkStageList == -1 && checkManualStageList == -1) { queueList.push(data.name, data.userid); queueName.push(data.name); var temp91 = 'The queue is now: '; for (var hj = 0; hj < queueName.length; hj++) { if (hj != (queueName.length - 1)) { temp91 += queueName[hj] + ', '; } else if (hj == (queueName.length - 1)) { temp91 += queueName[hj]; } } bot.speak(temp91); } }

If that doesn't work, tell me.

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17262202 .

samuri51 commented 11 years ago

try

else if (text == '/q+' && queue === true)
btburbank commented 11 years ago

No go. Still reports the q is empty.

On Tue, Apr 30, 2013 at 8:34 PM, chris larosa notifications@github.comwrote:

try

else if (text == 'q+' && queue === true)

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17262722 .

samuri51 commented 11 years ago

just tested it and it works for me...

samuri51 commented 11 years ago

guess u can do this too if u really wanna stick with regular expressions

else if (text.match(/^\/q\+$/) && queue === true)
samuri51 commented 11 years ago

and of course it would say the queue is empty if your the only one in it and you remove yourself... if its working it should tell you right when you join the queue that your in it

btburbank commented 11 years ago

Well lemme try that then.

On Tue, Apr 30, 2013 at 8:45 PM, chris larosa notifications@github.comwrote:

guess u can do this too if u really wanna stick with regular expressions

else if (text.match(/^\/q+$/) && queue === true)

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17263034 .

samuri51 commented 11 years ago

also make sure ur not modifying the pm version or something and thinking its the chat like i sometimes do :p and make sure the queue is on and make sure nothing would match that q+ statement in your else if hierarchy before it reaches it

btburbank commented 11 years ago

It's not add me at all. I get no notification of any kind. This has me genuinely stumped.

On Tue, Apr 30, 2013 at 8:46 PM, chris larosa notifications@github.comwrote:

and of course it would say the queue is empty if your the only one in it and you remove yourself... if its working it should tell you right when you join the queue that your in it

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17263080 .

btburbank commented 11 years ago

Your line of code fixed the issue Chris. I'm still testing out the other minor changes I made to the q commands.

On Tue, Apr 30, 2013 at 8:48 PM, chris larosa notifications@github.comwrote:

also make sure ur not modifying the pm version or something and thinking its the chat like i sometimes do :p and make sure the queue is on and make sure nothing would match that q+ statement in your else if hierarchy before it reaches it

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17263129 .

samuri51 commented 11 years ago

good to hear ;)

btburbank commented 11 years ago

This can be closed, and if I have any other issues, I'll open a request.

On Tue, Apr 30, 2013 at 8:51 PM, chris larosa notifications@github.comwrote:

good to hear ;)

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17263239 .

mnafricano commented 11 years ago

Don't forget to make sure you change /commands to show /q+ instead of /addme.

btburbank commented 11 years ago

Yeah I fixed that too.

On Tue, Apr 30, 2013 at 9:20 PM, Marcello Africano <notifications@github.com

wrote:

Don't forget to make sure you change /commands to show /q+ instead of /addme.

— Reply to this email directly or view it on GitHubhttps://github.com/samuri51/chillybot/issues/20#issuecomment-17264005 .