mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 4 1 2 3 4
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
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.

Code:
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.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
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!
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
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?

Joined: May 2015
Posts: 249
Fjord artisan
Offline
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!
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
You don't need an alias, you can use $!nick(#,0) in a timer to prevent the immediate evaluation.

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

Code:
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
}


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

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Use double "/".


Dont give a fish - teach to fish!
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Double / where? //$!nick(#,0) there?

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
This isn't working.. I have no idea what I am doing, please help

Code:
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. 

}


Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Hi there smile
Code:
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 smile
If you want to exclude more nicks add them after the sayviewers $chan

Last edited by OrFeAsGr; 21/05/15 02:31 PM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
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 frown

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
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.

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
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.
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
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/
smile
Np!

Last edited by OrFeAsGr; 23/05/15 01:39 AM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
No I was talking about the follower count. Like Followers: 434 Viewers: 6. Is this possible?

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
The current script isn't working now... -_-

Code:
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
}

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
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

Code:
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.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Thank you so much! I definitely appreciate your time. smile

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Weird. It's saying insufficient parameters.

Last edited by powerade661; 23/05/15 03:18 AM.
Page 1 of 4 1 2 3 4

Link Copied to Clipboard