mIRC Home    About    Download    Register    News    Help

Print Thread
#252447 13/04/15 02:40 AM
Joined: May 2014
Posts: 13
O
Pikka bird
OP Offline
Pikka bird
O
Joined: May 2014
Posts: 13
I'm currently working on a point system for someone, and I have everything set up and working fine except for one thing. I have the points start accumulating on join, which is fine, but even with reconnecting it doesn't check for people already in the channel, so unless they leave and come back, they don't receive points. Is there any way to check for everyone already in the userlist?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You could loop through $nick(#,0)

$nick(#,0) translates into the number of users in the channel
$nick(#,1) translates into the first user's $nick in the channel


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Just making a example of Nillen's code.
Code:
alias example {
  echo -ta Listing users in $+(#,.) Total: $nick(#,0)
  var %x = $nick(#,0)
  while (%x) {
    echo -ta -> $nick(#,%x)
    dec %x
  }
}

This start from the bottom of the userlist. Put it in remote and trigger it with /example


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: May 2014
Posts: 13
O
Pikka bird
OP Offline
Pikka bird
O
Joined: May 2014
Posts: 13
We ended up just having everyone leave and rejoin for it to start, but thanks anyway. However, looking around at the $+ function you posted I was able to figure out other things I couldn't figure out, so thanks again!
One more thing though, I'm also now trying to make it so you can use these points in like a bet or auction or something and can't quite figure it out. I was thinking in terms of say the command being !bet option1 option2 option3 etc. I managed to use
Code:
$calc(($0)-1)
to get the amount of words in the line after the command, but do you know how I would be able to put those into a txt or ini file on separate lines?

Or even if there's a better way to do the entire thing, would be appreciated as well. Basically doing a command where you can input your points toward a certain option, winners get the total pot evened out between then. Current line for points is
Code:
$readini(Points.ini,$+(#,.,$nick),Points)

Last edited by OmegaZeron; 15/04/15 03:08 PM.

Link Copied to Clipboard