mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 4 1 2 3 4
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Where it is msg # under the JSONOpen? Change that to $1?

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
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
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
It's still not displaying the message. I waited an hour. frown

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


I am SReject
My Stuff
Joined: Jan 2015
Posts: 168
P
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.

Joined: Jan 2015
Posts: 168
P
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.
Joined: Jan 2015
Posts: 168
P
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.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
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
Joined: Jan 2015
Posts: 168
P
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!

Joined: Jan 2015
Posts: 168
P
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?

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
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
Joined: Jan 2015
Posts: 168
P
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

Joined: Jan 2015
Posts: 168
P
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.

Joined: Jan 2015
Posts: 168
P
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?

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
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
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
How do I install that? No I don't.

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Never mind, I just installed it. Testing it now.

Joined: Jan 2015
Posts: 168
P
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?

Joined: Jan 2015
Posts: 168
P
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.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
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

Link Copied to Clipboard