mIRC Home    About    Download    Register    News    Help

Print Thread
#255021 14/09/15 11:45 PM
Joined: Jul 2015
Posts: 19
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Jul 2015
Posts: 19
Say, for example this script,
Code:
on *:TEXT:!teststart:#: {
  if ($nick isop #) {
    msg # this is just an example.
    msg # just an example.
    .timerAnnouncer 6 1800 msg $chan just an example
  }
  else {

  }
}



I want this to automatically startup as soon as a stream (twitch) starts but I have no idea if its possible.

If not, is there a way I can set a time for it to start without me having to type in a command?
Thanks

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
http://pastebin.com/ELS7ge60
I found this.. it's a script that checks if a stream is online or not. So.. it is made so that it triggers from a text event but since it uses an alias you can use it on your own.
Put the code from pastebin in a clean remote and then put this code too.
Code:
on *:start: {
.timercheckstream 0 25 twitch_stream Nick #SomeChannel SomeStream
}

on *:text:*:#: {
if ($strip($1) == !stopcheck) {
.timercheckstream off
}
elseif ($strip($1) == !startcheck) {
if ($timer(checkstream)) {
msg $chan Automated Checking Is Already ON.
}
elseif (!$timer(checkstream)) {
.timercheckstream 0 25 twitch_stream Nick #SomeChannel SomeStream
}
}
}

In the pastebin script the first parameter of the alias is $nick which is the person that triggered the text event. Since what i gave you will start checking automatically when mIRC starts you can use your nick on twitch.So replace Nick with your nick or whatever other word you want, #Somechannel with your channel and SomeStream with your stream name. I'm sure it will work, the scripter of this is pro smile
Good Luck!

NOTE: You'll have to restart mirc for it to start or just use the text command !startcheck

Last edited by OrFeAsGr; 15/09/15 01:40 AM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
To expand a bit from OrFeAsGr, this should do what you want automatically whenever you connect to your channel, just replace the channel in the alias stream_channel


Code:
alias stream_channel return #channel
on *:connect:{
 if ($servertarget == tmi.twitch.tv) {
  if ($stream_on) {
    set %connect_stream 1
  }
  else .timercheck_stream 0 3 check_stream 
 }
}
alias check_stream {
  if ($stream_on) {
    if ($me ison $stream_channel) do_msg
    else set %connect_stream 1
    .timercheck_stream off
  }
}
on *:disconnect:{
  if ($servertarget == tmi.twitch.tv) unset %connect_stream
}

on me:*:join:$($stream_channel):{
  if (%connect_stream) {
   do_msg
  }
}

alias do_msg {
  msg $stream_channel this is just an example
}
alias stream_on {
  var %u = https://api.twitch.tv/kraken/streams/ $+ $mid($stream_channel,2)
  JSONOpen -ud stream_on %u
  if (!%JSONError) && ($json(stream_on,stream,_id)) return 1
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2015
Posts: 19
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Jul 2015
Posts: 19
Yay thank you guys so much!


Link Copied to Clipboard