mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 4 1 2 3 4
Re: Help with viewer count script [Re: FroggieDaFrog] #253078 24/05/15 07:39 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Where it is msg # under the JSONOpen? Change that to $1?

Re: Help with viewer count script [Re: powerade661] #253079 24/05/15 07:45 PM
Joined: Apr 2010
Posts: 959
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 959
I added a fixed script to my previous post smile

Last edited by FroggieDaFrog; 24/05/15 07:48 PM.

I am SReject
My Stuff
Re: Help with viewer count script [Re: FroggieDaFrog] #253082 24/05/15 09:55 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
It's still not displaying the message. I waited an hour. frown

Re: Help with viewer count script [Re: powerade661] #253086 24/05/15 10:58 PM
Joined: Apr 2010
Posts: 959
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 959
Are you trying to get this to trigger using the same client its running on?


I am SReject
My Stuff
Re: Help with viewer count script [Re: FroggieDaFrog] #253089 25/05/15 01:40 AM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.

Re: Help with viewer count script [Re: powerade661] #253091 25/05/15 05:15 AM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.
Re: Help with viewer count script [Re: powerade661] #253094 25/05/15 11:01 AM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.

Re: Help with viewer count script [Re: powerade661] #253095 25/05/15 12:56 PM
Joined: Apr 2010
Posts: 959
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 959
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:


I am SReject
My Stuff
Re: Help with viewer count script [Re: FroggieDaFrog] #253101 25/05/15 07:45 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Thank you so much! It works great! I appreciate your time and patience with me. Have a good day!

Re: Help with viewer count script [Re: powerade661] #253102 25/05/15 10:29 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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?

Re: Help with viewer count script [Re: powerade661] #253103 25/05/15 10:54 PM
Joined: Apr 2010
Posts: 959
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 959
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 ...


I am SReject
My Stuff
Re: Help with viewer count script [Re: FroggieDaFrog] #253104 25/05/15 11:02 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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

Re: Help with viewer count script [Re: powerade661] #253105 25/05/15 11:52 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Well never mind, it's not updating the follower count even when I restart mIRC anymore.

Re: Help with viewer count script [Re: powerade661] #253107 26/05/15 07:04 AM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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?

Re: Help with viewer count script [Re: powerade661] #253111 26/05/15 01:28 PM
Joined: Apr 2010
Posts: 959
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 959
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.

I am SReject
My Stuff
Re: Help with viewer count script [Re: FroggieDaFrog] #253113 26/05/15 04:00 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
How do I install that? No I don't.

Re: Help with viewer count script [Re: powerade661] #253114 26/05/15 04:02 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Never mind, I just installed it. Testing it now.

Re: Help with viewer count script [Re: powerade661] #253115 26/05/15 04:17 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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?

Re: Help with viewer count script [Re: powerade661] #253117 26/05/15 05:16 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.

Re: Help with viewer count script [Re: powerade661] #253120 26/05/15 06:15 PM
Joined: Apr 2010
Posts: 959
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 959
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.

I am SReject
My Stuff
Page 3 of 4 1 2 3 4