mIRC Home    About    Download    Register    News    Help

Print Thread
#252435 10/04/15 07:03 PM
Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170

So, been working on this for about an hour. Finally got the basics of what I wanted. Basically just looking to improve on it a bit by allowing more than one multi available.

For those that don't know, a "multi-stream" is a way for twitch streamers to basically allow the sharing of their viewers. You put in the link and get both streams at once on one page, with the ability to switch chats.

I have it set right now to allow just the broadcaster and one other streamer. I know I had an old script set to allow more than one, but the amount of times I've changed scripts and such I seem to have misplaced it. So I decided to work on it again and maybe improve it a bit...

Code:
on *:text:!multi*:#: {
  if ($nick !isop #) {
    if (!%multi) { return }
    else {
      msg # Come checkout the multi-stream with %streamer and myself!!! %multi
    }
  }
  else {
    if ($2 == $null) {
      if (!%multi) {
        msg # $twitchname($nick) $+ , there is currently no multi-stream set. To set one please do "!multi broadcaster"
      }
      else {
        msg # Come checkout the multi-stream with %streamer and myself!!! %multi
      }
    }
    else if ($2 == clear) {
      unset %streamer
      unset %multi
      msg # $twitchname($nick) has cleared the multi-stream. To set a new one do "!multi broadcaster"
    }
    else {
      set %mystream $twitchname($mid(#,2-))
      set %streamer $twitchname($2)
      set %multi http://kbmod.com/multistream/ $+ %mystream $+ / $+ %streamer $+ /layout10/
      msg # Come checkout the multi-stream with %streamer and myself!!! %multi
    }
  }
}



alias twitchname {
  if ($hget(nickformat) == $null) { hmake nickformat }
  if ($hget(nickformat,$1)) { return $iif($hget(nickformat,$1) == $null,$1,$hget(nickformat,$1)) }
  var %json https://api.twitch.tv/kraken/users/ $+ $1
  JSONOpen -ud nicename %json
  hadd nickformat $1 $json(nicename,display_name)
  return $iif($hget(nickformat,$1) == $null,$1,$hget(nickformat,$1))
}


Please note: if you plan on using this, you will need Froggie's JSON parser (if you don't have this and you're using mIRC for a twitch bot... You're doing it wrong btw. It's amazing) or removing all of the $twitchname stuff as well as the alias for it.


Alright... So, on with the asking of help. The url for more than just 2 streams looks like this:
http://kbmod.com/multistream/Stream1/Stream2/Stream3/Stream4/layout10/ (you can go past 4 channels but very rarely will this be a thing... I'd say at most it'd be 8 and that's really pushing it.)

Any help with this is appreciated (as always) and if you don't feel like helping that's fine too :P I'll be working on this while I wait for responses since I have nothing else to really do at the moment and I really want to get this working. So, if I figure it out myself I'll be sure to post again so that nobody wastes time.

Last edited by Bramzee; 10/04/15 07:07 PM.
Bramzee #252436 10/04/15 07:50 PM
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Something like this would work for you
Code:
var %string $2-
var %tokens $numtok(%string,32)
var %i 1
var %main http://kbmod.com/multistream
var %end layout10/
while (%i <= %tokens) {
var %token $gettok(%string,%i,32)
var %multi $+(%multi,/,%token)
inc %i
}
echo -a $+(%main,%multi,%end)

Or just use $addtok instead


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Nillen #252442 11/04/15 06:49 PM
Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170
Thank you Nillen. Works great. I got this yesterday, just didn't have time to thank you before I started streaming. So, thank you smile


Link Copied to Clipboard