Well, that works. But I wouldn't suggest it as it is not optimal.
The way you scripted it right now would re-start the timer for every person joining the channel.
A reccomended way to do it is to start it on your join event. Such as:
Code:
on *:join:#: { 
if ($nick == $me) {
.timerUserCheck. $+ $chan 0 60 NameOfAlias $chan
}
}
As you know, after reading the help files of aliases - " /Help Aliases " - the first word you send to an alias will be treated as $1.
So sending " NameOfAlias $chan " will trigger the Alias, and send $chan (#channelname) as the first word.

When this reaches your alias, it will use "var %channel $1" which means "%channel" will now be the same as $chan which was sent from the Join event.

Now your code should look something like this:
Code:
on *:join:#: { 
if ($nick == $me) {
.timerUserCheck. $+ $chan 0 60 NameOfAlias $chan
}
}

alias NameOfAlias {
var %channel $1
var %users $nick(%channel,0)
var %file goals.txt
}
Let's keep working with this. You now have the values of all users in the channel every 60 seconds. You can try this out by adding this line to the code at the bottom.
Code:
echo %channel The user number of this channel are now: %users


But that's not your end-goal is it? No, you want to check it with the file you've added. You'll need to read up on While loops for this to work. Type " /help while loops " in the editbox and see if that makes sense. You can always try creating a custom alias as well and see how it works in actuality.

Now, let's proceed with this new knowledge.
Code:
on *:join:#: { 
if ($nick == $me) {
.timerUserCheck. $+ $chan 0 60 NameOfAlias $chan
}
}

alias NameOfAlias {
var %channel $1
var %users $nick(%channel,0)
var %file goals.txt
var %i 1
;%i is now = 1
var %lines $lines(%file)
;Now we know how many lines there are in %file (goals.txt)
;Let's make a while loop for how as many lines there are in the file.
while (%i <= %lines) {
;All right, we're in! 
var %line $read(%file,tn,%i) 
;This is specified to read the file's lines. Note that I'm using %i instead of 
;1 or something. This is cause we're going to increment %i and make it bigger.

;Let's proceed and make an if statement inside the loop
if (%users < %line) { 
;If the amount of users are under the amount presented in the file we want to stop looping
break
}
else { var %goal %line }
;If you actually are over the %line with %users, we create a new variable 
;called %goal which will be the same as %line that you did overcome.
inc %i
;now we increased it, so when this loop is "over" it's gonna re-do the loop as long
;as %i is not over %lines

}
;%line is at this point set to the goal you didn't yet reach
;%goal is set to the highest goal you reached.
;If you have 33 people and the goals are 10,20,30,40 - %goal will now be 30

;So now you just need to check if you actually reached a goal.
if (%goal) { msg %channel We reached the %goal goal! We now have %users total users! - The next goal is: %line $+ ! }
}


Now, make sure you read all the help files I've told you to read, and make sure you take the time to try and understand what's happening. That's the only way you'll ever learn to do these things by yourself.

Last edited by Nillen; 09/03/15 11:08 PM. Reason: Fixed timername

Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net