mIRC Home    About    Download    Register    News    Help

Print Thread
#110864 11/02/05 02:00 AM
Joined: Feb 2005
Posts: 16
J
jkouzes Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Feb 2005
Posts: 16
I have this script that I got from someone, that supposed to unhost a host if they are idle to long. But... for some reason if the host should talk, the idle command doesnt recognize the fact that they talked, and isnt refreshed.

Here is the script:
#idle off
alias hostidle {
var %i = 1, %chan = $comchan($me,1)
var %nick = $nick(%chan,1,o)
while (%nick) {
; if (%nick != $me) && ($nick(%chan,%i).idle >= 1800) {
if (%nick != $me) && ($nick(%chan,%i).idle >= 3600) {
mode %chan -o %nick
msg %chan Sorry %nick $+ , You have been idle too long, Please use !hostme when you decide to rejoin us ( $+ $duration($nick(%chan,%i).idle) $+ )
}
inc %i
%nick = $nick(%chan,%i,0)
}
}
#idle end
menu * {
Idle-Host ( $+ $group(#idle) $+ )
.On:{ .enable #idle | echo -a 4..::Idle-Host Enabled::.. }
.Off:{ .disable #idle | echo -a 4..::Idle-Host Disabled::.. }
.Start Idle-Host Scan (every 5 minutes):/.timerhostidler 0 300 hostidle
}

Any suggests on how to get it to reset the idle for the host. One thing that was wierd was... even after the host left the channel, and came back hours later, it still recorded them as being there....

#110865 11/02/05 02:48 AM
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
I don't think you can reset the idle for someone else, the mIRC helpfile says the identifier returns the time since the user last said something on the channel. Therefore only they can reset their idle time.

#110866 11/02/05 05:08 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
try this,

Code:
#idle off
alias hostidle { 
  var %i = 1, %chan = $comchan($me,1) 
  var %nick = $nick(%chan,1,o) 
  while (%nick) { 
    ;    if (%nick != $me) && ($nick(%chan,%i,o).idle >= 1800) { 
    if (%nick != $me) && ($nick(%chan,%i,o).idle >= 3600) {
      ;^ added ,o so now your looking at the same nick as is in %nick
      ;
      mode %chan -o %nick 
      msg %chan Sorry %nick $+ , You have been idle too long, Please use !hostme when you decide to rejoin us ( $+ $duration($nick(%chan,%i,o).idle) $+ ) 
      ;^ added ,o again
      ;
    } 
    inc %i 
    %nick = $nick(%chan,%i,o)
    ;^ replaced 0 (zero) with o, zero well respond with a $null so loop would have ended after first pass
    ;
  } 
} 
#idle end 
menu * { 
  Idle-Host ( $+ $group(#idle) $+ ) 
  .On:{ .enable #idle | echo -a 4..::Idle-Host Enabled::.. } 
  .Off:{ .disable #idle | echo -a 4..::Idle-Host Disabled::.. }  
  .Start Idle-Host Scan (every 5 minutes):/.timerhostidler 0 300 hostidle 
}


Under some instances accessing $nick(%chan,%i,o) and $nick(%chan,%i) well bring up the same results, becuase OP's are at the top of the list, but then u might have owners in channel, nicks starting with !, and they end up above them again.


Link Copied to Clipboard