Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

!Idle nick - network idle time

Recommended Posts

  • Administrators
>; Configuration layout:  

; Exclude:

alias -l exchan { return UnderNet,#help UnderNet,#poof }

; Include:

alias -l inchan { return UnderNet,#mircscripting UnderNet,#hell }

; Allow in case no match above:

alias -l allowother { return 1 }



on *:TEXT:!idle &:#: {

 if (!$checkchan) { return }

 var %hi = $+($network,$chr(44),$chan,$chr(44),$2)

 if ($hget(idle,%hi)) || ($hfind(idle,$+($network,$chr(44),*),0,w)) > 3) { return }

 hadd -mu10 idle %hi 1

 whois $2 $2

}

alias -l checkchan {

 var %s = $+($network,$chr(44),$chan)

 if ($istok($exchan,%s,32)) { return 0 }

 if ($istok($inchan,%s,32)) { return 1 }

 if ($allowother) { return 1 } | return 0

}



on *:DISCONNECT: { if ($hget(idle)) { hdel -w idle $+($network,$chr(44),*) } }

RAW 311:*: { check $2 }

RAW 307:*: { check $2 }

RAW 312:*: { check $2 }

RAW 319:*: { check $2 }

RAW 401:*: { check $2 }

alias -l check {

 var %hiw = $+($network,$chr(44),*,$chr(44),$1)

 if ($hfind(idle,%hiw,1,w)) { haltdef }

}

RAW 317:*: {

 var %nick = $2, %idle = $3, %m = $2 has been idle for $duration($3,HH:nn:ss)

 var %hiw = $+($network,$chr(44),*,$chr(44),%nick), %i = 1, %count = 0

 while ($hfind(idle,%hiw,%i,w)) {

   var %hi = $v1

   inc %count

   tokenize 44 %hi

   if ($me ison $2) { msg $2 %m }

   inc %i

 }

 if (!%count) { return }

 haltdef

 hadd -u10 idle $+($network,$chr(44),%nick) 317

}

RAW 318:*: { end $2 }

RAW 402:*: { end $2 }

alias -l end {

 var %nick = $1

 var %hi317 = $+($network,$chr(44),%nick)

 var %hiw = $+($network,$chr(44),*,$chr(44),%nick), %i = 1, %count = 0

 while ($hfind(idle,%hiw,%i,w)) {

   var %hi = $v1

   inc %count

   tokenize 44 %hi

   if (!$hget(idle,%hi317)) && ($me ison $2) { msg $2 !Idle for %nick failed. }

   inc %i

 }

 if (!%count) { return }

 haltdef

 hdel idle %hi317

 hdel -w idle %hiw

 if (!$hget(idle,0).item) { hfree idle }

Link to comment
Share on other sites



×
×
  • Create New...