check your idler's tags
Posted by CrashB
Wednesday, May 26, 2004
Description: for CSC|Kevin
on *:text:!idle *:#:{ idlecheck $chan $2- }
on *:text:!idletimer:#:{
if $timer(idletrade) == $null {
set %idletrade 1
set %idlechan $chan
.timeridletrade 1 30 { idletimer }
msg $chan The idle check timer is now active!
}
else {
unset %idletrade
unset %idlechan
.timeridletrade off
msg $chan The idle check timer is now off!
}
}
alias idlecheck {
var %i 1
var %c 0
while (%i <= $nick($chan,0)) && (%c < $$3) {
if $$2 isin $nick($chan,[ %i ]) { inc %c }
inc %i
}
if %c < $$3 {
join $$4
msg $$4 ATTENTION: $calc($$4 - %c) IDLERS ARE REQUIRED TO JOIN $$1 IN ACCORDANCE TO OUR IDLER TRADE AGREEMENT!
part $$4
}
else { msg $$1 Minimum number of idlers found. }
}
alias idletimer {
if %idletrade == $null { set %idletrade 1 }
idlecheck %idlechan $read(idletrade.txt,[ %idletrade ])
inc %idletrade
if %idletrade > $lines(idletrade.txt) { set %idletrade 1 }
.timeridletrade 1 30 { idletimer }
}