mIRC Home    About    Download    Register    News    Help

Print Thread
#254961 11/09/15 04:05 AM
Joined: Sep 2015
Posts: 1
C
Mostly harmless
OP Offline
Mostly harmless
C
Joined: Sep 2015
Posts: 1
I have searched around and I have been unable to find anything in regards to detecting a host from another channel to yours (via twitch). Any information would be very helpful, thanks!

ChesterT #254970 11/09/15 12:40 PM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
What are you trying to do specifically?
You can use $ialchan() to find host on a given channel, if you want to know which host from a given channel A is also on a given channel B, you can just use a while loop:
Code:
alias checkhosts {
  var %A $1,%B $2,%i 1,%m
  while ($ialchan(*,%A,%i) != $null) {
    %m = $v1
    if ($ialchan(%m,%B,0)) {
    echo -a host %m on %A is also on %B -- nick on %A : $ialchan(%m,%A,1).nick -- nick on %B : $ialchan(%m,%B,1).nick
    }
    inc %i
  }
}
Type /checkhosts #channelA #channelB

Note that multiple nickname could belong to a given host, the code will only return the first one.

Edit: looks like you were talking about another kind of 'host' grin

Last edited by Wims; 11/09/15 12:55 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
ChesterT #254971 11/09/15 12:46 PM
Joined: Mar 2014
Posts: 42
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Mar 2014
Posts: 42
the steps your script would have to take are as follow:

1: retrieve your ID from https://api.twitch.tv/kraken/channels/yourchannel

2:check http://tmi.twitch.tv/hosts?include_logins=1&target=yourID every minute or so to see who hosts you

3:strip the hosting usernames

4: if there is no cache, then cache the names. Else match the cache with the newly collected usernames

5:if new names, echo to chat

something like that, maybe.


Link Copied to Clipboard