mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2016
Posts: 11
E
empeK Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: May 2016
Posts: 11
Is there a way to select random viewer from viewer list which is displayed on mIRC ?

I mean i can do that when there is a viewer list in a file, but is it possible to get it straight from viewer list ?



Thanks in advance

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
I'm not very sure about this but the logical answer is that if you don't know the number of viewers.. it's kinda hard to pick one randomly. If you don't want to save the list, you could make the script connect, keep the number of the users, pick a random number of those, reconnect and get the name of the picked number.
P.S -Is there any part of the webpage mentioning the number of the viewers before the viewers?

Last edited by OrFeAsGr; 09/05/16 08:46 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
What constitutes a viewer, non op? Is twitch properly giving them +o? $nick(#,$r(1,$nick(#,0,r)),r) would do it.

Joined: May 2016
Posts: 11
E
empeK Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: May 2016
Posts: 11
Originally Posted By: Loki12583
What constitutes a viewer, non op? Is twitch properly giving them +o? $nick(#,$r(1,$nick(#,0,r)),r) would do it.


Thank you ! That did the job

Joined: May 2016
Posts: 11
E
empeK Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: May 2016
Posts: 11
One more question.

How do i can get all the viewers from viewer list. I mean for example if you have a point system or something and you want to add a point amount just for those who are now online and in the viewer list.

Basically it should take nickname one by one and add it till viewer list is over or until it finds same nick, so it knows that circle has been made.

Any ideas ?

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
You can make a while loop and in it check if the user is opped (with isop operator)
If yes give him points or anything.
If you're not familiar with while loops
/help while loops
isop operator works simply like this:
Code:
if ($nick isop $chan) {
Echo -at $nick Is Opped

!isop checks for the opposite ( ! Before operators or values negates them)
For your script you'll have to use $nick($chan,N) where N is the Nth user in the user list!
Let us know if you need more help!

Last edited by OrFeAsGr; 14/05/16 11:48 AM.
Joined: May 2016
Posts: 11
E
empeK Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: May 2016
Posts: 11
Thank you, that worked for me.

If some1 interested in this how do i circle all list here it is:

Code:
on 5:TEXT:!circle:#: {
  var %i = 1 
  while ( %i <= $nick($chan,0) ) { 
  Echo -at $nick($chan,%i) 
  inc %i 
  }
}


with $nick($chan,0) you get the number how much viewers are in the viewer list, and then you do the while loop to take very person.

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Great! I'm glad i helped!! smile

Last edited by OrFeAsGr; 14/05/16 03:29 PM.
Joined: Sep 2016
Posts: 3
C
Self-satisified door
Offline
Self-satisified door
C
Joined: Sep 2016
Posts: 3
BUMP , SOMEONE CAN SHARE THE SCRIPT TO SELECT A RANDOM USER FROM THE VIEWER LIST ? confused

Joined: Sep 2016
Posts: 15
T
Pikka bird
Offline
Pikka bird
T
Joined: Sep 2016
Posts: 15
Code:
on *:TEXT:!circle:#: {
  var %i = 1 
  while ( %i <= $nick($chan,0) ) { 
    write Nicklist.txt $nick($chan,%i) 
    inc %i 
  }
  msg # $read(Nicklist.txt,$rand(1,$nick($chan,0)))
}

Last edited by Tulga; 11/09/16 01:03 PM.
Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
You can select a random user from the viewewlist with just one line of code with no need to loop or write to a text file.
Code:
ON *:TEXT:!random:#: MSG $chan $nick($chan,$rand(1,$nick($chan,0)))

Alternatively, if you want to only select an ACTIVE user (one that has said something recently), see my randuser.mrc script on my GitHub linked in my signature.

Last edited by Blas; 20/09/16 03:59 AM.

Link Copied to Clipboard