alias idlers {
var %idlenicks = $snicks
var %i = 1
var %nicktoken = [color:blue]$gettok(%idlenicks,0,44)[/color]
while (%i <= %nicktoken) {
var %checknick = [color:blue]$gettok(%idlenicks,%i,44)[/color]
notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)
inc %i
}
}
I understand most of this, i'm just trying to learn how to use these type of scripts. I colored the parts I don't understand,
please explain them and how they work, thanks, and honestly, i'm not a bad scripter, just don't know how to use these type of scripts, but, know how to use dialogs and other scripts. thanks
I don't see how "scripting dialogs" is any different
--------------------------------------------------------------
why didn't you type /help $gettok
in the help file:
$gettok(text,N,C)
Returns the Nth token in text.
$gettok(a.b.c.d.e,3,46) returns c
$gettok(a.b.c.d.e,9,46) returns $null
You can also specify a range of tokens:
$gettok(a.b.c.d.e,2-,46) returns 2nd token onwards b.c.d.e
$gettok(a.b.c.d.e,2-4,46) returns tokens 2 through 4 b.c.d
You can specify a negative value for N.
$gettok(string,0,44) in this case will return the number of nicks you selected, see the help for $numtok as it replaces this
$numtok(text,C)
Returns number of tokens in text.
------------------------------------------
$snicks returns a list of selected nicks delimited by commas
nick1,nick2,nick3
$gettok allows you to select one of the nicks based on its position in the string
$gettok(nick1,nick2,nick3,2,44) would return nick2
using the while loop you can then check each nickname one at a time for the idle time with the %i increasing each time through the loop
$gettok(%idlenicks,%i,44)
notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)
change that to
echo -a %checknick $+ `s Idle Time in $active $+ : $duration($nick($active,%checknick).idle)
and then you will see it echoed, not notice the info to the nick