mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 4 1 2 3 4
P
powerade661
powerade661
P
Where it is msg # under the JSONOpen? Change that to $1?

Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
I added a fixed script to my previous post smile

Last edited by FroggieDaFrog; 24/05/15 07:48 PM.
P
powerade661
powerade661
P
It's still not displaying the message. I waited an hour. frown

Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
Are you trying to get this to trigger using the same client its running on?

P
powerade661
powerade661
P
I went to my chat and typed !viewerupdate it says "viewer update has been started" and then it doesn't display any message after 60 seconds in my chat.

P
powerade661
powerade661
P
Every time I do !viewerupdate, mIRC becomes completely unresponsive. It didn't do this with the other script, I don't understand what is going on. I even moved mIRC to another computer and still the same results. Please help frown Currently this is the only script that works, but it doesn't display the follower count.


Code:
on *:text:*:#: {
  if ($strip($1) == !viewerupdate) {
    if ($strip($2) == $null) {
set %viewerschan $chan
      msg $chan Viewer Update Has Been Started 
      .timer.update 0 60 sayviewers $chan intellibot_v2.0 nightbot wizebot
    }
    if ($strip($2) == off) {
      msg $chan Viewer Update has been stopped
      .timer.update off
    }
  }
}

alias sayviewers {
  set %viewers $nick($1,0)
  var %v = 1
  while (%v <= $nick($1,0)) {
    if ($istok($2-,$nick($1,%v),32)) {
      dec %viewers 1
    }
    inc %v
  }
  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid(#, 2-)
  msg $1 Stream update for $remove(#,$chr(35)) followers: $json(followcount, followers) Viewers: %viewers
}

on *:part:#: {
if ($chan == %viewerschan) {
if ($timer(.update)) {
.timer.update off
}
}
}




This script displays the follower count.

Code:

on *:text:*:#: {
  if ($strip($1) == !streamstatus) {
    if ($strip($2) == $null) {
      sayviewers $chan vector_bot nightbot wizebot

    }
  }
}

alias sayviewers {
  set %viewers $nick($1,0)
  var %v = 1
  while (%v <= $nick($1,0)) {
    if ($istok($2-,$nick($1,%v),32)) {
      dec %viewers 1
    }
    inc %v
    }
  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid(#, 2-)
  msg $1 Stream status for $remove(#,$chr(35)) followers: $json(followcount, followers) Viewers: %viewers
}



Last edited by powerade661; 25/05/15 06:10 AM.
P
powerade661
powerade661
P
I have been trying to figure out this all night. I have came to the conclusion (is this possible) when I execute the command without the timer, it is parsing JSON, but when I do it through the timer, it is only displaying the message without parsing JSON. Could this be the case, does anyone have any idea? The current script works and stops when the streamer leaves. It's just the follower count that doesn't work.

Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
I had a few typo's in my script.

Here's an update:
Code:
on $*:text:/^!viewerupdate(\s|$)/Si:#: {
  if (!$istwitch) { return }
  if ($2- == off && $nick isop # && $timer(FollowerUpdate $+ $cid $+ #)) {
    $+(.timerFollowerUpdate, $cid, #) off
    msg # Viewer update has been stopped
  }
  elseif ($0 == 1) {
    msg $chan Viewer Update Has Been Started 
    $+(.timerFollowerUpdate, $cid, #) 1 60 sayviewers # intellibot_v2.0 nightbot wizebot
  }
}
on *:part:#: {
  if (!$istwitch) { return }
  if ($mid(#, 2-) == $nick && $timer(FollowerUpdate $+ $cid $+ #)) {
    $+(.timer, $v1) off
  }
}
alias sayviewers {
  if (!$istwitch) { return }
  var %i = 1, %v = 0
  while (%i <= $nick($1, 0)) {
    if (!$istok($2-, $nick($1, %i), 32)) {
      inc %v
    }
    inc %i
  }
  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid($1, 2-)
  msg $1 Stream update, followers: $json(followcount, followers) Viewers: %v
  $+(.timerFollowerUpdate, $cid, $1) 1 60 sayviewers $1-
}
alias -l isTwitch return $iif($status == connected && $regex($server, /^(?:tmi|irc)\.twitch\.tv$/i), $true, $false)


And here is the output:

P
powerade661
powerade661
P
Thank you so much! It works great! I appreciate your time and patience with me. Have a good day!

P
powerade661
powerade661
P
Quick question, how would I increase the time to 30 minutes instead of 60 seconds? Would I put it place of where ever 1 60 are?

Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
replace the 60 with the number of SECONDS. so instead of
Code:
timer... 1 60 ...


you'd have the following for 30 minutes
Code:
timer... 1 1800 ...

P
powerade661
powerade661
P
It's not updating the follower count, I still have to restart mIRC in order to get it to update. Also it's not the excluding the channel. frown

P
powerade661
powerade661
P
Well never mind, it's not updating the follower count even when I restart mIRC anymore.

P
powerade661
powerade661
P
Update, I have to restart the computer in order for it to update now. Is there anyway to refresh this so I don't have to restart the computer?

Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
as far as I've tested, it should continue to update unless it encounters an error. To restart the update process, use !viewerupdate again

Just to make sure, you do have the json parser from my signature installed aswell, correct?

Last edited by FroggieDaFrog; 26/05/15 01:29 PM.
P
powerade661
powerade661
P
How do I install that? No I don't.

P
powerade661
powerade661
P
Never mind, I just installed it. Testing it now.

P
powerade661
powerade661
P
Just to make sure I am installing this correctly, I go to file, then new and copy and paste the JSON parser into there correct?

P
powerade661
powerade661
P
Ok the script works but it is still not excluding the channel. It still counts the channel as a viewer. I installed the JSON parser and everything works as it should, it updates and everything.

Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
so you want to ignore both a list of bots, and the streamer?


If that is the case:
Code:
on $*:text:/^!viewerupdate(\s|$)/Si:#: {
  if (!$istwitch) { return }
  if ($2- == off && $nick isop # && $timer(FollowerUpdate $+ $cid $+ #)) {
    $+(.timerFollowerUpdate, $cid, #) off
    msg # Viewer update has been stopped
  }
  elseif ($0 == 1) {
    msg $chan Viewer Update Has Been Started 
    $+(.timerFollowerUpdate, $cid, #) 1 60 sayviewers # intellibot_v2.0 nightbot wizebot
  }
}
on *:part:#: {
  if (!$istwitch) { return }
  if ($mid(#, 2-) == $nick && $timer(FollowerUpdate $+ $cid $+ #)) {
    $+(.timer, $v1) off
  }
}
alias sayviewers {
  if (!$istwitch) { return }
  var %i = 1, %v = 0, %ignore = $mid($1-,2-)
  while (%i <= $nick($1, 0)) {
    if (!$istok(%ignore, $nick($1, %i), 32)) {
      inc %v
    }
    inc %i
  }
  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid($1, 2-)
  msg $1 Stream update, followers: $json(followcount, followers) Viewers: %v
  $+(.timerFollowerUpdate, $cid, $1) 1 60 sayviewers $1-
}
alias -l isTwitch return $iif($status == connected && $regex($server, /^(?:tmi|irc)\.twitch\.tv$/i), $true, $false)

Last edited by FroggieDaFrog; 26/05/15 06:17 PM.
Page 3 of 4 1 2 3 4

Link Copied to Clipboard