|
Help with viewer count script
#252942
18/05/15 07:11 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
So my current script grabs viewers that are only in the chat. What I am trying to do is exclude the count if there are certain users in the chat such as bots. Is it possible to do this? Like if $nick == potatobot {return} elseif $nick == anotherbot basically it doesn't count these usernames and they aren't added into the count along with the current channel. An example of this would be if $nick == # These are just examples of what I am trying to do. Any help with this would be much appreciated.
on *:text:!viewerupdate:#: {
msg # Viewer update has been started
.timer.update 0 1800 msg # Current viewers in chat -> $nick(#,0)
}
on *:text:!viewerupdate off:#: {
msg # Viewer update has been stopped
.timer.update off
}
Last edited by powerade661; 18/05/15 07:12 AM.
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#252943
18/05/15 07:27 AM
|
Joined: May 2015
Posts: 249
splinny
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
As i remember, timer will return $nick(#,0) NOT updated, it will always be same (as when timer started). You need to make an alias, where $nick(#,0) is used, and timer will use this alias, so $nick(#,0) will be real-time updated. And to exclude some nicks, you can make "%exNicks botnick1 yournick botnick2" and use $istok(%exnicks,$nick(#,%x),32).
Dont give a fish - teach to fish!
|
|
|
Re: Help with viewer count script
[Re: splinny]
#252944
18/05/15 07:33 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
I have no idea how to do that. So is it only updating if it's not on a timer?
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#252945
18/05/15 08:08 AM
|
Joined: May 2015
Posts: 249
splinny
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
Type in your mIRC editbox: //timer 10 1 echo -ag $time Same with $nick(#,0).
Dont give a fish - teach to fish!
|
|
|
Re: Help with viewer count script
[Re: splinny]
#252949
18/05/15 12:45 PM
|
Joined: Jan 2004
Posts: 1,314
Loki12583
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 1,314 |
You don't need an alias, you can use $!nick(#,0) in a timer to prevent the immediate evaluation.
|
|
|
Re: Help with viewer count script
[Re: Loki12583]
#252958
18/05/15 03:22 PM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
So how would I code this exactly, I am not the best at lining up brackets. Would it be this instead? How do I make it so that the current channel is excluded? Is it "%exNicks #" for the current channel?
on *:text:!viewerupdate:#: {
msg # Viewer update has been started
.timer.update 0 1800 msg # Current viewers in chat ->
$!nick(#,0)
%exNicks wizebot zacbot # $istok(%exnicks,$nick(#,%x),32)
}
on *:text:!viewerupdate off:#: {
msg # Viewer update has been stopped
.timer.update off
}
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#252962
18/05/15 04:07 PM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
When I use $!nick(#,0) it doesn't return the number, it returns this There are $nick(#,0) viewers in the chat.
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#252963
18/05/15 04:10 PM
|
Joined: May 2015
Posts: 249
splinny
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
Dont give a fish - teach to fish!
|
|
|
Re: Help with viewer count script
[Re: splinny]
#252964
18/05/15 04:16 PM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
Double / where? //$!nick(#,0) there?
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#252967
18/05/15 05:13 PM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
This isn't working.. I have no idea what I am doing, please help
On *:text:!viewers:#:{
%exNicks $wizebot $zacbot661 $chan $nightbot
$istok(%exnicks,$nick(#,%x),32)
msg # There are $nick(#,0) viewers in the chat. Take note, this does not exclude bots.
}
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#253015
21/05/15 12:42 PM
|
Joined: Feb 2015
Posts: 243
OrFeAsGr
Fjord artisan
|
Fjord artisan
Joined: Feb 2015
Posts: 243 |
Hi there 
on *:text:*:#: {
if ($strip($1) == !viewerupdate) {
if ($strip($2) == $null) {
msg $chan Viewer Update Has Been Started
.timer.update 0 1800 sayviewers $chan zacbot661 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
}
msg $1 %viewers
}
i tested this and it works exactly as you want it  If you want to exclude more nicks add them after the sayviewers $chan
Last edited by OrFeAsGr; 21/05/15 02:31 PM.
|
|
|
Re: Help with viewer count script
[Re: OrFeAsGr]
#253027
23/05/15 01:01 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
I am not sure if I am doing something wrong but I did !viewerupdate and it shows me the message "viewer update has been started" but I am not seeing the viewers being displayed. I even lowered the timer to 0 30 and it still hasn't displayed anything 
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#253028
23/05/15 01:08 AM
|
Joined: Feb 2015
Posts: 243
OrFeAsGr
Fjord artisan
|
Fjord artisan
Joined: Feb 2015
Posts: 243 |
Hey! Have you changed anything else? Maybe you accidentaly removed $chan after the sayviewers and the script cant send the msg to the channel.
|
|
|
Re: Help with viewer count script
[Re: OrFeAsGr]
#253029
23/05/15 01:20 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
Apparently I couldn't predict 30 minutes from 30 seconds. It works lol Thanks for the help man. Is it possible to have it say Current viewers -> <number here> Also another question, are you good with sockets? I am trying to make it display followers and viewers. I am a huge newbie when it comes to sockets but I really want to learn how to do them. And I have tried looking at the justin.tv API but it is very confusing.
Last edited by powerade661; 23/05/15 01:22 AM.
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#253030
23/05/15 01:38 AM
|
Joined: Feb 2015
Posts: 243
OrFeAsGr
Fjord artisan
|
Fjord artisan
Joined: Feb 2015
Posts: 243 |
Yeah just change the text after "msg $1" in the alias. %viewers is the number of viewers/users on channel , you can place it where ever you want in the msg. I have done some work with sockets lately but im not so good at it yet. I have seen some snippets in Hawkee though while trying to help a user. I think this should work: http://hawkee.com/snippet/16083/Or this: http://hawkee.com/snippet/16083/ Np!
Last edited by OrFeAsGr; 23/05/15 01:39 AM.
|
|
|
Re: Help with viewer count script
[Re: OrFeAsGr]
#253031
23/05/15 01:41 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
No I was talking about the follower count. Like Followers: 434 Viewers: 6. Is this possible?
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#253032
23/05/15 02:48 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
The current script isn't working now... -_-
on *:text:*:#: {
if ($strip($1) == !viewerupdate) {
if ($strip($2) == $null) {
msg $chan Viewer Update Has Been Started
.timer.update 0 1800 sayviewers $chan zacbot661 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
}
msg $1 Viewers -> %viewers
}
|
|
|
Re: Help with viewer count script
[Re: powerade661]
#253033
23/05/15 02:49 AM
|
Joined: Jun 2014
Posts: 248
Belhifet
Fjord artisan
|
Fjord artisan
Joined: Jun 2014
Posts: 248 |
Sure its possible. You need a json parser which a resident froggy has made. Its kinda advanced scripting and obviously you aren't going to understand whats going on when you make it. It would really be best if you built on your knowledge instead of jumping into something you aren't quite ready for. Also this script kinda displays something thats already on the screen so its not all that important. --I guess this only applies if you are interested in learning msl..heh. anyway using the json parser of froggiesomething
alias followcount {
JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $1
return $json(followcount, followers)
}
on *:text:!viewers:#:{
msg # $followcount($chan) people following and w/e you want.
}
Last edited by Belhifet; 23/05/15 02:50 AM.
|
|
|
Re: Help with viewer count script
[Re: Belhifet]
#253034
23/05/15 03:02 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
Thank you so much! I definitely appreciate your time. 
|
|
|
Re: Help with viewer count script
[Re: Belhifet]
#253035
23/05/15 03:18 AM
|
Joined: Jan 2015
Posts: 168
powerade661
OP
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
Weird. It's saying insufficient parameters.
Last edited by powerade661; 23/05/15 03:18 AM.
|
|
|
|
|
|