mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2016
Posts: 5
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2016
Posts: 5
I current have this to check the title of the stream:
Code:
alias streamstatus {
  JSONOpen -ud streamstatus https://api.twitch.tv/kraken/channels/asdf
  IF ($json(streamstatus, status)) return $v1
  ELSE return Error
  JSONClose streamstatus
}

ON *:TEXT:!title:#: {
 if ((%floodenzazz) || ($($+(%,floodenzazz.,$nick),2))) { return }
  set -u7 %floodenzazz On
  set -u25 %floodenzazz. $+ $nick On
MSG $chan .w $nick Title: " $streamstatus "
}


I am wondering how I can make it so that it not only whispers the user the title of the stream, but also the time since the title was last changed. I am thinking something along the lines of checking the title every 5 mins using the twitch api, then simply recording the time when the text changes. Not sure how to do this though, any ideas?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Store the current title and $ctime, next time you check compare the title and display $duration($ctime - %lastcheck)

Joined: Apr 2016
Posts: 5
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2016
Posts: 5
I'm not sure how to do this, can you please elaborate?

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Elaborating in Loki's answer: In the text event use an if to compare the current title to the last one which willbe saved in a variable. If the title is the same you do nothing, if it is not you set a variable and assign $ctime as it's value. Then to print the time that has passed since last title change you use $duration($calc($ctime - %var) (assume %var is that variable..


Link Copied to Clipboard