mIRC Home    About    Download    Register    News    Help

Print Thread
#121835 02/06/05 11:48 AM
A
anarres
anarres
A
Hi all,
I want to make a romotes that when I type !idle scan all the channel users that have an high idle (5 hours for example) and thenI deop them.
I've tryed some ways but never works... can anyone help me?

Thanx

#121836 02/06/05 12:00 PM
D
defiant
defiant
D
It's not that hard, I take it you want this on your bot:

Code:
on *:TEXT:!Idle:#: {
  if ($nick == YOURNICKHERE) { check.idle $chan $nick }
}

This will make the bot trigger on "!Idle" on any channel it's on.
The next is the actual alias / work:
Code:
alias check.idle {
  var %m = $nick($1,0,o)
  var %i = 1
  while (%i <= %m) {
    if ($nick($1,%i,o).idle > 18000) { 
      if ($me isop $1) { mode $1 -o $ $nick($1,%i,o) }
      else { .notice $2 $nick($1,%i,o) on $1 is idle more than 5 hours! }
    }
    inc %i
  }
}

So, 18000sec = 5hours, when any op is idle for longer than 5hours it will try to deop him. If the bot isn't opped, it will notice you.

This can also work when typing "/check.idle #CHANNEL OWNNICK"
if put in own remote script

#121837 03/06/05 06:39 PM
A
anarres
anarres
A
I've tested just the alias, to see if it works and it doesn't. I've changet idle time to test it and nothing.
Thanx a lot

/alias check.idle { var %m = $nick($1,0,o) var %i = 1 while (%i <= %m) { if ($nick($1,%i,o).idle > 18000) { if ($me isop $1) { mode $1 -o $ $nick($1,%i,o) } else { .notice $2 $nick($1,%i,o) on $1 is idle more than 5 hours! } } inc %i } }

#121838 03/06/05 06:59 PM
M
mIRCManiac
mIRCManiac
M
alias check.idle {
; Syntax: /check.idle <channel>
; Example: /check.idle #mIRC
if ($me !isop $1) return
var %i = 1
while ($nick($1,%i,o) != $null) {
if (($v1 != $me) && ($nick(#,$nick($1,%i,o)).idle > 18000)) var %r = %r $nick($1,%i,o)
inc %i
}
mdeop $1 %r
}

alias mdeop {
; Syntax: /mdeop <channel> <nicks>
; Example: /mdeop #mIRC nick1 nick2 nick3
if ($me !isop $1) return
var %i = 1
while ($gettok($2-,%i,32) != $null) {
var %v = %v $v1
if ($numtok(%v,32) == $modespl) {
mode $1 $+(-,$str(o,$v1)) %v
var %v
}
inc %i
}
if (%v != $null) mode $1 $+(-,$str(o,$numtok(%v,32))) %v
}

Last edited by mIRCManiac; 03/06/05 07:03 PM.
#121839 03/06/05 08:42 PM
D
defiant
defiant
D
Well. when i tried the code given by me it worked,

You do realise that you should copy the given code to wordpad (start->run->wordpad), and there paste, and copy all again, and put that in remote?


Link Copied to Clipboard