alias idletime {
[color:green];$1 has to be something[/color]
if ($1 == $null) { echo -a 04,00[10,00idletime04,00] 04,00Useage: 06,00/idletime <nick> | halt }
[color:green];If $2 is something, then you may have made a mistake when typing /idletime[/color]
if ($2 !== $null) { echo -a 04,00[10,00idletime04,00] 04,00Useage: 06,00/idletime <nick> | halt }
[color:green];If you are not connected to a server, it wouldn't work anyway![/color]
if ($server == $null) { echo -a 04,00[10,00idletime04,00] 04,00Useage: 06,00You must be connected to a server | halt }
[color:green];Adds the nick you specified to a variable to compare later[/color]
set %idletime.nicks $addtok(%idletime.nicks,$1,44)
[color:green];enables the #idletime[/color]
enable #idletime
[color:green];Runs a /whois on the nick you specified[/color]
/whois $1
}
#idletime off
[color:green];307 - 310 are for DALNet only.[/color]
raw 307:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
raw 308:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
raw 309:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
raw 310:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
[color:green];311 returns nick!user@host and the "real name" for the user.[/color]
raw 311:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
[color:green];312 returns the server NICK is connected to.[/color]
raw 312:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
[color:green];313 returns if NICK is an IRC Operator[/color]
raw 313:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
[color:green];317 returns the idle time of the user.[/color]
raw 317:*:{
[color:green];add the line below (remove the ";" from the line starting ";echo -a") if what you expect isn't returned.[/color]
[color:green];This will echo out to you what is returned in the 317. You may need to alter the $1/$2/$3 etc in the code to get it[/color]
[color:green];to return the correct results[/color]
[color:green];echo -a 1= $1 2= $2 3= $3 4= $4 5= $5 6= $6[/color]
[color:green];if the nick that is returned ($1) is in the variable list of people you are expecting replies from, it carries on...[/color]
[color:green];This is in case you do "/idletime <nick1>" then "/idletime <nick2>" then "/idletime <nick3>" before the server replies[/color]
if ($istok(%idletime.nicks,$1,44) == $true) {
[color:green];echo out the results[/color]
echo -a 04,00[10,00idletime04,00] 06,00 $+ $1 $+ 04,00has been idle for 06,00 $+ $duration($3) $+
[color:green];halts any default use of raw 317[/color]
halt
}
}
[color:green];318 returns the "End of /WHOIS".[/color]
raw 318:*:{ if ($istok(%idletime.nicks,$1,44) == $true) {
[color:green];removes the nick from the variable list (once you've had a reply, you don't need it.[/color]
set %idletime.nicks $remtok(%idletime.nicks,$1,44)
[color:green];if there are more nicks in the variable then you don't want the group to be disabled.[/color]
if ($numtok(%idletime.nicks,44) == 0) { disable #idletime | halt }
halt
}
}
[color:green];319 returns the channels the user is on[/color]
raw 319:*:{ if ($istok(%idletime.nicks,$1,44) == $true) { halt } }
#idletime end