mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
so I would like my commands to only be working when my stream is online how can I do that?

Code:
on *:text:!hello:#: {
  if stream offline return
  if (%flood) { return }
  set -u4 %flood On
  msg $chan Hello
}


how do I make this to work?

Last edited by TUSK3N; 01/06/16 02:24 AM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Short&easy - use variable, which you can set manually.
Long&hard - use twitch`s API, aliases, nuclear physics and some advanced mathematics.


Dont give a fish - teach to fish!
Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
Originally Posted By: splinny
Short&easy - use variable, which you can set manually.
Long&hard - use twitch`s API, aliases, nuclear physics and some advanced mathematics.


Yeah, manually setting a variable is the easy method.

Here's an example of the hard one that I use to manage things like an automated CTT and things of that nature.

Code:
alias streamStatus {
  if (!$1) { return }
  if ($me !ison $1) { return }
  var %j = stream_ $+ $ticks $+ $ctime
  JSONOpen -ud %j https://api.twitch.tv/kraken/streams/ $+ $mid($1,2) $+ ?= $+ $ticks
  var %status = $json(%j,stream)


  if (!%status && %check_ [ $+ [ $mid($1,2) ] ] == 0 ) {
    set %check_ $+ $mid($1,2) 1
  }

  if (!%status && (%check_ [ $+ [ $mid($1,2) ] ] == 1)) {  
    set %status_ [ $+ [ $mid($1,2) ] ] Offline 
    set %check_ $+ $mid($1,2) 0
    /timer[CTT_ [ $+ [ $1 ] ] $+ ] off
  }

  if (%status_ [ $+ [ $mid($1,2) ] ] == Online && (%check_ [ $+ [ $mid($1,2) ] ] == 1)) {
    set %check_ $+ $mid($1,2) 0
    autoTweet $1
  }

  if (%status_ [ $+ [ $mid($1,2) ] ] == Online) {
    set %check_ $+ $mid($1,2) 0
    autoTweet $1
    return
  }

  if (%status) {
    set %status_ [ $+ [ $mid($1,2) ] ] Online
    msg $1 /me - We're live with $followGame($mid($1,2)) $+ . Sit back and enjoy the show. 
    unset %greeting_ [ $+ [ $mid($1,2) ] [ $+ _* ] ]
    set %check_ $+ $mid($1,2) 0
    autoTweet $1
  }
}


Link Copied to Clipboard