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.
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Originally Posted By: powerade661
Weird. It's saying insufficient parameters.


Try change the line of the above code to : $followcount($mid($chan,2))


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Remove the # tag from the #channel. The url would become https://api.twitch.tv/kraken/channels/#channel instead of https://api.twitch.tv/kraken/channels/channel

Changes to the code:
Code:
alias followcount {
  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $1
  return $json(followcount, followers)
}
on *:text:!viewers:#:{
msg # $followcount($mid($chan,2)) people following and w/e you want.
}


type " /help $mid " for further understanding, but essentially it takes the 2nd letter (c) from $chan (#channel) and everything behind it and makes it (channel)


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Posting since no one has linked my JSON parser yet.

(Geez people, if you are going to talk about it, give the link so users don't have to jump all over the board looking for it :P )

Also:
Code:
on *:text:!viewers:#:{
  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid(#, 2-)
  msg # $json(followcount, followers) people following and w/e you want.
}

Last edited by FroggieDaFrog; 23/05/15 04:36 PM.

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 Froggie! Last question, you will see exactly what I am trying to do once you look at the code. Thank you guys for all of your help. I could not have done this without you. Also in this code, is it possible to make it to when the streamer leaves, it is turned off? would you do

on !*:PART:$chan:{
.timer.update off

Code:
on *:text:*:#: {
  if ($strip($1) == !viewerupdate) {
    if ($strip($2) == $null) {
      msg $chan Viewer Update Has Been Started 
      .timer.update 0 10 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
  }

  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid(#, 2-)
  msg followers -> # $json(followcount, followers) $1 Viewers -> %viewers

}




Last edited by powerade661; 23/05/15 06:58 PM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Use json for https://api.twitch.tv/kraken/streams/ $+ %streamer_name - returns error when offline.


Dont give a fish - teach to fish!
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Yeah you got that right, just add it to the remote.
Although it's not nessecary i would do it this way
Code:
on *:part:#: {
if ($timer(.update)) {
.timer.update off
}
}

Added an if which checks if the timer is active, in order to avoid error messages.

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
So I would put this below the rest of the code? So this just checks if the timer is off? Or does it also check if it's on? I don't really understand what you have done here.
Also I had to exclude my channel otherwise it would count me as a viewer. It's not excluding $chan frown Also is it possible to exclude the # and just put the channel name?

Last edited by powerade661; 23/05/15 07:43 PM.
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
It checks if the timer is on and if it is it does /timer.update off
Yes smile just put it under the rest of the code and yes you can replace # with your channel
Code:
on *:part:#channel: {
if ($timer(.update)) {
.timer.update off
}
}

wink this will only work for #channel ,replace #channel with the channel you want it to work for

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
It won't work for any channel? on*:part $chan ? That doesn't work for all channels? If one channels leave it disables the timer for that channel?

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
The whole script is made so that it sends the msg to the channel where you gave the command !viewerupdate .
Now, do you want the timer to stop when someone parts that channel ?
If so, use this code instead:
Code:
on *:text:*:#: {
  if ($strip($1) == !viewerupdate) {
    if ($strip($2) == $null) {
set %viewerschan $chan
      msg $chan Viewer Update Has Been Started 
      .timer.update 0 10 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
  }
  JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid(#, 2-)
  msg followers -> # $json(followcount, followers) $1 Viewers -> %viewers
}

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

Example:
If you start the timer in #test , if someone parts from #test the timer will be stopped.
If someone parts #blabla the timer wont stop smile

Last edited by OrFeAsGr; 23/05/15 08:09 PM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
I want to make it so that if the streamer leaves the timer stops.

I thought that is what $chan was. Am I missing something? I was able to remove the # by doing $remove(#,$chr(35)) the only issue now is uppercasing the first letter for the channel. So in order to get it for the stream channel I would have to do on *:part:#channel for each individual streamer?

Last edited by powerade661; 23/05/15 08:19 PM.
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
the last code i gave you will stop the timer if someone parts the channel smile

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
But is that if anyone parts the channel? Or just the streamer, the timer stops? Sorry I am being so meticulous. Wait a second

if ($chan == %viewerschan) { that's how it knows if the streamer parted? Am I wrong or right?

Last edited by powerade661; 23/05/15 08:36 PM.
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Originally Posted By: powerade661
But is that if anyone parts the channel? Or just the streamer, the timer stops? Sorry I am being so meticulous. Wait a second

if ($chan == %viewerschan) { that's how it knows if the streamer parted? Am I wrong or right?


@powerade661, if you pay attention what does @OrFeaSGr saying you will be able to understand..


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
I see it now, sorry OrFeAsGr.

Last edited by powerade661; 23/05/15 08:45 PM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Do I have to close the JSONopen? It doesn't update the followers in other channels. It worked for one channel and then another, and then it stayed with one channel and it won't update anymore. frown I have no idea what is going on.

Code:
on *:text:*:#: {
  if ($strip($1) == !viewerstatus) {
    if ($strip($2) == $null) {
      sayviewers $chan zacbot661 nightbot wizebot coolkid661

    }
  }
}

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 # Stream status for $remove(#,$chr(35)) Followers: # $json(followcount, followers) Viewers: %viewers
}

Last edited by powerade661; 24/05/15 12:34 AM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Guys I do apologize. The computer I was hosting the bot on was very slow and I just figured out why it wasn't working very well. One core was slower than the other and after making changes, the script works very efficiently. Thanks for your time and patience with me.

Last edited by powerade661; 24/05/15 03:07 AM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
It's not putting the message in the chat, only through TMI. Any ideas? It only updates the followers if I restart mIRC. -_- This is so confusing.

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 # Stream update, followers: $json(followcount, followers) Viewers: %viewers
}

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

Last edited by powerade661; 24/05/15 03:58 AM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Does anyone have any idea why this is happening? It's still not placing the message in the chat and it's not updating the follower count unless I restart mIRC. Also I am thinking the timer is stopping if someone leaves the stream, instead of the streamer.

Last edited by powerade661; 24/05/15 07:35 PM.
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
change msg # to msg $1 in sayviewers

and because I'm a nice person with a nack for mSL:
Code:
on $*:text:/^!viewerupdate(\s|$)/Si:#: {
  if ($2 == off && $timer(FollowerUpdate $+ $cid $+ #)) {
    $+(.timerFollowerUpdate,$cid,#) off
  }
  elseif ($0 == 1) {
    msg $chan Viewer Update Has Been Started 
    $+(.timerFollowerUpdate,$cid,#) 0 60 sayviewers $chan intellibot_v2.0 nightbot wizebot
  }
}

on *:part:#: {
  if ($mid(#, 2-) == $nick && $timer(FollowerUpdate $+ $cid $+ #)) {
    $+(.timer,$v1) off
  }
}

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

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

I am SReject
My Stuff
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
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
I have tested it, and now it's not stopping the timer if the streamer leaves. Any ideas? Everything else is working fine.

Last edited by powerade661; 26/05/15 10:09 PM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
How long should I wait for it to update. Does anyone know?

Last edited by powerade661; 26/05/15 10:25 PM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Ok so the update is, it works for a while and then it will just stay with one channel and it won't grab the data from the API. I have tried allowing mIRC through the firewall private and public, I didn't really want to turn off my firewall, but I did just to test and it still did the same thing. I don't really know what's going on. Would anyone recommend I reinstall windows and start over from scratch? That's literally the only thing I haven't tried. The timer also doesn't stop when the streamer leaves. Any help with this would be much appreciated. I have tried everything.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
If you tried everything you'd be able to identify the point of failure. Reinstalling mIRC, let alone Windows, would have no effect.

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Let me rephrase that. I have tired everything that I know how to do.

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Also the reason why I said should I reinstall windows is because when I moved the program over to another computer it allocated over 4GB of RAM. But when I moved it to the computer it was on before, it only allocated 1.12GB of RAM. I am thinking there could be an issue with the operating system. The application is very unresponsive most of the time as well.

Last edited by powerade661; 27/05/15 10:24 PM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Any ideas as to why it's not stopping the timer when the streamer leaves?

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Never mind I figured it out. Here is the fixed code for anyone wondering.

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 # nightbot wizebot moobot
  }
}
on *:part:#: {
  if (!$istwitch) { return }
  if ($mid(#, 2-) == $nick && $timer(FollowerUpdate $+ $cid $+ #)) {
    $+(.timerFollowerUpdate, $cid, #) 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)

Page 1 of 4 1 2 3 4

Link Copied to Clipboard