mIRC Homepage
Posted By: Artiiz A script for VOD's (Twitch) - 27/09/15 03:37 PM
Hello,

So I'm thinking of making a command that saves down the exact time in the stream video that the "thing" happend.
This is to help the person who checks the VOD and makes an video of it.

I've tried doing this so far:
Code:
on 3:text:!save *:#yznb:{
  write HIGHLIGHT.txt $2 $uptime $time $date
  if ($nick == artiiz) {
  msg $chan @ $+ $nick VOD saved at $time $date }
}

But that doesn't quite seem to work.
I wonder if there is a way of making with the "$uptime" so that it gets the exact time in the VOD when I typed !save.

It looks like this in my HIGHLIGHT.txt when I type "!save test".
Code:
test 5605 17:36:36 27/09/2015


And I have no idea what the "5605" is for, if I need to change the $uptime to something else to make it trigger the Twitch channel.

Would really appreciate some help, thanks!
Posted By: OrFeAsGr Re: A script for VOD's (Twitch) - 27/09/15 04:00 PM
Hi,
5605 is the uptime of mIRC in seconds at the moment you triggered the text event.
What do you need it to write?
The uptime of the stream??
Posted By: Artiiz Re: A script for VOD's (Twitch) - 27/09/15 04:02 PM
Originally Posted By: OrFeAsGr
Hi,
5605 is the uptime of mIRC in seconds at the moment you triggered the text event.
What do you need it to write?
The uptime of the stream??


Exactly, how long in the stream the command were written, so that you can just click to that part in the VOD of the session.
Posted By: OrFeAsGr Re: A script for VOD's (Twitch) - 27/09/15 04:28 PM
Code:
on 3:text:!save *:#yznb:{
  uptime $time $date $2
  if ($nick == artiiz) {
  msg $chan @ $+ $nick VOD saved at $read(HIGHLIGHT.TXT) }
}

alias uptime_chan return ENTER-HERE-THE-TWITCH-CHANNEL
alias uptime {
  sockclose uptime
  sockopen uptime nightdev.com 80
set %time $1 
set %date $2
set %thing $3
}

ON *:SOCKOPEN:uptime: {
  if ($sockerr) { sockclose $sockname | halt }
  sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ $uptime_chan HTTP/1.1
  sockwrite -n $sockname Host: $sock($sockname).addr
  sockwrite -n $sockname $crlf
}
ON *:SOCKREAD:uptime: {
  if ($sockerr) { sockclose $sockname }
  var %data
  sockread %data
  if ($gettok(%data,1,32) isnum) && ($gettok(%data,2,32)) {
    var %c = $chr(35) $+ $uptime_chan
    if ($me !ison %c) { return }
write -c HIGHLIGHT.TXT
     write HIGHLIGHT.txt %thing $qt(%data) %time %date
  }
}

So.. i lended westor's script http://hawkee.com/snippet/16314/ (Twitch Uptime Informer) and implemented it on your script to make it do what you want.
You just need to change ENTER-HERE-THE-TWITCH-CHANNEL with your twitch channel but without #
I didn't test it but i'm sure it will work cause i changed only the commands on westor's script the rest of the code is the same so it should work just fine.
Credits should go to westor though! smile
Posted By: Artiiz Re: A script for VOD's (Twitch) - 27/09/15 07:41 PM
Thanks for the help!

There seems to be a problem though.
If I type !save ceveral times, it replaces the past text in the .txt doc with the new command answer.

It doesn't save all the commands in the txt file, it just replaces the old with the new smirk
Posted By: OrFeAsGr Re: A script for VOD's (Twitch) - 27/09/15 08:13 PM
I thought you wanted to save only the last.
To save all the commands remove the write -c HIGHLIGHT.txt
But how will you make the bot to msg all of them? You would need a big message or seperated timed messages.
Posted By: paper0rplastic Re: A script for VOD's (Twitch) - 27/09/15 08:19 PM
Using Froggie's JSON parser :

Code:
on *:text:!highlight:#: {
  highlight #
}

alias -l highlight {
  var %chan $1
  var %caster $mid(%chan,2)
  var %v highlight $+ $ticks
  JSONOpen -ud %v https://api.twitch.tv/kraken/streams/ $+ %caster
  var %id $json(%v,stream,_id)
  if (!%id) { msg %chan %caster is currently OFFLINE. | return }
  var %created $json(%v,stream,created_at)
  var %start $ctime($remove($replace(%created,T,$chr(32)),Z))
  var %uptime $duration($calc($gmt - %start))
  describe %chan + Highlight marker added at %uptime
  writeini highlights.ini %caster $ctime %uptime $+($chr(91),$asctime(m/d/yy),$chr(93))
}

on *:text:!display highlights:#: {
  var %caster $mid(#,2), %i 1 | while $ini(highlights.ini,%caster,%i) {
    var %m $v1 | var %r %r $readini highlights.ini %caster %m $chr(187) | inc %i
  }
  msg # $iif(%r,Highlight Markers: $left($v1,-2),There are no highlight markers.)
}
Posted By: Artiiz Re: A script for VOD's (Twitch) - 28/09/15 11:57 AM
Hey,

So it works perfectly fine.
But the problem is that I've added couple of Moderators into "Users" in mIRC as "3:username".
And now it seems that my other scripts doesn't seem to be working.
Is it because I'm using
Code:
on 1:text:

The "1"?
Should I be using "*" instead?

It all worked before because I never had anything in "Users" area, it was empty.
Posted By: OrFeAsGr Re: A script for VOD's (Twitch) - 28/09/15 01:24 PM
If you want this script to work for anyone despite their user lvl , yes use * . If you want a script to work for a certain user lvl you should use that lvl, but I recommend checking it with an if statement.
Posted By: westor Re: A script for VOD's (Twitch) - 28/09/15 01:24 PM
If you have multiple ON TEXT event into one file this may cause issues, try to paste this code into an other new file into the script editor.

Also if you have USER LEVELS LIST you can change the * with the number that you want to work.

/help on text
/help user list
© mIRC Discussion Forums