mIRC Home    About    Download    Register    News    Help

Print Thread
#253937 14/07/15 01:44 AM
Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
You have to enter /raw CAP REQ :twitch.tv/membership and rejoin your channels to receive the !join and !part information. But with the points system that is floating around for most twitch bots if the bot joins in the middle ( of a stream for example ), receives the information it doesn't accept the fact that they've "joined" the channel.

So they're not gaining points. The only fix I can think of is having the bot be there before everyone enters the chat.

Any suggestions / ideas for when the bot ISN'T there at the start?

Last edited by Feyl0rd; 14/07/15 03:31 AM. Reason: Words
Joined: Jul 2014
Posts: 34
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2014
Posts: 34
You can use: https://tmi.twitch.tv/group/user/<stream>/chatters

change <stream> for the name of your stream (e.g. Feyl0rd) and use a JSON parser to get the list of members on the stream

Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
Thanks for the response!
While this is one way to retrieve the members who are connected to the chat, it isn't (to my knowledge) a way to trigger the !join to enable the generation of points (via the script). With the /script I linked I'm able to retrieve the list of users from the channel the normal way, it's just that if I don't do it before the stream the event doesn't trigger. frown

Forgive me if I'm being ignorant.

Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
In that sense, the script should check every 5-30 seconds to see if a new user had joined the channel by refreshing that list.

I believe you can check them by using hash tables and updating that table.

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Why not to join channel with some delay?


Dont give a fish - teach to fish!
Joined: Jan 2004
Posts: 1,359
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,359
Are you saying the the membership cap doesn't send you users already in the room? That's unacceptable in terms of IRC implementation and you won't be able to depend on any internal mechanisms mIRC uses to keep track of user state.

You have not given the script you're using or any technical information that would assist us in helping you.

Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
Code:
on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 5 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)


The cap does list all the users connected to the channel currently, but if the bot joins the channel while people are already there it doesn't see the users as "joining" however when someone else (Or if people leave and come back) joins the channel it will go on as normal and see that they have joined and trigger the event.

Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
This is a great idea! I'll look into how to get that information into a hashtable.

Joined: Jan 2004
Posts: 1,359
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,359
No, that's a rather terrible workaround. You shouldn't need to gather the entire list of users every 30 seconds. And I'm sure Twitch would not require that by design.

Now that you've posted your code I can see it has little to nothing to do with the new membership cap. It would have suffered the same problem in the past. When you join you need to start a timer for people already in the room.

If when you join a room the list of users on the nicklist is properly filled then you have access to that information, these normally come in on raw 353.

If you need to explain further please /debug @debug and paste all relevant information.

Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
It did suffer in the past. But with the updates you couldn't see the nicklist unless you ran the cap line. So I have no idea how I would go about doing this so I'll just give it a shot in the dark.

Code:
raw 353:join:{
  $+(.timerpoints.,#,.,$nick) 0 5 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)
 }


If it wasn't already clear I'm pretty bad / lack the know-how on this stuff. Again forgive my ignorance.


Link Copied to Clipboard