alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
317 stars 97 forks source link

Not Selecting Chat Server #163

Closed oldramen closed 11 years ago

oldramen commented 11 years ago

I have a command that will relocate my bot to other rooms, and lately I've been getting this error message in the logs, breaking the bot when it does so:

wrong chat server, use chat4.turntable.fm:80 for roomid 5081ce0b4fb0bb17d209cbab and section None (on chat2.turntable.fm:80)

Izzmo commented 11 years ago

This has actually been a common issue in the last month or so, I have been running into with my auto-awesome script.

What I usually do is just reset the socket and all is good.

oldramen commented 11 years ago

Well, does the reset fix it for a while or just once? Because this literally crashes the bot.

Izzmo commented 11 years ago

Well chat servers don't change for rooms, so it would fix it for as long as the bot stayed in the room.

oldramen commented 11 years ago

Well, it only breaks when I'm migrating, which is the problem. The command is pretty simple:

//on receiving a command /go roomid
//callback is function(a,b,c) where a = userid of user calling command
//b is the variables (any text after /go)
//c is either true or false, (depending on whether command was issued via chat/pm)
    if (!b) return basic.say("You must provide a room id.",a,c);
    if (b == "home") return bot.roomRegister(config.room);
    core.moving = setTimeout(admin.gohome, 15E3); //if doesn't register in a room, returns to config room
    Note("Registering in room: "+a);
    return bot.roomRegister(b);
technobly commented 11 years ago

Are you deRegistering first?

oldramen commented 11 years ago

...derp.

technobly commented 11 years ago

/ragequit

oldramen commented 11 years ago

Hey, that was originally my command >.> Coding in that bit. Closing for now until I can test.