mIRC Home    About    Download    Register    News    Help

Print Thread
#135512 12/11/05 05:09 PM
Joined: Nov 2005
Posts: 13
D
DJmart Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2005
Posts: 13
I need some sort of script, that can dehalfop/deop me in 2-3 channels, if I am idle for more than X amount of minutes. If this can be done, I would appriciate it the most!

#135513 12/11/05 05:27 PM
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
This goes into Remotes:

Code:
alias check_self_idle {
  var %idx = 0, %chans, %chan, %secs
  ; set this to the channels you want to check, separated by a space
  %chans = #chan1 #chan2 #chan3
  ; set this to the amount of seconds to check against idle time
  %secs = 300
  ; 300 equals five minutes
  while (%idx < $numtok(%chans,32)) {
    inc %idx
    %chan = $gettok(%chans, %idx, 32)
    if ($nick(%chan,$me).idle >= %secs) {
      if ($me isop %chan) { mode %chan -o $me }
      if ($me ishop %chan) { mode %chan -h $me }
    }
  }
}


Modify the code above according the comments. If there's any confusion, let me know smile

#135514 12/11/05 05:57 PM
Joined: Nov 2005
Posts: 13
D
DJmart Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2005
Posts: 13
Code:
 alias check_self_idle {
  var %idx = 0, %chans, %chan, %secs
  ; set this to the channels you want to check, separated by a space
  %chans = #xbc_opers #xbc_game1 #xbc_help
  ; set this to the amount of seconds to check against idle time
  %secs = 60
  ; 300 equals five minutes
  while (%idx < $numtok(%chans,32)) {
    inc %idx
    %chan = $gettok(%chans, %idx, 32)
    if ($nick(%chan,$me).idle >= %secs) {
      if ($me isop %chan) { mode %chan -o $me }
      if ($me ishop %chan) { mode %chan -h $me }
    }
  }
}
  


thats how I set it up, and I idled for 1 minute, and It did not dehalfop me frown

#135515 12/11/05 06:05 PM
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
This is just an alias, where you'de have to type /check_self_idle
I just tested it out and it worked fine for me.
Quote:

-> #scripting nycdiesel sets mode: -o nycdiesel
-> #scripting nycdiesel sets mode: -h nycdiesel
-> #php nycdiesel sets mode: -o nycdiesel

If you wanted to run this continuously, you'de do:
Code:
/timercheckidle 0 60 check_self_idle

Last edited by nycdiesel; 12/11/05 06:07 PM.
#135516 12/11/05 10:54 PM
Joined: Nov 2005
Posts: 13
D
DJmart Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2005
Posts: 13
I guess I could say I am totally lost. help please!

#135517 13/11/05 01:40 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on me:*:join:#:{
$+(.timeridle,$network,.,$chan) 0 60 check_self_idle $!chan
}
alias check_self_idle {
if $nick($1,$me).idle > 300 {
if ($me isop $1) { .mode $1 -o $me }
elseif ($me ishop $1) { .mode $1 -h $me }
}
}
  


Link Copied to Clipboard